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,144 @@
|
|
|
1
|
+
// Listing, viewing, enabling and disabling Actions workflows.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, limitField, reads, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { num, optStr, str } from "./read.ts";
|
|
6
|
+
import { runSummary } from "./actions.ts";
|
|
7
|
+
|
|
8
|
+
const workflowField = s.string({
|
|
9
|
+
description: "Workflow file name (ci.yml), numeric id, or display name.",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const workflow = (w: unknown) => ({
|
|
13
|
+
id: num(w, "id"),
|
|
14
|
+
name: str(w, "name"),
|
|
15
|
+
path: str(w, "path"),
|
|
16
|
+
state: str(w, "state"),
|
|
17
|
+
url: str(w, "html_url"),
|
|
18
|
+
updatedAt: optStr(w, "updated_at"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const allWorkflows = async (gh: GitHub, full: string) =>
|
|
22
|
+
(
|
|
23
|
+
await gh.list(`repos/${full}/actions/workflows`, 1000, {
|
|
24
|
+
key: "workflows",
|
|
25
|
+
})
|
|
26
|
+
).map(workflow);
|
|
27
|
+
|
|
28
|
+
const resolveWorkflow = async (gh: GitHub, full: string, given: string) => {
|
|
29
|
+
if (/^\d+$/.test(given) || /\.ya?ml$/i.test(given))
|
|
30
|
+
return workflow(
|
|
31
|
+
await gh.rest("GET", `repos/${full}/actions/workflows/${enc(given)}`),
|
|
32
|
+
);
|
|
33
|
+
const matches = (await allWorkflows(gh, full)).filter(
|
|
34
|
+
(w) => w.name.toLowerCase() === given.toLowerCase(),
|
|
35
|
+
);
|
|
36
|
+
const [only, ...rest] = matches;
|
|
37
|
+
if (only === undefined)
|
|
38
|
+
throw new SurfaceError(
|
|
39
|
+
"not_found",
|
|
40
|
+
`no workflow named ${given} in ${full}`,
|
|
41
|
+
"list workflows with `workflow list` (all: true includes disabled ones)",
|
|
42
|
+
);
|
|
43
|
+
if (rest.length > 0)
|
|
44
|
+
throw new SurfaceError(
|
|
45
|
+
"usage",
|
|
46
|
+
`several workflows are named ${given}: ${matches.map((w) => `${w.id} (${w.path})`).join(", ")}`,
|
|
47
|
+
"pass the workflow id or file name instead",
|
|
48
|
+
);
|
|
49
|
+
return only;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const toggle = (gh: GitHub, verb: "enable" | "disable", description: string) =>
|
|
53
|
+
op({
|
|
54
|
+
description,
|
|
55
|
+
input: s.object({ repo: repoField, workflow: workflowField }),
|
|
56
|
+
annotations: writes,
|
|
57
|
+
run: async ({ repo, workflow: given }) => {
|
|
58
|
+
const r = await gh.repo(repo);
|
|
59
|
+
const w = await resolveWorkflow(gh, r.full, given);
|
|
60
|
+
await gh.rest("PUT", `repos/${r.full}/actions/workflows/${w.id}/${verb}`);
|
|
61
|
+
return {
|
|
62
|
+
repo: r.full,
|
|
63
|
+
...workflow(
|
|
64
|
+
await gh.rest("GET", `repos/${r.full}/actions/workflows/${w.id}`),
|
|
65
|
+
),
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const workflowOps = (gh: GitHub) => ({
|
|
71
|
+
list: op({
|
|
72
|
+
description:
|
|
73
|
+
"Workflows of a repo with their id, file path and state; disabled ones only when all is set. Replaces `gh workflow list`.",
|
|
74
|
+
input: s.object({
|
|
75
|
+
repo: repoField,
|
|
76
|
+
all: s.optional(
|
|
77
|
+
s.boolean({ description: "Include disabled workflows." }),
|
|
78
|
+
),
|
|
79
|
+
limit: limitField(50),
|
|
80
|
+
}),
|
|
81
|
+
annotations: reads,
|
|
82
|
+
run: async ({ repo, all, limit }) => {
|
|
83
|
+
const r = await gh.repo(repo);
|
|
84
|
+
const items = (await allWorkflows(gh, r.full)).filter(
|
|
85
|
+
(w) => all === true || w.state === "active",
|
|
86
|
+
);
|
|
87
|
+
return { repo: r.full, items: items.slice(0, limit ?? 50) };
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
view: op({
|
|
91
|
+
description:
|
|
92
|
+
"One workflow's state, path and url with its latest runs; yaml: true adds the workflow file content at a ref. Replaces `gh workflow view`.",
|
|
93
|
+
input: s.object({
|
|
94
|
+
repo: repoField,
|
|
95
|
+
workflow: workflowField,
|
|
96
|
+
yaml: s.optional(
|
|
97
|
+
s.boolean({ description: "Include the workflow file content." }),
|
|
98
|
+
),
|
|
99
|
+
ref: s.optional(
|
|
100
|
+
s.string({
|
|
101
|
+
description:
|
|
102
|
+
"Branch or tag to read the YAML from (default branch when omitted).",
|
|
103
|
+
}),
|
|
104
|
+
),
|
|
105
|
+
limit: limitField(5),
|
|
106
|
+
}),
|
|
107
|
+
annotations: reads,
|
|
108
|
+
run: async ({ repo, workflow: given, yaml, ref, limit }) => {
|
|
109
|
+
const r = await gh.repo(repo);
|
|
110
|
+
const w = await resolveWorkflow(gh, r.full, given);
|
|
111
|
+
const runs = (
|
|
112
|
+
await gh.list(
|
|
113
|
+
`repos/${r.full}/actions/workflows/${w.id}/runs`,
|
|
114
|
+
limit ?? 5,
|
|
115
|
+
{ key: "workflow_runs" },
|
|
116
|
+
)
|
|
117
|
+
).map(runSummary);
|
|
118
|
+
const file = w.path.split("/").map(enc).join("/");
|
|
119
|
+
const content =
|
|
120
|
+
yaml === true
|
|
121
|
+
? await gh.text(
|
|
122
|
+
`repos/${r.full}/contents/${file}${ref === undefined ? "" : `?ref=${enc(ref)}`}`,
|
|
123
|
+
"application/vnd.github.raw+json",
|
|
124
|
+
)
|
|
125
|
+
: undefined;
|
|
126
|
+
return {
|
|
127
|
+
repo: r.full,
|
|
128
|
+
...w,
|
|
129
|
+
runs,
|
|
130
|
+
...(content === undefined ? {} : { yaml: content }),
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
}),
|
|
134
|
+
enable: toggle(
|
|
135
|
+
gh,
|
|
136
|
+
"enable",
|
|
137
|
+
"Enable a disabled workflow; returns its new state. Replaces `gh workflow enable`.",
|
|
138
|
+
),
|
|
139
|
+
disable: toggle(
|
|
140
|
+
gh,
|
|
141
|
+
"disable",
|
|
142
|
+
"Disable a workflow so it stops triggering; returns its new state. Replaces `gh workflow disable`.",
|
|
143
|
+
),
|
|
144
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Reads zip archives (artifact downloads) and keeps every extracted path inside its target directory.
|
|
2
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { inflateRawSync } from "node:zlib";
|
|
4
|
+
import { SurfaceError } from "../vendor/surface/index.ts";
|
|
5
|
+
|
|
6
|
+
export type ZipEntry = { readonly path: string; readonly data: Uint8Array };
|
|
7
|
+
|
|
8
|
+
const EOCD = 0x06054b50;
|
|
9
|
+
const CENTRAL = 0x02014b50;
|
|
10
|
+
const LOCAL = 0x04034b50;
|
|
11
|
+
const ZIP64 = 0xffffffff;
|
|
12
|
+
|
|
13
|
+
const broken = (why: string): SurfaceError =>
|
|
14
|
+
new SurfaceError(
|
|
15
|
+
"invalid_response",
|
|
16
|
+
`not a readable zip: ${why}`,
|
|
17
|
+
"download it again; the archive may be truncated or use a feature this reader does not support",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/** Where `name` lands under `dir`; a name that resolves outside `dir` is refused. */
|
|
21
|
+
export const safeJoin = (dir: string, name: string): string => {
|
|
22
|
+
const root = resolve(dir);
|
|
23
|
+
const target = resolve(root, name);
|
|
24
|
+
const rel = relative(root, target);
|
|
25
|
+
if (
|
|
26
|
+
name.includes("\\") ||
|
|
27
|
+
isAbsolute(name) ||
|
|
28
|
+
rel === "" ||
|
|
29
|
+
rel === ".." ||
|
|
30
|
+
rel.startsWith(`..${sep}`) ||
|
|
31
|
+
isAbsolute(rel)
|
|
32
|
+
)
|
|
33
|
+
throw new SurfaceError(
|
|
34
|
+
"invalid_response",
|
|
35
|
+
`refusing a path outside the target directory: ${name}`,
|
|
36
|
+
"the archive or asset name is unsafe; inspect it before extracting",
|
|
37
|
+
);
|
|
38
|
+
return target;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** The file entries of a zip (directories skipped), each checked against its stored size and CRC-32. */
|
|
42
|
+
export const unzip = (bytes: Uint8Array): ZipEntry[] => {
|
|
43
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
44
|
+
const fits = (at: number, size: number) => {
|
|
45
|
+
if (at < 0 || at + size > bytes.length) throw broken("truncated");
|
|
46
|
+
};
|
|
47
|
+
const u16 = (at: number) => {
|
|
48
|
+
fits(at, 2);
|
|
49
|
+
return view.getUint16(at, true);
|
|
50
|
+
};
|
|
51
|
+
const u32 = (at: number) => {
|
|
52
|
+
fits(at, 4);
|
|
53
|
+
return view.getUint32(at, true);
|
|
54
|
+
};
|
|
55
|
+
const slice = (at: number, size: number) => {
|
|
56
|
+
fits(at, size);
|
|
57
|
+
return bytes.subarray(at, at + size);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
let end = -1;
|
|
61
|
+
for (
|
|
62
|
+
let at = bytes.length - 22;
|
|
63
|
+
at >= Math.max(0, bytes.length - 22 - 0xffff);
|
|
64
|
+
at--
|
|
65
|
+
)
|
|
66
|
+
if (u32(at) === EOCD) {
|
|
67
|
+
end = at;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
if (end < 0) throw broken("no end-of-central-directory record");
|
|
71
|
+
const count = u16(end + 10);
|
|
72
|
+
let at = u32(end + 16);
|
|
73
|
+
if (count === 0xffff || at === ZIP64) throw broken("zip64 is not supported");
|
|
74
|
+
|
|
75
|
+
const names = new TextDecoder();
|
|
76
|
+
const entries: ZipEntry[] = [];
|
|
77
|
+
for (let i = 0; i < count; i++) {
|
|
78
|
+
if (u32(at) !== CENTRAL) throw broken("bad central directory entry");
|
|
79
|
+
const flags = u16(at + 8);
|
|
80
|
+
const method = u16(at + 10);
|
|
81
|
+
const crc = u32(at + 16);
|
|
82
|
+
const packed = u32(at + 20);
|
|
83
|
+
const size = u32(at + 24);
|
|
84
|
+
const nameLength = u16(at + 28);
|
|
85
|
+
const local = u32(at + 42);
|
|
86
|
+
const path = names.decode(slice(at + 46, nameLength));
|
|
87
|
+
at += 46 + nameLength + u16(at + 30) + u16(at + 32);
|
|
88
|
+
if (path.endsWith("/")) continue;
|
|
89
|
+
if ((flags & 1) !== 0) throw broken(`${path} is encrypted`);
|
|
90
|
+
if (packed === ZIP64 || size === ZIP64)
|
|
91
|
+
throw broken("zip64 is not supported");
|
|
92
|
+
if (u32(local) !== LOCAL) throw broken(`bad local header for ${path}`);
|
|
93
|
+
const raw = slice(local + 30 + u16(local + 26) + u16(local + 28), packed);
|
|
94
|
+
let data: Uint8Array;
|
|
95
|
+
if (method === 0) data = raw;
|
|
96
|
+
else if (method === 8)
|
|
97
|
+
data = inflateRawSync(raw, { maxOutputLength: Math.max(size, 1) });
|
|
98
|
+
else throw broken(`${path} uses compression method ${method}`);
|
|
99
|
+
if (data.length !== size || Bun.hash.crc32(data) !== crc)
|
|
100
|
+
throw broken(`${path} fails its checksum`);
|
|
101
|
+
entries.push({ path, data });
|
|
102
|
+
}
|
|
103
|
+
return entries;
|
|
104
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Every operation this skill offers, defined once. sdk.ts, cli.ts and the MCP server (cli.ts mcp)
|
|
2
|
+
// are built from this; change an operation here and all three follow.
|
|
3
|
+
import { defineSurface } from "./vendor/surface/index.ts";
|
|
4
|
+
import { authOps, orgOps, statusOp } from "./src/account.ts";
|
|
5
|
+
import { actionOps } from "./src/actions.ts";
|
|
6
|
+
import { actionWriteOps } from "./src/actions-write.ts";
|
|
7
|
+
import { attestationOps } from "./src/attestations.ts";
|
|
8
|
+
import { branchProtectionOps } from "./src/branch-protection.ts";
|
|
9
|
+
import { cacheOps } from "./src/caches.ts";
|
|
10
|
+
import { codespaceOps } from "./src/codespaces.ts";
|
|
11
|
+
import { discussionOps } from "./src/discussions.ts";
|
|
12
|
+
import { defaultDeps } from "./src/env.ts";
|
|
13
|
+
import { gistOps } from "./src/gists.ts";
|
|
14
|
+
import { createGitHub, type Deps, type GitHub } from "./src/http.ts";
|
|
15
|
+
import { issueReadOps } from "./src/issues.ts";
|
|
16
|
+
import { issueExtraOps } from "./src/issues-extra.ts";
|
|
17
|
+
import { issueWriteOps } from "./src/issues-write.ts";
|
|
18
|
+
import { gpgKeyOps, sshKeyOps } from "./src/keys.ts";
|
|
19
|
+
import { labelOps } from "./src/labels.ts";
|
|
20
|
+
import { projectFieldOps } from "./src/project-fields.ts";
|
|
21
|
+
import { projectItemOps } from "./src/project-items.ts";
|
|
22
|
+
import { projectOps } from "./src/projects.ts";
|
|
23
|
+
import { pullExtraOps } from "./src/pulls-extra.ts";
|
|
24
|
+
import { pullReadOps } from "./src/pulls-read.ts";
|
|
25
|
+
import { pullReviewOps } from "./src/pulls-review.ts";
|
|
26
|
+
import { pullWriteOps } from "./src/pulls-write.ts";
|
|
27
|
+
import { rawOps } from "./src/raw.ts";
|
|
28
|
+
import { releaseWriteOps } from "./src/release-write.ts";
|
|
29
|
+
import { repoAdminOps } from "./src/repo-admin.ts";
|
|
30
|
+
import { repoContentOps } from "./src/repo-content.ts";
|
|
31
|
+
import { repoExtraOps } from "./src/repo-extras.ts";
|
|
32
|
+
import { releaseOps, repoOps } from "./src/repos.ts";
|
|
33
|
+
import { rulesetOps } from "./src/rulesets.ts";
|
|
34
|
+
import { searchOps } from "./src/search.ts";
|
|
35
|
+
import { commitSearchOp } from "./src/search-commits.ts";
|
|
36
|
+
import { secretOps } from "./src/secrets.ts";
|
|
37
|
+
import { variableOps } from "./src/variables.ts";
|
|
38
|
+
import { waitOps } from "./src/wait.ts";
|
|
39
|
+
import { workflowOps } from "./src/workflows.ts";
|
|
40
|
+
|
|
41
|
+
export const createSurface = (gh: GitHub, tokenInjected = false) =>
|
|
42
|
+
defineSurface({
|
|
43
|
+
name: "github",
|
|
44
|
+
version: "0.2.0",
|
|
45
|
+
description:
|
|
46
|
+
"Typed GitHub: pull requests, issues, Actions runs, workflows and caches, repositories and their settings, branch rules, releases, labels, secrets, variables, gists, projects, discussions, codespaces, search, raw REST and GraphQL.",
|
|
47
|
+
redact: gh.redact,
|
|
48
|
+
instructions:
|
|
49
|
+
"Use these tools instead of shelling out to the gh CLI. `repo` is owner/name and defaults to the git origin of the working directory. " +
|
|
50
|
+
"Results are trimmed JSON; reach for api_rest or api_graphql only when no typed tool fits. " +
|
|
51
|
+
"Before pr_merge, read pr_view and pr_checks and pass matchHeadSha so a moved head refuses the merge. " +
|
|
52
|
+
"Change repository settings, rules and secrets only on a repository the task owns.",
|
|
53
|
+
ops: {
|
|
54
|
+
pr: {
|
|
55
|
+
...pullReadOps(gh),
|
|
56
|
+
...pullWriteOps(gh),
|
|
57
|
+
...pullExtraOps(gh),
|
|
58
|
+
...pullReviewOps(gh),
|
|
59
|
+
wait: waitOps(gh).pr,
|
|
60
|
+
},
|
|
61
|
+
issue: {
|
|
62
|
+
...issueReadOps(gh),
|
|
63
|
+
...issueWriteOps(gh),
|
|
64
|
+
...issueExtraOps(gh),
|
|
65
|
+
},
|
|
66
|
+
run: { ...actionOps(gh), ...actionWriteOps(gh), wait: waitOps(gh).run },
|
|
67
|
+
workflow: workflowOps(gh),
|
|
68
|
+
cache: cacheOps(gh),
|
|
69
|
+
repo: {
|
|
70
|
+
...repoOps(gh),
|
|
71
|
+
...repoAdminOps(gh),
|
|
72
|
+
...repoContentOps(gh),
|
|
73
|
+
...repoExtraOps(gh),
|
|
74
|
+
},
|
|
75
|
+
ruleset: rulesetOps(gh),
|
|
76
|
+
branchProtection: branchProtectionOps(gh),
|
|
77
|
+
release: { ...releaseOps(gh), ...releaseWriteOps(gh) },
|
|
78
|
+
label: labelOps(gh),
|
|
79
|
+
secret: secretOps(gh),
|
|
80
|
+
variable: variableOps(gh),
|
|
81
|
+
gist: gistOps(gh),
|
|
82
|
+
project: {
|
|
83
|
+
...projectOps(gh),
|
|
84
|
+
...projectFieldOps(gh),
|
|
85
|
+
...projectItemOps(gh),
|
|
86
|
+
},
|
|
87
|
+
discussion: discussionOps(gh),
|
|
88
|
+
codespace: codespaceOps(gh),
|
|
89
|
+
attestation: attestationOps(gh),
|
|
90
|
+
sshKey: sshKeyOps(gh),
|
|
91
|
+
gpgKey: gpgKeyOps(gh),
|
|
92
|
+
search: { ...searchOps(gh), commits: commitSearchOp(gh) },
|
|
93
|
+
status: statusOp(gh),
|
|
94
|
+
org: orgOps(gh),
|
|
95
|
+
auth: authOps(gh, process.env, tokenInjected),
|
|
96
|
+
api: rawOps(gh),
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export const surfaceWith = (inject: Partial<Deps> = {}) =>
|
|
101
|
+
createSurface(
|
|
102
|
+
createGitHub({ ...defaultDeps(), ...inject }),
|
|
103
|
+
inject.token !== undefined,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
export const surface = surfaceWith();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"from": "skill-creator/surface",
|
|
3
|
+
"files": {
|
|
4
|
+
"cli.ts": "d957558db8722151c6e2100a7e0c2615d1c587844b23d631f2464ddc79cf983d",
|
|
5
|
+
"flags.ts": "938093648b3bc8982b2a18d8ab370cbd750aafd836b46f78b9a4f72b3b3d2d91",
|
|
6
|
+
"help.ts": "c249bf63198c08bc6efdc83125db93ee27d4c2bc36e10657b47a944814dd125e",
|
|
7
|
+
"http.ts": "932bd91feeae47045267227bc6235c093d1d6320605ba9b04d7422759bb30f38",
|
|
8
|
+
"index.ts": "1ffdc25a3375e143ef5fd195cad6680afac76b500f5cdfca45d694037413ada1",
|
|
9
|
+
"mcp.ts": "c278d2546bd22bf71694fa50d4f6ac0aa7ba3daad18385a0017b453b1ef2296b",
|
|
10
|
+
"schema.ts": "805ccdb74cb9663f53e0453b0a6a9aa3b532e07273e3b8f1f12b655952366cf5",
|
|
11
|
+
"stdio.ts": "3f94670e6a3ed3e4aace92a147420337571e832549cebfd7ae5c53853dfa732a",
|
|
12
|
+
"surface.ts": "2fcd7dad290f337b64f2fdabf584aadecde60ce6114850e7ed5a34783f269c53",
|
|
13
|
+
"tools.ts": "d84be74864c8c82b890208836ca4438fb3c025b27ce5e68a6e9566d6ea6fffb9"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// The command line a surface defines. `<group> <op> --flag value` runs an operation and prints
|
|
2
|
+
// its result as JSON; `--help` anywhere explains what is there; `mcp` serves the same operations
|
|
3
|
+
// as an MCP server (stdio by default, `--http` for Streamable HTTP).
|
|
4
|
+
import { parseArgs } from "node:util";
|
|
5
|
+
import { parseFlags } from "./flags.ts";
|
|
6
|
+
import { mcpHelp, opHelp, overview } from "./help.ts";
|
|
7
|
+
import { serveHttp } from "./http.ts";
|
|
8
|
+
import { mcpHandler, type McpOptions } from "./mcp.ts";
|
|
9
|
+
import { serveStdio } from "./stdio.ts";
|
|
10
|
+
import {
|
|
11
|
+
describeError,
|
|
12
|
+
internalError,
|
|
13
|
+
isOp,
|
|
14
|
+
redactValue,
|
|
15
|
+
SurfaceError,
|
|
16
|
+
type Ops,
|
|
17
|
+
type SurfaceDefinition,
|
|
18
|
+
} from "./surface.ts";
|
|
19
|
+
|
|
20
|
+
export type CliIo = {
|
|
21
|
+
readonly out: (text: string) => void;
|
|
22
|
+
readonly err: (text: string) => void;
|
|
23
|
+
readonly stdin: () => ReadableStream<Uint8Array>;
|
|
24
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
25
|
+
/** Resolves when the HTTP server should stop (SIGINT or SIGTERM by default). */
|
|
26
|
+
readonly stopped: () => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const processIo = (): CliIo => ({
|
|
30
|
+
out: (text) => process.stdout.write(`${text}\n`),
|
|
31
|
+
err: (text) => process.stderr.write(`${text}\n`),
|
|
32
|
+
stdin: () => Bun.stdin.stream(),
|
|
33
|
+
env: process.env,
|
|
34
|
+
stopped: () =>
|
|
35
|
+
new Promise((resolve) => {
|
|
36
|
+
process.once("SIGINT", () => resolve());
|
|
37
|
+
process.once("SIGTERM", () => resolve());
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
type Say = (text: string) => Promise<void>;
|
|
42
|
+
/** The only way this command line writes a line of its own: through the redactor. */
|
|
43
|
+
type Voice = { readonly out: Say; readonly err: Say };
|
|
44
|
+
|
|
45
|
+
// The bearer the HTTP server will require is a secret of this process too. It is read leniently,
|
|
46
|
+
// before the arguments are validated, so that not even the error for a bad argument can print it.
|
|
47
|
+
const bearerOf = (
|
|
48
|
+
argv: readonly string[],
|
|
49
|
+
env: CliIo["env"],
|
|
50
|
+
): string | undefined => {
|
|
51
|
+
const { values } = parseArgs({
|
|
52
|
+
args: [...argv],
|
|
53
|
+
options: { "token-env": { type: "string" } },
|
|
54
|
+
strict: false,
|
|
55
|
+
});
|
|
56
|
+
const name = values["token-env"];
|
|
57
|
+
const value = typeof name === "string" ? env[name] : undefined;
|
|
58
|
+
return value === undefined || value === "" ? undefined : value;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const serveMcp = async (
|
|
62
|
+
surface: SurfaceDefinition<Ops>,
|
|
63
|
+
cli: string,
|
|
64
|
+
argv: readonly string[],
|
|
65
|
+
io: CliIo,
|
|
66
|
+
say: Voice,
|
|
67
|
+
): Promise<number> => {
|
|
68
|
+
const { values } = parseArgs({
|
|
69
|
+
args: [...argv],
|
|
70
|
+
options: {
|
|
71
|
+
http: { type: "boolean" },
|
|
72
|
+
host: { type: "string" },
|
|
73
|
+
port: { type: "string" },
|
|
74
|
+
path: { type: "string" },
|
|
75
|
+
"token-env": { type: "string" },
|
|
76
|
+
"read-only": { type: "boolean" },
|
|
77
|
+
only: { type: "string" },
|
|
78
|
+
exclude: { type: "string" },
|
|
79
|
+
help: { type: "boolean", short: "h" },
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
if (values.help === true) {
|
|
83
|
+
await say.out(mcpHelp(cli));
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
const split = (text: string | undefined) =>
|
|
87
|
+
text === undefined ? undefined : text.split(",").map((each) => each.trim());
|
|
88
|
+
const only = split(values.only);
|
|
89
|
+
const exclude = split(values.exclude);
|
|
90
|
+
const options: McpOptions = {
|
|
91
|
+
...(values["read-only"] === true ? { readOnly: true } : {}),
|
|
92
|
+
...(only === undefined ? {} : { only }),
|
|
93
|
+
...(exclude === undefined ? {} : { exclude }),
|
|
94
|
+
};
|
|
95
|
+
const handler = mcpHandler(surface, options);
|
|
96
|
+
if (values.http !== true) {
|
|
97
|
+
// The protocol stream: each line is a reply the handler has already redacted.
|
|
98
|
+
await serveStdio(handler, { input: io.stdin(), write: io.out });
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
const tokenName = values["token-env"];
|
|
102
|
+
if (tokenName === undefined)
|
|
103
|
+
throw new SurfaceError(
|
|
104
|
+
"usage",
|
|
105
|
+
"mcp --http needs --token-env NAME",
|
|
106
|
+
"name an environment variable that holds the bearer token clients must send",
|
|
107
|
+
);
|
|
108
|
+
const token = io.env[tokenName] ?? "";
|
|
109
|
+
if (token === "") throw new SurfaceError("usage", `$${tokenName} is empty`);
|
|
110
|
+
const server = serveHttp(handler, {
|
|
111
|
+
...(values.host === undefined ? {} : { hostname: values.host }),
|
|
112
|
+
...(values.port === undefined ? {} : { port: Number(values.port) }),
|
|
113
|
+
...(values.path === undefined ? {} : { path: values.path }),
|
|
114
|
+
token,
|
|
115
|
+
});
|
|
116
|
+
await say.err(
|
|
117
|
+
`${surface.name} MCP server: ${server.url} (${handler.tools.length} tools)`,
|
|
118
|
+
);
|
|
119
|
+
await io.stopped();
|
|
120
|
+
await server.stop();
|
|
121
|
+
return 0;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** Runs the command line `argv` (without the program name); resolves to the exit code. */
|
|
125
|
+
export const runCli = async <O extends Ops>(
|
|
126
|
+
surface: SurfaceDefinition<O>,
|
|
127
|
+
argv: readonly string[],
|
|
128
|
+
given: Partial<CliIo> & { readonly cli?: string } = {},
|
|
129
|
+
): Promise<number> => {
|
|
130
|
+
const io = { ...processIo(), ...given };
|
|
131
|
+
const cli = given.cli ?? surface.name;
|
|
132
|
+
const bearer =
|
|
133
|
+
argv[0] === "mcp" ? bearerOf(argv.slice(1), io.env) : undefined;
|
|
134
|
+
const redact = async (text: string): Promise<string> => {
|
|
135
|
+
const hidden =
|
|
136
|
+
bearer === undefined ? text : text.replaceAll(bearer, "[redacted]");
|
|
137
|
+
return surface.redact === undefined ? hidden : surface.redact(hidden);
|
|
138
|
+
};
|
|
139
|
+
const say: Voice = {
|
|
140
|
+
out: async (text) => io.out(await redact(text)),
|
|
141
|
+
err: async (text) => io.err(await redact(text)),
|
|
142
|
+
};
|
|
143
|
+
try {
|
|
144
|
+
// The server gets the same redactor, so its replies hide the bearer as well as the surface's secrets.
|
|
145
|
+
if (argv[0] === "mcp")
|
|
146
|
+
return await serveMcp(
|
|
147
|
+
{ ...surface, redact },
|
|
148
|
+
cli,
|
|
149
|
+
argv.slice(1),
|
|
150
|
+
io,
|
|
151
|
+
say,
|
|
152
|
+
);
|
|
153
|
+
let ops: Ops = surface.ops;
|
|
154
|
+
const path: string[] = [];
|
|
155
|
+
for (const word of argv) {
|
|
156
|
+
if (word.startsWith("-")) break;
|
|
157
|
+
const next = ops[word];
|
|
158
|
+
if (next === undefined)
|
|
159
|
+
throw new SurfaceError(
|
|
160
|
+
"usage",
|
|
161
|
+
`unknown command ${[...path, word].join(" ")}`,
|
|
162
|
+
`run ${cli} ${path.join(" ")} --help`,
|
|
163
|
+
);
|
|
164
|
+
path.push(word);
|
|
165
|
+
if (isOp(next)) {
|
|
166
|
+
const rest = argv.slice(path.length);
|
|
167
|
+
const parsed = await parseFlags(next.input.json, rest, () =>
|
|
168
|
+
new Response(io.stdin()).text(),
|
|
169
|
+
);
|
|
170
|
+
if (parsed.help) {
|
|
171
|
+
await say.out(opHelp(cli, path, next));
|
|
172
|
+
return 0;
|
|
173
|
+
}
|
|
174
|
+
const result = await next.invoke(parsed.input);
|
|
175
|
+
if (result !== undefined)
|
|
176
|
+
await say.out(
|
|
177
|
+
JSON.stringify(await redactValue(redact, result), null, 2),
|
|
178
|
+
);
|
|
179
|
+
return 0;
|
|
180
|
+
}
|
|
181
|
+
ops = next;
|
|
182
|
+
}
|
|
183
|
+
await say.out(overview(surface, cli, ops, path));
|
|
184
|
+
return argv.length === path.length ||
|
|
185
|
+
argv.includes("--help") ||
|
|
186
|
+
argv.includes("-h")
|
|
187
|
+
? 0
|
|
188
|
+
: 2;
|
|
189
|
+
} catch (error) {
|
|
190
|
+
// Any thrown value is wrapped, never rethrown, so its text still reaches the redactor; the
|
|
191
|
+
// instanceof check itself is guarded, because it throws for a revoked or trapped Proxy.
|
|
192
|
+
let reported: Error;
|
|
193
|
+
try {
|
|
194
|
+
reported = error instanceof Error ? error : internalError(error);
|
|
195
|
+
} catch {
|
|
196
|
+
reported = internalError(error);
|
|
197
|
+
}
|
|
198
|
+
const { kind, message, hint } = describeError(reported);
|
|
199
|
+
await say.err(`error: ${kind}: ${message}`);
|
|
200
|
+
if (hint !== undefined) await say.err(`hint: ${hint}`);
|
|
201
|
+
return kind === "usage" ? 2 : 1;
|
|
202
|
+
}
|
|
203
|
+
};
|