@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,426 @@
|
|
|
1
|
+
import { Plugin, PluginTool } from '../manager.js';
|
|
2
|
+
import { Conductor } from '../../core/conductor.js';
|
|
3
|
+
import { execFile } from 'child_process';
|
|
4
|
+
import { promisify } from 'util';
|
|
5
|
+
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
|
|
8
|
+
export class DockerPlugin implements Plugin {
|
|
9
|
+
name = 'docker';
|
|
10
|
+
description = 'Docker container, image, volume, and network management';
|
|
11
|
+
version = '1.0.0';
|
|
12
|
+
|
|
13
|
+
async initialize(_conductor: Conductor): Promise<void> {}
|
|
14
|
+
isConfigured(): boolean {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private async docker(args: string[]): Promise<{ stdout: string; stderr: string }> {
|
|
19
|
+
try {
|
|
20
|
+
const { stdout, stderr } = await execFileAsync('docker', args, { timeout: 30000 });
|
|
21
|
+
return { stdout: stdout.trim(), stderr: stderr.trim() };
|
|
22
|
+
} catch (err: unknown) {
|
|
23
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
24
|
+
throw new Error(`Docker command failed: ${msg}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getTools(): PluginTool[] {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
name: 'docker_containers',
|
|
32
|
+
description: 'List Docker containers. Use --all to include stopped containers.',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
all: { type: 'boolean', description: 'Include stopped containers', default: false },
|
|
37
|
+
filters: { type: 'string', description: 'Docker filter flags (e.g. "status=running")' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
handler: async (input: { all?: boolean; filters?: string }) => {
|
|
41
|
+
const args = ['ps', '--format', '{{json .}}'];
|
|
42
|
+
if (input.all) args.push('-a');
|
|
43
|
+
if (input.filters) args.push('--filter', input.filters);
|
|
44
|
+
const { stdout } = await this.docker(args);
|
|
45
|
+
if (!stdout) return { containers: [] };
|
|
46
|
+
return {
|
|
47
|
+
containers: stdout
|
|
48
|
+
.split('\n')
|
|
49
|
+
.map((line) => {
|
|
50
|
+
try {
|
|
51
|
+
return JSON.parse(line);
|
|
52
|
+
} catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
.filter((c): c is Record<string, unknown> => c !== null),
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'docker_container_logs',
|
|
62
|
+
description: 'Get logs from a Docker container',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
container: { type: 'string', description: 'Container name or ID' },
|
|
67
|
+
tail: { type: 'number', description: 'Number of lines from end', default: 100 },
|
|
68
|
+
},
|
|
69
|
+
required: ['container'],
|
|
70
|
+
},
|
|
71
|
+
handler: async (input: { container: string; tail?: number }) => {
|
|
72
|
+
const args = ['logs', '--tail', String(input.tail ?? 100), input.container];
|
|
73
|
+
const { stdout, stderr } = await this.docker(args);
|
|
74
|
+
return { container: input.container, logs: stdout || stderr };
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'docker_container_action',
|
|
79
|
+
description: 'Start, stop, restart, pause, unpause, or kill a Docker container',
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: 'object',
|
|
82
|
+
properties: {
|
|
83
|
+
container: { type: 'string', description: 'Container name or ID' },
|
|
84
|
+
action: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
enum: ['start', 'stop', 'restart', 'pause', 'unpause', 'kill', 'remove'],
|
|
87
|
+
description: 'Action to perform',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
required: ['container', 'action'],
|
|
91
|
+
},
|
|
92
|
+
handler: async (input: { container: string; action: string }) => {
|
|
93
|
+
const args = [input.action, input.container];
|
|
94
|
+
if (input.action === 'remove') args.push('-f');
|
|
95
|
+
await this.docker(args);
|
|
96
|
+
return { container: input.container, action: input.action, status: 'success' };
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'docker_images',
|
|
101
|
+
description: 'List Docker images',
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {},
|
|
105
|
+
},
|
|
106
|
+
handler: async () => {
|
|
107
|
+
const { stdout } = await this.docker(['images', '--format', '{{json .}}']);
|
|
108
|
+
if (!stdout) return { images: [] };
|
|
109
|
+
return {
|
|
110
|
+
images: stdout
|
|
111
|
+
.split('\n')
|
|
112
|
+
.map((line) => {
|
|
113
|
+
try {
|
|
114
|
+
return JSON.parse(line);
|
|
115
|
+
} catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
.filter((c): c is Record<string, unknown> => c !== null),
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'docker_pull',
|
|
125
|
+
description: 'Pull a Docker image',
|
|
126
|
+
inputSchema: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
properties: {
|
|
129
|
+
image: { type: 'string', description: 'Image name (e.g. "nginx:latest")' },
|
|
130
|
+
},
|
|
131
|
+
required: ['image'],
|
|
132
|
+
},
|
|
133
|
+
handler: async (input: { image: string }) => {
|
|
134
|
+
const { stdout } = await this.docker(['pull', input.image]);
|
|
135
|
+
return { image: input.image, result: stdout };
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'docker_run',
|
|
140
|
+
description: 'Run a Docker container. Requires approval for security.',
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: 'object',
|
|
143
|
+
properties: {
|
|
144
|
+
image: { type: 'string', description: 'Image to run' },
|
|
145
|
+
name: { type: 'string', description: 'Container name' },
|
|
146
|
+
ports: { type: 'array', items: { type: 'string' }, description: 'Port mappings (e.g. ["8080:80"])' },
|
|
147
|
+
env: {
|
|
148
|
+
type: 'array',
|
|
149
|
+
items: { type: 'string' },
|
|
150
|
+
description: 'Environment variables (e.g. ["KEY=value"])',
|
|
151
|
+
},
|
|
152
|
+
volumes: {
|
|
153
|
+
type: 'array',
|
|
154
|
+
items: { type: 'string' },
|
|
155
|
+
description: 'Volume mounts (e.g. ["/host:/container"])',
|
|
156
|
+
},
|
|
157
|
+
detach: { type: 'boolean', description: 'Run in background', default: true },
|
|
158
|
+
command: { type: 'string', description: 'Command to run inside container' },
|
|
159
|
+
},
|
|
160
|
+
required: ['image'],
|
|
161
|
+
},
|
|
162
|
+
handler: async (input: {
|
|
163
|
+
image: string;
|
|
164
|
+
name?: string;
|
|
165
|
+
ports?: string[];
|
|
166
|
+
env?: string[];
|
|
167
|
+
volumes?: string[];
|
|
168
|
+
detach?: boolean;
|
|
169
|
+
command?: string;
|
|
170
|
+
}) => {
|
|
171
|
+
const args = ['run'];
|
|
172
|
+
if (input.name) args.push('--name', input.name);
|
|
173
|
+
if (input.detach) args.push('-d');
|
|
174
|
+
if (input.ports) for (const p of input.ports) args.push('-p', p);
|
|
175
|
+
if (input.env) for (const e of input.env) args.push('-e', e);
|
|
176
|
+
if (input.volumes) for (const v of input.volumes) args.push('-v', v);
|
|
177
|
+
args.push(input.image);
|
|
178
|
+
if (input.command) args.push(input.command);
|
|
179
|
+
const { stdout } = await this.docker(args);
|
|
180
|
+
return { image: input.image, container_id: stdout.trim() };
|
|
181
|
+
},
|
|
182
|
+
requiresApproval: true,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'docker_volumes',
|
|
186
|
+
description: 'List Docker volumes',
|
|
187
|
+
inputSchema: { type: 'object', properties: {} },
|
|
188
|
+
handler: async () => {
|
|
189
|
+
const { stdout } = await this.docker(['volume', 'ls', '--format', '{{json .}}']);
|
|
190
|
+
if (!stdout) return { volumes: [] };
|
|
191
|
+
return {
|
|
192
|
+
volumes: stdout
|
|
193
|
+
.split('\n')
|
|
194
|
+
.map((line) => {
|
|
195
|
+
try {
|
|
196
|
+
return JSON.parse(line);
|
|
197
|
+
} catch {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
.filter((c): c is Record<string, unknown> => c !== null),
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'docker_networks',
|
|
207
|
+
description: 'List Docker networks',
|
|
208
|
+
inputSchema: { type: 'object', properties: {} },
|
|
209
|
+
handler: async () => {
|
|
210
|
+
const { stdout } = await this.docker(['network', 'ls', '--format', '{{json .}}']);
|
|
211
|
+
if (!stdout) return { networks: [] };
|
|
212
|
+
return {
|
|
213
|
+
networks: stdout
|
|
214
|
+
.split('\n')
|
|
215
|
+
.map((line) => {
|
|
216
|
+
try {
|
|
217
|
+
return JSON.parse(line);
|
|
218
|
+
} catch {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
.filter((c): c is Record<string, unknown> => c !== null),
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: 'docker_stats',
|
|
228
|
+
description: 'Get resource usage stats for running containers',
|
|
229
|
+
inputSchema: {
|
|
230
|
+
type: 'object',
|
|
231
|
+
properties: {
|
|
232
|
+
container: { type: 'string', description: 'Specific container (omit for all)' },
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
handler: async (input: { container?: string }) => {
|
|
236
|
+
const args = ['stats', '--no-stream', '--format', '{{json .}}'];
|
|
237
|
+
if (input.container) args.push(input.container);
|
|
238
|
+
const { stdout } = await this.docker(args);
|
|
239
|
+
if (!stdout) return { stats: [] };
|
|
240
|
+
return {
|
|
241
|
+
stats: stdout
|
|
242
|
+
.split('\n')
|
|
243
|
+
.map((line) => {
|
|
244
|
+
try {
|
|
245
|
+
return JSON.parse(line);
|
|
246
|
+
} catch {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
.filter((c): c is Record<string, unknown> => c !== null),
|
|
251
|
+
};
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
{
|
|
256
|
+
name: 'docker_build',
|
|
257
|
+
description: 'Build a Docker image from a Dockerfile',
|
|
258
|
+
inputSchema: {
|
|
259
|
+
type: 'object',
|
|
260
|
+
properties: {
|
|
261
|
+
context: { type: 'string', description: 'Build context path (directory containing Dockerfile)' },
|
|
262
|
+
tag: { type: 'string', description: 'Image tag (e.g. "myapp:latest")' },
|
|
263
|
+
dockerfile: { type: 'string', description: 'Path to Dockerfile if not in context root' },
|
|
264
|
+
build_args: {
|
|
265
|
+
type: 'array',
|
|
266
|
+
items: { type: 'string' },
|
|
267
|
+
description: 'Build arguments (e.g. ["VERSION=1.0"])',
|
|
268
|
+
},
|
|
269
|
+
no_cache: { type: 'boolean', description: 'Disable build cache', default: false },
|
|
270
|
+
},
|
|
271
|
+
required: ['context', 'tag'],
|
|
272
|
+
},
|
|
273
|
+
requiresApproval: true,
|
|
274
|
+
handler: async (input: {
|
|
275
|
+
context: string;
|
|
276
|
+
tag: string;
|
|
277
|
+
dockerfile?: string;
|
|
278
|
+
build_args?: string[];
|
|
279
|
+
no_cache?: boolean;
|
|
280
|
+
}) => {
|
|
281
|
+
const args = ['build', '-t', input.tag];
|
|
282
|
+
if (input.dockerfile) args.push('-f', input.dockerfile);
|
|
283
|
+
if (input.no_cache) args.push('--no-cache');
|
|
284
|
+
if (input.build_args) for (const a of input.build_args) args.push('--build-arg', a);
|
|
285
|
+
args.push(input.context);
|
|
286
|
+
const { stdout, stderr } = await this.docker(args);
|
|
287
|
+
return { tag: input.tag, output: stdout || stderr };
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
{
|
|
292
|
+
name: 'docker_push',
|
|
293
|
+
description: 'Push a Docker image to a registry',
|
|
294
|
+
inputSchema: {
|
|
295
|
+
type: 'object',
|
|
296
|
+
properties: {
|
|
297
|
+
image: { type: 'string', description: 'Image name and tag to push (e.g. "registry.io/myapp:latest")' },
|
|
298
|
+
},
|
|
299
|
+
required: ['image'],
|
|
300
|
+
},
|
|
301
|
+
requiresApproval: true,
|
|
302
|
+
handler: async (input: { image: string }) => {
|
|
303
|
+
const { stdout, stderr } = await this.docker(['push', input.image]);
|
|
304
|
+
return { image: input.image, result: stdout || stderr };
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
{
|
|
309
|
+
name: 'docker_network_ls',
|
|
310
|
+
description: 'List Docker networks',
|
|
311
|
+
inputSchema: { type: 'object', properties: {} },
|
|
312
|
+
handler: async () => {
|
|
313
|
+
const { stdout } = await this.docker(['network', 'ls', '--format', '{{json .}}']);
|
|
314
|
+
if (!stdout) return { networks: [] };
|
|
315
|
+
return {
|
|
316
|
+
networks: stdout
|
|
317
|
+
.split('\n')
|
|
318
|
+
.map((line) => {
|
|
319
|
+
try {
|
|
320
|
+
return JSON.parse(line);
|
|
321
|
+
} catch {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
})
|
|
325
|
+
.filter((c): c is Record<string, unknown> => c !== null),
|
|
326
|
+
};
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
|
|
330
|
+
{
|
|
331
|
+
name: 'docker_volume_ls',
|
|
332
|
+
description: 'List Docker volumes',
|
|
333
|
+
inputSchema: { type: 'object', properties: {} },
|
|
334
|
+
handler: async () => {
|
|
335
|
+
const { stdout } = await this.docker(['volume', 'ls', '--format', '{{json .}}']);
|
|
336
|
+
if (!stdout) return { volumes: [] };
|
|
337
|
+
return {
|
|
338
|
+
volumes: stdout
|
|
339
|
+
.split('\n')
|
|
340
|
+
.map((line) => {
|
|
341
|
+
try {
|
|
342
|
+
return JSON.parse(line);
|
|
343
|
+
} catch {
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
})
|
|
347
|
+
.filter((c): c is Record<string, unknown> => c !== null),
|
|
348
|
+
};
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
|
|
352
|
+
{
|
|
353
|
+
name: 'docker_compose_up',
|
|
354
|
+
description: 'Start services defined in a docker-compose file',
|
|
355
|
+
inputSchema: {
|
|
356
|
+
type: 'object',
|
|
357
|
+
properties: {
|
|
358
|
+
project_dir: { type: 'string', description: 'Directory containing docker-compose.yml' },
|
|
359
|
+
services: {
|
|
360
|
+
type: 'array',
|
|
361
|
+
items: { type: 'string' },
|
|
362
|
+
description: 'Specific services to start (omit for all)',
|
|
363
|
+
},
|
|
364
|
+
detach: { type: 'boolean', description: 'Run in background', default: true },
|
|
365
|
+
build: { type: 'boolean', description: 'Build images before starting', default: false },
|
|
366
|
+
},
|
|
367
|
+
required: ['project_dir'],
|
|
368
|
+
},
|
|
369
|
+
requiresApproval: true,
|
|
370
|
+
handler: async (input: { project_dir: string; services?: string[]; detach?: boolean; build?: boolean }) => {
|
|
371
|
+
const args = ['compose', '-f', `${input.project_dir}/docker-compose.yml`, 'up'];
|
|
372
|
+
if (input.detach ?? true) args.push('-d');
|
|
373
|
+
if (input.build) args.push('--build');
|
|
374
|
+
if (input.services?.length) args.push(...input.services);
|
|
375
|
+
const { stdout, stderr } = await this.docker(args);
|
|
376
|
+
return { project_dir: input.project_dir, result: stdout || stderr };
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
|
|
380
|
+
{
|
|
381
|
+
name: 'docker_compose_down',
|
|
382
|
+
description: 'Stop and remove services defined in a docker-compose file',
|
|
383
|
+
inputSchema: {
|
|
384
|
+
type: 'object',
|
|
385
|
+
properties: {
|
|
386
|
+
project_dir: { type: 'string', description: 'Directory containing docker-compose.yml' },
|
|
387
|
+
volumes: { type: 'boolean', description: 'Also remove named volumes', default: false },
|
|
388
|
+
},
|
|
389
|
+
required: ['project_dir'],
|
|
390
|
+
},
|
|
391
|
+
requiresApproval: true,
|
|
392
|
+
handler: async (input: { project_dir: string; volumes?: boolean }) => {
|
|
393
|
+
const args = ['compose', '-f', `${input.project_dir}/docker-compose.yml`, 'down'];
|
|
394
|
+
if (input.volumes) args.push('-v');
|
|
395
|
+
const { stdout, stderr } = await this.docker(args);
|
|
396
|
+
return { project_dir: input.project_dir, result: stdout || stderr };
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
{
|
|
401
|
+
name: 'docker_exec',
|
|
402
|
+
description: 'Execute a command inside a running container',
|
|
403
|
+
inputSchema: {
|
|
404
|
+
type: 'object',
|
|
405
|
+
properties: {
|
|
406
|
+
container: { type: 'string', description: 'Container name or ID' },
|
|
407
|
+
command: { type: 'string', description: 'Command to run (e.g. "ls /app")' },
|
|
408
|
+
user: { type: 'string', description: 'Run as this user (optional)' },
|
|
409
|
+
},
|
|
410
|
+
required: ['container', 'command'],
|
|
411
|
+
},
|
|
412
|
+
requiresApproval: true,
|
|
413
|
+
handler: async (input: { container: string; command: string; user?: string }) => {
|
|
414
|
+
const args = ['exec'];
|
|
415
|
+
if (input.user) args.push('-u', input.user);
|
|
416
|
+
args.push(input.container);
|
|
417
|
+
// Split command string safely
|
|
418
|
+
const parts = input.command.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) ?? [input.command];
|
|
419
|
+
args.push(...parts);
|
|
420
|
+
const { stdout, stderr } = await this.docker(args);
|
|
421
|
+
return { container: input.container, command: input.command, output: stdout || stderr };
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
];
|
|
425
|
+
}
|
|
426
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Plugin, PluginTool } from '../manager.js';
|
|
2
|
+
import { Conductor } from '../../core/conductor.js';
|
|
3
|
+
|
|
4
|
+
export class FunPlugin implements Plugin {
|
|
5
|
+
name = 'fun';
|
|
6
|
+
description = 'Jokes, cat facts, trivia, random numbers, and more';
|
|
7
|
+
version = '1.0.0';
|
|
8
|
+
|
|
9
|
+
async initialize(_conductor: Conductor): Promise<void> {}
|
|
10
|
+
isConfigured(): boolean {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getTools(): PluginTool[] {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
name: 'fun_joke',
|
|
18
|
+
description: 'Get a random joke',
|
|
19
|
+
inputSchema: { type: 'object', properties: {} },
|
|
20
|
+
handler: async () => {
|
|
21
|
+
const res = await fetch('https://official-joke-api.appspot.com/random_joke');
|
|
22
|
+
return await res.json();
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'fun_cat_fact',
|
|
27
|
+
description: 'Get a random cat fact',
|
|
28
|
+
inputSchema: { type: 'object', properties: {} },
|
|
29
|
+
handler: async () => {
|
|
30
|
+
const res = await fetch('https://catfact.ninja/fact');
|
|
31
|
+
return await res.json();
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'fun_trivia',
|
|
36
|
+
description: 'Get a random trivia question',
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
difficulty: { type: 'string', description: 'easy, medium, or hard', default: 'medium' },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
handler: async (input: { difficulty?: string }) => {
|
|
44
|
+
const diff = input.difficulty || 'medium';
|
|
45
|
+
const res = await fetch(`https://opentdb.com/api.php?amount=1&difficulty=${diff}&type=multiple`);
|
|
46
|
+
const data = (await res.json()) as any;
|
|
47
|
+
if (!data.results?.length) return { error: 'No trivia found' };
|
|
48
|
+
const q = data.results[0];
|
|
49
|
+
const answers = [...q.incorrect_answers, q.correct_answer].sort(() => Math.random() - 0.5);
|
|
50
|
+
return {
|
|
51
|
+
category: q.category,
|
|
52
|
+
difficulty: q.difficulty,
|
|
53
|
+
question: q.question.replace(/&[^;]+;/g, (m: string) => {
|
|
54
|
+
const map: Record<string, string> = {
|
|
55
|
+
'&': '&',
|
|
56
|
+
'<': '<',
|
|
57
|
+
'>': '>',
|
|
58
|
+
'"': '"',
|
|
59
|
+
''': "'",
|
|
60
|
+
};
|
|
61
|
+
return map[m] || m;
|
|
62
|
+
}),
|
|
63
|
+
answers,
|
|
64
|
+
correct: q.correct_answer,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'fun_random_number',
|
|
70
|
+
description: 'Generate a random number in a range',
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
min: { type: 'number', description: 'Minimum value', default: 1 },
|
|
75
|
+
max: { type: 'number', description: 'Maximum value', default: 100 },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
handler: async (input: { min?: number; max?: number }) => {
|
|
79
|
+
const min = input.min ?? 1;
|
|
80
|
+
const max = input.max ?? 100;
|
|
81
|
+
return { min, max, result: Math.floor(Math.random() * (max - min + 1)) + min };
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'fun_quote',
|
|
86
|
+
description: 'Get an inspirational quote',
|
|
87
|
+
inputSchema: { type: 'object', properties: {} },
|
|
88
|
+
handler: async () => {
|
|
89
|
+
// Built-in quotes — zero latency, no dead API dependencies
|
|
90
|
+
const quotes = [
|
|
91
|
+
{ quote: 'The best way to predict the future is to create it.', author: 'Peter Drucker' },
|
|
92
|
+
{ quote: "Code is like humor. When you have to explain it, it's bad.", author: 'Cory House' },
|
|
93
|
+
{ quote: 'First, solve the problem. Then, write the code.', author: 'John Johnson' },
|
|
94
|
+
{
|
|
95
|
+
quote:
|
|
96
|
+
'Any fool can write code that a computer can understand. Good programmers write code that humans can understand.',
|
|
97
|
+
author: 'Martin Fowler',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
quote: 'Programs must be written for people to read, and only incidentally for machines to execute.',
|
|
101
|
+
author: 'Harold Abelson',
|
|
102
|
+
},
|
|
103
|
+
{ quote: 'Simplicity is the soul of efficiency.', author: 'Austin Freeman' },
|
|
104
|
+
{ quote: 'Make it work, make it right, make it fast.', author: 'Kent Beck' },
|
|
105
|
+
{ quote: 'Talk is cheap. Show me the code.', author: 'Linus Torvalds' },
|
|
106
|
+
{ quote: 'In order to be irreplaceable, one must always be different.', author: 'Coco Chanel' },
|
|
107
|
+
{ quote: 'The secret of getting ahead is getting started.', author: 'Mark Twain' },
|
|
108
|
+
{ quote: "It always seems impossible until it's done.", author: 'Nelson Mandela' },
|
|
109
|
+
{ quote: "Whether you think you can or you think you can't, you're right.", author: 'Henry Ford' },
|
|
110
|
+
{ quote: 'The only way to do great work is to love what you do.', author: 'Steve Jobs' },
|
|
111
|
+
{ quote: 'Stay hungry, stay foolish.', author: 'Steve Jobs' },
|
|
112
|
+
];
|
|
113
|
+
return quotes[Math.floor(Math.random() * quotes.length)];
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
}
|