@useconductor/conductor 1.0.0
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/.claude-plugin/marketplace.json +33 -0
- package/.claude-plugin/plugin.json +23 -0
- package/.eslintrc.json +23 -0
- package/.gitattributes +6 -0
- package/.github/FUNDING.yml +15 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +91 -0
- package/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +63 -0
- package/.github/ISSUE_TEMPLATE/plugin_request.yml +71 -0
- package/.github/README.md +13 -0
- package/.github/workflows/README.md +22 -0
- package/.github/workflows/auto-release.yml +112 -0
- package/.github/workflows/ci.yml +49 -0
- package/.github/workflows/claude-code-review.yml +44 -0
- package/.github/workflows/claude.yml +36 -0
- package/.github/workflows/sync-install.yml +47 -0
- package/.mcp.json +9 -0
- package/.prettierrc.json +7 -0
- package/C.png +0 -0
- package/CHANGELOG.md +74 -0
- package/CLAUDE.md +118 -0
- package/CONTRIBUTING.md +231 -0
- package/LICENSE +201 -0
- package/README.md +179 -0
- package/SECURITY.md +47 -0
- package/commands/conductor-setup.md +11 -0
- package/commands/conductor-status.md +7 -0
- package/dist/ai/base.d.ts +44 -0
- package/dist/ai/base.d.ts.map +1 -0
- package/dist/ai/base.js +47 -0
- package/dist/ai/base.js.map +1 -0
- package/dist/ai/claude.d.ts +11 -0
- package/dist/ai/claude.d.ts.map +1 -0
- package/dist/ai/claude.js +149 -0
- package/dist/ai/claude.js.map +1 -0
- package/dist/ai/gemini.d.ts +15 -0
- package/dist/ai/gemini.d.ts.map +1 -0
- package/dist/ai/gemini.js +156 -0
- package/dist/ai/gemini.js.map +1 -0
- package/dist/ai/maestro.d.ts +22 -0
- package/dist/ai/maestro.d.ts.map +1 -0
- package/dist/ai/maestro.js +142 -0
- package/dist/ai/maestro.js.map +1 -0
- package/dist/ai/manager.d.ts +47 -0
- package/dist/ai/manager.d.ts.map +1 -0
- package/dist/ai/manager.js +450 -0
- package/dist/ai/manager.js.map +1 -0
- package/dist/ai/ollama.d.ts +16 -0
- package/dist/ai/ollama.d.ts.map +1 -0
- package/dist/ai/ollama.js +151 -0
- package/dist/ai/ollama.js.map +1 -0
- package/dist/ai/openai.d.ts +11 -0
- package/dist/ai/openai.d.ts.map +1 -0
- package/dist/ai/openai.js +132 -0
- package/dist/ai/openai.js.map +1 -0
- package/dist/ai/openrouter.d.ts +11 -0
- package/dist/ai/openrouter.d.ts.map +1 -0
- package/dist/ai/openrouter.js +139 -0
- package/dist/ai/openrouter.js.map +1 -0
- package/dist/bot/slack.d.ts +17 -0
- package/dist/bot/slack.d.ts.map +1 -0
- package/dist/bot/slack.js +144 -0
- package/dist/bot/slack.js.map +1 -0
- package/dist/bot/telegram.d.ts +19 -0
- package/dist/bot/telegram.d.ts.map +1 -0
- package/dist/bot/telegram.js +157 -0
- package/dist/bot/telegram.js.map +1 -0
- package/dist/cli/commands/ai.d.ts +4 -0
- package/dist/cli/commands/ai.d.ts.map +1 -0
- package/dist/cli/commands/ai.js +161 -0
- package/dist/cli/commands/ai.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +18 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +213 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +15 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +281 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/install.d.ts +16 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/install.js +750 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/lifecycle.d.ts +4 -0
- package/dist/cli/commands/lifecycle.d.ts.map +1 -0
- package/dist/cli/commands/lifecycle.js +84 -0
- package/dist/cli/commands/lifecycle.js.map +1 -0
- package/dist/cli/commands/marketplace.d.ts +13 -0
- package/dist/cli/commands/marketplace.d.ts.map +1 -0
- package/dist/cli/commands/marketplace.js +197 -0
- package/dist/cli/commands/marketplace.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +6 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +83 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +10 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -0
- package/dist/cli/commands/onboard.js +207 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/plugin-create.d.ts +13 -0
- package/dist/cli/commands/plugin-create.d.ts.map +1 -0
- package/dist/cli/commands/plugin-create.js +122 -0
- package/dist/cli/commands/plugin-create.js.map +1 -0
- package/dist/cli/commands/plugins.d.ts +5 -0
- package/dist/cli/commands/plugins.d.ts.map +1 -0
- package/dist/cli/commands/plugins.js +30 -0
- package/dist/cli/commands/plugins.js.map +1 -0
- package/dist/cli/commands/release.d.ts +13 -0
- package/dist/cli/commands/release.d.ts.map +1 -0
- package/dist/cli/commands/release.js +243 -0
- package/dist/cli/commands/release.js.map +1 -0
- package/dist/cli/commands/telegram.d.ts +3 -0
- package/dist/cli/commands/telegram.d.ts.map +1 -0
- package/dist/cli/commands/telegram.js +20 -0
- package/dist/cli/commands/telegram.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +402 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/oauth.d.ts +8 -0
- package/dist/config/oauth.d.ts.map +1 -0
- package/dist/config/oauth.js +13 -0
- package/dist/config/oauth.js.map +1 -0
- package/dist/core/audit.d.ts +91 -0
- package/dist/core/audit.d.ts.map +1 -0
- package/dist/core/audit.js +233 -0
- package/dist/core/audit.js.map +1 -0
- package/dist/core/circuit-breaker.d.ts +56 -0
- package/dist/core/circuit-breaker.d.ts.map +1 -0
- package/dist/core/circuit-breaker.js +107 -0
- package/dist/core/circuit-breaker.js.map +1 -0
- package/dist/core/conductor.d.ts +44 -0
- package/dist/core/conductor.d.ts.map +1 -0
- package/dist/core/conductor.js +200 -0
- package/dist/core/conductor.js.map +1 -0
- package/dist/core/config.d.ts +66 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +86 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/database.d.ts +59 -0
- package/dist/core/database.d.ts.map +1 -0
- package/dist/core/database.js +342 -0
- package/dist/core/database.js.map +1 -0
- package/dist/core/errors.d.ts +231 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +254 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/health.d.ts +72 -0
- package/dist/core/health.d.ts.map +1 -0
- package/dist/core/health.js +116 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/interfaces.d.ts +62 -0
- package/dist/core/interfaces.d.ts.map +1 -0
- package/dist/core/interfaces.js +8 -0
- package/dist/core/interfaces.js.map +1 -0
- package/dist/core/logger.d.ts +15 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +30 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/rbac.d.ts +132 -0
- package/dist/core/rbac.d.ts.map +1 -0
- package/dist/core/rbac.js +230 -0
- package/dist/core/rbac.js.map +1 -0
- package/dist/core/retry.d.ts +22 -0
- package/dist/core/retry.d.ts.map +1 -0
- package/dist/core/retry.js +41 -0
- package/dist/core/retry.js.map +1 -0
- package/dist/core/webhooks.d.ts +92 -0
- package/dist/core/webhooks.d.ts.map +1 -0
- package/dist/core/webhooks.js +176 -0
- package/dist/core/webhooks.js.map +1 -0
- package/dist/core/zero-config.d.ts +22 -0
- package/dist/core/zero-config.d.ts.map +1 -0
- package/dist/core/zero-config.js +59 -0
- package/dist/core/zero-config.js.map +1 -0
- package/dist/dashboard/cli.d.ts +6 -0
- package/dist/dashboard/cli.d.ts.map +1 -0
- package/dist/dashboard/cli.js +42 -0
- package/dist/dashboard/cli.js.map +1 -0
- package/dist/dashboard/index.html +3426 -0
- package/dist/dashboard/server.d.ts +7 -0
- package/dist/dashboard/server.d.ts.map +1 -0
- package/dist/dashboard/server.js +1427 -0
- package/dist/dashboard/server.js.map +1 -0
- package/dist/mcp/server.d.ts +27 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +380 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/misc.d.ts +15 -0
- package/dist/mcp/tools/misc.d.ts.map +1 -0
- package/dist/mcp/tools/misc.js +49 -0
- package/dist/mcp/tools/misc.js.map +1 -0
- package/dist/plugins/builtin/calculator.d.ts +11 -0
- package/dist/plugins/builtin/calculator.d.ts.map +1 -0
- package/dist/plugins/builtin/calculator.js +166 -0
- package/dist/plugins/builtin/calculator.js.map +1 -0
- package/dist/plugins/builtin/colors.d.ts +15 -0
- package/dist/plugins/builtin/colors.d.ts.map +1 -0
- package/dist/plugins/builtin/colors.js +193 -0
- package/dist/plugins/builtin/colors.js.map +1 -0
- package/dist/plugins/builtin/cron.d.ts +40 -0
- package/dist/plugins/builtin/cron.d.ts.map +1 -0
- package/dist/plugins/builtin/cron.js +578 -0
- package/dist/plugins/builtin/cron.js.map +1 -0
- package/dist/plugins/builtin/crypto.d.ts +11 -0
- package/dist/plugins/builtin/crypto.d.ts.map +1 -0
- package/dist/plugins/builtin/crypto.js +83 -0
- package/dist/plugins/builtin/crypto.js.map +1 -0
- package/dist/plugins/builtin/database.d.ts +29 -0
- package/dist/plugins/builtin/database.d.ts.map +1 -0
- package/dist/plugins/builtin/database.js +230 -0
- package/dist/plugins/builtin/database.js.map +1 -0
- package/dist/plugins/builtin/docker.d.ts +12 -0
- package/dist/plugins/builtin/docker.d.ts.map +1 -0
- package/dist/plugins/builtin/docker.js +436 -0
- package/dist/plugins/builtin/docker.js.map +1 -0
- package/dist/plugins/builtin/fun.d.ts +11 -0
- package/dist/plugins/builtin/fun.d.ts.map +1 -0
- package/dist/plugins/builtin/fun.js +114 -0
- package/dist/plugins/builtin/fun.js.map +1 -0
- package/dist/plugins/builtin/gcal.d.ts +38 -0
- package/dist/plugins/builtin/gcal.d.ts.map +1 -0
- package/dist/plugins/builtin/gcal.js +280 -0
- package/dist/plugins/builtin/gcal.js.map +1 -0
- package/dist/plugins/builtin/gdrive.d.ts +26 -0
- package/dist/plugins/builtin/gdrive.d.ts.map +1 -0
- package/dist/plugins/builtin/gdrive.js +295 -0
- package/dist/plugins/builtin/gdrive.js.map +1 -0
- package/dist/plugins/builtin/github-actions.d.ts +38 -0
- package/dist/plugins/builtin/github-actions.d.ts.map +1 -0
- package/dist/plugins/builtin/github-actions.js +629 -0
- package/dist/plugins/builtin/github-actions.js.map +1 -0
- package/dist/plugins/builtin/github.d.ts +26 -0
- package/dist/plugins/builtin/github.d.ts.map +1 -0
- package/dist/plugins/builtin/github.js +800 -0
- package/dist/plugins/builtin/github.js.map +1 -0
- package/dist/plugins/builtin/gmail.d.ts +50 -0
- package/dist/plugins/builtin/gmail.d.ts.map +1 -0
- package/dist/plugins/builtin/gmail.js +445 -0
- package/dist/plugins/builtin/gmail.js.map +1 -0
- package/dist/plugins/builtin/hash.d.ts +11 -0
- package/dist/plugins/builtin/hash.d.ts.map +1 -0
- package/dist/plugins/builtin/hash.js +95 -0
- package/dist/plugins/builtin/hash.js.map +1 -0
- package/dist/plugins/builtin/homekit.d.ts +53 -0
- package/dist/plugins/builtin/homekit.d.ts.map +1 -0
- package/dist/plugins/builtin/homekit.js +341 -0
- package/dist/plugins/builtin/homekit.js.map +1 -0
- package/dist/plugins/builtin/index.d.ts +4 -0
- package/dist/plugins/builtin/index.d.ts.map +1 -0
- package/dist/plugins/builtin/index.js +96 -0
- package/dist/plugins/builtin/index.js.map +1 -0
- package/dist/plugins/builtin/jira.d.ts +50 -0
- package/dist/plugins/builtin/jira.d.ts.map +1 -0
- package/dist/plugins/builtin/jira.js +353 -0
- package/dist/plugins/builtin/jira.js.map +1 -0
- package/dist/plugins/builtin/linear.d.ts +35 -0
- package/dist/plugins/builtin/linear.d.ts.map +1 -0
- package/dist/plugins/builtin/linear.js +397 -0
- package/dist/plugins/builtin/linear.js.map +1 -0
- package/dist/plugins/builtin/lumen.d.ts +21 -0
- package/dist/plugins/builtin/lumen.d.ts.map +1 -0
- package/dist/plugins/builtin/lumen.js +404 -0
- package/dist/plugins/builtin/lumen.js.map +1 -0
- package/dist/plugins/builtin/memory.d.ts +22 -0
- package/dist/plugins/builtin/memory.d.ts.map +1 -0
- package/dist/plugins/builtin/memory.js +184 -0
- package/dist/plugins/builtin/memory.js.map +1 -0
- package/dist/plugins/builtin/n8n.d.ts +60 -0
- package/dist/plugins/builtin/n8n.d.ts.map +1 -0
- package/dist/plugins/builtin/n8n.js +519 -0
- package/dist/plugins/builtin/n8n.js.map +1 -0
- package/dist/plugins/builtin/network.d.ts +11 -0
- package/dist/plugins/builtin/network.d.ts.map +1 -0
- package/dist/plugins/builtin/network.js +88 -0
- package/dist/plugins/builtin/network.js.map +1 -0
- package/dist/plugins/builtin/notes.d.ts +47 -0
- package/dist/plugins/builtin/notes.d.ts.map +1 -0
- package/dist/plugins/builtin/notes.js +641 -0
- package/dist/plugins/builtin/notes.js.map +1 -0
- package/dist/plugins/builtin/notion.d.ts +47 -0
- package/dist/plugins/builtin/notion.d.ts.map +1 -0
- package/dist/plugins/builtin/notion.js +317 -0
- package/dist/plugins/builtin/notion.js.map +1 -0
- package/dist/plugins/builtin/shell.d.ts +12 -0
- package/dist/plugins/builtin/shell.d.ts.map +1 -0
- package/dist/plugins/builtin/shell.js +310 -0
- package/dist/plugins/builtin/shell.js.map +1 -0
- package/dist/plugins/builtin/slack.d.ts +31 -0
- package/dist/plugins/builtin/slack.d.ts.map +1 -0
- package/dist/plugins/builtin/slack.js +295 -0
- package/dist/plugins/builtin/slack.js.map +1 -0
- package/dist/plugins/builtin/spotify.d.ts +55 -0
- package/dist/plugins/builtin/spotify.d.ts.map +1 -0
- package/dist/plugins/builtin/spotify.js +623 -0
- package/dist/plugins/builtin/spotify.js.map +1 -0
- package/dist/plugins/builtin/stripe.d.ts +35 -0
- package/dist/plugins/builtin/stripe.d.ts.map +1 -0
- package/dist/plugins/builtin/stripe.js +376 -0
- package/dist/plugins/builtin/stripe.js.map +1 -0
- package/dist/plugins/builtin/system.d.ts +11 -0
- package/dist/plugins/builtin/system.d.ts.map +1 -0
- package/dist/plugins/builtin/system.js +91 -0
- package/dist/plugins/builtin/system.js.map +1 -0
- package/dist/plugins/builtin/text-tools.d.ts +11 -0
- package/dist/plugins/builtin/text-tools.d.ts.map +1 -0
- package/dist/plugins/builtin/text-tools.js +146 -0
- package/dist/plugins/builtin/text-tools.js.map +1 -0
- package/dist/plugins/builtin/timezone.d.ts +13 -0
- package/dist/plugins/builtin/timezone.d.ts.map +1 -0
- package/dist/plugins/builtin/timezone.js +164 -0
- package/dist/plugins/builtin/timezone.js.map +1 -0
- package/dist/plugins/builtin/todoist.d.ts +49 -0
- package/dist/plugins/builtin/todoist.d.ts.map +1 -0
- package/dist/plugins/builtin/todoist.js +540 -0
- package/dist/plugins/builtin/todoist.js.map +1 -0
- package/dist/plugins/builtin/translate.d.ts +11 -0
- package/dist/plugins/builtin/translate.d.ts.map +1 -0
- package/dist/plugins/builtin/translate.js +42 -0
- package/dist/plugins/builtin/translate.js.map +1 -0
- package/dist/plugins/builtin/url-tools.d.ts +11 -0
- package/dist/plugins/builtin/url-tools.d.ts.map +1 -0
- package/dist/plugins/builtin/url-tools.js +70 -0
- package/dist/plugins/builtin/url-tools.js.map +1 -0
- package/dist/plugins/builtin/vercel.d.ts +55 -0
- package/dist/plugins/builtin/vercel.d.ts.map +1 -0
- package/dist/plugins/builtin/vercel.js +514 -0
- package/dist/plugins/builtin/vercel.js.map +1 -0
- package/dist/plugins/builtin/weather.d.ts +13 -0
- package/dist/plugins/builtin/weather.d.ts.map +1 -0
- package/dist/plugins/builtin/weather.js +103 -0
- package/dist/plugins/builtin/weather.js.map +1 -0
- package/dist/plugins/builtin/x.d.ts +54 -0
- package/dist/plugins/builtin/x.d.ts.map +1 -0
- package/dist/plugins/builtin/x.js +402 -0
- package/dist/plugins/builtin/x.js.map +1 -0
- package/dist/plugins/manager.d.ts +77 -0
- package/dist/plugins/manager.d.ts.map +1 -0
- package/dist/plugins/manager.js +141 -0
- package/dist/plugins/manager.js.map +1 -0
- package/dist/plugins/validation.d.ts +18 -0
- package/dist/plugins/validation.d.ts.map +1 -0
- package/dist/plugins/validation.js +81 -0
- package/dist/plugins/validation.js.map +1 -0
- package/dist/security/auth.d.ts +23 -0
- package/dist/security/auth.d.ts.map +1 -0
- package/dist/security/auth.js +56 -0
- package/dist/security/auth.js.map +1 -0
- package/dist/security/keychain.d.ts +60 -0
- package/dist/security/keychain.d.ts.map +1 -0
- package/dist/security/keychain.js +213 -0
- package/dist/security/keychain.js.map +1 -0
- package/dist/utils/google-auth.d.ts +21 -0
- package/dist/utils/google-auth.d.ts.map +1 -0
- package/dist/utils/google-auth.js +135 -0
- package/dist/utils/google-auth.js.map +1 -0
- package/dist/utils/retry.d.ts +5 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +34 -0
- package/dist/utils/retry.js.map +1 -0
- package/docs/README.md +13 -0
- package/docs/api.md +210 -0
- package/docs/getting-started.md +100 -0
- package/docs/plugins.md +306 -0
- package/docs-site/.vitepress/config.ts +59 -0
- package/docs-site/README.md +12 -0
- package/docs-site/index.md +30 -0
- package/eslint.config.js +29 -0
- package/install.ps1 +334 -0
- package/install.sh +1119 -0
- package/local-install.sh +304 -0
- package/package.json +90 -0
- package/packages/README.md +11 -0
- package/packages/plugin-sdk/README.md +12 -0
- package/packages/plugin-sdk/package.json +22 -0
- package/packages/plugin-sdk/src/README.md +11 -0
- package/packages/plugin-sdk/src/index.ts +191 -0
- package/sdks/README.md +26 -0
- package/sdks/csharp/ConductorClient.cs +65 -0
- package/sdks/csharp/README.md +11 -0
- package/sdks/go/README.md +11 -0
- package/sdks/go/conductor.go +257 -0
- package/sdks/java/ConductorClient.java +27 -0
- package/sdks/java/README.md +11 -0
- package/sdks/php/README.md +11 -0
- package/sdks/php/src/Client.php +72 -0
- package/sdks/python/README.md +12 -0
- package/sdks/python/conductor/__init__.py +227 -0
- package/sdks/python/pyproject.toml +30 -0
- package/sdks/ruby/README.md +11 -0
- package/sdks/ruby/lib/conductor.rb +46 -0
- package/sdks/rust/Cargo.toml +14 -0
- package/sdks/rust/README.md +11 -0
- package/sdks/swift/README.md +11 -0
- package/sdks/swift/Sources/Conductor/ConductorClient.swift +65 -0
- package/skills/conductor-mcp/SKILL.md +38 -0
- package/src/README.md +20 -0
- package/src/ai/README.md +18 -0
- package/src/ai/base.ts +93 -0
- package/src/ai/claude.ts +162 -0
- package/src/ai/gemini.ts +188 -0
- package/src/ai/maestro.ts +168 -0
- package/src/ai/manager.ts +537 -0
- package/src/ai/ollama.ts +186 -0
- package/src/ai/openai.ts +147 -0
- package/src/ai/openrouter.ts +152 -0
- package/src/bot/README.md +12 -0
- package/src/bot/slack.ts +164 -0
- package/src/bot/telegram.ts +185 -0
- package/src/cli/README.md +24 -0
- package/src/cli/commands/README.md +20 -0
- package/src/cli/commands/ai.ts +170 -0
- package/src/cli/commands/doctor.ts +221 -0
- package/src/cli/commands/init.ts +348 -0
- package/src/cli/commands/install.ts +792 -0
- package/src/cli/commands/lifecycle.ts +95 -0
- package/src/cli/commands/marketplace.ts +253 -0
- package/src/cli/commands/mcp.ts +92 -0
- package/src/cli/commands/onboard.ts +248 -0
- package/src/cli/commands/plugin-create.ts +130 -0
- package/src/cli/commands/plugins.ts +36 -0
- package/src/cli/commands/release.ts +251 -0
- package/src/cli/commands/telegram.ts +25 -0
- package/src/cli/index.ts +450 -0
- package/src/config/README.md +11 -0
- package/src/config/oauth.ts +26 -0
- package/src/core/README.md +22 -0
- package/src/core/audit.ts +291 -0
- package/src/core/circuit-breaker.ts +129 -0
- package/src/core/conductor.ts +240 -0
- package/src/core/config.ts +149 -0
- package/src/core/database.ts +411 -0
- package/src/core/errors.ts +275 -0
- package/src/core/health.ts +159 -0
- package/src/core/interfaces.ts +75 -0
- package/src/core/logger.ts +33 -0
- package/src/core/rbac.ts +321 -0
- package/src/core/retry.ts +61 -0
- package/src/core/webhooks.ts +234 -0
- package/src/core/zero-config.ts +72 -0
- package/src/dashboard/README.md +15 -0
- package/src/dashboard/cli.ts +48 -0
- package/src/dashboard/index.html +3426 -0
- package/src/dashboard/server.ts +1544 -0
- package/src/mcp/README.md +20 -0
- package/src/mcp/server.ts +475 -0
- package/src/mcp/tools/README.md +11 -0
- package/src/mcp/tools/misc.ts +61 -0
- package/src/plugins/README.md +28 -0
- package/src/plugins/builtin/README.md +23 -0
- package/src/plugins/builtin/calculator.ts +178 -0
- package/src/plugins/builtin/colors.ts +201 -0
- package/src/plugins/builtin/cron.ts +649 -0
- package/src/plugins/builtin/crypto.ts +85 -0
- package/src/plugins/builtin/database.ts +235 -0
- package/src/plugins/builtin/docker.ts +426 -0
- package/src/plugins/builtin/fun.ts +118 -0
- package/src/plugins/builtin/gcal.ts +305 -0
- package/src/plugins/builtin/gdrive.ts +326 -0
- package/src/plugins/builtin/github-actions.ts +666 -0
- package/src/plugins/builtin/github.ts +912 -0
- package/src/plugins/builtin/gmail.ts +492 -0
- package/src/plugins/builtin/hash.ts +98 -0
- package/src/plugins/builtin/homekit.ts +389 -0
- package/src/plugins/builtin/index.ts +116 -0
- package/src/plugins/builtin/jira.ts +380 -0
- package/src/plugins/builtin/linear.ts +448 -0
- package/src/plugins/builtin/lumen.ts +497 -0
- package/src/plugins/builtin/memory.ts +200 -0
- package/src/plugins/builtin/n8n.ts +565 -0
- package/src/plugins/builtin/network.ts +92 -0
- package/src/plugins/builtin/notes.ts +689 -0
- package/src/plugins/builtin/notion.ts +348 -0
- package/src/plugins/builtin/shell.ts +334 -0
- package/src/plugins/builtin/slack.ts +327 -0
- package/src/plugins/builtin/spotify.ts +665 -0
- package/src/plugins/builtin/stripe.ts +388 -0
- package/src/plugins/builtin/system.ts +93 -0
- package/src/plugins/builtin/text-tools.ts +150 -0
- package/src/plugins/builtin/timezone.ts +173 -0
- package/src/plugins/builtin/todoist.ts +625 -0
- package/src/plugins/builtin/translate.ts +47 -0
- package/src/plugins/builtin/url-tools.ts +73 -0
- package/src/plugins/builtin/vercel.ts +546 -0
- package/src/plugins/builtin/weather.ts +112 -0
- package/src/plugins/builtin/x.ts +440 -0
- package/src/plugins/manager.ts +213 -0
- package/src/plugins/validation.ts +94 -0
- package/src/security/README.md +12 -0
- package/src/security/auth.ts +72 -0
- package/src/security/keychain.ts +226 -0
- package/src/utils/README.md +12 -0
- package/src/utils/google-auth.ts +159 -0
- package/src/utils/retry.ts +41 -0
- package/test-all.mjs +1256 -0
- package/test.mjs +633 -0
- package/tests/README.md +19 -0
- package/tests/calculator.test.ts +54 -0
- package/tests/docker.test.ts +42 -0
- package/tests/load.test.ts +129 -0
- package/tests/mcp.test.ts +14 -0
- package/tests/shell.test.ts +42 -0
- package/tsconfig.json +21 -0
- package/vitest.config.ts +14 -0
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Actions Plugin — TheAlxLabs / Conductor
|
|
3
|
+
*
|
|
4
|
+
* Full GitHub CI/CD and project management:
|
|
5
|
+
* - Workflow runs: trigger, monitor, cancel, get logs
|
|
6
|
+
* - Pull requests: list, create, review, merge
|
|
7
|
+
* - Issues: create, update, comment, assign, label
|
|
8
|
+
* - Releases: list, create, publish
|
|
9
|
+
* - Notifications: check what needs attention
|
|
10
|
+
* - Code search across your repos
|
|
11
|
+
*
|
|
12
|
+
* Extends the existing github plugin (which handles public data).
|
|
13
|
+
* This plugin focuses on authenticated, write, and Actions operations.
|
|
14
|
+
*
|
|
15
|
+
* Setup:
|
|
16
|
+
* 1. https://github.com/settings/tokens → Fine-grained or classic PAT
|
|
17
|
+
* 2. Scopes needed: repo, workflow, read:user, notifications
|
|
18
|
+
* 3. Run: conductor plugins config github_actions token <YOUR_TOKEN>
|
|
19
|
+
*
|
|
20
|
+
* Keychain: github / token
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { Plugin, PluginTool } from '../manager.js';
|
|
24
|
+
import { Conductor } from '../../core/conductor.js';
|
|
25
|
+
import { Keychain } from '../../security/keychain.js';
|
|
26
|
+
|
|
27
|
+
const GH_BASE = 'https://api.github.com';
|
|
28
|
+
const GH_ACCEPT = 'application/vnd.github+json';
|
|
29
|
+
const GH_API_VERSION = '2022-11-28';
|
|
30
|
+
|
|
31
|
+
export class GitHubActionsPlugin implements Plugin {
|
|
32
|
+
name = 'github_actions';
|
|
33
|
+
description = 'GitHub CI/CD, PRs, issues, releases, notifications — full write access, requires PAT';
|
|
34
|
+
version = '1.0.0';
|
|
35
|
+
|
|
36
|
+
private keychain!: Keychain;
|
|
37
|
+
|
|
38
|
+
async initialize(conductor: Conductor): Promise<void> {
|
|
39
|
+
this.keychain = new Keychain(conductor.getConfig().getConfigDir());
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
isConfigured(): boolean {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private async getToken(): Promise<string> {
|
|
47
|
+
const token = await this.keychain.get('github', 'token');
|
|
48
|
+
if (!token) {
|
|
49
|
+
throw new Error(
|
|
50
|
+
'GitHub token not configured.\n' +
|
|
51
|
+
'Create a PAT at https://github.com/settings/tokens\n' +
|
|
52
|
+
'Then run: conductor plugins config github_actions token <TOKEN>',
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return token;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private async ghFetch(
|
|
59
|
+
path: string,
|
|
60
|
+
options: { method?: string; body?: any; params?: Record<string, string> } = {},
|
|
61
|
+
): Promise<any> {
|
|
62
|
+
const token = await this.getToken();
|
|
63
|
+
const url = new URL(`${GH_BASE}${path}`);
|
|
64
|
+
if (options.params) {
|
|
65
|
+
for (const [k, v] of Object.entries(options.params)) url.searchParams.set(k, v);
|
|
66
|
+
}
|
|
67
|
+
const res = await fetch(url.toString(), {
|
|
68
|
+
method: options.method ?? 'GET',
|
|
69
|
+
headers: {
|
|
70
|
+
Authorization: `Bearer ${token}`,
|
|
71
|
+
Accept: GH_ACCEPT,
|
|
72
|
+
'X-GitHub-Api-Version': GH_API_VERSION,
|
|
73
|
+
'Content-Type': 'application/json',
|
|
74
|
+
},
|
|
75
|
+
body: options.body ? JSON.stringify(options.body) : undefined,
|
|
76
|
+
});
|
|
77
|
+
if (res.status === 204) return {};
|
|
78
|
+
if (!res.ok) {
|
|
79
|
+
const err = (await res.json().catch(() => ({ message: res.statusText }))) as any;
|
|
80
|
+
throw new Error(`GitHub API ${res.status}: ${err.message ?? res.statusText}`);
|
|
81
|
+
}
|
|
82
|
+
return res.json();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ── Formatters ──────────────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
private formatRun(r: any) {
|
|
88
|
+
return {
|
|
89
|
+
id: r.id,
|
|
90
|
+
name: r.name,
|
|
91
|
+
workflow: r.workflow_id,
|
|
92
|
+
status: r.status,
|
|
93
|
+
conclusion: r.conclusion ?? 'pending',
|
|
94
|
+
branch: r.head_branch,
|
|
95
|
+
commit: r.head_sha?.slice(0, 8),
|
|
96
|
+
triggeredBy: r.triggering_actor?.login ?? r.actor?.login ?? '',
|
|
97
|
+
event: r.event,
|
|
98
|
+
createdAt: r.created_at,
|
|
99
|
+
updatedAt: r.updated_at,
|
|
100
|
+
duration:
|
|
101
|
+
r.updated_at && r.created_at
|
|
102
|
+
? `${Math.round((new Date(r.updated_at).getTime() - new Date(r.created_at).getTime()) / 1000)}s`
|
|
103
|
+
: null,
|
|
104
|
+
url: r.html_url,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private formatPR(pr: any) {
|
|
109
|
+
return {
|
|
110
|
+
number: pr.number,
|
|
111
|
+
title: pr.title,
|
|
112
|
+
state: pr.state,
|
|
113
|
+
draft: pr.draft ?? false,
|
|
114
|
+
author: pr.user?.login ?? '',
|
|
115
|
+
base: pr.base?.ref ?? '',
|
|
116
|
+
head: pr.head?.ref ?? '',
|
|
117
|
+
additions: pr.additions ?? 0,
|
|
118
|
+
deletions: pr.deletions ?? 0,
|
|
119
|
+
changedFiles: pr.changed_files ?? 0,
|
|
120
|
+
mergeable: pr.mergeable,
|
|
121
|
+
labels: (pr.labels ?? []).map((l: any) => l.name),
|
|
122
|
+
reviewers: (pr.requested_reviewers ?? []).map((r: any) => r.login),
|
|
123
|
+
createdAt: pr.created_at,
|
|
124
|
+
updatedAt: pr.updated_at,
|
|
125
|
+
url: pr.html_url,
|
|
126
|
+
body: pr.body?.slice(0, 500) ?? '',
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
private formatIssue(i: any) {
|
|
131
|
+
return {
|
|
132
|
+
number: i.number,
|
|
133
|
+
title: i.title,
|
|
134
|
+
state: i.state,
|
|
135
|
+
author: i.user?.login ?? '',
|
|
136
|
+
assignees: (i.assignees ?? []).map((a: any) => a.login),
|
|
137
|
+
labels: (i.labels ?? []).map((l: any) => l.name),
|
|
138
|
+
comments: i.comments ?? 0,
|
|
139
|
+
createdAt: i.created_at,
|
|
140
|
+
updatedAt: i.updated_at,
|
|
141
|
+
url: i.html_url,
|
|
142
|
+
body: i.body?.slice(0, 500) ?? '',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// ── Tools ───────────────────────────────────────────────────────────────────
|
|
147
|
+
|
|
148
|
+
getTools(): PluginTool[] {
|
|
149
|
+
return [
|
|
150
|
+
// ── gh_my_repos ────────────────────────────────────────────────────────
|
|
151
|
+
{
|
|
152
|
+
name: 'gh_my_repos',
|
|
153
|
+
description: "List the authenticated user's own repositories",
|
|
154
|
+
inputSchema: {
|
|
155
|
+
type: 'object',
|
|
156
|
+
properties: {
|
|
157
|
+
sort: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
enum: ['updated', 'created', 'pushed', 'full_name'],
|
|
160
|
+
description: 'Sort order (default: pushed)',
|
|
161
|
+
},
|
|
162
|
+
limit: { type: 'number', description: 'Max repos (default: 30)' },
|
|
163
|
+
visibility: {
|
|
164
|
+
type: 'string',
|
|
165
|
+
enum: ['all', 'public', 'private'],
|
|
166
|
+
description: 'Filter by visibility (default: all)',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
handler: async ({ sort = 'pushed', limit = 30, visibility = 'all' }: any) => {
|
|
171
|
+
const data = await this.ghFetch('/user/repos', {
|
|
172
|
+
params: {
|
|
173
|
+
sort,
|
|
174
|
+
per_page: String(Math.min(limit, 100)),
|
|
175
|
+
visibility,
|
|
176
|
+
affiliation: 'owner',
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
return {
|
|
180
|
+
count: data.length,
|
|
181
|
+
repos: data.map((r: any) => ({
|
|
182
|
+
name: r.name,
|
|
183
|
+
fullName: r.full_name,
|
|
184
|
+
description: r.description ?? '',
|
|
185
|
+
language: r.language ?? '',
|
|
186
|
+
private: r.private,
|
|
187
|
+
stars: r.stargazers_count,
|
|
188
|
+
openIssues: r.open_issues_count,
|
|
189
|
+
defaultBranch: r.default_branch,
|
|
190
|
+
pushedAt: r.pushed_at,
|
|
191
|
+
url: r.html_url,
|
|
192
|
+
})),
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
// ── gh_workflow_runs ───────────────────────────────────────────────────
|
|
198
|
+
{
|
|
199
|
+
name: 'gh_workflow_runs',
|
|
200
|
+
description: 'List recent workflow runs for a repository',
|
|
201
|
+
inputSchema: {
|
|
202
|
+
type: 'object',
|
|
203
|
+
properties: {
|
|
204
|
+
owner: { type: 'string', description: 'Repo owner' },
|
|
205
|
+
repo: { type: 'string', description: 'Repo name' },
|
|
206
|
+
status: {
|
|
207
|
+
type: 'string',
|
|
208
|
+
enum: ['completed', 'in_progress', 'queued', 'failure', 'success'],
|
|
209
|
+
description: 'Filter by status',
|
|
210
|
+
},
|
|
211
|
+
branch: { type: 'string', description: 'Filter by branch name' },
|
|
212
|
+
limit: { type: 'number', description: 'Max runs (default: 10)' },
|
|
213
|
+
},
|
|
214
|
+
required: ['owner', 'repo'],
|
|
215
|
+
},
|
|
216
|
+
handler: async ({ owner, repo, status, branch, limit = 10 }: any) => {
|
|
217
|
+
const params: Record<string, string> = { per_page: String(Math.min(limit, 100)) };
|
|
218
|
+
if (status) params.status = status;
|
|
219
|
+
if (branch) params.branch = branch;
|
|
220
|
+
const data = await this.ghFetch(`/repos/${owner}/${repo}/actions/runs`, { params });
|
|
221
|
+
return {
|
|
222
|
+
totalCount: data.total_count ?? 0,
|
|
223
|
+
runs: (data.workflow_runs ?? []).map(this.formatRun.bind(this)),
|
|
224
|
+
};
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
// ── gh_run_status ──────────────────────────────────────────────────────
|
|
229
|
+
{
|
|
230
|
+
name: 'gh_run_status',
|
|
231
|
+
description: 'Get the status and jobs of a specific workflow run',
|
|
232
|
+
inputSchema: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {
|
|
235
|
+
owner: { type: 'string' },
|
|
236
|
+
repo: { type: 'string' },
|
|
237
|
+
runId: { type: 'number', description: 'Workflow run ID' },
|
|
238
|
+
},
|
|
239
|
+
required: ['owner', 'repo', 'runId'],
|
|
240
|
+
},
|
|
241
|
+
handler: async ({ owner, repo, runId }: any) => {
|
|
242
|
+
const [run, jobs] = await Promise.all([
|
|
243
|
+
this.ghFetch(`/repos/${owner}/${repo}/actions/runs/${runId}`),
|
|
244
|
+
this.ghFetch(`/repos/${owner}/${repo}/actions/runs/${runId}/jobs`),
|
|
245
|
+
]);
|
|
246
|
+
return {
|
|
247
|
+
...this.formatRun(run),
|
|
248
|
+
jobs: (jobs.jobs ?? []).map((j: any) => ({
|
|
249
|
+
id: j.id,
|
|
250
|
+
name: j.name,
|
|
251
|
+
status: j.status,
|
|
252
|
+
conclusion: j.conclusion ?? 'pending',
|
|
253
|
+
startedAt: j.started_at,
|
|
254
|
+
completedAt: j.completed_at,
|
|
255
|
+
steps: (j.steps ?? []).map((s: any) => ({
|
|
256
|
+
name: s.name,
|
|
257
|
+
status: s.status,
|
|
258
|
+
conclusion: s.conclusion,
|
|
259
|
+
number: s.number,
|
|
260
|
+
})),
|
|
261
|
+
})),
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
// ── gh_trigger_workflow ────────────────────────────────────────────────
|
|
267
|
+
{
|
|
268
|
+
name: 'gh_trigger_workflow',
|
|
269
|
+
description: 'Manually trigger a GitHub Actions workflow (workflow_dispatch)',
|
|
270
|
+
inputSchema: {
|
|
271
|
+
type: 'object',
|
|
272
|
+
properties: {
|
|
273
|
+
owner: { type: 'string' },
|
|
274
|
+
repo: { type: 'string' },
|
|
275
|
+
workflow: {
|
|
276
|
+
type: 'string',
|
|
277
|
+
description: 'Workflow file name (e.g. "deploy.yml") or ID',
|
|
278
|
+
},
|
|
279
|
+
ref: { type: 'string', description: 'Branch or tag to run on (default: main)' },
|
|
280
|
+
inputs: {
|
|
281
|
+
type: 'object',
|
|
282
|
+
description: 'Workflow input parameters (key-value pairs)',
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
required: ['owner', 'repo', 'workflow'],
|
|
286
|
+
},
|
|
287
|
+
handler: async ({ owner, repo, workflow, ref = 'main', inputs = {} }: any) => {
|
|
288
|
+
await this.ghFetch(`/repos/${owner}/${repo}/actions/workflows/${encodeURIComponent(workflow)}/dispatches`, {
|
|
289
|
+
method: 'POST',
|
|
290
|
+
body: { ref, inputs },
|
|
291
|
+
});
|
|
292
|
+
// Give GitHub a moment then fetch the latest run
|
|
293
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
294
|
+
const runs = await this.ghFetch(`/repos/${owner}/${repo}/actions/runs`, {
|
|
295
|
+
params: { per_page: '1', event: 'workflow_dispatch' },
|
|
296
|
+
});
|
|
297
|
+
const latestRun = runs.workflow_runs?.[0];
|
|
298
|
+
return {
|
|
299
|
+
triggered: true,
|
|
300
|
+
run: latestRun ? this.formatRun(latestRun) : null,
|
|
301
|
+
};
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
// ── gh_cancel_run ──────────────────────────────────────────────────────
|
|
306
|
+
{
|
|
307
|
+
name: 'gh_cancel_run',
|
|
308
|
+
description: 'Cancel a running GitHub Actions workflow run',
|
|
309
|
+
requiresApproval: true,
|
|
310
|
+
inputSchema: {
|
|
311
|
+
type: 'object',
|
|
312
|
+
properties: {
|
|
313
|
+
owner: { type: 'string' },
|
|
314
|
+
repo: { type: 'string' },
|
|
315
|
+
runId: { type: 'number' },
|
|
316
|
+
},
|
|
317
|
+
required: ['owner', 'repo', 'runId'],
|
|
318
|
+
},
|
|
319
|
+
handler: async ({ owner, repo, runId }: any) => {
|
|
320
|
+
await this.ghFetch(`/repos/${owner}/${repo}/actions/runs/${runId}/cancel`, {
|
|
321
|
+
method: 'POST',
|
|
322
|
+
});
|
|
323
|
+
return { cancelled: true, runId };
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
// ── gh_list_prs ────────────────────────────────────────────────────────
|
|
328
|
+
{
|
|
329
|
+
name: 'gh_list_prs',
|
|
330
|
+
description: 'List pull requests for a repository',
|
|
331
|
+
inputSchema: {
|
|
332
|
+
type: 'object',
|
|
333
|
+
properties: {
|
|
334
|
+
owner: { type: 'string' },
|
|
335
|
+
repo: { type: 'string' },
|
|
336
|
+
state: {
|
|
337
|
+
type: 'string',
|
|
338
|
+
enum: ['open', 'closed', 'all'],
|
|
339
|
+
description: 'PR state filter (default: open)',
|
|
340
|
+
},
|
|
341
|
+
limit: { type: 'number', description: 'Max PRs (default: 20)' },
|
|
342
|
+
},
|
|
343
|
+
required: ['owner', 'repo'],
|
|
344
|
+
},
|
|
345
|
+
handler: async ({ owner, repo, state = 'open', limit = 20 }: any) => {
|
|
346
|
+
const data = await this.ghFetch(`/repos/${owner}/${repo}/pulls`, {
|
|
347
|
+
params: { state, per_page: String(Math.min(limit, 100)), sort: 'updated' },
|
|
348
|
+
});
|
|
349
|
+
return {
|
|
350
|
+
count: data.length,
|
|
351
|
+
prs: data.map(this.formatPR.bind(this)),
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
// ── gh_create_pr ───────────────────────────────────────────────────────
|
|
357
|
+
{
|
|
358
|
+
name: 'gh_create_pr',
|
|
359
|
+
description: 'Create a new pull request',
|
|
360
|
+
inputSchema: {
|
|
361
|
+
type: 'object',
|
|
362
|
+
properties: {
|
|
363
|
+
owner: { type: 'string' },
|
|
364
|
+
repo: { type: 'string' },
|
|
365
|
+
title: { type: 'string', description: 'PR title' },
|
|
366
|
+
body: { type: 'string', description: 'PR description' },
|
|
367
|
+
head: { type: 'string', description: 'Source branch (your feature branch)' },
|
|
368
|
+
base: { type: 'string', description: 'Target branch (default: main)' },
|
|
369
|
+
draft: { type: 'boolean', description: 'Create as draft PR (default: false)' },
|
|
370
|
+
},
|
|
371
|
+
required: ['owner', 'repo', 'title', 'head'],
|
|
372
|
+
},
|
|
373
|
+
handler: async ({ owner, repo, title, body = '', head, base = 'main', draft = false }: any) => {
|
|
374
|
+
const pr = await this.ghFetch(`/repos/${owner}/${repo}/pulls`, {
|
|
375
|
+
method: 'POST',
|
|
376
|
+
body: { title, body, head, base, draft },
|
|
377
|
+
});
|
|
378
|
+
return { created: true, ...this.formatPR(pr) };
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
// ── gh_merge_pr ────────────────────────────────────────────────────────
|
|
383
|
+
{
|
|
384
|
+
name: 'gh_merge_pr',
|
|
385
|
+
description: 'Merge a pull request',
|
|
386
|
+
requiresApproval: true,
|
|
387
|
+
inputSchema: {
|
|
388
|
+
type: 'object',
|
|
389
|
+
properties: {
|
|
390
|
+
owner: { type: 'string' },
|
|
391
|
+
repo: { type: 'string' },
|
|
392
|
+
prNumber: { type: 'number', description: 'PR number' },
|
|
393
|
+
method: {
|
|
394
|
+
type: 'string',
|
|
395
|
+
enum: ['merge', 'squash', 'rebase'],
|
|
396
|
+
description: 'Merge strategy (default: merge)',
|
|
397
|
+
},
|
|
398
|
+
commitTitle: { type: 'string', description: 'Custom commit title' },
|
|
399
|
+
},
|
|
400
|
+
required: ['owner', 'repo', 'prNumber'],
|
|
401
|
+
},
|
|
402
|
+
handler: async ({ owner, repo, prNumber, method = 'merge', commitTitle }: any) => {
|
|
403
|
+
const body: any = { merge_method: method };
|
|
404
|
+
if (commitTitle) body.commit_title = commitTitle;
|
|
405
|
+
const res = await this.ghFetch(`/repos/${owner}/${repo}/pulls/${prNumber}/merge`, {
|
|
406
|
+
method: 'PUT',
|
|
407
|
+
body,
|
|
408
|
+
});
|
|
409
|
+
return { merged: true, sha: res.sha, message: res.message };
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
|
|
413
|
+
// ── gh_list_issues ─────────────────────────────────────────────────────
|
|
414
|
+
{
|
|
415
|
+
name: 'gh_list_issues',
|
|
416
|
+
description: 'List issues for a repository',
|
|
417
|
+
inputSchema: {
|
|
418
|
+
type: 'object',
|
|
419
|
+
properties: {
|
|
420
|
+
owner: { type: 'string' },
|
|
421
|
+
repo: { type: 'string' },
|
|
422
|
+
state: {
|
|
423
|
+
type: 'string',
|
|
424
|
+
enum: ['open', 'closed', 'all'],
|
|
425
|
+
description: 'Issue state (default: open)',
|
|
426
|
+
},
|
|
427
|
+
labels: { type: 'string', description: 'Comma-separated label filter' },
|
|
428
|
+
assignee: { type: 'string', description: 'Filter by assignee username' },
|
|
429
|
+
limit: { type: 'number', description: 'Max issues (default: 20)' },
|
|
430
|
+
},
|
|
431
|
+
required: ['owner', 'repo'],
|
|
432
|
+
},
|
|
433
|
+
handler: async ({ owner, repo, state = 'open', labels, assignee, limit = 20 }: any) => {
|
|
434
|
+
const params: Record<string, string> = {
|
|
435
|
+
state,
|
|
436
|
+
per_page: String(Math.min(limit, 100)),
|
|
437
|
+
sort: 'updated',
|
|
438
|
+
};
|
|
439
|
+
if (labels) params.labels = labels;
|
|
440
|
+
if (assignee) params.assignee = assignee;
|
|
441
|
+
const data = await this.ghFetch(`/repos/${owner}/${repo}/issues`, { params });
|
|
442
|
+
// Filter out pull requests (they appear in issues endpoint too)
|
|
443
|
+
const issues = data.filter((i: any) => !i.pull_request);
|
|
444
|
+
return {
|
|
445
|
+
count: issues.length,
|
|
446
|
+
issues: issues.map(this.formatIssue.bind(this)),
|
|
447
|
+
};
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
|
|
451
|
+
// ── gh_create_issue ────────────────────────────────────────────────────
|
|
452
|
+
{
|
|
453
|
+
name: 'gh_create_issue',
|
|
454
|
+
description: 'Create a new GitHub issue',
|
|
455
|
+
inputSchema: {
|
|
456
|
+
type: 'object',
|
|
457
|
+
properties: {
|
|
458
|
+
owner: { type: 'string' },
|
|
459
|
+
repo: { type: 'string' },
|
|
460
|
+
title: { type: 'string', description: 'Issue title' },
|
|
461
|
+
body: { type: 'string', description: 'Issue body (markdown)' },
|
|
462
|
+
labels: {
|
|
463
|
+
type: 'array',
|
|
464
|
+
items: { type: 'string' },
|
|
465
|
+
description: 'Label names to apply',
|
|
466
|
+
},
|
|
467
|
+
assignees: {
|
|
468
|
+
type: 'array',
|
|
469
|
+
items: { type: 'string' },
|
|
470
|
+
description: 'GitHub usernames to assign',
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
required: ['owner', 'repo', 'title'],
|
|
474
|
+
},
|
|
475
|
+
handler: async ({ owner, repo, title, body = '', labels = [], assignees = [] }: any) => {
|
|
476
|
+
const issue = await this.ghFetch(`/repos/${owner}/${repo}/issues`, {
|
|
477
|
+
method: 'POST',
|
|
478
|
+
body: { title, body, labels, assignees },
|
|
479
|
+
});
|
|
480
|
+
return { created: true, ...this.formatIssue(issue) };
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
// ── gh_comment ─────────────────────────────────────────────────────────
|
|
485
|
+
{
|
|
486
|
+
name: 'gh_comment',
|
|
487
|
+
description: 'Add a comment to a GitHub issue or pull request',
|
|
488
|
+
inputSchema: {
|
|
489
|
+
type: 'object',
|
|
490
|
+
properties: {
|
|
491
|
+
owner: { type: 'string' },
|
|
492
|
+
repo: { type: 'string' },
|
|
493
|
+
number: { type: 'number', description: 'Issue or PR number' },
|
|
494
|
+
body: { type: 'string', description: 'Comment text (markdown)' },
|
|
495
|
+
},
|
|
496
|
+
required: ['owner', 'repo', 'number', 'body'],
|
|
497
|
+
},
|
|
498
|
+
handler: async ({ owner, repo, number, body }: any) => {
|
|
499
|
+
const comment = await this.ghFetch(`/repos/${owner}/${repo}/issues/${number}/comments`, {
|
|
500
|
+
method: 'POST',
|
|
501
|
+
body: { body },
|
|
502
|
+
});
|
|
503
|
+
return {
|
|
504
|
+
created: true,
|
|
505
|
+
id: comment.id,
|
|
506
|
+
url: comment.html_url,
|
|
507
|
+
};
|
|
508
|
+
},
|
|
509
|
+
},
|
|
510
|
+
|
|
511
|
+
// ── gh_releases ────────────────────────────────────────────────────────
|
|
512
|
+
{
|
|
513
|
+
name: 'gh_releases',
|
|
514
|
+
description: 'List releases for a repository',
|
|
515
|
+
inputSchema: {
|
|
516
|
+
type: 'object',
|
|
517
|
+
properties: {
|
|
518
|
+
owner: { type: 'string' },
|
|
519
|
+
repo: { type: 'string' },
|
|
520
|
+
limit: { type: 'number', description: 'Max releases (default: 10)' },
|
|
521
|
+
},
|
|
522
|
+
required: ['owner', 'repo'],
|
|
523
|
+
},
|
|
524
|
+
handler: async ({ owner, repo, limit = 10 }: any) => {
|
|
525
|
+
const data = await this.ghFetch(`/repos/${owner}/${repo}/releases`, {
|
|
526
|
+
params: { per_page: String(Math.min(limit, 100)) },
|
|
527
|
+
});
|
|
528
|
+
return {
|
|
529
|
+
count: data.length,
|
|
530
|
+
releases: data.map((r: any) => ({
|
|
531
|
+
id: r.id,
|
|
532
|
+
tag: r.tag_name,
|
|
533
|
+
name: r.name ?? r.tag_name,
|
|
534
|
+
draft: r.draft,
|
|
535
|
+
prerelease: r.prerelease,
|
|
536
|
+
author: r.author?.login ?? '',
|
|
537
|
+
publishedAt: r.published_at,
|
|
538
|
+
body: r.body?.slice(0, 500) ?? '',
|
|
539
|
+
assets: (r.assets ?? []).map((a: any) => ({
|
|
540
|
+
name: a.name,
|
|
541
|
+
size: a.size,
|
|
542
|
+
downloads: a.download_count,
|
|
543
|
+
})),
|
|
544
|
+
url: r.html_url,
|
|
545
|
+
})),
|
|
546
|
+
};
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
|
|
550
|
+
// ── gh_create_release ──────────────────────────────────────────────────
|
|
551
|
+
{
|
|
552
|
+
name: 'gh_create_release',
|
|
553
|
+
description: 'Create a new GitHub release',
|
|
554
|
+
requiresApproval: true,
|
|
555
|
+
inputSchema: {
|
|
556
|
+
type: 'object',
|
|
557
|
+
properties: {
|
|
558
|
+
owner: { type: 'string' },
|
|
559
|
+
repo: { type: 'string' },
|
|
560
|
+
tag: { type: 'string', description: 'Tag name (e.g. v1.2.3)' },
|
|
561
|
+
name: { type: 'string', description: 'Release title' },
|
|
562
|
+
body: { type: 'string', description: 'Release notes (markdown)' },
|
|
563
|
+
draft: { type: 'boolean', description: 'Create as draft (default: false)' },
|
|
564
|
+
prerelease: { type: 'boolean', description: 'Mark as pre-release (default: false)' },
|
|
565
|
+
generateNotes: {
|
|
566
|
+
type: 'boolean',
|
|
567
|
+
description: 'Auto-generate release notes from PRs/commits (default: false)',
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
required: ['owner', 'repo', 'tag'],
|
|
571
|
+
},
|
|
572
|
+
handler: async ({
|
|
573
|
+
owner,
|
|
574
|
+
repo,
|
|
575
|
+
tag,
|
|
576
|
+
name,
|
|
577
|
+
body = '',
|
|
578
|
+
draft = false,
|
|
579
|
+
prerelease = false,
|
|
580
|
+
generateNotes = false,
|
|
581
|
+
}: any) => {
|
|
582
|
+
const release = await this.ghFetch(`/repos/${owner}/${repo}/releases`, {
|
|
583
|
+
method: 'POST',
|
|
584
|
+
body: {
|
|
585
|
+
tag_name: tag,
|
|
586
|
+
name: name ?? tag,
|
|
587
|
+
body,
|
|
588
|
+
draft,
|
|
589
|
+
prerelease,
|
|
590
|
+
generate_release_notes: generateNotes,
|
|
591
|
+
},
|
|
592
|
+
});
|
|
593
|
+
return {
|
|
594
|
+
created: true,
|
|
595
|
+
id: release.id,
|
|
596
|
+
tag: release.tag_name,
|
|
597
|
+
name: release.name,
|
|
598
|
+
url: release.html_url,
|
|
599
|
+
draft: release.draft,
|
|
600
|
+
};
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
|
|
604
|
+
// ── gh_notifications ───────────────────────────────────────────────────
|
|
605
|
+
{
|
|
606
|
+
name: 'gh_notifications',
|
|
607
|
+
description: 'Get unread GitHub notifications (mentions, CI failures, reviews needed)',
|
|
608
|
+
inputSchema: {
|
|
609
|
+
type: 'object',
|
|
610
|
+
properties: {
|
|
611
|
+
limit: { type: 'number', description: 'Max notifications (default: 20)' },
|
|
612
|
+
all: { type: 'boolean', description: 'Include read notifications (default: false)' },
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
handler: async ({ limit = 20, all = false }: any) => {
|
|
616
|
+
const data = await this.ghFetch('/notifications', {
|
|
617
|
+
params: {
|
|
618
|
+
all: String(all),
|
|
619
|
+
per_page: String(Math.min(limit, 50)),
|
|
620
|
+
},
|
|
621
|
+
});
|
|
622
|
+
return {
|
|
623
|
+
count: data.length,
|
|
624
|
+
notifications: data.map((n: any) => ({
|
|
625
|
+
id: n.id,
|
|
626
|
+
unread: n.unread,
|
|
627
|
+
reason: n.reason,
|
|
628
|
+
type: n.subject?.type ?? '',
|
|
629
|
+
title: n.subject?.title ?? '',
|
|
630
|
+
repo: n.repository?.full_name ?? '',
|
|
631
|
+
updatedAt: n.updated_at,
|
|
632
|
+
})),
|
|
633
|
+
};
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
|
|
637
|
+
// ── gh_code_search ─────────────────────────────────────────────────────
|
|
638
|
+
{
|
|
639
|
+
name: 'gh_code_search',
|
|
640
|
+
description: 'Search code across GitHub repositories',
|
|
641
|
+
inputSchema: {
|
|
642
|
+
type: 'object',
|
|
643
|
+
properties: {
|
|
644
|
+
query: { type: 'string', description: 'Search query (supports repo:, lang:, path: operators)' },
|
|
645
|
+
limit: { type: 'number', description: 'Max results (default: 10)' },
|
|
646
|
+
},
|
|
647
|
+
required: ['query'],
|
|
648
|
+
},
|
|
649
|
+
handler: async ({ query, limit = 10 }: any) => {
|
|
650
|
+
const data = await this.ghFetch('/search/code', {
|
|
651
|
+
params: { q: query, per_page: String(Math.min(limit, 30)) },
|
|
652
|
+
});
|
|
653
|
+
return {
|
|
654
|
+
totalCount: data.total_count ?? 0,
|
|
655
|
+
results: (data.items ?? []).map((i: any) => ({
|
|
656
|
+
repo: i.repository?.full_name ?? '',
|
|
657
|
+
path: i.path,
|
|
658
|
+
name: i.name,
|
|
659
|
+
url: i.html_url,
|
|
660
|
+
})),
|
|
661
|
+
};
|
|
662
|
+
},
|
|
663
|
+
},
|
|
664
|
+
];
|
|
665
|
+
}
|
|
666
|
+
}
|