@hailer/mcp 1.2.0 → 1.3.9
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/agents/agent-hailer-helper.md +118 -0
- package/.claude/commands/debug-squad.md +13 -290
- package/.claude/commands/publish.md +2 -2
- package/.claude/commands/review-squad.md +17 -139
- package/.claude/skills/create-and-publish-app/SKILL.md +148 -81
- package/.claude/skills/hailer-app-builder/SKILL.md +29 -2
- package/.claude/skills/hailer-ui-guide/SKILL.md +265 -0
- package/.env.example +50 -1
- package/CLAUDE.md +141 -10
- package/dist/app-prep.d.ts +27 -0
- package/dist/app-prep.d.ts.map +1 -0
- package/dist/app-prep.js +94 -0
- package/dist/app-prep.js.map +1 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +3 -0
- package/dist/app.js.map +1 -1
- package/dist/bot/bot-manager.d.ts +9 -6
- package/dist/bot/bot-manager.d.ts.map +1 -1
- package/dist/bot/bot-manager.js +142 -31
- package/dist/bot/bot-manager.js.map +1 -1
- package/dist/bot/bot.d.ts +61 -16
- package/dist/bot/bot.d.ts.map +1 -1
- package/dist/bot/bot.js +927 -151
- package/dist/bot/bot.js.map +1 -1
- package/dist/bot/operation-logger.d.ts.map +1 -1
- package/dist/bot/operation-logger.js +24 -12
- package/dist/bot/operation-logger.js.map +1 -1
- package/dist/bot/services/bot-permissions.d.ts +37 -5
- package/dist/bot/services/bot-permissions.d.ts.map +1 -1
- package/dist/bot/services/bot-permissions.js +159 -35
- package/dist/bot/services/bot-permissions.js.map +1 -1
- package/dist/bot/services/conversation-manager.d.ts +23 -23
- package/dist/bot/services/conversation-manager.d.ts.map +1 -1
- package/dist/bot/services/conversation-manager.js +52 -49
- package/dist/bot/services/conversation-manager.js.map +1 -1
- package/dist/bot/services/helper-prompt.d.ts +8 -0
- package/dist/bot/services/helper-prompt.d.ts.map +1 -0
- package/dist/bot/services/helper-prompt.js +177 -0
- package/dist/bot/services/helper-prompt.js.map +1 -0
- package/dist/bot/services/message-classifier.d.ts +16 -16
- package/dist/bot/services/message-classifier.d.ts.map +1 -1
- package/dist/bot/services/message-classifier.js +55 -49
- package/dist/bot/services/message-classifier.js.map +1 -1
- package/dist/bot/services/message-formatter.d.ts +47 -38
- package/dist/bot/services/message-formatter.d.ts.map +1 -1
- package/dist/bot/services/message-formatter.js +99 -80
- package/dist/bot/services/message-formatter.js.map +1 -1
- package/dist/bot/services/permission-guard.d.ts.map +1 -1
- package/dist/bot/services/permission-guard.js +20 -10
- package/dist/bot/services/permission-guard.js.map +1 -1
- package/dist/bot/services/signal-router.d.ts.map +1 -1
- package/dist/bot/services/signal-router.js +11 -6
- package/dist/bot/services/signal-router.js.map +1 -1
- package/dist/bot/services/system-prompt.d.ts +14 -0
- package/dist/bot/services/system-prompt.d.ts.map +1 -1
- package/dist/bot/services/system-prompt.js +181 -4
- package/dist/bot/services/system-prompt.js.map +1 -1
- package/dist/bot/services/token-billing.d.ts +23 -23
- package/dist/bot/services/token-billing.d.ts.map +1 -1
- package/dist/bot/services/token-billing.js +51 -36
- package/dist/bot/services/token-billing.js.map +1 -1
- package/dist/bot/services/types.d.ts +3 -1
- package/dist/bot/services/types.d.ts.map +1 -1
- package/dist/bot/services/typing-indicator.d.ts +8 -8
- package/dist/bot/services/typing-indicator.d.ts.map +1 -1
- package/dist/bot/services/typing-indicator.js +12 -10
- package/dist/bot/services/typing-indicator.js.map +1 -1
- package/dist/bot/services/workspace-refresh.d.ts +3 -3
- package/dist/bot/services/workspace-refresh.d.ts.map +1 -1
- package/dist/bot/services/workspace-refresh.js +23 -13
- package/dist/bot/services/workspace-refresh.js.map +1 -1
- package/dist/bot/tool-executor.d.ts +10 -6
- package/dist/bot/tool-executor.d.ts.map +1 -1
- package/dist/bot/tool-executor.js +12 -6
- package/dist/bot/tool-executor.js.map +1 -1
- package/dist/bot/workspace-overview.d.ts.map +1 -1
- package/dist/bot/workspace-overview.js +6 -3
- package/dist/bot/workspace-overview.js.map +1 -1
- package/dist/bot-config/activity-error.d.ts +47 -0
- package/dist/bot-config/activity-error.d.ts.map +1 -0
- package/dist/bot-config/activity-error.js +67 -0
- package/dist/bot-config/activity-error.js.map +1 -0
- package/dist/bot-config/context.d.ts +4 -4
- package/dist/bot-config/context.d.ts.map +1 -1
- package/dist/bot-config/context.js +18 -14
- package/dist/bot-config/context.js.map +1 -1
- package/dist/bot-config/events.d.ts +45 -0
- package/dist/bot-config/events.d.ts.map +1 -0
- package/dist/bot-config/events.js +51 -0
- package/dist/bot-config/events.js.map +1 -0
- package/dist/bot-config/index.d.ts +3 -0
- package/dist/bot-config/index.d.ts.map +1 -1
- package/dist/bot-config/index.js +8 -1
- package/dist/bot-config/index.js.map +1 -1
- package/dist/bot-config/loader.d.ts +3 -0
- package/dist/bot-config/loader.d.ts.map +1 -1
- package/dist/bot-config/loader.js +45 -20
- package/dist/bot-config/loader.js.map +1 -1
- package/dist/bot-config/persistence.js.map +1 -1
- package/dist/bot-config/reconciler.d.ts +11 -0
- package/dist/bot-config/reconciler.d.ts.map +1 -0
- package/dist/bot-config/reconciler.js +121 -0
- package/dist/bot-config/reconciler.js.map +1 -0
- package/dist/bot-config/state.d.ts.map +1 -1
- package/dist/bot-config/state.js.map +1 -1
- package/dist/bot-config/types.d.ts +32 -0
- package/dist/bot-config/types.d.ts.map +1 -1
- package/dist/bot-config/webhooks.d.ts.map +1 -1
- package/dist/bot-config/webhooks.js.map +1 -1
- package/dist/bot-config/workflow-installer.d.ts +37 -0
- package/dist/bot-config/workflow-installer.d.ts.map +1 -0
- package/dist/bot-config/workflow-installer.js +346 -0
- package/dist/bot-config/workflow-installer.js.map +1 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +92 -11
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +23 -19
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +65 -27
- package/dist/config.js.map +1 -1
- package/dist/core.d.ts +6 -4
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +11 -16
- package/dist/core.js.map +1 -1
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +7 -4
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/request-logger.d.ts +19 -19
- package/dist/lib/request-logger.d.ts.map +1 -1
- package/dist/lib/request-logger.js +19 -19
- package/dist/lib/request-logger.js.map +1 -1
- package/dist/mcp/UserContextCache.d.ts +28 -22
- package/dist/mcp/UserContextCache.d.ts.map +1 -1
- package/dist/mcp/UserContextCache.js +23 -23
- package/dist/mcp/UserContextCache.js.map +1 -1
- package/dist/mcp/auth.js.map +1 -1
- package/dist/mcp/hailer-clients.d.ts +5 -4
- package/dist/mcp/hailer-clients.d.ts.map +1 -1
- package/dist/mcp/hailer-clients.js +83 -34
- package/dist/mcp/hailer-clients.js.map +1 -1
- package/dist/mcp/hailer-rpc.d.ts +40 -0
- package/dist/mcp/hailer-rpc.d.ts.map +1 -0
- package/dist/mcp/hailer-rpc.js +43 -0
- package/dist/mcp/hailer-rpc.js.map +1 -0
- package/dist/mcp/publish-auth-injector.d.ts +22 -0
- package/dist/mcp/publish-auth-injector.d.ts.map +1 -0
- package/dist/mcp/publish-auth-injector.js +100 -0
- package/dist/mcp/publish-auth-injector.js.map +1 -0
- package/dist/mcp/session-store.d.ts +16 -16
- package/dist/mcp/session-store.d.ts.map +1 -1
- package/dist/mcp/session-store.js +16 -16
- package/dist/mcp/session-store.js.map +1 -1
- package/dist/mcp/tool-profiles.d.ts +69 -0
- package/dist/mcp/tool-profiles.d.ts.map +1 -0
- package/dist/mcp/tool-profiles.js +176 -0
- package/dist/mcp/tool-profiles.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +16 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -1
- package/dist/mcp/tool-registry.js +91 -39
- package/dist/mcp/tool-registry.js.map +1 -1
- package/dist/mcp/tools/activity.d.ts +2 -0
- package/dist/mcp/tools/activity.d.ts.map +1 -1
- package/dist/mcp/tools/activity.js +575 -218
- package/dist/mcp/tools/activity.js.map +1 -1
- package/dist/mcp/tools/aliases.d.ts +11 -0
- package/dist/mcp/tools/aliases.d.ts.map +1 -0
- package/dist/mcp/tools/aliases.js +182 -0
- package/dist/mcp/tools/aliases.js.map +1 -0
- package/dist/mcp/tools/app-core.d.ts +6 -8
- package/dist/mcp/tools/app-core.d.ts.map +1 -1
- package/dist/mcp/tools/app-core.js +355 -254
- package/dist/mcp/tools/app-core.js.map +1 -1
- package/dist/mcp/tools/app-marketplace.d.ts +8 -16
- package/dist/mcp/tools/app-marketplace.d.ts.map +1 -1
- package/dist/mcp/tools/app-marketplace.js +604 -932
- package/dist/mcp/tools/app-marketplace.js.map +1 -1
- package/dist/mcp/tools/app.d.ts +4 -7
- package/dist/mcp/tools/app.d.ts.map +1 -1
- package/dist/mcp/tools/app.js +4 -7
- package/dist/mcp/tools/app.js.map +1 -1
- package/dist/mcp/tools/bot-self.d.ts +21 -0
- package/dist/mcp/tools/bot-self.d.ts.map +1 -0
- package/dist/mcp/tools/bot-self.js +174 -0
- package/dist/mcp/tools/bot-self.js.map +1 -0
- package/dist/mcp/tools/calendar.d.ts +21 -0
- package/dist/mcp/tools/calendar.d.ts.map +1 -0
- package/dist/mcp/tools/calendar.js +741 -0
- package/dist/mcp/tools/calendar.js.map +1 -0
- package/dist/mcp/tools/company.d.ts.map +1 -1
- package/dist/mcp/tools/company.js +2 -1
- package/dist/mcp/tools/company.js.map +1 -1
- package/dist/mcp/tools/date.js.map +1 -1
- package/dist/mcp/tools/discussion.d.ts +29 -3
- package/dist/mcp/tools/discussion.d.ts.map +1 -1
- package/dist/mcp/tools/discussion.js +419 -534
- package/dist/mcp/tools/discussion.js.map +1 -1
- package/dist/mcp/tools/file.d.ts.map +1 -1
- package/dist/mcp/tools/file.js +18 -16
- package/dist/mcp/tools/file.js.map +1 -1
- package/dist/mcp/tools/index.js +4 -4
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/insight.d.ts +24 -5
- package/dist/mcp/tools/insight.d.ts.map +1 -1
- package/dist/mcp/tools/insight.js +513 -480
- package/dist/mcp/tools/insight.js.map +1 -1
- package/dist/mcp/tools/user.d.ts.map +1 -1
- package/dist/mcp/tools/user.js +15 -13
- package/dist/mcp/tools/user.js.map +1 -1
- package/dist/mcp/tools/workflow-permissions.d.ts +2 -4
- package/dist/mcp/tools/workflow-permissions.d.ts.map +1 -1
- package/dist/mcp/tools/workflow-permissions.js +88 -97
- package/dist/mcp/tools/workflow-permissions.js.map +1 -1
- package/dist/mcp/tools/workflow.d.ts +9 -7
- package/dist/mcp/tools/workflow.d.ts.map +1 -1
- package/dist/mcp/tools/workflow.js +852 -860
- package/dist/mcp/tools/workflow.js.map +1 -1
- package/dist/mcp/utils/api-errors.d.ts.map +1 -1
- package/dist/mcp/utils/api-errors.js +2 -2
- package/dist/mcp/utils/api-errors.js.map +1 -1
- package/dist/mcp/utils/data-transformers.d.ts +0 -3
- package/dist/mcp/utils/data-transformers.d.ts.map +1 -1
- package/dist/mcp/utils/data-transformers.js +32 -5
- package/dist/mcp/utils/data-transformers.js.map +1 -1
- package/dist/mcp/utils/file-upload.d.ts.map +1 -1
- package/dist/mcp/utils/file-upload.js +1 -1
- package/dist/mcp/utils/file-upload.js.map +1 -1
- package/dist/mcp/utils/hailer-api-client.d.ts +81 -81
- package/dist/mcp/utils/hailer-api-client.d.ts.map +1 -1
- package/dist/mcp/utils/hailer-api-client.js +113 -103
- package/dist/mcp/utils/hailer-api-client.js.map +1 -1
- package/dist/mcp/utils/index.d.ts.map +1 -1
- package/dist/mcp/utils/index.js.map +1 -1
- package/dist/mcp/utils/logger.d.ts.map +1 -1
- package/dist/mcp/utils/logger.js.map +1 -1
- package/dist/mcp/utils/response-builder.d.ts.map +1 -1
- package/dist/mcp/utils/response-builder.js +8 -4
- package/dist/mcp/utils/response-builder.js.map +1 -1
- package/dist/mcp/utils/role-utils.d.ts.map +1 -1
- package/dist/mcp/utils/role-utils.js +6 -3
- package/dist/mcp/utils/role-utils.js.map +1 -1
- package/dist/mcp/utils/tool-helpers.d.ts.map +1 -1
- package/dist/mcp/utils/tool-helpers.js +2 -2
- package/dist/mcp/utils/tool-helpers.js.map +1 -1
- package/dist/mcp/utils/types.d.ts +2 -1
- package/dist/mcp/utils/types.d.ts.map +1 -1
- package/dist/mcp/utils/types.js.map +1 -1
- package/dist/mcp/webhook-handler.d.ts +43 -8
- package/dist/mcp/webhook-handler.d.ts.map +1 -1
- package/dist/mcp/webhook-handler.js +861 -116
- package/dist/mcp/webhook-handler.js.map +1 -1
- package/dist/mcp/workspace-admin-store.d.ts +49 -0
- package/dist/mcp/workspace-admin-store.d.ts.map +1 -0
- package/dist/mcp/workspace-admin-store.js +168 -0
- package/dist/mcp/workspace-admin-store.js.map +1 -0
- package/dist/mcp/workspace-cache.d.ts +2 -2
- package/dist/mcp/workspace-cache.d.ts.map +1 -1
- package/dist/mcp/workspace-cache.js +9 -5
- package/dist/mcp/workspace-cache.js.map +1 -1
- package/dist/mcp-server.d.ts +26 -11
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +367 -48
- package/dist/mcp-server.js.map +1 -1
- package/dist/plugins/vipunen/client.d.ts +41 -41
- package/dist/plugins/vipunen/client.d.ts.map +1 -1
- package/dist/plugins/vipunen/client.js +53 -48
- package/dist/plugins/vipunen/client.js.map +1 -1
- package/dist/plugins/vipunen/index.js.map +1 -1
- package/dist/plugins/vipunen/tools.d.ts.map +1 -1
- package/dist/plugins/vipunen/tools.js +6 -3
- package/dist/plugins/vipunen/tools.js.map +1 -1
- package/dist/public-chat/graduate.d.ts +29 -0
- package/dist/public-chat/graduate.d.ts.map +1 -0
- package/dist/public-chat/graduate.js +593 -0
- package/dist/public-chat/graduate.js.map +1 -0
- package/dist/public-chat/handler.d.ts +12 -0
- package/dist/public-chat/handler.d.ts.map +1 -0
- package/dist/public-chat/handler.js +183 -0
- package/dist/public-chat/handler.js.map +1 -0
- package/dist/public-chat/index.d.ts +16 -0
- package/dist/public-chat/index.d.ts.map +1 -0
- package/dist/public-chat/index.js +74 -0
- package/dist/public-chat/index.js.map +1 -0
- package/dist/public-chat/knowledge.d.ts +3 -0
- package/dist/public-chat/knowledge.d.ts.map +1 -0
- package/dist/public-chat/knowledge.js +1340 -0
- package/dist/public-chat/knowledge.js.map +1 -0
- package/dist/public-chat/rate-limit.d.ts +16 -0
- package/dist/public-chat/rate-limit.d.ts.map +1 -0
- package/dist/public-chat/rate-limit.js +51 -0
- package/dist/public-chat/rate-limit.js.map +1 -0
- package/dist/public-chat/session-store.d.ts +41 -0
- package/dist/public-chat/session-store.d.ts.map +1 -0
- package/dist/public-chat/session-store.js +95 -0
- package/dist/public-chat/session-store.js.map +1 -0
- package/dist/public-chat/studio-prewarm.d.ts +61 -0
- package/dist/public-chat/studio-prewarm.d.ts.map +1 -0
- package/dist/public-chat/studio-prewarm.js +162 -0
- package/dist/public-chat/studio-prewarm.js.map +1 -0
- package/dist/public-chat/system-prompt.d.ts +22 -0
- package/dist/public-chat/system-prompt.d.ts.map +1 -0
- package/dist/public-chat/system-prompt.js +435 -0
- package/dist/public-chat/system-prompt.js.map +1 -0
- package/package.json +15 -7
- package/scripts/build-public-chat-knowledge.py +101 -0
- package/scripts/smoke-public-chat-live.ts +148 -0
- package/scripts/smoke-public-chat.ts +110 -0
- package/.claude/CLAUDE.md +0 -126
- package/.claude/commands/app-squad.md +0 -131
- package/.claude/commands/audit-squad.md +0 -158
- package/.claude/commands/cleanup-squad.md +0 -98
- package/.claude/commands/config-squad.md +0 -106
- package/.claude/commands/crud-squad.md +0 -87
- package/.claude/commands/data-squad.md +0 -97
- package/.claude/commands/doc-squad.md +0 -65
- package/.claude/commands/help.md +0 -29
- package/.claude/commands/help:agents.md +0 -182
- package/.claude/commands/help:commands.md +0 -78
- package/.claude/commands/help:faq.md +0 -79
- package/.claude/commands/help:plugins.md +0 -50
- package/.claude/commands/help:skills.md +0 -87
- package/.claude/commands/help:tools.md +0 -75
- package/.claude/commands/hotfix-squad.md +0 -112
- package/.claude/commands/integration-squad.md +0 -82
- package/.claude/commands/janitor-squad.md +0 -167
- package/.claude/commands/onboard-squad.md +0 -130
- package/.claude/commands/swarm.md +0 -210
- package/.claude/commands/tool-builder.md +0 -39
- package/.claude/skills/publish-hailer-app/SKILL.md +0 -280
- package/dist/CLAUDE.md +0 -370
- package/dist/agents/bot-manager.d.ts +0 -48
- package/dist/agents/bot-manager.d.ts.map +0 -1
- package/dist/agents/bot-manager.js +0 -254
- package/dist/agents/bot-manager.js.map +0 -1
- package/dist/agents/bug-fixer/ai.d.ts +0 -80
- package/dist/agents/bug-fixer/ai.d.ts.map +0 -1
- package/dist/agents/bug-fixer/ai.js +0 -466
- package/dist/agents/bug-fixer/ai.js.map +0 -1
- package/dist/agents/bug-fixer/bot.d.ts +0 -92
- package/dist/agents/bug-fixer/bot.d.ts.map +0 -1
- package/dist/agents/bug-fixer/bot.js +0 -687
- package/dist/agents/bug-fixer/bot.js.map +0 -1
- package/dist/agents/bug-fixer/config.d.ts +0 -21
- package/dist/agents/bug-fixer/config.d.ts.map +0 -1
- package/dist/agents/bug-fixer/config.js +0 -218
- package/dist/agents/bug-fixer/config.js.map +0 -1
- package/dist/agents/bug-fixer/files.d.ts +0 -67
- package/dist/agents/bug-fixer/files.d.ts.map +0 -1
- package/dist/agents/bug-fixer/files.js +0 -386
- package/dist/agents/bug-fixer/files.js.map +0 -1
- package/dist/agents/bug-fixer/git.d.ts +0 -48
- package/dist/agents/bug-fixer/git.d.ts.map +0 -1
- package/dist/agents/bug-fixer/git.js +0 -298
- package/dist/agents/bug-fixer/git.js.map +0 -1
- package/dist/agents/bug-fixer/index.d.ts +0 -103
- package/dist/agents/bug-fixer/index.d.ts.map +0 -1
- package/dist/agents/bug-fixer/index.js +0 -262
- package/dist/agents/bug-fixer/index.js.map +0 -1
- package/dist/agents/bug-fixer/lsp.d.ts +0 -113
- package/dist/agents/bug-fixer/lsp.d.ts.map +0 -1
- package/dist/agents/bug-fixer/lsp.js +0 -485
- package/dist/agents/bug-fixer/lsp.js.map +0 -1
- package/dist/agents/bug-fixer/monitor.d.ts +0 -123
- package/dist/agents/bug-fixer/monitor.d.ts.map +0 -1
- package/dist/agents/bug-fixer/monitor.js +0 -629
- package/dist/agents/bug-fixer/monitor.js.map +0 -1
- package/dist/agents/bug-fixer/prompt.d.ts +0 -5
- package/dist/agents/bug-fixer/prompt.d.ts.map +0 -1
- package/dist/agents/bug-fixer/prompt.js +0 -94
- package/dist/agents/bug-fixer/prompt.js.map +0 -1
- package/dist/agents/bug-fixer/registries/pending-classification.d.ts +0 -28
- package/dist/agents/bug-fixer/registries/pending-classification.d.ts.map +0 -1
- package/dist/agents/bug-fixer/registries/pending-classification.js +0 -50
- package/dist/agents/bug-fixer/registries/pending-classification.js.map +0 -1
- package/dist/agents/bug-fixer/registries/pending-fix.d.ts +0 -33
- package/dist/agents/bug-fixer/registries/pending-fix.d.ts.map +0 -1
- package/dist/agents/bug-fixer/registries/pending-fix.js +0 -64
- package/dist/agents/bug-fixer/registries/pending-fix.js.map +0 -1
- package/dist/agents/bug-fixer/registries/pending.d.ts +0 -27
- package/dist/agents/bug-fixer/registries/pending.d.ts.map +0 -1
- package/dist/agents/bug-fixer/registries/pending.js +0 -49
- package/dist/agents/bug-fixer/registries/pending.js.map +0 -1
- package/dist/agents/bug-fixer/specialist-daemon.d.ts +0 -88
- package/dist/agents/bug-fixer/specialist-daemon.d.ts.map +0 -1
- package/dist/agents/bug-fixer/specialist-daemon.js +0 -431
- package/dist/agents/bug-fixer/specialist-daemon.js.map +0 -1
- package/dist/agents/bug-fixer/specialist.d.ts +0 -47
- package/dist/agents/bug-fixer/specialist.d.ts.map +0 -1
- package/dist/agents/bug-fixer/specialist.js +0 -327
- package/dist/agents/bug-fixer/specialist.js.map +0 -1
- package/dist/agents/bug-fixer/types.d.ts +0 -123
- package/dist/agents/bug-fixer/types.d.ts.map +0 -1
- package/dist/agents/bug-fixer/types.js +0 -9
- package/dist/agents/bug-fixer/types.js.map +0 -1
- package/dist/agents/factory.d.ts +0 -172
- package/dist/agents/factory.d.ts.map +0 -1
- package/dist/agents/factory.js +0 -706
- package/dist/agents/factory.js.map +0 -1
- package/dist/agents/hailer-expert/index.d.ts +0 -8
- package/dist/agents/hailer-expert/index.d.ts.map +0 -1
- package/dist/agents/hailer-expert/index.js +0 -14
- package/dist/agents/hailer-expert/index.js.map +0 -1
- package/dist/agents/hal/daemon.d.ts +0 -174
- package/dist/agents/hal/daemon.d.ts.map +0 -1
- package/dist/agents/hal/daemon.js +0 -1385
- package/dist/agents/hal/daemon.js.map +0 -1
- package/dist/agents/hal/definitions.d.ts +0 -42
- package/dist/agents/hal/definitions.d.ts.map +0 -1
- package/dist/agents/hal/definitions.js +0 -300
- package/dist/agents/hal/definitions.js.map +0 -1
- package/dist/agents/hal/index.d.ts +0 -3
- package/dist/agents/hal/index.d.ts.map +0 -1
- package/dist/agents/hal/index.js +0 -8
- package/dist/agents/hal/index.js.map +0 -1
- package/dist/agents/index.d.ts +0 -18
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/index.js +0 -48
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/shared/base.d.ts +0 -253
- package/dist/agents/shared/base.d.ts.map +0 -1
- package/dist/agents/shared/base.js +0 -1122
- package/dist/agents/shared/base.js.map +0 -1
- package/dist/agents/shared/schemas/action-schema.d.ts +0 -62
- package/dist/agents/shared/schemas/action-schema.d.ts.map +0 -1
- package/dist/agents/shared/schemas/action-schema.js +0 -483
- package/dist/agents/shared/schemas/action-schema.js.map +0 -1
- package/dist/agents/shared/services/agent-registry.d.ts +0 -108
- package/dist/agents/shared/services/agent-registry.d.ts.map +0 -1
- package/dist/agents/shared/services/agent-registry.js +0 -469
- package/dist/agents/shared/services/agent-registry.js.map +0 -1
- package/dist/agents/shared/services/conversation-manager.d.ts +0 -57
- package/dist/agents/shared/services/conversation-manager.d.ts.map +0 -1
- package/dist/agents/shared/services/conversation-manager.js +0 -168
- package/dist/agents/shared/services/conversation-manager.js.map +0 -1
- package/dist/agents/shared/services/mcp-client.d.ts +0 -56
- package/dist/agents/shared/services/mcp-client.d.ts.map +0 -1
- package/dist/agents/shared/services/mcp-client.js +0 -124
- package/dist/agents/shared/services/mcp-client.js.map +0 -1
- package/dist/agents/shared/services/message-classifier.d.ts +0 -37
- package/dist/agents/shared/services/message-classifier.d.ts.map +0 -1
- package/dist/agents/shared/services/message-classifier.js +0 -203
- package/dist/agents/shared/services/message-classifier.js.map +0 -1
- package/dist/agents/shared/services/message-formatter.d.ts +0 -89
- package/dist/agents/shared/services/message-formatter.d.ts.map +0 -1
- package/dist/agents/shared/services/message-formatter.js +0 -390
- package/dist/agents/shared/services/message-formatter.js.map +0 -1
- package/dist/agents/shared/services/session-logger.d.ts +0 -162
- package/dist/agents/shared/services/session-logger.d.ts.map +0 -1
- package/dist/agents/shared/services/session-logger.js +0 -724
- package/dist/agents/shared/services/session-logger.js.map +0 -1
- package/dist/agents/shared/services/structured-output-executor.d.ts +0 -88
- package/dist/agents/shared/services/structured-output-executor.d.ts.map +0 -1
- package/dist/agents/shared/services/structured-output-executor.js +0 -296
- package/dist/agents/shared/services/structured-output-executor.js.map +0 -1
- package/dist/agents/shared/services/token-billing.d.ts +0 -72
- package/dist/agents/shared/services/token-billing.d.ts.map +0 -1
- package/dist/agents/shared/services/token-billing.js +0 -198
- package/dist/agents/shared/services/token-billing.js.map +0 -1
- package/dist/agents/shared/services/tool-executor.d.ts +0 -43
- package/dist/agents/shared/services/tool-executor.d.ts.map +0 -1
- package/dist/agents/shared/services/tool-executor.js +0 -175
- package/dist/agents/shared/services/tool-executor.js.map +0 -1
- package/dist/agents/shared/services/typing-indicator.d.ts +0 -24
- package/dist/agents/shared/services/typing-indicator.d.ts.map +0 -1
- package/dist/agents/shared/services/typing-indicator.js +0 -54
- package/dist/agents/shared/services/typing-indicator.js.map +0 -1
- package/dist/agents/shared/services/workspace-schema-cache.d.ts +0 -122
- package/dist/agents/shared/services/workspace-schema-cache.d.ts.map +0 -1
- package/dist/agents/shared/services/workspace-schema-cache.js +0 -507
- package/dist/agents/shared/services/workspace-schema-cache.js.map +0 -1
- package/dist/agents/shared/specialist.d.ts +0 -91
- package/dist/agents/shared/specialist.d.ts.map +0 -1
- package/dist/agents/shared/specialist.js +0 -399
- package/dist/agents/shared/specialist.js.map +0 -1
- package/dist/agents/shared/tool-schema-loader.d.ts +0 -65
- package/dist/agents/shared/tool-schema-loader.d.ts.map +0 -1
- package/dist/agents/shared/tool-schema-loader.js +0 -238
- package/dist/agents/shared/tool-schema-loader.js.map +0 -1
- package/dist/agents/shared/types.d.ts +0 -190
- package/dist/agents/shared/types.d.ts.map +0 -1
- package/dist/agents/shared/types.js +0 -13
- package/dist/agents/shared/types.js.map +0 -1
- package/dist/bot/bot-config.d.ts +0 -37
- package/dist/bot/bot-config.d.ts.map +0 -1
- package/dist/bot/bot-config.js +0 -219
- package/dist/bot/bot-config.js.map +0 -1
- package/dist/bot/services/__tests__/permission-guard.test.d.ts +0 -2
- package/dist/bot/services/__tests__/permission-guard.test.d.ts.map +0 -1
- package/dist/bot/services/__tests__/permission-guard.test.js +0 -357
- package/dist/bot/services/__tests__/permission-guard.test.js.map +0 -1
- package/dist/bot/services/session-logger.d.ts +0 -162
- package/dist/bot/services/session-logger.d.ts.map +0 -1
- package/dist/bot/services/session-logger.js +0 -724
- package/dist/bot/services/session-logger.js.map +0 -1
- package/dist/bot/services/workspace-schema-cache.d.ts +0 -122
- package/dist/bot/services/workspace-schema-cache.d.ts.map +0 -1
- package/dist/bot/services/workspace-schema-cache.js +0 -506
- package/dist/bot/services/workspace-schema-cache.js.map +0 -1
- package/dist/bot-config/tools.d.ts +0 -28
- package/dist/bot-config/tools.d.ts.map +0 -1
- package/dist/bot-config/tools.js +0 -279
- package/dist/bot-config/tools.js.map +0 -1
- package/dist/client/agents/base.d.ts +0 -207
- package/dist/client/agents/base.d.ts.map +0 -1
- package/dist/client/agents/base.js +0 -744
- package/dist/client/agents/base.js.map +0 -1
- package/dist/client/agents/definitions.d.ts +0 -53
- package/dist/client/agents/definitions.d.ts.map +0 -1
- package/dist/client/agents/definitions.js +0 -263
- package/dist/client/agents/definitions.js.map +0 -1
- package/dist/client/agents/orchestrator.d.ts +0 -141
- package/dist/client/agents/orchestrator.d.ts.map +0 -1
- package/dist/client/agents/orchestrator.js +0 -1062
- package/dist/client/agents/orchestrator.js.map +0 -1
- package/dist/client/agents/specialist.d.ts +0 -86
- package/dist/client/agents/specialist.d.ts.map +0 -1
- package/dist/client/agents/specialist.js +0 -340
- package/dist/client/agents/specialist.js.map +0 -1
- package/dist/client/bot-entrypoint.d.ts +0 -7
- package/dist/client/bot-entrypoint.d.ts.map +0 -1
- package/dist/client/bot-entrypoint.js +0 -103
- package/dist/client/bot-entrypoint.js.map +0 -1
- package/dist/client/bot-manager.d.ts +0 -44
- package/dist/client/bot-manager.d.ts.map +0 -1
- package/dist/client/bot-manager.js +0 -173
- package/dist/client/bot-manager.js.map +0 -1
- package/dist/client/bot-runner.d.ts +0 -35
- package/dist/client/bot-runner.d.ts.map +0 -1
- package/dist/client/bot-runner.js +0 -188
- package/dist/client/bot-runner.js.map +0 -1
- package/dist/client/chat-agent-daemon.d.ts +0 -464
- package/dist/client/chat-agent-daemon.d.ts.map +0 -1
- package/dist/client/chat-agent-daemon.js +0 -1774
- package/dist/client/chat-agent-daemon.js.map +0 -1
- package/dist/client/daemon-factory.d.ts +0 -106
- package/dist/client/daemon-factory.d.ts.map +0 -1
- package/dist/client/daemon-factory.js +0 -301
- package/dist/client/daemon-factory.js.map +0 -1
- package/dist/client/factory.d.ts +0 -111
- package/dist/client/factory.d.ts.map +0 -1
- package/dist/client/factory.js +0 -314
- package/dist/client/factory.js.map +0 -1
- package/dist/client/index.d.ts +0 -17
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -38
- package/dist/client/index.js.map +0 -1
- package/dist/client/multi-bot-manager.d.ts +0 -42
- package/dist/client/multi-bot-manager.d.ts.map +0 -1
- package/dist/client/multi-bot-manager.js +0 -161
- package/dist/client/multi-bot-manager.js.map +0 -1
- package/dist/client/orchestrator-daemon.d.ts +0 -87
- package/dist/client/orchestrator-daemon.d.ts.map +0 -1
- package/dist/client/orchestrator-daemon.js +0 -444
- package/dist/client/orchestrator-daemon.js.map +0 -1
- package/dist/client/server.d.ts +0 -8
- package/dist/client/server.d.ts.map +0 -1
- package/dist/client/server.js +0 -251
- package/dist/client/server.js.map +0 -1
- package/dist/client/services/agent-registry.d.ts +0 -108
- package/dist/client/services/agent-registry.d.ts.map +0 -1
- package/dist/client/services/agent-registry.js +0 -630
- package/dist/client/services/agent-registry.js.map +0 -1
- package/dist/client/services/conversation-manager.d.ts +0 -50
- package/dist/client/services/conversation-manager.d.ts.map +0 -1
- package/dist/client/services/conversation-manager.js +0 -136
- package/dist/client/services/conversation-manager.js.map +0 -1
- package/dist/client/services/mcp-client.d.ts +0 -48
- package/dist/client/services/mcp-client.d.ts.map +0 -1
- package/dist/client/services/mcp-client.js +0 -105
- package/dist/client/services/mcp-client.js.map +0 -1
- package/dist/client/services/message-classifier.d.ts +0 -37
- package/dist/client/services/message-classifier.d.ts.map +0 -1
- package/dist/client/services/message-classifier.js +0 -187
- package/dist/client/services/message-classifier.js.map +0 -1
- package/dist/client/services/message-formatter.d.ts +0 -84
- package/dist/client/services/message-formatter.d.ts.map +0 -1
- package/dist/client/services/message-formatter.js +0 -353
- package/dist/client/services/message-formatter.js.map +0 -1
- package/dist/client/services/session-logger.d.ts +0 -106
- package/dist/client/services/session-logger.d.ts.map +0 -1
- package/dist/client/services/session-logger.js +0 -446
- package/dist/client/services/session-logger.js.map +0 -1
- package/dist/client/services/tool-executor.d.ts +0 -41
- package/dist/client/services/tool-executor.d.ts.map +0 -1
- package/dist/client/services/tool-executor.js +0 -169
- package/dist/client/services/tool-executor.js.map +0 -1
- package/dist/client/services/workspace-schema-cache.d.ts +0 -149
- package/dist/client/services/workspace-schema-cache.d.ts.map +0 -1
- package/dist/client/services/workspace-schema-cache.js +0 -732
- package/dist/client/services/workspace-schema-cache.js.map +0 -1
- package/dist/client/specialist-daemon.d.ts +0 -77
- package/dist/client/specialist-daemon.d.ts.map +0 -1
- package/dist/client/specialist-daemon.js +0 -197
- package/dist/client/specialist-daemon.js.map +0 -1
- package/dist/client/specialists.d.ts +0 -53
- package/dist/client/specialists.d.ts.map +0 -1
- package/dist/client/specialists.js +0 -178
- package/dist/client/specialists.js.map +0 -1
- package/dist/client/tool-schema-loader.d.ts +0 -62
- package/dist/client/tool-schema-loader.d.ts.map +0 -1
- package/dist/client/tool-schema-loader.js +0 -232
- package/dist/client/tool-schema-loader.js.map +0 -1
- package/dist/client/types.d.ts +0 -327
- package/dist/client/types.d.ts.map +0 -1
- package/dist/client/types.js +0 -121
- package/dist/client/types.js.map +0 -1
- package/dist/commands/seed-config.d.ts +0 -9
- package/dist/commands/seed-config.d.ts.map +0 -1
- package/dist/commands/seed-config.js +0 -377
- package/dist/commands/seed-config.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -11
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -320
- package/dist/commands/setup.js.map +0 -1
- package/dist/lib/discussion-lock.d.ts +0 -42
- package/dist/lib/discussion-lock.d.ts.map +0 -1
- package/dist/lib/discussion-lock.js +0 -110
- package/dist/lib/discussion-lock.js.map +0 -1
- package/dist/mcp/signal-handler.d.ts +0 -82
- package/dist/mcp/signal-handler.d.ts.map +0 -1
- package/dist/mcp/signal-handler.js +0 -406
- package/dist/mcp/signal-handler.js.map +0 -1
- package/dist/mcp/tools/__tests__/discussion-forward.test.d.ts +0 -2
- package/dist/mcp/tools/__tests__/discussion-forward.test.d.ts.map +0 -1
- package/dist/mcp/tools/__tests__/discussion-forward.test.js +0 -218
- package/dist/mcp/tools/__tests__/discussion-forward.test.js.map +0 -1
- package/dist/mcp/tools/app-member.d.ts +0 -14
- package/dist/mcp/tools/app-member.d.ts.map +0 -1
- package/dist/mcp/tools/app-member.js +0 -195
- package/dist/mcp/tools/app-member.js.map +0 -1
- package/dist/mcp/tools/app-scaffold.d.ts +0 -14
- package/dist/mcp/tools/app-scaffold.d.ts.map +0 -1
- package/dist/mcp/tools/app-scaffold.js +0 -581
- package/dist/mcp/tools/app-scaffold.js.map +0 -1
- package/dist/mcp/tools/bot-config/constants.d.ts +0 -23
- package/dist/mcp/tools/bot-config/constants.d.ts.map +0 -1
- package/dist/mcp/tools/bot-config/constants.js +0 -94
- package/dist/mcp/tools/bot-config/constants.js.map +0 -1
- package/dist/mcp/tools/bot-config/core.d.ts +0 -253
- package/dist/mcp/tools/bot-config/core.d.ts.map +0 -1
- package/dist/mcp/tools/bot-config/core.js +0 -2456
- package/dist/mcp/tools/bot-config/core.js.map +0 -1
- package/dist/mcp/tools/bot-config/index.d.ts +0 -10
- package/dist/mcp/tools/bot-config/index.d.ts.map +0 -1
- package/dist/mcp/tools/bot-config/index.js +0 -59
- package/dist/mcp/tools/bot-config/index.js.map +0 -1
- package/dist/mcp/tools/bot-config/tools.d.ts +0 -7
- package/dist/mcp/tools/bot-config/tools.d.ts.map +0 -1
- package/dist/mcp/tools/bot-config/tools.js +0 -15
- package/dist/mcp/tools/bot-config/tools.js.map +0 -1
- package/dist/mcp/tools/bot-config/types.d.ts +0 -50
- package/dist/mcp/tools/bot-config/types.d.ts.map +0 -1
- package/dist/mcp/tools/bot-config/types.js +0 -6
- package/dist/mcp/tools/bot-config/types.js.map +0 -1
- package/dist/mcp/tools/bug-fixer-tools.d.ts +0 -45
- package/dist/mcp/tools/bug-fixer-tools.d.ts.map +0 -1
- package/dist/mcp/tools/bug-fixer-tools.js +0 -1096
- package/dist/mcp/tools/bug-fixer-tools.js.map +0 -1
- package/dist/mcp/tools/document.d.ts +0 -11
- package/dist/mcp/tools/document.d.ts.map +0 -1
- package/dist/mcp/tools/document.js +0 -741
- package/dist/mcp/tools/document.js.map +0 -1
- package/dist/mcp/tools/investigate.d.ts +0 -9
- package/dist/mcp/tools/investigate.d.ts.map +0 -1
- package/dist/mcp/tools/investigate.js +0 -254
- package/dist/mcp/tools/investigate.js.map +0 -1
- package/dist/mcp/utils/pagination.d.ts +0 -40
- package/dist/mcp/utils/pagination.d.ts.map +0 -1
- package/dist/mcp/utils/pagination.js +0 -55
- package/dist/mcp/utils/pagination.js.map +0 -1
- package/dist/modules/bug-reports/bug-config.d.ts +0 -25
- package/dist/modules/bug-reports/bug-config.d.ts.map +0 -1
- package/dist/modules/bug-reports/bug-config.js +0 -187
- package/dist/modules/bug-reports/bug-config.js.map +0 -1
- package/dist/modules/bug-reports/bug-monitor.d.ts +0 -108
- package/dist/modules/bug-reports/bug-monitor.d.ts.map +0 -1
- package/dist/modules/bug-reports/bug-monitor.js +0 -510
- package/dist/modules/bug-reports/bug-monitor.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-agent.d.ts +0 -58
- package/dist/modules/bug-reports/giuseppe-agent.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-agent.js +0 -467
- package/dist/modules/bug-reports/giuseppe-agent.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-ai.d.ts +0 -83
- package/dist/modules/bug-reports/giuseppe-ai.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-ai.js +0 -466
- package/dist/modules/bug-reports/giuseppe-ai.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-bot.d.ts +0 -110
- package/dist/modules/bug-reports/giuseppe-bot.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-bot.js +0 -804
- package/dist/modules/bug-reports/giuseppe-bot.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-daemon.d.ts +0 -80
- package/dist/modules/bug-reports/giuseppe-daemon.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-daemon.js +0 -617
- package/dist/modules/bug-reports/giuseppe-daemon.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-files.d.ts +0 -64
- package/dist/modules/bug-reports/giuseppe-files.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-files.js +0 -375
- package/dist/modules/bug-reports/giuseppe-files.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-git.d.ts +0 -48
- package/dist/modules/bug-reports/giuseppe-git.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-git.js +0 -298
- package/dist/modules/bug-reports/giuseppe-git.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-lsp.d.ts +0 -113
- package/dist/modules/bug-reports/giuseppe-lsp.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-lsp.js +0 -485
- package/dist/modules/bug-reports/giuseppe-lsp.js.map +0 -1
- package/dist/modules/bug-reports/giuseppe-prompt.d.ts +0 -5
- package/dist/modules/bug-reports/giuseppe-prompt.d.ts.map +0 -1
- package/dist/modules/bug-reports/giuseppe-prompt.js +0 -94
- package/dist/modules/bug-reports/giuseppe-prompt.js.map +0 -1
- package/dist/modules/bug-reports/index.d.ts +0 -77
- package/dist/modules/bug-reports/index.d.ts.map +0 -1
- package/dist/modules/bug-reports/index.js +0 -215
- package/dist/modules/bug-reports/index.js.map +0 -1
- package/dist/modules/bug-reports/pending-classification-registry.d.ts +0 -28
- package/dist/modules/bug-reports/pending-classification-registry.d.ts.map +0 -1
- package/dist/modules/bug-reports/pending-classification-registry.js +0 -50
- package/dist/modules/bug-reports/pending-classification-registry.js.map +0 -1
- package/dist/modules/bug-reports/pending-fix-registry.d.ts +0 -30
- package/dist/modules/bug-reports/pending-fix-registry.d.ts.map +0 -1
- package/dist/modules/bug-reports/pending-fix-registry.js +0 -42
- package/dist/modules/bug-reports/pending-fix-registry.js.map +0 -1
- package/dist/modules/bug-reports/pending-registry.d.ts +0 -27
- package/dist/modules/bug-reports/pending-registry.d.ts.map +0 -1
- package/dist/modules/bug-reports/pending-registry.js +0 -49
- package/dist/modules/bug-reports/pending-registry.js.map +0 -1
- package/dist/modules/bug-reports/types.d.ts +0 -123
- package/dist/modules/bug-reports/types.d.ts.map +0 -1
- package/dist/modules/bug-reports/types.js +0 -9
- package/dist/modules/bug-reports/types.js.map +0 -1
- package/dist/plugins/bug-fixer/index.d.ts +0 -2
- package/dist/plugins/bug-fixer/index.d.ts.map +0 -1
- package/dist/plugins/bug-fixer/index.js +0 -18
- package/dist/plugins/bug-fixer/index.js.map +0 -1
- package/dist/plugins/bug-fixer/tools.d.ts +0 -45
- package/dist/plugins/bug-fixer/tools.d.ts.map +0 -1
- package/dist/plugins/bug-fixer/tools.js +0 -1096
- package/dist/plugins/bug-fixer/tools.js.map +0 -1
- package/dist/plugins/vipunen/__tests__/tools.test.d.ts +0 -10
- package/dist/plugins/vipunen/__tests__/tools.test.d.ts.map +0 -1
- package/dist/plugins/vipunen/__tests__/tools.test.js +0 -646
- package/dist/plugins/vipunen/__tests__/tools.test.js.map +0 -1
- package/dist/routes/agents.d.ts +0 -44
- package/dist/routes/agents.d.ts.map +0 -1
- package/dist/routes/agents.js +0 -311
- package/dist/routes/agents.js.map +0 -1
- package/dist/services/agent-credential-store.d.ts +0 -73
- package/dist/services/agent-credential-store.d.ts.map +0 -1
- package/dist/services/agent-credential-store.js +0 -212
- package/dist/services/agent-credential-store.js.map +0 -1
- package/dist/stdio-server.d.ts +0 -14
- package/dist/stdio-server.d.ts.map +0 -1
- package/dist/stdio-server.js +0 -101
- package/dist/stdio-server.js.map +0 -1
- package/dist/workspace/context.d.ts +0 -148
- package/dist/workspace/context.d.ts.map +0 -1
- package/dist/workspace/context.js +0 -339
- package/dist/workspace/context.js.map +0 -1
- package/dist/workspace/credentials.d.ts +0 -55
- package/dist/workspace/credentials.d.ts.map +0 -1
- package/dist/workspace/credentials.js +0 -239
- package/dist/workspace/credentials.js.map +0 -1
- package/dist/workspace/index.d.ts +0 -21
- package/dist/workspace/index.d.ts.map +0 -1
- package/dist/workspace/index.js +0 -45
- package/dist/workspace/index.js.map +0 -1
- package/dist/workspace/loader.d.ts +0 -27
- package/dist/workspace/loader.d.ts.map +0 -1
- package/dist/workspace/loader.js +0 -222
- package/dist/workspace/loader.js.map +0 -1
- package/dist/workspace/schema.d.ts +0 -37
- package/dist/workspace/schema.d.ts.map +0 -1
- package/dist/workspace/schema.js +0 -192
- package/dist/workspace/schema.js.map +0 -1
package/dist/mcp-server.js
CHANGED
|
@@ -51,9 +51,14 @@ const logger_1 = require("./lib/logger");
|
|
|
51
51
|
const config_1 = require("./config");
|
|
52
52
|
const UserContextCache_1 = require("./mcp/UserContextCache");
|
|
53
53
|
const tool_registry_1 = require("./mcp/tool-registry");
|
|
54
|
+
const tool_profiles_1 = require("./mcp/tool-profiles");
|
|
54
55
|
const session_store_1 = require("./mcp/session-store");
|
|
55
56
|
const webhook_handler_1 = require("./mcp/webhook-handler");
|
|
57
|
+
const workspace_admin_store_1 = require("./mcp/workspace-admin-store");
|
|
58
|
+
const rate_limit_1 = require("./public-chat/rate-limit");
|
|
59
|
+
const hailer_clients_1 = require("./mcp/hailer-clients");
|
|
56
60
|
const vipunen_1 = require("./plugins/vipunen");
|
|
61
|
+
const public_chat_1 = require("./public-chat");
|
|
57
62
|
// Load MCP instructions for Claude App
|
|
58
63
|
// Try dist/mcp/ first (production), then src/mcp/ (development)
|
|
59
64
|
let mcpInstructions;
|
|
@@ -83,6 +88,9 @@ class MCPServerService {
|
|
|
83
88
|
config;
|
|
84
89
|
toolRegistry;
|
|
85
90
|
appConfig;
|
|
91
|
+
/** sessionId → profile + timestamp. Set at MCP initialize when clientInfo identifies an SDK-aware client. */
|
|
92
|
+
mcpClientProfiles = new Map();
|
|
93
|
+
static PROFILE_TTL_MS = 60 * 60 * 1000; // 1 hour
|
|
86
94
|
constructor(config) {
|
|
87
95
|
this.config = config;
|
|
88
96
|
this.toolRegistry = config.toolRegistry;
|
|
@@ -100,6 +108,14 @@ class MCPServerService {
|
|
|
100
108
|
});
|
|
101
109
|
}
|
|
102
110
|
setupMiddleware() {
|
|
111
|
+
// Trust all private-range hops (ingress, hailer-api /proxy/mcp) so req.ip
|
|
112
|
+
// resolves to the first PUBLIC address in X-Forwarded-For regardless of
|
|
113
|
+
// how many internal proxies the request traversed. The public ingress
|
|
114
|
+
// (ALB in prod, Traefik in dev) always appends the real client IP as the
|
|
115
|
+
// rightmost entry, and every internal hop is loopback/RFC1918, so this
|
|
116
|
+
// is hop-count-agnostic and spoof-safe for internet clients. Required
|
|
117
|
+
// for per-visitor rate-limit buckets.
|
|
118
|
+
this.app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']);
|
|
103
119
|
// Configure CORS - empty array means allow all origins (like original cors())
|
|
104
120
|
if (this.config.corsOrigins.length === 0) {
|
|
105
121
|
this.app.use((0, cors_1.default)());
|
|
@@ -109,7 +125,9 @@ class MCPServerService {
|
|
|
109
125
|
origin: this.config.corsOrigins
|
|
110
126
|
}));
|
|
111
127
|
}
|
|
112
|
-
|
|
128
|
+
// Match the Hailer backend's 20mb body limit — the body-parser default of
|
|
129
|
+
// 100kb rejected large bulk create/update payloads with 413 before any handler ran.
|
|
130
|
+
this.app.use(express_1.default.json({ limit: '20mb' }));
|
|
113
131
|
// Request logging middleware (skip noise: health checks, OAuth discovery probes)
|
|
114
132
|
this.app.use((req, res, next) => {
|
|
115
133
|
const isHealthCheck = req.path === '/health';
|
|
@@ -322,7 +340,8 @@ class MCPServerService {
|
|
|
322
340
|
});
|
|
323
341
|
// Legacy POST callback for backwards compatibility
|
|
324
342
|
this.app.post(`${API_PREFIX}/oauth/callback`, express_1.default.urlencoded({ extended: true }), (req, res) => {
|
|
325
|
-
|
|
343
|
+
// Body contains access_token (a credential) — log only field names, not values.
|
|
344
|
+
req.logger.debug('OAuth callback POST received', { fields: Object.keys(req.body ?? {}) });
|
|
326
345
|
const { access_token, error } = req.body;
|
|
327
346
|
if (error) {
|
|
328
347
|
return res.status(400).send(`<html><body><h1>Authorization Failed</h1><p>Error: ${this.escapeHtml(String(error))}</p></body></html>`);
|
|
@@ -363,35 +382,84 @@ class MCPServerService {
|
|
|
363
382
|
const webhookPath = (0, webhook_handler_1.getWebhookPath)();
|
|
364
383
|
if (webhookPath) {
|
|
365
384
|
// POST /webhook/{token} - Receives updates from Hailer workflow webhooks
|
|
366
|
-
this.app.post(webhookPath, (req, res) => {
|
|
385
|
+
this.app.post(webhookPath, async (req, res) => {
|
|
367
386
|
req.logger.debug('Bot config webhook received', {
|
|
368
387
|
activityId: req.body?._id,
|
|
369
388
|
activityName: req.body?.name,
|
|
370
389
|
workspaceId: req.body?.cid,
|
|
371
390
|
});
|
|
391
|
+
// Always return 200 so Hailer doesn't auto-suspend webhook delivery
|
|
392
|
+
// after consecutive non-2xx responses. Errors are logged; the body
|
|
393
|
+
// carries `success: false` + `error` for anyone polling the status
|
|
394
|
+
// endpoint.
|
|
372
395
|
try {
|
|
373
|
-
const result = (0, webhook_handler_1.handleBotConfigWebhook)(req.body);
|
|
396
|
+
const result = await (0, webhook_handler_1.handleBotConfigWebhook)(req.body);
|
|
374
397
|
if (result.success) {
|
|
375
398
|
req.logger.debug('Bot config updated via webhook', {
|
|
376
399
|
action: result.action,
|
|
377
400
|
workspaceId: result.workspaceId,
|
|
378
401
|
botType: result.botType,
|
|
379
402
|
});
|
|
380
|
-
res.status(200).json(result);
|
|
381
403
|
}
|
|
382
404
|
else {
|
|
383
|
-
req.logger.warn('Bot config webhook
|
|
384
|
-
res.status(400).json(result);
|
|
405
|
+
req.logger.warn('Bot config webhook handled with non-success', { error: result.error });
|
|
385
406
|
}
|
|
407
|
+
res.status(200).json(result);
|
|
386
408
|
}
|
|
387
409
|
catch (error) {
|
|
388
410
|
req.logger.error('Bot config webhook error', { error });
|
|
389
|
-
res.status(
|
|
411
|
+
res.status(200).json({
|
|
390
412
|
success: false,
|
|
391
413
|
error: error instanceof Error ? error.message : 'Internal error',
|
|
392
414
|
});
|
|
393
415
|
}
|
|
394
416
|
});
|
|
417
|
+
// DELETE /webhook/{token}/bot/:activityId?workspaceId=X&actorUid=Y&actorName=Z
|
|
418
|
+
// Called by AI Hub when the user deletes a bot, BEFORE the activity is
|
|
419
|
+
// removed in Hailer. Tears down the Hailer user account (via the bot's
|
|
420
|
+
// own session) and removes the local config entry, so deletion in AI Hub
|
|
421
|
+
// is propagated atomically rather than waiting for the reconciler tick.
|
|
422
|
+
// actorUid/actorName are optional and used purely for audit attribution
|
|
423
|
+
// — the actual operations run with the admin API key.
|
|
424
|
+
this.app.delete(`${webhookPath}/bot/:activityId`, async (req, res) => {
|
|
425
|
+
const activityId = req.params.activityId;
|
|
426
|
+
const workspaceId = typeof req.query.workspaceId === 'string' ? req.query.workspaceId : '';
|
|
427
|
+
if (!workspaceId) {
|
|
428
|
+
res.status(400).json({ error: 'workspaceId query param required' });
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const actor = {
|
|
432
|
+
uid: typeof req.query.actorUid === 'string' ? req.query.actorUid : undefined,
|
|
433
|
+
name: typeof req.query.actorName === 'string' ? req.query.actorName : undefined,
|
|
434
|
+
};
|
|
435
|
+
try {
|
|
436
|
+
const outcome = await (0, webhook_handler_1.destroyBot)(workspaceId, activityId, actor);
|
|
437
|
+
if (!outcome.teardownOk) {
|
|
438
|
+
// 502: the config entry is gone and AI Hub will still delete
|
|
439
|
+
// the activity, but the Hailer user account was not torn down
|
|
440
|
+
// (no listener, or listener threw). Operator needs to know.
|
|
441
|
+
res.status(502).json({
|
|
442
|
+
success: false,
|
|
443
|
+
removed: !!outcome.removed,
|
|
444
|
+
email: outcome.removed?.email ?? null,
|
|
445
|
+
error: outcome.teardownError ?? 'teardown skipped',
|
|
446
|
+
});
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
res.status(200).json({
|
|
450
|
+
success: true,
|
|
451
|
+
removed: !!outcome.removed,
|
|
452
|
+
email: outcome.removed?.email ?? null,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
catch (err) {
|
|
456
|
+
req.logger.error('Bot destroy failed', { workspaceId, activityId, actor, err });
|
|
457
|
+
res.status(500).json({
|
|
458
|
+
success: false,
|
|
459
|
+
error: err instanceof Error ? err.message : 'Internal error',
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
});
|
|
395
463
|
// GET /webhook/{token}/status - Status endpoint to see all workspace configs
|
|
396
464
|
this.app.get(`${webhookPath}/status`, (_req, res) => {
|
|
397
465
|
const configs = (0, webhook_handler_1.listWorkspaceConfigs)();
|
|
@@ -411,6 +479,179 @@ class MCPServerService {
|
|
|
411
479
|
else {
|
|
412
480
|
this.logger.debug('Webhook endpoint disabled (no WEBHOOK_TOKEN)');
|
|
413
481
|
}
|
|
482
|
+
const adminCheckCacheTtlMs = 3000;
|
|
483
|
+
const adminCheckCacheMax = 1000;
|
|
484
|
+
const adminCheckCache = new Map();
|
|
485
|
+
const sweepAdminCheckCache = (now) => {
|
|
486
|
+
for (const [staleKey, entry] of adminCheckCache) {
|
|
487
|
+
if (now - entry.time >= adminCheckCacheTtlMs) {
|
|
488
|
+
adminCheckCache.delete(staleKey);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
// Bounded insert: TTL is otherwise only checked on read, so attacker-
|
|
493
|
+
// supplied random workspaceIds would grow the map without bound. Sweep
|
|
494
|
+
// expired entries when full, then evict the oldest (Maps iterate in
|
|
495
|
+
// insertion order) as a last resort.
|
|
496
|
+
const setAdminCheckCache = (key, body) => {
|
|
497
|
+
const now = Date.now();
|
|
498
|
+
if (adminCheckCache.size >= adminCheckCacheMax) {
|
|
499
|
+
sweepAdminCheckCache(now);
|
|
500
|
+
}
|
|
501
|
+
const oldestKey = adminCheckCache.keys().next().value;
|
|
502
|
+
if (adminCheckCache.size >= adminCheckCacheMax && oldestKey) {
|
|
503
|
+
adminCheckCache.delete(oldestKey);
|
|
504
|
+
}
|
|
505
|
+
adminCheckCache.set(key, { body, time: now });
|
|
506
|
+
};
|
|
507
|
+
// Route-scoped CORS: AI Hub polls /check with `credentials: 'include'`
|
|
508
|
+
// through api.hailer.com /proxy/mcp, and the proxy copies upstream
|
|
509
|
+
// response headers verbatim — so the global allow-all
|
|
510
|
+
// `Access-Control-Allow-Origin: *` from setupMiddleware would reach the
|
|
511
|
+
// browser and make it reject every credentialed response. Reflect only
|
|
512
|
+
// the AI Hub app origins, with credentials enabled. The POST is a
|
|
513
|
+
// top-level form navigation (no CORS), so only the GET needs this.
|
|
514
|
+
const adminAuthorizeCors = (0, cors_1.default)({
|
|
515
|
+
origin: config_1.environment.ADMIN_CORS_ORIGINS,
|
|
516
|
+
credentials: true,
|
|
517
|
+
});
|
|
518
|
+
// /check returns the stored admin's uid (opaque ObjectId) so AI Hub can
|
|
519
|
+
// compare against the current user and distinguish "you are connected"
|
|
520
|
+
// from "another admin connected this workspace." Name/email are NOT
|
|
521
|
+
// returned — this endpoint is reachable over plaintext HTTP given only
|
|
522
|
+
// the workspaceId, and we don't want admin PII traveling on the wire.
|
|
523
|
+
this.app.get('/admin-authorize/check', adminAuthorizeCors, async (req, res) => {
|
|
524
|
+
const workspaceId = typeof req.query.workspaceId === 'string' ? req.query.workspaceId : '';
|
|
525
|
+
if (!workspaceId) {
|
|
526
|
+
res.status(400).json({ error: 'workspaceId required' });
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
// Generous per-IP budget: the AI Hub popup polls every ~1.5s for up
|
|
530
|
+
// to 120s (~81 requests per full flow incl. the baseline probe);
|
|
531
|
+
// 250/hr fits three timed-out flows plus app-startup checks. Keyed
|
|
532
|
+
// by IP only — keying by IP+workspaceId would let one IP mint
|
|
533
|
+
// unlimited fresh buckets via random workspaceIds. AI Hub treats
|
|
534
|
+
// non-200 as { hasKey: false } and keeps polling, so 429 degrades
|
|
535
|
+
// gracefully. Reachable only via the session-gated /proxy/mcp in
|
|
536
|
+
// prod, so this is defense-in-depth, not the primary gate.
|
|
537
|
+
const rate = (0, rate_limit_1.checkRate)(`admin-check:${req.ip ?? 'unknown'}`, 250);
|
|
538
|
+
if (!rate.ok) {
|
|
539
|
+
res.status(429).json({ error: 'rate_limited', retryAfterSec: rate.retryAfterSec });
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
const cached = adminCheckCache.get(workspaceId);
|
|
543
|
+
if (cached && Date.now() - cached.time < adminCheckCacheTtlMs) {
|
|
544
|
+
res.json(cached.body);
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
const record = await (0, workspace_admin_store_1.getValidatedAdminRecord)(workspaceId);
|
|
548
|
+
let body = { hasKey: false };
|
|
549
|
+
if (record) {
|
|
550
|
+
body = {
|
|
551
|
+
hasKey: true,
|
|
552
|
+
installedAt: record.installedAt,
|
|
553
|
+
expiresAt: record.expiresAt,
|
|
554
|
+
admin: { uid: record.uid },
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
setAdminCheckCache(workspaceId, body);
|
|
558
|
+
res.json(body);
|
|
559
|
+
});
|
|
560
|
+
this.app.post('/admin-authorize', express_1.default.urlencoded({ extended: true }), async (req, res) => {
|
|
561
|
+
const completeUrl = (status, message) => {
|
|
562
|
+
const base = `${config_1.environment.HAILER_APP_URL}/#/authorize/complete?status=${status}`;
|
|
563
|
+
return message ? `${base}&message=${encodeURIComponent(message)}` : base;
|
|
564
|
+
};
|
|
565
|
+
try {
|
|
566
|
+
// Rate-limit the expensive write (each call runs live core.init
|
|
567
|
+
// validation). Namespaced key so it has its own per-IP budget,
|
|
568
|
+
// separate from the public-chat limiter sharing this module.
|
|
569
|
+
const rate = (0, rate_limit_1.checkRate)(`admin-authorize:${req.ip ?? 'unknown'}`);
|
|
570
|
+
if (!rate.ok) {
|
|
571
|
+
req.logger.warn('Admin authorize: rate limited', { retryAfterSec: rate.retryAfterSec });
|
|
572
|
+
res.redirect(303, completeUrl('error', 'Too many attempts — please wait a moment and try again.'));
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
const workspaceId = typeof req.query.workspaceId === 'string' ? req.query.workspaceId : '';
|
|
576
|
+
const apiKey = typeof req.body?.apiKey === 'string' ? req.body.apiKey : '';
|
|
577
|
+
req.logger.debug('Admin authorize POST received', {
|
|
578
|
+
workspaceId,
|
|
579
|
+
hasApiKey: !!apiKey,
|
|
580
|
+
contentType: req.headers['content-type'],
|
|
581
|
+
bodyKeys: req.body ? Object.keys(req.body) : [],
|
|
582
|
+
queryKeys: Object.keys(req.query),
|
|
583
|
+
});
|
|
584
|
+
if (!workspaceId || !apiKey) {
|
|
585
|
+
res.redirect(303, completeUrl('error', 'Missing workspaceId or apiKey'));
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
// Validate the key by resolving the admin's identity, and capture it for audit/display.
|
|
589
|
+
let identity;
|
|
590
|
+
let targetRole;
|
|
591
|
+
let adminClient;
|
|
592
|
+
try {
|
|
593
|
+
adminClient = await (0, hailer_clients_1.createHailerClientByApiKey)(apiKey);
|
|
594
|
+
identity = await (0, workspace_admin_store_1.resolveAdminIdentity)(adminClient);
|
|
595
|
+
targetRole = identity.uid ? await (0, workspace_admin_store_1.resolveRoleInWorkspace)(adminClient, identity.uid, workspaceId) : undefined;
|
|
596
|
+
}
|
|
597
|
+
catch (validateErr) {
|
|
598
|
+
req.logger.warn('Admin authorize: API key validation failed', {
|
|
599
|
+
workspaceId,
|
|
600
|
+
error: validateErr instanceof Error ? validateErr.message : validateErr,
|
|
601
|
+
});
|
|
602
|
+
res.redirect(303, completeUrl('error', 'API key validation failed'));
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
if (!identity.uid) {
|
|
606
|
+
res.redirect(303, completeUrl('error', 'API key did not resolve to a user'));
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
if (!identity.emailVerified) {
|
|
610
|
+
// Unverified admin email → Hailer blocks the bot invite (403
|
|
611
|
+
// 'Validate your email.') → reinvite doom loop. Refuse the key
|
|
612
|
+
// until the admin verifies (fail-closed on missing/false).
|
|
613
|
+
req.logger.warn('Admin authorize: email not verified — refusing to persist', {
|
|
614
|
+
workspaceId, adminUid: identity.uid,
|
|
615
|
+
});
|
|
616
|
+
res.redirect(303, completeUrl('error', 'Please verify your Hailer email before connecting this workspace.'));
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
// Authorize the key against the target workspace. This endpoint is
|
|
620
|
+
// reachable publicly via the api.hailer.com /proxy/mcp service, so we
|
|
621
|
+
// must not store a key for a workspace it is not entitled to. The
|
|
622
|
+
// user must be an admin/owner of the TARGET workspace — checked
|
|
623
|
+
// directly via v2.network.get, NOT via identity.workspaceId: that is
|
|
624
|
+
// the key's ambient current-workspace pointer (init.network._id),
|
|
625
|
+
// which follows last-viewed/switchEcosystem and falsely rejects
|
|
626
|
+
// admins whose pointer sits in another workspace.
|
|
627
|
+
if (targetRole !== 'admin' && targetRole !== 'owner') {
|
|
628
|
+
req.logger.warn('Admin authorize: user is not an admin/owner of the target workspace', {
|
|
629
|
+
workspaceId, adminUid: identity.uid, targetRole, ambientWorkspaceId: identity.workspaceId,
|
|
630
|
+
});
|
|
631
|
+
res.redirect(303, completeUrl('error', 'Only workspace admins or owners can connect bot credentials'));
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
// The popup path bypasses webhooks, so stale 'email-not-verified'
|
|
635
|
+
// markers written by earlier webhook rejections never get cleared
|
|
636
|
+
// — AI Hub's pill stays wedged red even with a verified key
|
|
637
|
+
// stored. Sweep BEFORE persisting so /check flips to hasKey only
|
|
638
|
+
// once markers are gone. clearAdminKeyErrors never throws.
|
|
639
|
+
if (adminClient) {
|
|
640
|
+
await (0, webhook_handler_1.clearAdminKeyErrors)(adminClient, workspaceId);
|
|
641
|
+
}
|
|
642
|
+
(0, workspace_admin_store_1.persistAdminCredentials)(workspaceId, apiKey, identity);
|
|
643
|
+
adminCheckCache.delete(workspaceId);
|
|
644
|
+
req.logger.info('Admin credentials stored via authorize flow', {
|
|
645
|
+
workspaceId,
|
|
646
|
+
adminUid: identity.uid,
|
|
647
|
+
});
|
|
648
|
+
res.redirect(303, completeUrl('success'));
|
|
649
|
+
}
|
|
650
|
+
catch (error) {
|
|
651
|
+
req.logger.error('Admin authorize failed', { error });
|
|
652
|
+
res.redirect(303, completeUrl('error', 'Storage failed'));
|
|
653
|
+
}
|
|
654
|
+
});
|
|
414
655
|
// ===== Daemon status endpoint =====
|
|
415
656
|
this.app.get('/daemon/status', (_, res) => {
|
|
416
657
|
if (!this.config.getDaemonStatus) {
|
|
@@ -426,9 +667,9 @@ class MCPServerService {
|
|
|
426
667
|
});
|
|
427
668
|
// ===== Hailer MCP endpoint — Direct API key auth (for Claude Code, mcp-remote, SDK) =====
|
|
428
669
|
// Restored original mcpHandler from pre-Cowork era with BOT_INTERNAL filtering and strict access control
|
|
429
|
-
const mcpHandler = async (req, res, apiKeyOverride) => {
|
|
670
|
+
const mcpHandler = async (req, res, apiKeyOverride, profile) => {
|
|
430
671
|
const apiKey = apiKeyOverride || req.query.apiKey;
|
|
431
|
-
req.logger.debug('MCP request received', { method: req.body?.method, apiKey: apiKey?.slice(0, 8) + '...' });
|
|
672
|
+
req.logger.debug('MCP request received', { method: req.body?.method, apiKey: apiKey?.slice(0, 8) + '...', profile });
|
|
432
673
|
try {
|
|
433
674
|
const mcpRequest = req.body;
|
|
434
675
|
if (!mcpRequest.params) {
|
|
@@ -438,15 +679,18 @@ class MCPServerService {
|
|
|
438
679
|
if (mcpRequest.method === 'tools/list') {
|
|
439
680
|
req.logger.debug('Handling tools/list request');
|
|
440
681
|
let filterConfig;
|
|
441
|
-
|
|
682
|
+
// Resolve effective profile: explicit route override OR session-tracked clientInfo
|
|
683
|
+
const effectiveProfile = this.resolveSessionProfile(req, profile);
|
|
684
|
+
if (effectiveProfile) {
|
|
685
|
+
filterConfig = (0, tool_profiles_1.profileFilterConfig)(effectiveProfile);
|
|
686
|
+
req.logger.debug('Using profile tool allowlist', { profile: effectiveProfile, source: profile ? 'route' : 'clientInfo' });
|
|
687
|
+
}
|
|
688
|
+
if (!effectiveProfile && apiKey) {
|
|
442
689
|
try {
|
|
443
690
|
const agentConfig = this.appConfig.getClientConfig(apiKey);
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
allowedGroups: agentConfig.allowedGroups
|
|
448
|
-
};
|
|
449
|
-
}
|
|
691
|
+
filterConfig = (agentConfig.allowedTools || agentConfig.allowedGroups)
|
|
692
|
+
? { allowedTools: agentConfig.allowedTools, allowedGroups: agentConfig.allowedGroups }
|
|
693
|
+
: undefined;
|
|
450
694
|
}
|
|
451
695
|
catch {
|
|
452
696
|
req.logger.debug('No config found for apiKey, returning all tools');
|
|
@@ -455,15 +699,11 @@ class MCPServerService {
|
|
|
455
699
|
// BOT_INTERNAL filtering: only include if explicitly requested (for daemons)
|
|
456
700
|
const includeBotInternal = mcpRequest.params?.includeBotInternal === true;
|
|
457
701
|
if (!filterConfig) {
|
|
458
|
-
filterConfig =
|
|
459
|
-
|
|
460
|
-
};
|
|
461
|
-
req.logger.debug('Using default tool filter (excludes NUCLEAR and BOT_INTERNAL)');
|
|
462
|
-
}
|
|
463
|
-
else if (filterConfig.allowedGroups) {
|
|
464
|
-
filterConfig.allowedGroups = filterConfig.allowedGroups.filter(g => (includeBotInternal || g !== tool_registry_1.ToolGroup.BOT_INTERNAL) &&
|
|
465
|
-
(config_1.environment.ENABLE_NUCLEAR_TOOLS || g !== tool_registry_1.ToolGroup.NUCLEAR));
|
|
702
|
+
filterConfig = (0, tool_profiles_1.profileFilterConfig)(config_1.environment.MCP_DEFAULT_PROFILE);
|
|
703
|
+
req.logger.debug('Using default profile tool filter', { profile: config_1.environment.MCP_DEFAULT_PROFILE });
|
|
466
704
|
}
|
|
705
|
+
filterConfig.allowedGroups = filterConfig.allowedGroups?.filter(grp => (includeBotInternal || grp !== tool_registry_1.ToolGroup.BOT_INTERNAL) &&
|
|
706
|
+
(config_1.environment.ENABLE_NUCLEAR_TOOLS || grp !== tool_registry_1.ToolGroup.NUCLEAR));
|
|
467
707
|
result = {
|
|
468
708
|
tools: this.toolRegistry.getToolDefinitions(filterConfig)
|
|
469
709
|
};
|
|
@@ -493,13 +733,30 @@ class MCPServerService {
|
|
|
493
733
|
if (!this.canAccessToolStrict(name, apiKey)) {
|
|
494
734
|
return this.sendMcpError(res, mcpRequest.id, -32603, `Access denied to tool: ${name}`, 403);
|
|
495
735
|
}
|
|
736
|
+
// Profile enforcement — explicit route/clientInfo profile, else the
|
|
737
|
+
// default profile when no per-account config governs this key
|
|
738
|
+
if (!this.canAccessToolForProfile(name, apiKey, this.resolveSessionProfile(req, profile))) {
|
|
739
|
+
return this.sendMcpError(res, mcpRequest.id, -32603, `Tool not available in this connection's profile: ${name}`, 403);
|
|
740
|
+
}
|
|
496
741
|
const userContext = await UserContextCache_1.UserContextCache.getContext(apiKey);
|
|
497
742
|
result = await this.toolRegistry.executeTool(name, args, userContext);
|
|
498
743
|
}
|
|
499
744
|
else if (mcpRequest.method === 'initialize') {
|
|
500
745
|
const sessionId = `session-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
|
|
501
746
|
res.setHeader('Mcp-Session-Id', sessionId);
|
|
502
|
-
|
|
747
|
+
const clientInfo = mcpRequest.params?.clientInfo;
|
|
748
|
+
req.logger.info('Client connected', { sessionId, clientInfo });
|
|
749
|
+
// Auto-detect SDK-aware clients (e.g. OpenCode in Hailer Studio sessions)
|
|
750
|
+
if (clientInfo?.name === 'opencode') {
|
|
751
|
+
this.mcpClientProfiles.set(sessionId, { profile: 'sdk', ts: Date.now() });
|
|
752
|
+
// Lazy TTL cleanup — drop entries older than PROFILE_TTL_MS on each insert
|
|
753
|
+
const cutoff = Date.now() - MCPServerService.PROFILE_TTL_MS;
|
|
754
|
+
for (const [sid, entry] of this.mcpClientProfiles) {
|
|
755
|
+
if (entry.ts < cutoff)
|
|
756
|
+
this.mcpClientProfiles.delete(sid);
|
|
757
|
+
}
|
|
758
|
+
req.logger.debug('Assigned sdk profile to session', { sessionId, clientName: clientInfo.name });
|
|
759
|
+
}
|
|
503
760
|
result = {
|
|
504
761
|
protocolVersion: '2024-11-05',
|
|
505
762
|
capabilities: { tools: {} },
|
|
@@ -532,18 +789,25 @@ class MCPServerService {
|
|
|
532
789
|
}
|
|
533
790
|
catch (error) {
|
|
534
791
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
792
|
+
const apiKeyForLog = typeof req.query.apiKey === 'string'
|
|
793
|
+
? req.query.apiKey.slice(0, 8) + '...'
|
|
794
|
+
: undefined;
|
|
535
795
|
if (errorMessage.includes('Multi-workspace credentials detected')) {
|
|
536
|
-
req.logger.warn('Multi-workspace credentials blocked', { apiKey:
|
|
796
|
+
req.logger.warn('Multi-workspace credentials blocked', { apiKey: apiKeyForLog });
|
|
537
797
|
this.sendMcpError(res, req.body?.id || null, -32001, errorMessage, 200);
|
|
538
798
|
}
|
|
539
799
|
else {
|
|
540
|
-
req.logger.error('MCP handler error', error, { apiKey:
|
|
800
|
+
req.logger.error('MCP handler error', error, { apiKey: apiKeyForLog });
|
|
541
801
|
this.sendMcpError(res, req.body?.id || null, -32000, `Server error: ${errorMessage}`, 500);
|
|
542
802
|
}
|
|
543
803
|
}
|
|
544
804
|
};
|
|
545
805
|
// Route 1: /api/mcp?apiKey=xxx (standard format)
|
|
546
806
|
this.app.post('/api/mcp', (req, res) => mcpHandler(req, res));
|
|
807
|
+
// Route 1b: /api/studio/mcp?apiKey=xxx — Studio sessions (SDK-aware tool surface)
|
|
808
|
+
this.app.post('/api/studio/mcp', (req, res) => mcpHandler(req, res, undefined, 'sdk'));
|
|
809
|
+
// Route 1c: /api/sdk/mcp?apiKey=xxx — canonical alias for SDK projects (same surface as Studio)
|
|
810
|
+
this.app.post('/api/sdk/mcp', (req, res) => mcpHandler(req, res, undefined, 'sdk'));
|
|
547
811
|
// Route 2: /:apiKey (simplified format - API key as path)
|
|
548
812
|
// Matches 16-64 char alphanumeric keys, but ONLY for MCP requests (has jsonrpc field)
|
|
549
813
|
this.app.post('/:apiKey([a-zA-Z0-9_-]{16,64})', (req, res, next) => {
|
|
@@ -675,6 +939,10 @@ class MCPServerService {
|
|
|
675
939
|
label: 'Cowork'
|
|
676
940
|
});
|
|
677
941
|
});
|
|
942
|
+
// Public chat (anonymous) — login-page demo chatbot.
|
|
943
|
+
const publicChatRegistered = (0, public_chat_1.registerPublicChatRoutes)(this.app, {
|
|
944
|
+
anthropicApiKey: config_1.environment.ANTHROPIC_API_KEY,
|
|
945
|
+
});
|
|
678
946
|
this.logger.debug('Routes configured', {
|
|
679
947
|
routes: [
|
|
680
948
|
'/health',
|
|
@@ -683,6 +951,10 @@ class MCPServerService {
|
|
|
683
951
|
'/:apiKey (Hailer — API key as path)',
|
|
684
952
|
`${API_PREFIX}/mcp (Cowork — OAuth)`,
|
|
685
953
|
'/api/vipunen (Vipunen — Bearer key)',
|
|
954
|
+
...(publicChatRegistered ? [
|
|
955
|
+
`${public_chat_1.PUBLIC_CHAT_ROUTE} (public chat — anonymous)`,
|
|
956
|
+
`${public_chat_1.PUBLIC_CHAT_AUTHORIZE_ROUTE} (public chat — graduation)`,
|
|
957
|
+
] : []),
|
|
686
958
|
'/.well-known/oauth-authorization-server',
|
|
687
959
|
'/.well-known/oauth-protected-resource',
|
|
688
960
|
`${API_PREFIX}/oauth/register`,
|
|
@@ -718,14 +990,15 @@ class MCPServerService {
|
|
|
718
990
|
return `${prefix}-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
|
|
719
991
|
}
|
|
720
992
|
/**
|
|
721
|
-
|
|
722
|
-
|
|
993
|
+
* Strict access control for /api/mcp — returns false on catch (no config = no access)
|
|
994
|
+
*/
|
|
723
995
|
canAccessToolStrict(toolName, apiKey) {
|
|
724
996
|
// User API Keys aren't in CLIENT_CONFIGS — apply permissive access (non-NUCLEAR)
|
|
725
997
|
if (apiKey.startsWith('userapikey_')) {
|
|
726
998
|
const tool = this.toolRegistry.getTool(toolName);
|
|
727
|
-
if (!tool)
|
|
999
|
+
if (!tool) {
|
|
728
1000
|
return false;
|
|
1001
|
+
}
|
|
729
1002
|
if (tool.group === tool_registry_1.ToolGroup.NUCLEAR && !config_1.environment.ENABLE_NUCLEAR_TOOLS) {
|
|
730
1003
|
return false;
|
|
731
1004
|
}
|
|
@@ -747,8 +1020,8 @@ class MCPServerService {
|
|
|
747
1020
|
}
|
|
748
1021
|
}
|
|
749
1022
|
/**
|
|
750
|
-
|
|
751
|
-
|
|
1023
|
+
* Permissive access control for Cowork — allows non-NUCLEAR tools on catch (OAuth sessions)
|
|
1024
|
+
*/
|
|
752
1025
|
canAccessToolPermissive(toolName, apiKey) {
|
|
753
1026
|
try {
|
|
754
1027
|
const agentConfig = this.appConfig.getClientConfig(apiKey);
|
|
@@ -763,8 +1036,9 @@ class MCPServerService {
|
|
|
763
1036
|
}
|
|
764
1037
|
catch {
|
|
765
1038
|
const tool = this.toolRegistry.getTool(toolName);
|
|
766
|
-
if (!tool)
|
|
1039
|
+
if (!tool) {
|
|
767
1040
|
return false;
|
|
1041
|
+
}
|
|
768
1042
|
if (tool.group === tool_registry_1.ToolGroup.NUCLEAR && !config_1.environment.ENABLE_NUCLEAR_TOOLS) {
|
|
769
1043
|
return false;
|
|
770
1044
|
}
|
|
@@ -772,9 +1046,53 @@ class MCPServerService {
|
|
|
772
1046
|
}
|
|
773
1047
|
}
|
|
774
1048
|
/**
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
1049
|
+
* Resolve the connection's tool profile: explicit route override first,
|
|
1050
|
+
* else the session-tracked profile assigned at MCP initialize (clientInfo).
|
|
1051
|
+
*/
|
|
1052
|
+
resolveSessionProfile(req, routeProfile) {
|
|
1053
|
+
if (routeProfile) {
|
|
1054
|
+
return routeProfile;
|
|
1055
|
+
}
|
|
1056
|
+
const sessionHeader = req.headers['mcp-session-id'];
|
|
1057
|
+
const sessionId = Array.isArray(sessionHeader) ? sessionHeader[0] : sessionHeader;
|
|
1058
|
+
if (!sessionId) {
|
|
1059
|
+
return undefined;
|
|
1060
|
+
}
|
|
1061
|
+
const entry = this.mcpClientProfiles.get(sessionId);
|
|
1062
|
+
if (entry && Date.now() - entry.ts < MCPServerService.PROFILE_TTL_MS) {
|
|
1063
|
+
return entry.profile;
|
|
1064
|
+
}
|
|
1065
|
+
return undefined;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Profile enforcement for tools/call. An explicit route/clientInfo profile
|
|
1069
|
+
* always governs. Otherwise per-account allowedTools/allowedGroups config
|
|
1070
|
+
* takes precedence (already enforced by canAccessToolStrict/Permissive);
|
|
1071
|
+
* keys without explicit config fall back to the server's default profile.
|
|
1072
|
+
*/
|
|
1073
|
+
canAccessToolForProfile(toolName, apiKey, explicitProfile) {
|
|
1074
|
+
const tool = this.toolRegistry.getTool(toolName);
|
|
1075
|
+
if (!tool) {
|
|
1076
|
+
return false;
|
|
1077
|
+
}
|
|
1078
|
+
if (explicitProfile) {
|
|
1079
|
+
return (0, tool_profiles_1.isToolAllowedForProfile)(explicitProfile, tool);
|
|
1080
|
+
}
|
|
1081
|
+
try {
|
|
1082
|
+
const agentConfig = this.appConfig.getClientConfig(apiKey);
|
|
1083
|
+
if (agentConfig.allowedTools || agentConfig.allowedGroups) {
|
|
1084
|
+
return true;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
catch {
|
|
1088
|
+
// No per-account config — default profile governs
|
|
1089
|
+
}
|
|
1090
|
+
return (0, tool_profiles_1.isToolAllowedForProfile)(config_1.environment.MCP_DEFAULT_PROFILE, tool);
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Cowork MCP JSON-RPC handler for /api/cowork/mcp (OAuth multi-user).
|
|
1094
|
+
* Permissive access control, contextType filter, OAuth 401 flow.
|
|
1095
|
+
*/
|
|
778
1096
|
async handleCoworkMcp(req, res, options) {
|
|
779
1097
|
req.logger.debug(`${options.label} MCP request received`, { method: req.body?.method });
|
|
780
1098
|
try {
|
|
@@ -805,14 +1123,10 @@ class MCPServerService {
|
|
|
805
1123
|
}
|
|
806
1124
|
}
|
|
807
1125
|
if (!filterConfig) {
|
|
808
|
-
filterConfig =
|
|
809
|
-
|
|
810
|
-
};
|
|
811
|
-
req.logger.debug('Using default tool filter (excludes NUCLEAR)');
|
|
812
|
-
}
|
|
813
|
-
else if (filterConfig.allowedGroups) {
|
|
814
|
-
filterConfig.allowedGroups = filterConfig.allowedGroups.filter(g => (config_1.environment.ENABLE_NUCLEAR_TOOLS || g !== tool_registry_1.ToolGroup.NUCLEAR));
|
|
1126
|
+
filterConfig = (0, tool_profiles_1.profileFilterConfig)(config_1.environment.MCP_DEFAULT_PROFILE);
|
|
1127
|
+
req.logger.debug('Using default profile tool filter', { profile: config_1.environment.MCP_DEFAULT_PROFILE });
|
|
815
1128
|
}
|
|
1129
|
+
filterConfig.allowedGroups = filterConfig.allowedGroups?.filter(grp => (config_1.environment.ENABLE_NUCLEAR_TOOLS || grp !== tool_registry_1.ToolGroup.NUCLEAR));
|
|
816
1130
|
result = {
|
|
817
1131
|
tools: this.toolRegistry.getToolDefinitions(filterConfig)
|
|
818
1132
|
.filter((def) => {
|
|
@@ -847,6 +1161,11 @@ class MCPServerService {
|
|
|
847
1161
|
if (!this.canAccessToolPermissive(name, apiKey)) {
|
|
848
1162
|
return this.sendMcpError(res, mcpRequest.id, -32603, `Access denied to tool: ${name}`, 403);
|
|
849
1163
|
}
|
|
1164
|
+
// Profile enforcement — Cowork has no route/clientInfo profile, so
|
|
1165
|
+
// per-account config governs, else the default profile
|
|
1166
|
+
if (!this.canAccessToolForProfile(name, apiKey)) {
|
|
1167
|
+
return this.sendMcpError(res, mcpRequest.id, -32603, `Tool not available in this connection's profile: ${name}`, 403);
|
|
1168
|
+
}
|
|
850
1169
|
if (contextType === 'none') {
|
|
851
1170
|
return this.sendMcpError(res, mcpRequest.id, -32602, `Tool not found: ${name}`, 404);
|
|
852
1171
|
}
|
|
@@ -894,8 +1213,8 @@ class MCPServerService {
|
|
|
894
1213
|
}
|
|
895
1214
|
}
|
|
896
1215
|
/**
|
|
897
|
-
|
|
898
|
-
|
|
1216
|
+
* Send MCP success response via SSE
|
|
1217
|
+
*/
|
|
899
1218
|
sendMcpResult(res, id, result) {
|
|
900
1219
|
const response = { jsonrpc: '2.0', result, id };
|
|
901
1220
|
res.setHeader('Content-Type', 'text/event-stream');
|
|
@@ -905,8 +1224,8 @@ class MCPServerService {
|
|
|
905
1224
|
res.end();
|
|
906
1225
|
}
|
|
907
1226
|
/**
|
|
908
|
-
|
|
909
|
-
|
|
1227
|
+
* Send MCP error response
|
|
1228
|
+
*/
|
|
910
1229
|
sendMcpError(res, id, code, message, httpStatus) {
|
|
911
1230
|
const errorResponse = {
|
|
912
1231
|
jsonrpc: '2.0',
|