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,250 @@
|
|
|
1
|
+
// One definition of a skill's operations. `op` pairs a schema-typed input with a handler;
|
|
2
|
+
// `defineSurface` names the set. From that definition `bind` builds the typed SDK client,
|
|
3
|
+
// `runCli` the command line and `mcpHandler` the MCP server, so the three never drift apart.
|
|
4
|
+
import {
|
|
5
|
+
conforms,
|
|
6
|
+
problems,
|
|
7
|
+
type Infer,
|
|
8
|
+
type JsonSchema,
|
|
9
|
+
type Schema,
|
|
10
|
+
} from "./schema.ts";
|
|
11
|
+
|
|
12
|
+
export type Annotations = {
|
|
13
|
+
/** Reads only: changes nothing anywhere. */
|
|
14
|
+
readonly readOnly?: boolean;
|
|
15
|
+
/** May delete or overwrite what it touches (meaningful when not readOnly). */
|
|
16
|
+
readonly destructive?: boolean;
|
|
17
|
+
/** Calling it twice with the same input does no more than calling it once. */
|
|
18
|
+
readonly idempotent?: boolean;
|
|
19
|
+
/** Reaches beyond this machine's own state (other machines, the network). */
|
|
20
|
+
readonly openWorld?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type OpDefinition<I, O> = {
|
|
24
|
+
readonly description: string;
|
|
25
|
+
readonly title?: string;
|
|
26
|
+
readonly input: Schema<I>;
|
|
27
|
+
readonly output?: Schema<O>;
|
|
28
|
+
readonly annotations?: Annotations;
|
|
29
|
+
readonly run: (input: I) => O | Promise<O>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** An operation: its documentation, its schemas and `invoke`, which validates and then runs. */
|
|
33
|
+
export type Op<I, O> = OpDefinition<I, O> & {
|
|
34
|
+
readonly invoke: (input: unknown) => Promise<O>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type AnyOp = {
|
|
38
|
+
readonly description: string;
|
|
39
|
+
readonly title?: string;
|
|
40
|
+
readonly input: { readonly json: JsonSchema };
|
|
41
|
+
readonly output?: { readonly json: JsonSchema };
|
|
42
|
+
readonly annotations?: Annotations;
|
|
43
|
+
readonly invoke: (input: unknown) => Promise<unknown>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type Ops = { readonly [name: string]: AnyOp | Ops };
|
|
47
|
+
|
|
48
|
+
export type SurfaceDefinition<O extends Ops> = {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly version: string;
|
|
51
|
+
readonly description?: string;
|
|
52
|
+
/** Guidance an MCP client hands its model: when to use these tools, and how. */
|
|
53
|
+
readonly instructions?: string;
|
|
54
|
+
/** Removes secrets from text. Everything the CLI prints and every MCP tool reply passes through it. */
|
|
55
|
+
readonly redact?: (text: string) => string | Promise<string>;
|
|
56
|
+
readonly ops: O;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** A failure every surface reports the same way: `kind` is machine-readable, `hint` says what to do. */
|
|
60
|
+
export class SurfaceError extends Error {
|
|
61
|
+
override readonly name = "SurfaceError";
|
|
62
|
+
readonly kind: string;
|
|
63
|
+
readonly hint: string | undefined;
|
|
64
|
+
constructor(kind: string, message: string, hint?: string) {
|
|
65
|
+
super(message);
|
|
66
|
+
this.kind = kind;
|
|
67
|
+
this.hint = hint;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const op = <I, O>(definition: OpDefinition<I, O>): Op<I, O> => ({
|
|
72
|
+
...definition,
|
|
73
|
+
invoke: async (input: unknown) => {
|
|
74
|
+
const given = input ?? {};
|
|
75
|
+
if (!conforms(definition.input, given)) {
|
|
76
|
+
throw new SurfaceError(
|
|
77
|
+
"usage",
|
|
78
|
+
problems(definition.input.json, given).join("; "),
|
|
79
|
+
"see the operation's input schema (--help on the CLI, inputSchema over MCP)",
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return definition.run(given);
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export const defineSurface = <const O extends Ops>(
|
|
87
|
+
definition: SurfaceDefinition<O>,
|
|
88
|
+
): SurfaceDefinition<O> => definition;
|
|
89
|
+
|
|
90
|
+
export const isOp = (value: AnyOp | Ops): value is AnyOp =>
|
|
91
|
+
typeof value["invoke"] === "function" &&
|
|
92
|
+
typeof value["description"] === "string";
|
|
93
|
+
|
|
94
|
+
export type Entry = { readonly path: readonly string[]; readonly op: AnyOp };
|
|
95
|
+
|
|
96
|
+
/** Every operation with its path, depth-first in definition order. */
|
|
97
|
+
export const entries = (
|
|
98
|
+
ops: Ops,
|
|
99
|
+
prefix: readonly string[] = [],
|
|
100
|
+
): readonly Entry[] =>
|
|
101
|
+
Object.entries(ops).flatMap(([name, value]) =>
|
|
102
|
+
isOp(value)
|
|
103
|
+
? [{ path: [...prefix, name], op: value }]
|
|
104
|
+
: entries(value, [...prefix, name]),
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
type Call<I, O> =
|
|
108
|
+
Readonly<Record<string, never>> extends I
|
|
109
|
+
? (input?: I) => Promise<O>
|
|
110
|
+
: (input: I) => Promise<O>;
|
|
111
|
+
|
|
112
|
+
/** The typed SDK a surface defines: `client.group.op(input)`. */
|
|
113
|
+
export type Client<O extends Ops> = {
|
|
114
|
+
readonly [K in keyof O]: O[K] extends Op<infer I, infer R>
|
|
115
|
+
? Call<I, Awaited<R>>
|
|
116
|
+
: O[K] extends Ops
|
|
117
|
+
? Client<O[K]>
|
|
118
|
+
: never;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export function bind<O extends Ops>(ops: O): Client<O>;
|
|
122
|
+
export function bind(ops: Ops): unknown {
|
|
123
|
+
return Object.fromEntries(
|
|
124
|
+
Object.entries(ops).map(([name, value]) => [
|
|
125
|
+
name,
|
|
126
|
+
isOp(value) ? (input?: unknown) => value.invoke(input) : bind(value),
|
|
127
|
+
]),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type Described = {
|
|
132
|
+
readonly kind: string;
|
|
133
|
+
readonly message: string;
|
|
134
|
+
readonly hint?: string;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// A thrown value can be hostile to reading it (a throwing getter, a Proxy trap, a cycle, a BigInt):
|
|
138
|
+
// each read below falls back instead of throwing, so describing a failure never fails.
|
|
139
|
+
const field = (error: object, key: string): string | undefined => {
|
|
140
|
+
try {
|
|
141
|
+
const value: unknown = Reflect.get(error, key);
|
|
142
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
143
|
+
} catch {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const json = (value: object): string | undefined => {
|
|
149
|
+
try {
|
|
150
|
+
return JSON.stringify(value);
|
|
151
|
+
} catch {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/** Any thrown value as `{ kind, message, hint }`, reading `kind` and `hint` where errors carry them; it never throws. */
|
|
157
|
+
export const describeError = (error: unknown): Described => {
|
|
158
|
+
if (typeof error !== "object" || error === null) {
|
|
159
|
+
return { kind: "error", message: String(error) };
|
|
160
|
+
}
|
|
161
|
+
const hint = field(error, "hint");
|
|
162
|
+
return {
|
|
163
|
+
kind:
|
|
164
|
+
field(error, "kind") ??
|
|
165
|
+
field(error, "code") ??
|
|
166
|
+
field(error, "name") ??
|
|
167
|
+
"error",
|
|
168
|
+
message:
|
|
169
|
+
field(error, "message") ??
|
|
170
|
+
json(error) ??
|
|
171
|
+
"a thrown value that could not be described",
|
|
172
|
+
...(hint === undefined ? {} : { hint }),
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* A thrown value that is not an Error (or cannot even be asked: `instanceof` throws for a revoked
|
|
178
|
+
* Proxy or a throwing getPrototypeOf trap), as the SurfaceError internal a boundary reports.
|
|
179
|
+
*/
|
|
180
|
+
export const internalError = (value: unknown): SurfaceError =>
|
|
181
|
+
new SurfaceError("internal", describeError(value).message);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The secrets a skill has read, for its surface's `redact`: call `remember` where a secret is read
|
|
185
|
+
* and pass `redact` to `defineSurface`, so no answer the surface prints carries one.
|
|
186
|
+
*/
|
|
187
|
+
export const secretTally = () => {
|
|
188
|
+
const secrets = new Set<string>();
|
|
189
|
+
return {
|
|
190
|
+
remember: (secret: string): string => {
|
|
191
|
+
if (secret !== "") secrets.add(secret);
|
|
192
|
+
return secret;
|
|
193
|
+
},
|
|
194
|
+
// The longest first, so a secret that contains another is redacted whole.
|
|
195
|
+
redact: (text: string): string =>
|
|
196
|
+
[...secrets]
|
|
197
|
+
.toSorted((a, b) => b.length - a.length)
|
|
198
|
+
.reduce((out, secret) => out.split(secret).join("[redacted]"), text),
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
type Redact = SurfaceDefinition<Ops>["redact"];
|
|
203
|
+
type Redactor = NonNullable<Redact>;
|
|
204
|
+
type Fields = { readonly [key: string]: unknown };
|
|
205
|
+
|
|
206
|
+
const isFields = (value: unknown): value is Fields =>
|
|
207
|
+
typeof value === "object" && value !== null && !Array.isArray(value);
|
|
208
|
+
|
|
209
|
+
// Keys are redacted as well as values: a secret is as readable as a property name as it is as a string.
|
|
210
|
+
const walkFields = async (redact: Redactor, record: Fields): Promise<Fields> =>
|
|
211
|
+
Object.fromEntries(
|
|
212
|
+
await Promise.all(
|
|
213
|
+
Object.entries(record).map(
|
|
214
|
+
async ([key, value]) =>
|
|
215
|
+
[await redact(key), await walk(redact, value)] as const,
|
|
216
|
+
),
|
|
217
|
+
),
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
const walk = async (redact: Redactor, value: unknown): Promise<unknown> => {
|
|
221
|
+
if (typeof value === "string") return redact(value);
|
|
222
|
+
if (Array.isArray(value))
|
|
223
|
+
return Promise.all(value.map((each) => walk(redact, each)));
|
|
224
|
+
return isFields(value) ? walkFields(redact, value) : value;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/** A JSON record with every key and every string in it, at any depth, passed through `redact`. */
|
|
228
|
+
export const redactFields = async (
|
|
229
|
+
redact: Redact,
|
|
230
|
+
record: Fields,
|
|
231
|
+
): Promise<Fields> =>
|
|
232
|
+
redact === undefined ? record : walkFields(redact, record);
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* `value` as it will be serialized, with every key and string passed through `redact`. It is turned
|
|
236
|
+
* into plain JSON first, so a date or any other `toJSON` value is redacted in the form it is printed
|
|
237
|
+
* in; redacting the value, not its JSON text, also catches a secret holding characters JSON escapes.
|
|
238
|
+
*/
|
|
239
|
+
export const redactValue = async (
|
|
240
|
+
redact: Redact,
|
|
241
|
+
value: unknown,
|
|
242
|
+
): Promise<unknown> => {
|
|
243
|
+
if (redact === undefined) return value;
|
|
244
|
+
const text: string | undefined = JSON.stringify(value);
|
|
245
|
+
if (text === undefined) return undefined;
|
|
246
|
+
const plain: unknown = JSON.parse(text);
|
|
247
|
+
return walk(redact, plain);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export type { Infer };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// How a surface's operations become MCP tools: names, schemas, behaviour hints, and which of
|
|
2
|
+
// them a server exposes.
|
|
3
|
+
import {
|
|
4
|
+
entries,
|
|
5
|
+
type Entry,
|
|
6
|
+
type Ops,
|
|
7
|
+
type SurfaceDefinition,
|
|
8
|
+
} from "./surface.ts";
|
|
9
|
+
import type { JsonSchema } from "./schema.ts";
|
|
10
|
+
|
|
11
|
+
export type McpOptions = {
|
|
12
|
+
/** Serve only operations annotated readOnly. */
|
|
13
|
+
readonly readOnly?: boolean;
|
|
14
|
+
/** Serve only tools whose name matches one of these patterns (`*` is a wildcard). */
|
|
15
|
+
readonly only?: readonly string[];
|
|
16
|
+
/** Leave out tools whose name matches one of these patterns. */
|
|
17
|
+
readonly exclude?: readonly string[];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type Tool = {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly title?: string;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
readonly inputSchema: JsonSchema;
|
|
25
|
+
readonly outputSchema?: JsonSchema;
|
|
26
|
+
readonly annotations: JsonSchema;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** The MCP tool name of an operation path: `["workspace", "move"]` is `workspace_move`. */
|
|
30
|
+
export const toolName = (path: readonly string[]): string => path.join("_");
|
|
31
|
+
|
|
32
|
+
const matches = (patterns: readonly string[], name: string): boolean =>
|
|
33
|
+
patterns.some((pattern) =>
|
|
34
|
+
new RegExp(
|
|
35
|
+
`^${pattern
|
|
36
|
+
.split("*")
|
|
37
|
+
.map((part) => part.replace(/[.+?^${}()|[\]\\]/g, "\\$&"))
|
|
38
|
+
.join(".*")}$`,
|
|
39
|
+
).test(name),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const objectSchema = (schema: JsonSchema): JsonSchema =>
|
|
43
|
+
schema["type"] === "object"
|
|
44
|
+
? schema
|
|
45
|
+
: { type: "object", additionalProperties: false };
|
|
46
|
+
|
|
47
|
+
export const toolOf = ({ path, op }: Entry): Tool => {
|
|
48
|
+
const hints = op.annotations ?? {};
|
|
49
|
+
const output = op.output?.json;
|
|
50
|
+
return {
|
|
51
|
+
name: toolName(path),
|
|
52
|
+
...(op.title === undefined ? {} : { title: op.title }),
|
|
53
|
+
description: op.description,
|
|
54
|
+
inputSchema: objectSchema(op.input.json),
|
|
55
|
+
...(output !== undefined && output["type"] === "object"
|
|
56
|
+
? { outputSchema: output }
|
|
57
|
+
: {}),
|
|
58
|
+
annotations: {
|
|
59
|
+
...(op.title === undefined ? {} : { title: op.title }),
|
|
60
|
+
readOnlyHint: hints.readOnly === true,
|
|
61
|
+
destructiveHint: hints.readOnly !== true && hints.destructive !== false,
|
|
62
|
+
idempotentHint: hints.idempotent === true,
|
|
63
|
+
openWorldHint: hints.openWorld === true,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** The operations a server with `options` exposes, in definition order. */
|
|
69
|
+
export const servedEntries = (
|
|
70
|
+
surface: SurfaceDefinition<Ops>,
|
|
71
|
+
options: McpOptions,
|
|
72
|
+
): readonly Entry[] =>
|
|
73
|
+
entries(surface.ops).filter(({ path, op }) => {
|
|
74
|
+
const name = toolName(path);
|
|
75
|
+
if (options.readOnly === true && op.annotations?.readOnly !== true)
|
|
76
|
+
return false;
|
|
77
|
+
if (options.only !== undefined && !matches(options.only, name))
|
|
78
|
+
return false;
|
|
79
|
+
return !(options.exclude !== undefined && matches(options.exclude, name));
|
|
80
|
+
});
|