@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,112 @@
|
|
|
1
|
+
import { Plugin, PluginTool } from '../manager.js';
|
|
2
|
+
import { Conductor } from '../../core/conductor.js';
|
|
3
|
+
|
|
4
|
+
export class WeatherPlugin implements Plugin {
|
|
5
|
+
name = 'weather';
|
|
6
|
+
description = 'Current weather and forecasts (powered by Open-Meteo, no API key needed)';
|
|
7
|
+
version = '1.0.0';
|
|
8
|
+
|
|
9
|
+
async initialize(_conductor: Conductor): Promise<void> {}
|
|
10
|
+
isConfigured(): boolean {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
private async geocode(city: string): Promise<{ lat: number; lon: number; name: string; country: string }> {
|
|
15
|
+
const res = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(city)}&count=1`);
|
|
16
|
+
const data = (await res.json()) as any;
|
|
17
|
+
if (!data.results?.length) throw new Error(`City not found: ${city}`);
|
|
18
|
+
const r = data.results[0];
|
|
19
|
+
return { lat: r.latitude, lon: r.longitude, name: r.name, country: r.country };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private wmoCode(code: number): string {
|
|
23
|
+
const codes: Record<number, string> = {
|
|
24
|
+
0: 'Clear sky',
|
|
25
|
+
1: 'Mainly clear',
|
|
26
|
+
2: 'Partly cloudy',
|
|
27
|
+
3: 'Overcast',
|
|
28
|
+
45: 'Fog',
|
|
29
|
+
48: 'Rime fog',
|
|
30
|
+
51: 'Light drizzle',
|
|
31
|
+
53: 'Moderate drizzle',
|
|
32
|
+
55: 'Dense drizzle',
|
|
33
|
+
61: 'Slight rain',
|
|
34
|
+
63: 'Moderate rain',
|
|
35
|
+
65: 'Heavy rain',
|
|
36
|
+
71: 'Slight snow',
|
|
37
|
+
73: 'Moderate snow',
|
|
38
|
+
75: 'Heavy snow',
|
|
39
|
+
77: 'Snow grains',
|
|
40
|
+
80: 'Slight showers',
|
|
41
|
+
81: 'Moderate showers',
|
|
42
|
+
82: 'Violent showers',
|
|
43
|
+
85: 'Slight snow showers',
|
|
44
|
+
86: 'Heavy snow showers',
|
|
45
|
+
95: 'Thunderstorm',
|
|
46
|
+
96: 'Thunderstorm w/ slight hail',
|
|
47
|
+
99: 'Thunderstorm w/ heavy hail',
|
|
48
|
+
};
|
|
49
|
+
return codes[code] || `Unknown (${code})`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getTools(): PluginTool[] {
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
name: 'weather_current',
|
|
56
|
+
description: 'Get current weather for a city',
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
city: { type: 'string', description: 'City name (e.g. "Toronto", "London")' },
|
|
61
|
+
},
|
|
62
|
+
required: ['city'],
|
|
63
|
+
},
|
|
64
|
+
handler: async (input: { city: string }) => {
|
|
65
|
+
const geo = await this.geocode(input.city);
|
|
66
|
+
const res = await fetch(
|
|
67
|
+
`https://api.open-meteo.com/v1/forecast?latitude=${geo.lat}&longitude=${geo.lon}¤t=temperature_2m,relative_humidity_2m,apparent_temperature,weather_code,wind_speed_10m,wind_direction_10m&temperature_unit=celsius`,
|
|
68
|
+
);
|
|
69
|
+
const data = (await res.json()) as any;
|
|
70
|
+
const c = data.current;
|
|
71
|
+
return {
|
|
72
|
+
location: `${geo.name}, ${geo.country}`,
|
|
73
|
+
temperature: `${c.temperature_2m}°C`,
|
|
74
|
+
feels_like: `${c.apparent_temperature}°C`,
|
|
75
|
+
humidity: `${c.relative_humidity_2m}%`,
|
|
76
|
+
wind: `${c.wind_speed_10m} km/h`,
|
|
77
|
+
condition: this.wmoCode(c.weather_code),
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'weather_forecast',
|
|
83
|
+
description: 'Get 7-day weather forecast for a city',
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
city: { type: 'string', description: 'City name' },
|
|
88
|
+
},
|
|
89
|
+
required: ['city'],
|
|
90
|
+
},
|
|
91
|
+
handler: async (input: { city: string }) => {
|
|
92
|
+
const geo = await this.geocode(input.city);
|
|
93
|
+
const res = await fetch(
|
|
94
|
+
`https://api.open-meteo.com/v1/forecast?latitude=${geo.lat}&longitude=${geo.lon}&daily=temperature_2m_max,temperature_2m_min,weather_code,precipitation_sum&temperature_unit=celsius&forecast_days=7`,
|
|
95
|
+
);
|
|
96
|
+
const data = (await res.json()) as any;
|
|
97
|
+
const d = data.daily;
|
|
98
|
+
return {
|
|
99
|
+
location: `${geo.name}, ${geo.country}`,
|
|
100
|
+
forecast: d.time.map((date: string, i: number) => ({
|
|
101
|
+
date,
|
|
102
|
+
high: `${d.temperature_2m_max[i]}°C`,
|
|
103
|
+
low: `${d.temperature_2m_min[i]}°C`,
|
|
104
|
+
condition: this.wmoCode(d.weather_code[i]),
|
|
105
|
+
precipitation: `${d.precipitation_sum[i]} mm`,
|
|
106
|
+
})),
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* X (Twitter) Plugin
|
|
3
|
+
*
|
|
4
|
+
* Post tweets, search X, get user info, manage timeline.
|
|
5
|
+
* Uses X API v2 with a Bearer Token (read) and OAuth 1.0a (write).
|
|
6
|
+
*
|
|
7
|
+
* Setup:
|
|
8
|
+
* For read-only (search, timeline, user lookup):
|
|
9
|
+
* 1. Go to https://developer.x.com and create a project + app
|
|
10
|
+
* 2. Copy the Bearer Token
|
|
11
|
+
* 3. Run: conductor plugins config x bearer_token <YOUR_TOKEN>
|
|
12
|
+
*
|
|
13
|
+
* For posting (tweets, likes, follows):
|
|
14
|
+
* Also needed: API Key, API Secret, Access Token, Access Token Secret
|
|
15
|
+
* These use OAuth 1.0a for user-level write access.
|
|
16
|
+
* Run: conductor plugins config x api_key <KEY>
|
|
17
|
+
* conductor plugins config x api_secret <SECRET>
|
|
18
|
+
* conductor plugins config x access_token <TOKEN>
|
|
19
|
+
* conductor plugins config x access_secret <SECRET>
|
|
20
|
+
*
|
|
21
|
+
* Stored in keychain as: x / bearer_token, x / api_key, etc.
|
|
22
|
+
*
|
|
23
|
+
* Note: X API free tier allows ~500k tweet reads/month and posting.
|
|
24
|
+
* Basic plan ($100/mo) removes most limits.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import crypto from 'crypto';
|
|
28
|
+
import { Plugin, PluginTool } from '../manager.js';
|
|
29
|
+
import { Conductor } from '../../core/conductor.js';
|
|
30
|
+
import { Keychain } from '../../security/keychain.js';
|
|
31
|
+
import { withRetry } from '../../core/retry.js';
|
|
32
|
+
|
|
33
|
+
const X_BASE = 'https://api.twitter.com/2';
|
|
34
|
+
|
|
35
|
+
export class XPlugin implements Plugin {
|
|
36
|
+
name = 'x';
|
|
37
|
+
description = 'Post tweets, search X, get timelines and user info — requires X API credentials';
|
|
38
|
+
version = '1.0.0';
|
|
39
|
+
|
|
40
|
+
configSchema = {
|
|
41
|
+
fields: [
|
|
42
|
+
{
|
|
43
|
+
key: 'bearer_token',
|
|
44
|
+
label: 'X Bearer Token',
|
|
45
|
+
type: 'password' as const,
|
|
46
|
+
required: true,
|
|
47
|
+
secret: true,
|
|
48
|
+
service: 'x',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: 'api_key',
|
|
52
|
+
label: 'X API Key (Consumer)',
|
|
53
|
+
type: 'password' as const,
|
|
54
|
+
required: true,
|
|
55
|
+
secret: true,
|
|
56
|
+
service: 'x',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'api_secret',
|
|
60
|
+
label: 'X API Secret (Consumer)',
|
|
61
|
+
type: 'password' as const,
|
|
62
|
+
required: true,
|
|
63
|
+
secret: true,
|
|
64
|
+
service: 'x',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'access_token',
|
|
68
|
+
label: 'X Access Token',
|
|
69
|
+
type: 'password' as const,
|
|
70
|
+
required: true,
|
|
71
|
+
secret: true,
|
|
72
|
+
service: 'x',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: 'access_secret',
|
|
76
|
+
label: 'X Access Secret',
|
|
77
|
+
type: 'password' as const,
|
|
78
|
+
required: true,
|
|
79
|
+
secret: true,
|
|
80
|
+
service: 'x',
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
setupInstructions:
|
|
84
|
+
'Create a Project and App in developer.x.com. Enable "User authentication settings" with OAuth 1.0a permissions for write access.',
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
private keychain!: Keychain;
|
|
88
|
+
|
|
89
|
+
async initialize(conductor: Conductor): Promise<void> {
|
|
90
|
+
this.keychain = new Keychain(conductor.getConfig().getConfigDir());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
isConfigured(): boolean {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
private async getBearerToken(): Promise<string> {
|
|
98
|
+
const token = await this.keychain.get('x', 'bearer_token');
|
|
99
|
+
if (!token) {
|
|
100
|
+
throw new Error(
|
|
101
|
+
'X Bearer Token not configured.\n' +
|
|
102
|
+
'Get one at https://developer.x.com and run:\n' +
|
|
103
|
+
' conductor plugins config x bearer_token <YOUR_TOKEN>',
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return token;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private async getOAuthCreds(): Promise<{
|
|
110
|
+
apiKey: string;
|
|
111
|
+
apiSecret: string;
|
|
112
|
+
accessToken: string;
|
|
113
|
+
accessSecret: string;
|
|
114
|
+
}> {
|
|
115
|
+
const [apiKey, apiSecret, accessToken, accessSecret] = await Promise.all([
|
|
116
|
+
this.keychain.get('x', 'api_key'),
|
|
117
|
+
this.keychain.get('x', 'api_secret'),
|
|
118
|
+
this.keychain.get('x', 'access_token'),
|
|
119
|
+
this.keychain.get('x', 'access_secret'),
|
|
120
|
+
]);
|
|
121
|
+
if (!apiKey || !apiSecret || !accessToken || !accessSecret) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
'X write credentials not fully configured. Run:\n' +
|
|
124
|
+
' conductor plugins config x api_key <KEY>\n' +
|
|
125
|
+
' conductor plugins config x api_secret <SECRET>\n' +
|
|
126
|
+
' conductor plugins config x access_token <TOKEN>\n' +
|
|
127
|
+
' conductor plugins config x access_secret <SECRET>',
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
return { apiKey, apiSecret, accessToken, accessSecret };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
private async xFetch(path: string, params?: Record<string, string>): Promise<any> {
|
|
134
|
+
const token = await this.getBearerToken();
|
|
135
|
+
const url = new URL(`${X_BASE}${path}`);
|
|
136
|
+
if (params) {
|
|
137
|
+
for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return withRetry(async () => {
|
|
141
|
+
const res = await fetch(url.toString(), {
|
|
142
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
143
|
+
});
|
|
144
|
+
if (!res.ok) {
|
|
145
|
+
let errStr = res.statusText;
|
|
146
|
+
try {
|
|
147
|
+
const errJSON = (await res.json()) as any;
|
|
148
|
+
errStr = errJSON.detail ?? errJSON.title ?? res.statusText;
|
|
149
|
+
} catch {}
|
|
150
|
+
const error = new Error(`X API ${res.status}: ${errStr}`);
|
|
151
|
+
(error as any).status = res.status;
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
return res.json();
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
private buildOAuthHeader(
|
|
159
|
+
method: string,
|
|
160
|
+
url: string,
|
|
161
|
+
creds: { apiKey: string; apiSecret: string; accessToken: string; accessSecret: string },
|
|
162
|
+
): string {
|
|
163
|
+
const nonce = crypto.randomBytes(16).toString('hex');
|
|
164
|
+
const timestamp = Math.floor(Date.now() / 1000).toString();
|
|
165
|
+
|
|
166
|
+
const oauthParams: Record<string, string> = {
|
|
167
|
+
oauth_consumer_key: creds.apiKey,
|
|
168
|
+
oauth_nonce: nonce,
|
|
169
|
+
oauth_signature_method: 'HMAC-SHA1',
|
|
170
|
+
oauth_timestamp: timestamp,
|
|
171
|
+
oauth_token: creds.accessToken,
|
|
172
|
+
oauth_version: '1.0',
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const allParams = { ...oauthParams };
|
|
176
|
+
const sortedParams = Object.keys(allParams)
|
|
177
|
+
.sort()
|
|
178
|
+
.map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(allParams[k])}`)
|
|
179
|
+
.join('&');
|
|
180
|
+
|
|
181
|
+
const baseString = [method.toUpperCase(), encodeURIComponent(url), encodeURIComponent(sortedParams)].join('&');
|
|
182
|
+
|
|
183
|
+
const signingKey = `${encodeURIComponent(creds.apiSecret)}&${encodeURIComponent(creds.accessSecret)}`;
|
|
184
|
+
const signature = crypto.createHmac('sha1', signingKey).update(baseString).digest('base64');
|
|
185
|
+
|
|
186
|
+
oauthParams['oauth_signature'] = signature;
|
|
187
|
+
|
|
188
|
+
const headerValue = Object.keys(oauthParams)
|
|
189
|
+
.map((k) => `${encodeURIComponent(k)}="${encodeURIComponent(oauthParams[k])}"`)
|
|
190
|
+
.join(', ');
|
|
191
|
+
|
|
192
|
+
return `OAuth ${headerValue}`;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
private async xPost(path: string, body: any): Promise<any> {
|
|
196
|
+
const creds = await this.getOAuthCreds();
|
|
197
|
+
const url = `${X_BASE}${path}`;
|
|
198
|
+
const authHeader = this.buildOAuthHeader('POST', url, creds);
|
|
199
|
+
|
|
200
|
+
return withRetry(async () => {
|
|
201
|
+
const res = await fetch(url, {
|
|
202
|
+
method: 'POST',
|
|
203
|
+
headers: {
|
|
204
|
+
Authorization: authHeader,
|
|
205
|
+
'Content-Type': 'application/json',
|
|
206
|
+
},
|
|
207
|
+
body: JSON.stringify(body),
|
|
208
|
+
});
|
|
209
|
+
if (!res.ok) {
|
|
210
|
+
let errStr = res.statusText;
|
|
211
|
+
try {
|
|
212
|
+
const errJSON = (await res.json()) as any;
|
|
213
|
+
errStr = errJSON.detail ?? errJSON.title ?? res.statusText;
|
|
214
|
+
} catch {}
|
|
215
|
+
const error = new Error(`X API ${res.status}: ${errStr}`);
|
|
216
|
+
(error as any).status = res.status;
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
return res.json();
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
private formatTweet(t: any, includes?: any) {
|
|
224
|
+
const author = includes?.users?.find((u: any) => u.id === t.author_id);
|
|
225
|
+
return {
|
|
226
|
+
id: t.id,
|
|
227
|
+
text: t.text,
|
|
228
|
+
author: author ? { id: author.id, username: author.username, name: author.name } : { id: t.author_id },
|
|
229
|
+
createdAt: t.created_at ?? '',
|
|
230
|
+
publicMetrics: t.public_metrics ?? {},
|
|
231
|
+
url: t.author_id ? `https://x.com/i/web/status/${t.id}` : '',
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
getTools(): PluginTool[] {
|
|
236
|
+
return [
|
|
237
|
+
// ── x_search ────────────────────────────────────────────────────────────
|
|
238
|
+
{
|
|
239
|
+
name: 'x_search',
|
|
240
|
+
description: 'Search recent tweets on X. Supports operators like from:user, #hashtag, -filter:retweets',
|
|
241
|
+
inputSchema: {
|
|
242
|
+
type: 'object',
|
|
243
|
+
properties: {
|
|
244
|
+
query: { type: 'string', description: 'X search query' },
|
|
245
|
+
maxResults: {
|
|
246
|
+
type: 'number',
|
|
247
|
+
description: 'Max tweets to return (10–100, default: 10)',
|
|
248
|
+
},
|
|
249
|
+
sortOrder: {
|
|
250
|
+
type: 'string',
|
|
251
|
+
enum: ['recency', 'relevancy'],
|
|
252
|
+
description: 'Sort by recency or relevancy (default: recency)',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
required: ['query'],
|
|
256
|
+
},
|
|
257
|
+
handler: async ({ query, maxResults = 10, sortOrder = 'recency' }: any) => {
|
|
258
|
+
const res = await this.xFetch('/tweets/search/recent', {
|
|
259
|
+
query,
|
|
260
|
+
max_results: String(Math.min(Math.max(maxResults, 10), 100)),
|
|
261
|
+
sort_order: sortOrder,
|
|
262
|
+
'tweet.fields': 'created_at,public_metrics,author_id',
|
|
263
|
+
expansions: 'author_id',
|
|
264
|
+
'user.fields': 'username,name',
|
|
265
|
+
});
|
|
266
|
+
return {
|
|
267
|
+
count: res.data?.length ?? 0,
|
|
268
|
+
tweets: (res.data ?? []).map((t: any) => this.formatTweet(t, res.includes)),
|
|
269
|
+
};
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
// ── x_get_user ──────────────────────────────────────────────────────────
|
|
274
|
+
{
|
|
275
|
+
name: 'x_get_user',
|
|
276
|
+
description: 'Get an X user profile by username or ID',
|
|
277
|
+
inputSchema: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
properties: {
|
|
280
|
+
username: { type: 'string', description: 'X username (without @)' },
|
|
281
|
+
userId: { type: 'string', description: 'X user ID (alternative to username)' },
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
handler: async ({ username, userId }: any) => {
|
|
285
|
+
if (!username && !userId) throw new Error('Provide username or userId.');
|
|
286
|
+
const path = userId ? `/users/${userId}` : `/users/by/username/${username}`;
|
|
287
|
+
const res = await this.xFetch(path, {
|
|
288
|
+
'user.fields': 'name,username,description,public_metrics,created_at,verified,location,url',
|
|
289
|
+
});
|
|
290
|
+
const u = res.data;
|
|
291
|
+
return {
|
|
292
|
+
id: u.id,
|
|
293
|
+
username: u.username,
|
|
294
|
+
name: u.name,
|
|
295
|
+
bio: u.description ?? '',
|
|
296
|
+
location: u.location ?? '',
|
|
297
|
+
url: u.url ?? '',
|
|
298
|
+
followers: u.public_metrics?.followers_count ?? 0,
|
|
299
|
+
following: u.public_metrics?.following_count ?? 0,
|
|
300
|
+
tweetCount: u.public_metrics?.tweet_count ?? 0,
|
|
301
|
+
verified: u.verified ?? false,
|
|
302
|
+
createdAt: u.created_at ?? '',
|
|
303
|
+
xUrl: `https://x.com/${u.username}`,
|
|
304
|
+
};
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
// ── x_get_timeline ──────────────────────────────────────────────────────
|
|
309
|
+
{
|
|
310
|
+
name: 'x_get_timeline',
|
|
311
|
+
description: "Get a user's recent tweets",
|
|
312
|
+
inputSchema: {
|
|
313
|
+
type: 'object',
|
|
314
|
+
properties: {
|
|
315
|
+
username: { type: 'string', description: 'X username (without @)' },
|
|
316
|
+
maxResults: { type: 'number', description: 'Max tweets (5–100, default: 10)' },
|
|
317
|
+
excludeReplies: {
|
|
318
|
+
type: 'boolean',
|
|
319
|
+
description: 'Exclude reply tweets (default: false)',
|
|
320
|
+
},
|
|
321
|
+
excludeRetweets: {
|
|
322
|
+
type: 'boolean',
|
|
323
|
+
description: 'Exclude retweets (default: false)',
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
required: ['username'],
|
|
327
|
+
},
|
|
328
|
+
handler: async ({ username, maxResults = 10, excludeReplies = false, excludeRetweets = false }: any) => {
|
|
329
|
+
const userRes = await this.xFetch(`/users/by/username/${username}`);
|
|
330
|
+
const userId = userRes.data?.id;
|
|
331
|
+
if (!userId) throw new Error(`User not found: ${username}`);
|
|
332
|
+
|
|
333
|
+
const exclude: string[] = [];
|
|
334
|
+
if (excludeReplies) exclude.push('replies');
|
|
335
|
+
if (excludeRetweets) exclude.push('retweets');
|
|
336
|
+
|
|
337
|
+
const params: Record<string, string> = {
|
|
338
|
+
max_results: String(Math.min(Math.max(maxResults, 5), 100)),
|
|
339
|
+
'tweet.fields': 'created_at,public_metrics',
|
|
340
|
+
};
|
|
341
|
+
if (exclude.length) params.exclude = exclude.join(',');
|
|
342
|
+
|
|
343
|
+
const res = await this.xFetch(`/users/${userId}/tweets`, params);
|
|
344
|
+
return {
|
|
345
|
+
username,
|
|
346
|
+
count: res.data?.length ?? 0,
|
|
347
|
+
tweets: (res.data ?? []).map((t: any) => ({
|
|
348
|
+
id: t.id,
|
|
349
|
+
text: t.text,
|
|
350
|
+
createdAt: t.created_at ?? '',
|
|
351
|
+
likes: t.public_metrics?.like_count ?? 0,
|
|
352
|
+
retweets: t.public_metrics?.retweet_count ?? 0,
|
|
353
|
+
replies: t.public_metrics?.reply_count ?? 0,
|
|
354
|
+
url: `https://x.com/${username}/status/${t.id}`,
|
|
355
|
+
})),
|
|
356
|
+
};
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
|
|
360
|
+
// ── x_post_tweet ────────────────────────────────────────────────────────
|
|
361
|
+
{
|
|
362
|
+
name: 'x_post_tweet',
|
|
363
|
+
description: 'Post a new tweet to X (requires OAuth 1.0a write credentials)',
|
|
364
|
+
requiresApproval: true,
|
|
365
|
+
inputSchema: {
|
|
366
|
+
type: 'object',
|
|
367
|
+
properties: {
|
|
368
|
+
text: { type: 'string', description: 'Tweet text (max 280 chars)' },
|
|
369
|
+
replyToId: {
|
|
370
|
+
type: 'string',
|
|
371
|
+
description: 'Tweet ID to reply to (optional)',
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
required: ['text'],
|
|
375
|
+
},
|
|
376
|
+
handler: async ({ text, replyToId }: any) => {
|
|
377
|
+
if (text.length > 280) {
|
|
378
|
+
return { error: `Tweet too long: ${text.length} chars (max 280).` };
|
|
379
|
+
}
|
|
380
|
+
const body: any = { text };
|
|
381
|
+
if (replyToId) body.reply = { in_reply_to_tweet_id: replyToId };
|
|
382
|
+
|
|
383
|
+
const res = await this.xPost('/tweets', body);
|
|
384
|
+
return {
|
|
385
|
+
posted: true,
|
|
386
|
+
id: res.data?.id,
|
|
387
|
+
text: res.data?.text,
|
|
388
|
+
url: `https://x.com/i/web/status/${res.data?.id}`,
|
|
389
|
+
};
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
// ── x_delete_tweet ──────────────────────────────────────────────────────
|
|
394
|
+
{
|
|
395
|
+
name: 'x_delete_tweet',
|
|
396
|
+
description: 'Delete one of your tweets (requires OAuth write credentials)',
|
|
397
|
+
requiresApproval: true,
|
|
398
|
+
inputSchema: {
|
|
399
|
+
type: 'object',
|
|
400
|
+
properties: {
|
|
401
|
+
tweetId: { type: 'string', description: 'Tweet ID to delete' },
|
|
402
|
+
},
|
|
403
|
+
required: ['tweetId'],
|
|
404
|
+
},
|
|
405
|
+
handler: async ({ tweetId }: any) => {
|
|
406
|
+
const creds = await this.getOAuthCreds();
|
|
407
|
+
const url = `${X_BASE}/tweets/${tweetId}`;
|
|
408
|
+
const authHeader = this.buildOAuthHeader('DELETE', url, creds);
|
|
409
|
+
|
|
410
|
+
const res = await fetch(url, {
|
|
411
|
+
method: 'DELETE',
|
|
412
|
+
headers: { Authorization: authHeader },
|
|
413
|
+
});
|
|
414
|
+
if (!res.ok) throw new Error(`Delete failed: ${res.status} ${res.statusText}`);
|
|
415
|
+
const data = (await res.json()) as any;
|
|
416
|
+
return { deleted: data.data?.deleted ?? true, tweetId };
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
|
|
420
|
+
// ── x_like_tweet ────────────────────────────────────────────────────────
|
|
421
|
+
{
|
|
422
|
+
name: 'x_like_tweet',
|
|
423
|
+
description: 'Like a tweet (requires OAuth write credentials and your user ID)',
|
|
424
|
+
requiresApproval: true,
|
|
425
|
+
inputSchema: {
|
|
426
|
+
type: 'object',
|
|
427
|
+
properties: {
|
|
428
|
+
tweetId: { type: 'string', description: 'Tweet ID to like' },
|
|
429
|
+
userId: { type: 'string', description: 'Your X user ID (required for liking)' },
|
|
430
|
+
},
|
|
431
|
+
required: ['tweetId', 'userId'],
|
|
432
|
+
},
|
|
433
|
+
handler: async ({ tweetId, userId }: any) => {
|
|
434
|
+
const res = await this.xPost(`/users/${userId}/likes`, { tweet_id: tweetId });
|
|
435
|
+
return { liked: res.data?.liked ?? true, tweetId };
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
];
|
|
439
|
+
}
|
|
440
|
+
}
|