@hotmeshio/long-tail 0.23.2 → 0.24.1
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/build/adapters/express.d.ts +11 -1
- package/build/adapters/express.js +42 -41
- package/build/api/auth-sso.d.ts +1 -1
- package/build/api/bot-accounts.d.ts +2 -0
- package/build/api/bot-accounts.js +4 -0
- package/build/api/capabilities.d.ts +7 -2
- package/build/api/capabilities.js +13 -2
- package/build/api/escalations/analytics.js +5 -0
- package/build/api/escalations/bulk.d.ts +2 -0
- package/build/api/escalations/bulk.js +9 -4
- package/build/api/escalations/helpers.d.ts +5 -0
- package/build/api/escalations/helpers.js +7 -0
- package/build/api/escalations/metadata.js +3 -0
- package/build/api/escalations/single.d.ts +3 -2
- package/build/api/escalations/single.js +8 -3
- package/build/api/mcp/tools.d.ts +12 -0
- package/build/api/mcp/tools.js +113 -9
- package/build/api/scan-codes/choice.js +31 -7
- package/build/api/settings.js +9 -0
- package/build/api/tasks.d.ts +3 -3
- package/build/api/tasks.js +30 -7
- package/build/api/workflows/input-lookups.js +1 -1
- package/build/api/workflows/invocable.js +2 -2
- package/build/api/workflows/invocation.js +1 -1
- package/build/api/yaml-workflows/cron.d.ts +3 -2
- package/build/api/yaml-workflows/cron.js +6 -1
- package/build/api/yaml-workflows/deploy.d.ts +15 -2
- package/build/api/yaml-workflows/deploy.js +69 -2
- package/build/lib/db/schemas/038_oauth_server.sql +46 -0
- package/build/lib/db/schemas/039_nats_ws_tickets.sql +12 -0
- package/build/lib/events/browser-view.d.ts +20 -0
- package/build/lib/events/browser-view.js +117 -0
- package/build/lib/events/nats-ws-filter.d.ts +29 -0
- package/build/lib/events/nats-ws-filter.js +109 -0
- package/build/lib/events/nats-ws-proxy.d.ts +7 -0
- package/build/lib/events/nats-ws-proxy.js +86 -7
- package/build/lib/events/nats-ws-server-filter.d.ts +16 -0
- package/build/lib/events/nats-ws-server-filter.js +56 -0
- package/build/lib/events/nats-ws-ticket.d.ts +19 -0
- package/build/lib/events/nats-ws-ticket.js +63 -0
- package/build/lib/events/socketio.d.ts +10 -1
- package/build/lib/events/socketio.js +10 -3
- package/build/lib/http/index.d.ts +27 -0
- package/build/lib/http/index.js +55 -0
- package/build/modules/auth.d.ts +15 -24
- package/build/modules/auth.js +43 -126
- package/build/modules/capabilities.d.ts +62 -0
- package/build/modules/capabilities.js +188 -0
- package/build/modules/config.d.ts +19 -0
- package/build/modules/config.js +27 -0
- package/build/modules/defaults.d.ts +10 -0
- package/build/modules/defaults.js +12 -1
- package/build/modules/maintenance.d.ts +2 -0
- package/build/modules/maintenance.js +7 -0
- package/build/modules/mcp-auth.d.ts +11 -0
- package/build/modules/mcp-auth.js +56 -0
- package/build/modules/oauth-server.d.ts +18 -0
- package/build/modules/oauth-server.js +40 -0
- package/build/routes/agents.js +47 -14
- package/build/routes/announcements.js +2 -2
- package/build/routes/auth-sso.js +2 -2
- package/build/routes/auth.js +2 -2
- package/build/routes/bot-accounts.js +26 -3
- package/build/routes/capabilities.js +4 -4
- package/build/routes/controlplane.js +2 -2
- package/build/routes/dba.js +2 -2
- package/build/routes/delegation.js +2 -2
- package/build/routes/diagnostics.js +2 -2
- package/build/routes/docs.js +2 -2
- package/build/routes/domain.js +2 -2
- package/build/routes/escalations/accumulate.d.ts +1 -1
- package/build/routes/escalations/acting.d.ts +1 -1
- package/build/routes/escalations/analytics.d.ts +1 -1
- package/build/routes/escalations/bulk.d.ts +1 -1
- package/build/routes/escalations/facets.d.ts +1 -1
- package/build/routes/escalations/index.js +2 -2
- package/build/routes/escalations/list.d.ts +1 -1
- package/build/routes/escalations/metadata.d.ts +1 -1
- package/build/routes/escalations/related.d.ts +1 -1
- package/build/routes/escalations/resolve.d.ts +1 -1
- package/build/routes/escalations/single.d.ts +1 -1
- package/build/routes/escalations/single.js +1 -1
- package/build/routes/exports.js +14 -13
- package/build/routes/file-browser.js +9 -8
- package/build/routes/files.js +2 -2
- package/build/routes/index.js +4 -2
- package/build/routes/insight.js +5 -4
- package/build/routes/knowledge.js +2 -2
- package/build/routes/maintenance.js +2 -2
- package/build/routes/mcp-endpoint.d.ts +3 -1
- package/build/routes/mcp-endpoint.js +18 -8
- package/build/routes/mcp.js +35 -15
- package/build/routes/me.js +2 -2
- package/build/routes/namespaces.js +4 -3
- package/build/routes/nats-credentials.js +27 -3
- package/build/routes/oauth-server/authorize.d.ts +2 -0
- package/build/routes/oauth-server/authorize.js +110 -0
- package/build/routes/oauth-server/grants.d.ts +2 -0
- package/build/routes/oauth-server/grants.js +35 -0
- package/build/routes/oauth-server/index.d.ts +8 -0
- package/build/routes/oauth-server/index.js +52 -0
- package/build/routes/oauth-server/registration.d.ts +2 -0
- package/build/routes/oauth-server/registration.js +38 -0
- package/build/routes/oauth-server/token.d.ts +2 -0
- package/build/routes/oauth-server/token.js +100 -0
- package/build/routes/oauth-well-known.d.ts +8 -0
- package/build/routes/oauth-well-known.js +31 -0
- package/build/routes/oauth.js +2 -2
- package/build/routes/overview.js +2 -2
- package/build/routes/personas.js +2 -2
- package/build/routes/pipelines.js +6 -5
- package/build/routes/roles.js +2 -2
- package/build/routes/scan-codes.js +2 -2
- package/build/routes/settings.js +2 -2
- package/build/routes/tasks.js +5 -5
- package/build/routes/topics.js +21 -9
- package/build/routes/users.js +25 -22
- package/build/routes/workflow-sets.js +13 -12
- package/build/routes/workflows/config.js +15 -2
- package/build/routes/workflows/discovery.js +2 -2
- package/build/routes/workflows/index.js +2 -2
- package/build/routes/workflows/invocation.js +11 -10
- package/build/routes/yaml-workflows/cron.js +20 -7
- package/build/routes/yaml-workflows/crud.js +13 -12
- package/build/routes/yaml-workflows/deployment.js +11 -10
- package/build/routes/yaml-workflows/index.js +2 -2
- package/build/routes/yaml-workflows/versions.js +2 -2
- package/build/services/agent/authority.d.ts +15 -0
- package/build/services/agent/authority.js +59 -0
- package/build/services/agent/trigger-registry.js +7 -2
- package/build/services/auth/bot-api-key.d.ts +2 -0
- package/build/services/auth/bot-api-key.js +10 -0
- package/build/services/auth/oauth-server/access-token.d.ts +36 -0
- package/build/services/auth/oauth-server/access-token.js +80 -0
- package/build/services/auth/oauth-server/authorization.d.ts +47 -0
- package/build/services/auth/oauth-server/authorization.js +54 -0
- package/build/services/auth/oauth-server/constants.d.ts +11 -0
- package/build/services/auth/oauth-server/constants.js +16 -0
- package/build/services/auth/oauth-server/index.d.ts +3 -0
- package/build/services/auth/oauth-server/index.js +27 -0
- package/build/services/auth/oauth-server/metadata.d.ts +21 -0
- package/build/services/auth/oauth-server/metadata.js +53 -0
- package/build/services/auth/oauth-server/registration.d.ts +42 -0
- package/build/services/auth/oauth-server/registration.js +134 -0
- package/build/services/auth/oauth-server/sql.d.ts +50 -0
- package/build/services/auth/oauth-server/sql.js +156 -0
- package/build/services/auth/oauth-server/store.d.ts +88 -0
- package/build/services/auth/oauth-server/store.js +171 -0
- package/build/services/auth/sql.d.ts +1 -0
- package/build/services/auth/sql.js +3 -1
- package/build/services/cron/index.js +5 -3
- package/build/services/escalation/queries.js +7 -2
- package/build/services/export/index.d.ts +10 -0
- package/build/services/export/index.js +27 -0
- package/build/services/invocation-access.d.ts +25 -4
- package/build/services/invocation-access.js +39 -7
- package/build/services/maintenance/index.js +8 -0
- package/build/services/mcp/client/connection-dispatch.d.ts +6 -1
- package/build/services/mcp/client/connection-dispatch.js +3 -2
- package/build/services/mcp/client/connection-lifecycle.d.ts +10 -2
- package/build/services/mcp/client/connection-lifecycle.js +45 -7
- package/build/services/mcp/client/connection-test.js +2 -6
- package/build/services/mcp/client/connection.d.ts +1 -1
- package/build/services/mcp/client/connection.js +3 -1
- package/build/services/mcp/client/index.d.ts +2 -2
- package/build/services/mcp/client/index.js +4 -1
- package/build/services/mcp/client/network-transport.d.ts +12 -0
- package/build/services/mcp/client/network-transport.js +20 -0
- package/build/services/mcp/client/tools.d.ts +13 -0
- package/build/services/mcp/client/tools.js +18 -0
- package/build/services/mcp/db-server/index.js +2 -1
- package/build/services/mcp/external-server.d.ts +9 -4
- package/build/services/mcp/external-server.js +34 -11
- package/build/services/mcp/playwright-server/index.js +2 -1
- package/build/services/mcp/registered-tools.d.ts +3 -0
- package/build/services/mcp/registered-tools.js +7 -0
- package/build/services/mcp/seed-service-account.d.ts +4 -1
- package/build/services/mcp/seed-service-account.js +11 -6
- package/build/services/mcp/server-lifecycle.js +2 -1
- package/build/services/workflow-invocation.d.ts +16 -3
- package/build/services/workflow-invocation.js +42 -10
- package/build/services/yaml-workflow/deployer.d.ts +10 -2
- package/build/services/yaml-workflow/deployer.js +17 -5
- package/build/services/yaml-workflow/invoke.js +31 -26
- package/build/services/yaml-workflow/workers/register.js +3 -13
- package/build/services/yaml-workflow/workers/step-tool.d.ts +7 -0
- package/build/services/yaml-workflow/workers/step-tool.js +69 -0
- package/build/start/config.js +7 -0
- package/build/start/index.js +4 -22
- package/build/start/server.d.ts +6 -4
- package/build/start/server.js +11 -35
- package/build/start/socket-auth.js +2 -1
- package/build/start/workers.js +1 -1
- package/build/system/mcp-servers/admin/agent-subscriptions.js +25 -1
- package/build/system/mcp-servers/admin/agents.js +25 -2
- package/build/system/mcp-servers/admin/announcements.js +3 -2
- package/build/system/mcp-servers/admin/bot-accounts.js +37 -5
- package/build/system/mcp-servers/admin/escalations.d.ts +3 -5
- package/build/system/mcp-servers/admin/escalations.js +74 -70
- package/build/system/mcp-servers/admin/exports.js +7 -1
- package/build/system/mcp-servers/admin/index.js +24 -25
- package/build/system/mcp-servers/admin/overview.d.ts +2 -2
- package/build/system/mcp-servers/admin/run-read.d.ts +2 -0
- package/build/system/mcp-servers/admin/run-read.js +5 -0
- package/build/system/mcp-servers/admin/scan-codes.d.ts +2 -2
- package/build/system/mcp-servers/admin/scan-codes.js +5 -11
- package/build/system/mcp-servers/admin/schemas.d.ts +26 -26
- package/build/system/mcp-servers/admin/tasks.js +7 -2
- package/build/system/mcp-servers/admin/users.js +31 -4
- package/build/system/mcp-servers/admin/workflow-config.js +12 -1
- package/build/system/mcp-servers/admin/workflows.js +27 -5
- package/build/system/mcp-servers/admin/yaml-workflows.js +13 -21
- package/build/system/mcp-servers/caller-auth.d.ts +18 -0
- package/build/system/mcp-servers/caller-auth.js +29 -0
- package/build/system/mcp-servers/claude-code.js +2 -1
- package/build/system/mcp-servers/db-query/index.js +2 -1
- package/build/system/mcp-servers/file-storage.js +2 -1
- package/build/system/mcp-servers/http-fetch.js +2 -1
- package/build/system/mcp-servers/human-queue.js +7 -3
- package/build/system/mcp-servers/oauth.js +31 -4
- package/build/system/mcp-servers/schema-exchange.js +2 -1
- package/build/system/mcp-servers/vision.d.ts +1 -0
- package/build/system/mcp-servers/vision.js +17 -7
- package/build/system/mcp-servers/workflow.js +13 -25
- package/build/system/seed/tool-manifests-admin.d.ts +2 -17985
- package/build/system/seed/tool-manifests-admin.js +121 -121
- package/build/system/seed/tool-manifests-data.d.ts +8 -374
- package/build/system/seed/tool-manifests-data.js +22 -4
- package/build/system/seed/tool-manifests-escalation.d.ts +2 -352
- package/build/system/seed/tool-manifests-escalation.js +11 -1
- package/build/system/seed/tool-manifests-events.d.ts +2 -116
- package/build/system/seed/tool-manifests-events.js +6 -2
- package/build/system/seed/tool-manifests-knowledge.d.ts +2 -221
- package/build/system/seed/tool-manifests-knowledge.js +41 -1
- package/build/system/seed/tool-manifests-workflows.d.ts +2 -71
- package/build/system/seed/tool-manifests-workflows.js +3 -1
- package/build/system/workflows/shared/principal-tools.d.ts +20 -0
- package/build/system/workflows/shared/principal-tools.js +64 -0
- package/build/system/workflows/shared/tool-executor.js +21 -11
- package/build/system/workflows/shared/tool-loader.js +8 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/auth.d.ts +1 -1
- package/build/types/capability.d.ts +14 -0
- package/build/types/capability.js +2 -0
- package/build/types/events.d.ts +1 -1
- package/build/types/index.d.ts +3 -1
- package/build/types/maintenance.d.ts +2 -2
- package/build/types/mcp.d.ts +3 -1
- package/build/types/oauth-server.d.ts +52 -0
- package/build/types/oauth-server.js +2 -0
- package/build/types/startup.d.ts +15 -7
- package/build/vitest.config.js +2 -1
- package/build/vitest.fast.config.d.ts +2 -0
- package/build/vitest.fast.config.js +20 -0
- package/build/vitest.llm.config.d.ts +2 -0
- package/build/vitest.llm.config.js +16 -0
- package/dashboard/dist/assets/{AdminDashboard-BPWsgMfZ.js → AdminDashboard-B3mkMIOT.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-BPWsgMfZ.js.map → AdminDashboard-B3mkMIOT.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-De9imyo5.js → AgentConfigPage-CQj2B678.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-De9imyo5.js.map → AgentConfigPage-CQj2B678.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-B6o96Y5G.js → AgentDetailPage-CzrD8JJI.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-B6o96Y5G.js.map → AgentDetailPage-CzrD8JJI.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-DMEmiK_W.js → AgentsPage-jg2OFwyW.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-DMEmiK_W.js.map → AgentsPage-jg2OFwyW.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-DeYMngwE.js → AvailableEscalationsPage-IS28XBRe.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-DeYMngwE.js.map → AvailableEscalationsPage-IS28XBRe.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-DDmpgGHZ.js → BotPicker-DvEJFpwS.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-DDmpgGHZ.js.map → BotPicker-DvEJFpwS.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-BqlklomG.js → BulkAssignModal-BoQCi-YC.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-BqlklomG.js.map → BulkAssignModal-BoQCi-YC.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-DOtjDTbK.js → CapabilitiesPage-kwlrcb_t.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-DOtjDTbK.js.map → CapabilitiesPage-kwlrcb_t.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-CLr8LP0V.js → CollapsibleSection-UMIV4KIj.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-CLr8LP0V.js.map → CollapsibleSection-UMIV4KIj.js.map} +1 -1
- package/dashboard/dist/assets/ConfirmDeleteModal-C5puwMg7.js +2 -0
- package/dashboard/dist/assets/ConfirmDeleteModal-C5puwMg7.js.map +1 -0
- package/dashboard/dist/assets/ConnectedAppsPage-drZa65kP.js +2 -0
- package/dashboard/dist/assets/ConnectedAppsPage-drZa65kP.js.map +1 -0
- package/dashboard/dist/assets/{CountdownTimer-DxX72PwV.js → CountdownTimer-LG03dVgR.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-DxX72PwV.js.map → CountdownTimer-LG03dVgR.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-CObc9Rs5.js → CredentialsPage-CaFQ6vLb.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-CObc9Rs5.js.map → CredentialsPage-CaFQ6vLb.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-Bb8GoNY5.js → CronLabel-Co5j7tzW.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-Bb8GoNY5.js.map → CronLabel-Co5j7tzW.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-CmGhVlYl.js → ElapsedCell-WJyE9G0T.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-CmGhVlYl.js.map → ElapsedCell-WJyE9G0T.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-B4Jwy1w3.js → EntityTimelinePanel-CDFFfX9d.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-B4Jwy1w3.js.map → EntityTimelinePanel-CDFFfX9d.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-CZZbZ4Aa.js → EscalationListSchemaPage-CMrUlaKI.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-CZZbZ4Aa.js.map → EscalationListSchemaPage-CMrUlaKI.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-D0ko59_S.js → EscalationSchemaPage-Dx2Lyfrz.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-D0ko59_S.js.map → EscalationSchemaPage-Dx2Lyfrz.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTimeline-BcnJEKFD.js → EscalationTimeline-d3nvshOk.js} +2 -2
- package/dashboard/dist/assets/{EscalationTimeline-BcnJEKFD.js.map → EscalationTimeline-d3nvshOk.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTitleSelect-P0q5sck4.js → EscalationTitleSelect-DWQieOM9.js} +2 -2
- package/dashboard/dist/assets/{EscalationTitleSelect-P0q5sck4.js.map → EscalationTitleSelect-DWQieOM9.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-BLPmh4AF.js → EscalationsOverview-BX8Cpi0X.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-BLPmh4AF.js.map → EscalationsOverview-BX8Cpi0X.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-gBzi5tIS.js → EventTable-D1-ITVXS.js} +2 -2
- package/dashboard/dist/assets/{EventTable-gBzi5tIS.js.map → EventTable-D1-ITVXS.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-BulSsWb2.js → FilterBar-ABC9ctin.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-BulSsWb2.js.map → FilterBar-ABC9ctin.js.map} +1 -1
- package/dashboard/dist/assets/{FormattedValue-BMHRrvrL.js → FormattedValue-k27T4bG7.js} +2 -2
- package/dashboard/dist/assets/{FormattedValue-BMHRrvrL.js.map → FormattedValue-k27T4bG7.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage--997yNRr.js → GraphInvokePage-DKUErxWc.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage--997yNRr.js.map → GraphInvokePage-DKUErxWc.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-CwXFz--v.js → HomePage-C6u9dIpR.js} +2 -2
- package/dashboard/dist/assets/{HomePage-CwXFz--v.js.map → HomePage-C6u9dIpR.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-Df4qZryJ.js → ListToolbar-gA5rFzkz.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-Df4qZryJ.js.map → ListToolbar-gA5rFzkz.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-DrogIAKJ.js → McpOverview-BOPo3J_i.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-DrogIAKJ.js.map → McpOverview-BOPo3J_i.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-CJmvCAE6.js → McpQueryDetailPage-BRVVi0Zh.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-CJmvCAE6.js.map → McpQueryDetailPage-BRVVi0Zh.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-lygo4Yq0.js → McpQueryPage-Dmbb6SAc.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-lygo4Yq0.js.map → McpQueryPage-Dmbb6SAc.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-hvns2sCm.js → McpRunDetailPage-bMXNO-6V.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-hvns2sCm.js.map → McpRunDetailPage-bMXNO-6V.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-C2_7spTX.js → McpRunsPage-Bi9AMWja.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-C2_7spTX.js.map → McpRunsPage-Bi9AMWja.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-BlK8WlsY.js → OperationsPage-CvR74ZUJ.js} +3 -3
- package/dashboard/dist/assets/{OperationsPage-BlK8WlsY.js.map → OperationsPage-CvR74ZUJ.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-BeWBiMGX.js → OperatorDashboard-DctmZw10.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-BeWBiMGX.js.map → OperatorDashboard-DctmZw10.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-CNHpsX_i.js → PersonaDetailPage-Ubqm2rQH.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-CNHpsX_i.js.map → PersonaDetailPage-Ubqm2rQH.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-ChASEZRg.js → PersonasPage-BpFL2rpo.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-ChASEZRg.js.map → PersonasPage-BpFL2rpo.js.map} +1 -1
- package/dashboard/dist/assets/{PortalPage-D5Lk-PKF.js → PortalPage-Dfc_Q02R.js} +2 -2
- package/dashboard/dist/assets/{PortalPage-D5Lk-PKF.js.map → PortalPage-Dfc_Q02R.js.map} +1 -1
- package/dashboard/dist/assets/ProcessDetailPage-liJspvQh.js +2 -0
- package/dashboard/dist/assets/{ProcessDetailPage-DNgCIwRl.js.map → ProcessDetailPage-liJspvQh.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-pRjWuWlH.js → ProcessesListPage-C3OM5ZUy.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-pRjWuWlH.js.map → ProcessesListPage-C3OM5ZUy.js.map} +1 -1
- package/dashboard/dist/assets/ResolverForm-B1_x8Blv.js +8 -0
- package/dashboard/dist/assets/ResolverForm-B1_x8Blv.js.map +1 -0
- package/dashboard/dist/assets/{RoleDetailPage-Bh_UcfYY.js → RoleDetailPage-CrlYCh-R.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-Bh_UcfYY.js.map → RoleDetailPage-CrlYCh-R.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-CK17N7zz.js → RolesPage-BaazL_pt.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-CK17N7zz.js.map → RolesPage-BaazL_pt.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-BEKUP0p2.js → RunAsSelector-DxuV0fa1.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-BEKUP0p2.js.map → RunAsSelector-DxuV0fa1.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-Bd0Pflqx.js → ScanCodesPage-C0mvmYTq.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-Bd0Pflqx.js.map → ScanCodesPage-C0mvmYTq.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-CnuhozmJ.js → ScanSchemeDetailPage-CiJgt5dZ.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-CnuhozmJ.js.map → ScanSchemeDetailPage-CiJgt5dZ.js.map} +1 -1
- package/dashboard/dist/assets/{ScanStationPage-CoLc-q3h.js → ScanStationPage-DzGaXc40.js} +2 -2
- package/dashboard/dist/assets/{ScanStationPage-CoLc-q3h.js.map → ScanStationPage-DzGaXc40.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-COrfvkBi.js → StickyPagination-CqbjVY6T.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-COrfvkBi.js.map → StickyPagination-CqbjVY6T.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-Cif2egLy.js → StreamMessageDetail-wX3i0aqs.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-Cif2egLy.js.map → StreamMessageDetail-wX3i0aqs.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BnZYTrAh.js → SwimlaneTimeline-C50PsFoV.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BnZYTrAh.js.map → SwimlaneTimeline-C50PsFoV.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-DEz_dqyR.js → TaskDetailPage-bbNSv4Ae.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-DEz_dqyR.js.map → TaskDetailPage-bbNSv4Ae.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-oEfEGj0_.js → TasksListPage-CDWnm_d9.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-oEfEGj0_.js.map → TasksListPage-CDWnm_d9.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-Dz5TgZZZ.js → TimeAgo-BLjqlfoX.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-Dz5TgZZZ.js.map → TimeAgo-BLjqlfoX.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-BUTgE244.js → TimestampCell-CnW0ENb5.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-BUTgE244.js.map → TimestampCell-CnW0ENb5.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-BS4g6vt-.js → ToolTestPanel-DkMgCB-k.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-BS4g6vt-.js.map → ToolTestPanel-DkMgCB-k.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-C_I6JIVD.js → TopicDetailPage-g3pljKKX.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-C_I6JIVD.js.map → TopicDetailPage-g3pljKKX.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-Cr6-wfhJ.js → TopicsPage-CVcCYdy-.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-Cr6-wfhJ.js.map → TopicsPage-CVcCYdy-.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-ZFpWMaFF.js → UserName-D6zGIK2i.js} +2 -2
- package/dashboard/dist/assets/{UserName-ZFpWMaFF.js.map → UserName-D6zGIK2i.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-ByPixDZW.js → WorkflowExecutionPage-B8g81FCJ.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-ByPixDZW.js.map → WorkflowExecutionPage-B8g81FCJ.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-CWsJdMdR.js → WorkflowsDashboard-nxT3bv6W.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-CWsJdMdR.js.map → WorkflowsDashboard-nxT3bv6W.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-Dk9gyqZN.js → WorkflowsOverview-grI-KAI2.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-Dk9gyqZN.js.map → WorkflowsOverview-grI-KAI2.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CHwcrsaT.js → YamlWorkflowDetailPage-BoZ-hfBE.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CHwcrsaT.js.map → YamlWorkflowDetailPage-BoZ-hfBE.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-B5jRX2Ph.js → YamlWorkflowsPage-Bf04rwRv.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-B5jRX2Ph.js.map → YamlWorkflowsPage-Bf04rwRv.js.map} +1 -1
- package/dashboard/dist/assets/{agents-Dd7E-27d.js → agents-Dphpdi8l.js} +2 -2
- package/dashboard/dist/assets/{agents-Dd7E-27d.js.map → agents-Dphpdi8l.js.map} +1 -1
- package/dashboard/dist/assets/{bots-CpaYjZTk.js → bots-DIFE298x.js} +2 -2
- package/dashboard/dist/assets/{bots-CpaYjZTk.js.map → bots-DIFE298x.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-CNjg_qv1.js → capabilities-D7Y7LClY.js} +2 -2
- package/dashboard/dist/assets/{capabilities-CNjg_qv1.js.map → capabilities-D7Y7LClY.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-DgmvnAtU.js → controlplane-D1TGcYsS.js} +2 -2
- package/dashboard/dist/assets/{controlplane-DgmvnAtU.js.map → controlplane-D1TGcYsS.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-Uj4U9g5H.js → escalation-columns-cwZE6xyo.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-Uj4U9g5H.js.map → escalation-columns-cwZE6xyo.js.map} +1 -1
- package/dashboard/dist/assets/{index-x5z73M9N.js → index-BzYcUPdD.js} +2 -2
- package/dashboard/dist/assets/{index-x5z73M9N.js.map → index-BzYcUPdD.js.map} +1 -1
- package/dashboard/dist/assets/index-CeCtqujG.js +67 -0
- package/dashboard/dist/assets/index-CeCtqujG.js.map +1 -0
- package/dashboard/dist/assets/{index-RIFT3RlO.js → index-ChV7pBjM.js} +2 -2
- package/dashboard/dist/assets/{index-RIFT3RlO.js.map → index-ChV7pBjM.js.map} +1 -1
- package/dashboard/dist/assets/{index-OfO0173w.js → index-CniRa65p.js} +2 -2
- package/dashboard/dist/assets/{index-OfO0173w.js.map → index-CniRa65p.js.map} +1 -1
- package/dashboard/dist/assets/{index-ByBy9M3L.js → index-CxdjT1Yk.js} +2 -2
- package/dashboard/dist/assets/{index-ByBy9M3L.js.map → index-CxdjT1Yk.js.map} +1 -1
- package/dashboard/dist/assets/{index-C_K7OlzT.js → index-DAvi5_2T.js} +2 -2
- package/dashboard/dist/assets/{index-C_K7OlzT.js.map → index-DAvi5_2T.js.map} +1 -1
- package/dashboard/dist/assets/{index-BrwqtXRh.js → index-DN-kX7hL.js} +2 -2
- package/dashboard/dist/assets/{index-BrwqtXRh.js.map → index-DN-kX7hL.js.map} +1 -1
- package/dashboard/dist/assets/index-Dl_8hbYI.js +2 -0
- package/dashboard/dist/assets/index-Dl_8hbYI.js.map +1 -0
- package/dashboard/dist/assets/{index-D4Dlznn9.js → index-DpKOr311.js} +2 -2
- package/dashboard/dist/assets/{index-D4Dlznn9.js.map → index-DpKOr311.js.map} +1 -1
- package/dashboard/dist/assets/{index-CnOvJz6U.js → index-Dy1wWu2e.js} +2 -2
- package/dashboard/dist/assets/{index-CnOvJz6U.js.map → index-Dy1wWu2e.js.map} +1 -1
- package/dashboard/dist/assets/{index-BT1Ms5Q5.js → index-HLu98Sqh.js} +2 -2
- package/dashboard/dist/assets/{index-BT1Ms5Q5.js.map → index-HLu98Sqh.js.map} +1 -1
- package/dashboard/dist/assets/{index-BFASQ7_X.js → index-ag2pCAPu.js} +2 -2
- package/dashboard/dist/assets/{index-BFASQ7_X.js.map → index-ag2pCAPu.js.map} +1 -1
- package/dashboard/dist/assets/{index-BsHVgWH6.js → index-gkxPN7Vx.js} +2 -2
- package/dashboard/dist/assets/{index-BsHVgWH6.js.map → index-gkxPN7Vx.js.map} +1 -1
- package/dashboard/dist/assets/index-m9A3UYst.css +1 -0
- package/dashboard/dist/assets/{knowledge-Cci_r6Kl.js → knowledge-DnMs-SOJ.js} +2 -2
- package/dashboard/dist/assets/{knowledge-Cci_r6Kl.js.map → knowledge-DnMs-SOJ.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-NY4iL0L-.js → mcp-CwW-K3r4.js} +2 -2
- package/dashboard/dist/assets/{mcp-NY4iL0L-.js.map → mcp-CwW-K3r4.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-CbvZo_I_.js → mcp-query-BZt5e8_Q.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-CbvZo_I_.js.map → mcp-query-BZt5e8_Q.js.map} +1 -1
- package/dashboard/dist/assets/{personas-Fy-f7QQd.js → personas-UA-Xn60f.js} +2 -2
- package/dashboard/dist/assets/{personas-Fy-f7QQd.js.map → personas-UA-Xn60f.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-DKiuozxV.js → pipelines-Cu3PARum.js} +2 -2
- package/dashboard/dist/assets/{pipelines-DKiuozxV.js.map → pipelines-Cu3PARum.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-CdM1Rkk9.js → tasks-BO6h8GJE.js} +2 -2
- package/dashboard/dist/assets/{tasks-CdM1Rkk9.js.map → tasks-BO6h8GJE.js.map} +1 -1
- package/dashboard/dist/assets/{topics-XNy2mf3n.js → topics-CWjCR-17.js} +2 -2
- package/dashboard/dist/assets/{topics-XNy2mf3n.js.map → topics-CWjCR-17.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-CyGcU3_S.js → useDebouncedValue-6t0jx1RB.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-CyGcU3_S.js.map → useDebouncedValue-6t0jx1RB.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-C2RIh_IN.js → useNamespace-CqpoQx6D.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-C2RIh_IN.js.map → useNamespace-CqpoQx6D.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-CDiV5fjf.js → useYamlActivityEvents-hmCQQwzB.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-CDiV5fjf.js.map → useYamlActivityEvents-hmCQQwzB.js.map} +1 -1
- package/dashboard/dist/assets/{validate-DcGWN82Y.js → validate-BIRn4a6d.js} +2 -2
- package/dashboard/dist/assets/{validate-DcGWN82Y.js.map → validate-BIRn4a6d.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-CH8UrouH.js → yaml-workflows-ziUdZhKY.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-CH8UrouH.js.map → yaml-workflows-ziUdZhKY.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/agents.md +3 -1
- package/docs/api/http/agents.md +15 -1
- package/docs/api/http/escalations.md +3 -3
- package/docs/api/http/exports.md +3 -1
- package/docs/api/http/file-browser.md +3 -1
- package/docs/api/http/mcp-endpoint.md +8 -5
- package/docs/api/http/mcp-servers.md +34 -4
- package/docs/api/http/namespaces.md +2 -0
- package/docs/api/http/pipelines.md +2 -0
- package/docs/api/http/roles.md +11 -8
- package/docs/api/http/service-accounts.md +8 -2
- package/docs/api/http/settings.md +29 -2
- package/docs/api/http/tasks.md +3 -1
- package/docs/api/http/topics.md +7 -1
- package/docs/api/http/users.md +8 -2
- package/docs/api/http/workflows.md +25 -10
- package/docs/api/http/yaml-workflows.md +21 -0
- package/docs/api/mcp/admin.md +409 -49
- package/docs/api/mcp/file-storage.md +4 -0
- package/docs/api/mcp/http-fetch.md +6 -2
- package/docs/api/mcp/human-queue.md +53 -0
- package/docs/api/mcp/index.md +13 -10
- package/docs/api/mcp/knowledge.md +34 -0
- package/docs/api/mcp/oauth.md +1 -1
- package/docs/api/mcp/ortho.md +113 -0
- package/docs/api/mcp/vision.md +1 -1
- package/docs/api/sdk/bot-accounts.md +1 -0
- package/docs/api/sdk/escalations.md +2 -2
- package/docs/api/sdk/mcp.md +2 -2
- package/docs/api/sdk/settings.md +1 -1
- package/docs/api/sdk/tasks.md +2 -2
- package/docs/api/sdk/workflows.md +2 -2
- package/docs/api/sdk/yaml-workflows.md +1 -1
- package/docs/architecture.md +3 -1
- package/docs/auth.md +3 -2
- package/docs/cloud.md +7 -2
- package/docs/dashboard.md +16 -7
- package/docs/data.md +1 -1
- package/docs/escalation-strategies.md +9 -20
- package/docs/events.md +6 -0
- package/docs/iam.md +7 -5
- package/docs/maintenance.md +51 -28
- package/docs/mcp.md +159 -210
- package/docs/oauth-and-delegation.md +32 -21
- package/docs/topics.md +2 -0
- package/docs/workflows.md +14 -112
- package/package.json +5 -3
- package/dashboard/dist/assets/ConfirmDeleteModal-DW4DrPur.js +0 -2
- package/dashboard/dist/assets/ConfirmDeleteModal-DW4DrPur.js.map +0 -1
- package/dashboard/dist/assets/ProcessDetailPage-DNgCIwRl.js +0 -2
- package/dashboard/dist/assets/ResolverForm-CKIOAGtY.js +0 -8
- package/dashboard/dist/assets/ResolverForm-CKIOAGtY.js.map +0 -1
- package/dashboard/dist/assets/index-CtlBjl8o.js +0 -2
- package/dashboard/dist/assets/index-CtlBjl8o.js.map +0 -1
- package/dashboard/dist/assets/index-LRYC__mE.js +0 -67
- package/dashboard/dist/assets/index-LRYC__mE.js.map +0 -1
- package/dashboard/dist/assets/index-MYI2_Xb3.css +0 -1
|
@@ -37,8 +37,10 @@ exports.getClients = getClients;
|
|
|
37
37
|
exports.getBuiltinFactories = getBuiltinFactories;
|
|
38
38
|
exports.getBuiltinServers = getBuiltinServers;
|
|
39
39
|
exports.registerBuiltinServer = registerBuiltinServer;
|
|
40
|
+
exports.getBuiltinToolManifest = getBuiltinToolManifest;
|
|
40
41
|
exports.connectToServer = connectToServer;
|
|
41
42
|
exports.disconnectFromServer = disconnectFromServer;
|
|
43
|
+
exports.resolveBuiltinServerName = resolveBuiltinServerName;
|
|
42
44
|
exports.resolveClient = resolveClient;
|
|
43
45
|
exports.connectAutoServers = connectAutoServers;
|
|
44
46
|
exports.disconnectAll = disconnectAll;
|
|
@@ -46,10 +48,9 @@ exports.isConnected = isConnected;
|
|
|
46
48
|
exports.clear = clear;
|
|
47
49
|
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
48
50
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
49
|
-
const sse_js_1 = require("@modelcontextprotocol/sdk/client/sse.js");
|
|
50
|
-
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
51
51
|
const inMemory_js_1 = require("@modelcontextprotocol/sdk/inMemory.js");
|
|
52
52
|
const logger_1 = require("../../../lib/logger");
|
|
53
|
+
const network_transport_1 = require("./network-transport");
|
|
53
54
|
const mcpDbService = __importStar(require("../db"));
|
|
54
55
|
/** In-memory map of server ID/name to active MCP client */
|
|
55
56
|
const clients = new Map();
|
|
@@ -59,6 +60,8 @@ const clients = new Map();
|
|
|
59
60
|
* rather than external stdio/SSE connections.
|
|
60
61
|
*/
|
|
61
62
|
const builtinFactories = new Map();
|
|
63
|
+
/** Tool manifests declared with a built-in factory (Long Tail's or the host's), keyed by server name. */
|
|
64
|
+
const builtinManifests = new Map();
|
|
62
65
|
/**
|
|
63
66
|
* Cached built-in McpServer instances -- keyed by canonical server name.
|
|
64
67
|
* Used by dispatchBuiltinTool() to call tool handlers directly without
|
|
@@ -81,8 +84,16 @@ function getBuiltinServers() {
|
|
|
81
84
|
* Register a built-in server factory so it can be auto-connected
|
|
82
85
|
* when callServerTool is invoked with its name.
|
|
83
86
|
*/
|
|
84
|
-
function registerBuiltinServer(name, factory) {
|
|
87
|
+
function registerBuiltinServer(name, factory, toolManifest) {
|
|
85
88
|
builtinFactories.set(name, factory);
|
|
89
|
+
if (toolManifest)
|
|
90
|
+
builtinManifests.set(name, toolManifest);
|
|
91
|
+
else
|
|
92
|
+
builtinManifests.delete(name);
|
|
93
|
+
}
|
|
94
|
+
/** The tool manifest a built-in server was registered with, if any. */
|
|
95
|
+
function getBuiltinToolManifest(name) {
|
|
96
|
+
return builtinManifests.get(name);
|
|
86
97
|
}
|
|
87
98
|
/**
|
|
88
99
|
* Connect to a registered MCP server.
|
|
@@ -135,11 +146,8 @@ async function connectToServer(server) {
|
|
|
135
146
|
env: server.transport_config.env,
|
|
136
147
|
});
|
|
137
148
|
}
|
|
138
|
-
else if (ttype === 'streamable-http') {
|
|
139
|
-
transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(server.transport_config.url));
|
|
140
|
-
}
|
|
141
149
|
else {
|
|
142
|
-
transport =
|
|
150
|
+
transport = (0, network_transport_1.createNetworkTransport)(ttype === 'streamable-http' ? 'streamable-http' : 'sse', server.transport_config);
|
|
143
151
|
}
|
|
144
152
|
await client.connect(transport);
|
|
145
153
|
clients.set(server.id, client);
|
|
@@ -174,6 +182,36 @@ async function disconnectFromServer(serverId) {
|
|
|
174
182
|
* Alias lookups (e.g. 'translation' matching 'long-tail-translation') reuse
|
|
175
183
|
* the same client instance to avoid double-connecting the singleton server.
|
|
176
184
|
*/
|
|
185
|
+
/**
|
|
186
|
+
* The built-in server a server id or name resolves to, by the same rules
|
|
187
|
+
* resolveClient follows: an exact or fuzzy factory name, else a registered
|
|
188
|
+
* server whose name matches a factory. Null for an external server.
|
|
189
|
+
*/
|
|
190
|
+
async function resolveBuiltinServerName(serverId) {
|
|
191
|
+
if (builtinFactories.has(serverId))
|
|
192
|
+
return serverId;
|
|
193
|
+
const norm = (s) => s.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
|
|
194
|
+
const normId = norm(serverId);
|
|
195
|
+
for (const [name] of builtinFactories) {
|
|
196
|
+
const normName = norm(name);
|
|
197
|
+
if (normName.includes(normId) || normId.includes(normName))
|
|
198
|
+
return name;
|
|
199
|
+
}
|
|
200
|
+
try {
|
|
201
|
+
const dbServer = (await mcpDbService.getMcpServer(serverId)) ||
|
|
202
|
+
(await mcpDbService.getMcpServerByName(serverId));
|
|
203
|
+
if (!dbServer)
|
|
204
|
+
return null;
|
|
205
|
+
for (const [name] of builtinFactories) {
|
|
206
|
+
if (dbServer.name === name || name.includes(dbServer.name) || dbServer.name.includes(name))
|
|
207
|
+
return name;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// DB lookup failed: treated as external
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
177
215
|
async function resolveClient(serverId) {
|
|
178
216
|
// 1. Direct lookup (by UUID or name)
|
|
179
217
|
if (clients.has(serverId))
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.testConnection = testConnection;
|
|
4
4
|
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
5
5
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
6
|
-
const
|
|
7
|
-
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
6
|
+
const network_transport_1 = require("./network-transport");
|
|
8
7
|
/**
|
|
9
8
|
* Test connectivity to an MCP server without persisting.
|
|
10
9
|
* Creates a temporary client, connects, lists tools, then disconnects.
|
|
@@ -21,11 +20,8 @@ async function testConnection(transportType, transportConfig) {
|
|
|
21
20
|
env: transportConfig.env,
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
|
-
else if (transportType === 'streamable-http') {
|
|
25
|
-
transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(transportConfig.url));
|
|
26
|
-
}
|
|
27
23
|
else {
|
|
28
|
-
transport =
|
|
24
|
+
transport = (0, network_transport_1.createNetworkTransport)(transportType, transportConfig);
|
|
29
25
|
}
|
|
30
26
|
await client.connect(transport);
|
|
31
27
|
const { tools } = await client.listTools();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { registerBuiltinServer, connectToServer, disconnectFromServer, resolveClient, connectAutoServers, disconnectAll, isConnected, clear, } from './connection-lifecycle';
|
|
1
|
+
export { registerBuiltinServer, getBuiltinToolManifest, connectToServer, disconnectFromServer, resolveClient, resolveBuiltinServerName, connectAutoServers, disconnectAll, isConnected, clear, } from './connection-lifecycle';
|
|
2
2
|
export { testConnection } from './connection-test';
|
|
3
3
|
export { dispatchBuiltinTool, listServerTools, } from './connection-dispatch';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listServerTools = exports.dispatchBuiltinTool = exports.testConnection = exports.clear = exports.isConnected = exports.disconnectAll = exports.connectAutoServers = exports.resolveClient = exports.disconnectFromServer = exports.connectToServer = exports.registerBuiltinServer = void 0;
|
|
3
|
+
exports.listServerTools = exports.dispatchBuiltinTool = exports.testConnection = exports.clear = exports.isConnected = exports.disconnectAll = exports.connectAutoServers = exports.resolveBuiltinServerName = exports.resolveClient = exports.disconnectFromServer = exports.connectToServer = exports.getBuiltinToolManifest = exports.registerBuiltinServer = void 0;
|
|
4
4
|
var connection_lifecycle_1 = require("./connection-lifecycle");
|
|
5
5
|
Object.defineProperty(exports, "registerBuiltinServer", { enumerable: true, get: function () { return connection_lifecycle_1.registerBuiltinServer; } });
|
|
6
|
+
Object.defineProperty(exports, "getBuiltinToolManifest", { enumerable: true, get: function () { return connection_lifecycle_1.getBuiltinToolManifest; } });
|
|
6
7
|
Object.defineProperty(exports, "connectToServer", { enumerable: true, get: function () { return connection_lifecycle_1.connectToServer; } });
|
|
7
8
|
Object.defineProperty(exports, "disconnectFromServer", { enumerable: true, get: function () { return connection_lifecycle_1.disconnectFromServer; } });
|
|
8
9
|
Object.defineProperty(exports, "resolveClient", { enumerable: true, get: function () { return connection_lifecycle_1.resolveClient; } });
|
|
10
|
+
Object.defineProperty(exports, "resolveBuiltinServerName", { enumerable: true, get: function () { return connection_lifecycle_1.resolveBuiltinServerName; } });
|
|
9
11
|
Object.defineProperty(exports, "connectAutoServers", { enumerable: true, get: function () { return connection_lifecycle_1.connectAutoServers; } });
|
|
10
12
|
Object.defineProperty(exports, "disconnectAll", { enumerable: true, get: function () { return connection_lifecycle_1.disconnectAll; } });
|
|
11
13
|
Object.defineProperty(exports, "isConnected", { enumerable: true, get: function () { return connection_lifecycle_1.isConnected; } });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { registerBuiltinServer, connectToServer, disconnectFromServer, listServerTools, resolveClient, connectAutoServers, disconnectAll, isConnected, clear, } from './connection';
|
|
2
|
-
export { callServerTool, toolActivities, } from './tools';
|
|
1
|
+
export { registerBuiltinServer, getBuiltinToolManifest, connectToServer, disconnectFromServer, listServerTools, resolveClient, resolveBuiltinServerName, connectAutoServers, disconnectAll, isConnected, clear, } from './connection';
|
|
2
|
+
export { callServerTool, callBuiltinToolAs, toolActivities, } from './tools';
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toolActivities = exports.callServerTool = exports.clear = exports.isConnected = exports.disconnectAll = exports.connectAutoServers = exports.resolveClient = exports.listServerTools = exports.disconnectFromServer = exports.connectToServer = exports.registerBuiltinServer = void 0;
|
|
3
|
+
exports.toolActivities = exports.callBuiltinToolAs = exports.callServerTool = exports.clear = exports.isConnected = exports.disconnectAll = exports.connectAutoServers = exports.resolveBuiltinServerName = exports.resolveClient = exports.listServerTools = exports.disconnectFromServer = exports.connectToServer = exports.getBuiltinToolManifest = exports.registerBuiltinServer = void 0;
|
|
4
4
|
var connection_1 = require("./connection");
|
|
5
5
|
Object.defineProperty(exports, "registerBuiltinServer", { enumerable: true, get: function () { return connection_1.registerBuiltinServer; } });
|
|
6
|
+
Object.defineProperty(exports, "getBuiltinToolManifest", { enumerable: true, get: function () { return connection_1.getBuiltinToolManifest; } });
|
|
6
7
|
Object.defineProperty(exports, "connectToServer", { enumerable: true, get: function () { return connection_1.connectToServer; } });
|
|
7
8
|
Object.defineProperty(exports, "disconnectFromServer", { enumerable: true, get: function () { return connection_1.disconnectFromServer; } });
|
|
8
9
|
Object.defineProperty(exports, "listServerTools", { enumerable: true, get: function () { return connection_1.listServerTools; } });
|
|
9
10
|
Object.defineProperty(exports, "resolveClient", { enumerable: true, get: function () { return connection_1.resolveClient; } });
|
|
11
|
+
Object.defineProperty(exports, "resolveBuiltinServerName", { enumerable: true, get: function () { return connection_1.resolveBuiltinServerName; } });
|
|
10
12
|
Object.defineProperty(exports, "connectAutoServers", { enumerable: true, get: function () { return connection_1.connectAutoServers; } });
|
|
11
13
|
Object.defineProperty(exports, "disconnectAll", { enumerable: true, get: function () { return connection_1.disconnectAll; } });
|
|
12
14
|
Object.defineProperty(exports, "isConnected", { enumerable: true, get: function () { return connection_1.isConnected; } });
|
|
13
15
|
Object.defineProperty(exports, "clear", { enumerable: true, get: function () { return connection_1.clear; } });
|
|
14
16
|
var tools_1 = require("./tools");
|
|
15
17
|
Object.defineProperty(exports, "callServerTool", { enumerable: true, get: function () { return tools_1.callServerTool; } });
|
|
18
|
+
Object.defineProperty(exports, "callBuiltinToolAs", { enumerable: true, get: function () { return tools_1.callBuiltinToolAs; } });
|
|
16
19
|
Object.defineProperty(exports, "toolActivities", { enumerable: true, get: function () { return tools_1.toolActivities; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
2
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
3
|
+
/**
|
|
4
|
+
* The client transport for a network MCP server. `headers` ride every
|
|
5
|
+
* request (the SSE stream and its POSTs alike), which is how a server that
|
|
6
|
+
* authenticates its callers, such as another Long Tail's /mcp with a
|
|
7
|
+
* service-account key, is reached.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createNetworkTransport(transportType: 'sse' | 'streamable-http', config: {
|
|
10
|
+
url?: string;
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
}): SSEClientTransport | StreamableHTTPClientTransport;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNetworkTransport = createNetworkTransport;
|
|
4
|
+
const sse_js_1 = require("@modelcontextprotocol/sdk/client/sse.js");
|
|
5
|
+
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
6
|
+
/**
|
|
7
|
+
* The client transport for a network MCP server. `headers` ride every
|
|
8
|
+
* request (the SSE stream and its POSTs alike), which is how a server that
|
|
9
|
+
* authenticates its callers, such as another Long Tail's /mcp with a
|
|
10
|
+
* service-account key, is reached.
|
|
11
|
+
*/
|
|
12
|
+
function createNetworkTransport(transportType, config) {
|
|
13
|
+
if (!config.url)
|
|
14
|
+
throw new Error('A network MCP server needs a url');
|
|
15
|
+
const url = new URL(config.url);
|
|
16
|
+
const requestInit = config.headers && Object.keys(config.headers).length ? { headers: config.headers } : undefined;
|
|
17
|
+
return transportType === 'streamable-http'
|
|
18
|
+
? new streamableHttp_js_1.StreamableHTTPClientTransport(url, { requestInit })
|
|
19
|
+
: new sse_js_1.SSEClientTransport(url, { requestInit });
|
|
20
|
+
}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Call a built-in server's tool as a named caller: the handler sees the
|
|
3
|
+
* caller as an external principal, so caller-aware tools act with the
|
|
4
|
+
* caller's own rights rather than lt-system's. `serverName` is the canonical
|
|
5
|
+
* built-in name (resolveBuiltinServerName).
|
|
6
|
+
*/
|
|
7
|
+
export declare function callBuiltinToolAs(serverName: string, toolName: string, args: Record<string, any>, caller: {
|
|
8
|
+
userId: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
}, credentials?: {
|
|
11
|
+
userId?: string;
|
|
12
|
+
delegationToken?: string;
|
|
13
|
+
}): Promise<any>;
|
|
1
14
|
/**
|
|
2
15
|
* Call a tool on a connected server.
|
|
3
16
|
* Resolves the server by ID or name, auto-connecting built-in servers.
|
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.callBuiltinToolAs = callBuiltinToolAs;
|
|
36
37
|
exports.callServerTool = callServerTool;
|
|
37
38
|
exports.toolActivities = toolActivities;
|
|
38
39
|
const logger_1 = require("../../../lib/logger");
|
|
@@ -53,6 +54,23 @@ function deriveAuthFromToolContext() {
|
|
|
53
54
|
delegationToken: ctx.credentials.delegationToken,
|
|
54
55
|
};
|
|
55
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Call a built-in server's tool as a named caller: the handler sees the
|
|
59
|
+
* caller as an external principal, so caller-aware tools act with the
|
|
60
|
+
* caller's own rights rather than lt-system's. `serverName` is the canonical
|
|
61
|
+
* built-in name (resolveBuiltinServerName).
|
|
62
|
+
*/
|
|
63
|
+
async function callBuiltinToolAs(serverName, toolName, args, caller, credentials) {
|
|
64
|
+
// `_auth` carries the identity tools resolve credentials with, as callServerTool sets it.
|
|
65
|
+
const toolArgs = {
|
|
66
|
+
...args,
|
|
67
|
+
_auth: credentials ? { userId: credentials.userId, token: credentials.delegationToken } : { userId: caller.userId },
|
|
68
|
+
};
|
|
69
|
+
const builtin = await (0, connection_1.dispatchBuiltinTool)(serverName, toolName, toolArgs, { authInfo: caller });
|
|
70
|
+
if (!builtin)
|
|
71
|
+
throw Object.assign(new Error(`Tool ${toolName} not found on ${serverName}`), { name: 'ToolNotFoundError' });
|
|
72
|
+
return builtin.result;
|
|
73
|
+
}
|
|
56
74
|
/**
|
|
57
75
|
* Call a tool on a connected server.
|
|
58
76
|
* Resolves the server by ID or name, auto-connecting built-in servers.
|
|
@@ -5,6 +5,7 @@ exports.getDbServer = getDbServer;
|
|
|
5
5
|
exports.stopDbServer = stopDbServer;
|
|
6
6
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
7
7
|
const logger_1 = require("../../../lib/logger");
|
|
8
|
+
const registered_tools_1 = require("../registered-tools");
|
|
8
9
|
const tools_1 = require("./tools");
|
|
9
10
|
let server = null;
|
|
10
11
|
/**
|
|
@@ -28,7 +29,7 @@ async function createDbServer(options) {
|
|
|
28
29
|
server = instance;
|
|
29
30
|
}
|
|
30
31
|
(0, tools_1.registerDbTools)(instance);
|
|
31
|
-
logger_1.loggerRegistry.info(`[lt-mcp:db-server] ${name} ready (
|
|
32
|
+
logger_1.loggerRegistry.info(`[lt-mcp:db-server] ${name} ready (${(0, registered_tools_1.registeredToolCount)(instance)} tools registered)`);
|
|
32
33
|
return instance;
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
@@ -6,10 +6,15 @@
|
|
|
6
6
|
* Created per-request in stateless mode (pure in-memory, no IO).
|
|
7
7
|
*/
|
|
8
8
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
|
+
import type { CapabilityAccess } from '../../types';
|
|
9
10
|
import type { ExposureConfig } from './exposure';
|
|
11
|
+
export declare const SHIPPED_SERVERS: Set<string>;
|
|
10
12
|
/**
|
|
11
|
-
* Create a unified McpServer with tools
|
|
12
|
-
* Called per-request in stateless mode
|
|
13
|
-
* the
|
|
13
|
+
* Create a unified McpServer with the tools this caller may use from all
|
|
14
|
+
* qualifying shipped servers. Called per-request in stateless mode, so a tool
|
|
15
|
+
* the caller lacks the capability for is neither listed nor callable. When
|
|
16
|
+
* the request calls one tool, only that tool is registered and only its gate
|
|
17
|
+
* is checked. Server instances are cached; only the McpServer wrapper and
|
|
18
|
+
* tool registrations are fresh (pure in-memory).
|
|
14
19
|
*/
|
|
15
|
-
export declare function createUnifiedMcpServer(exposure?: ExposureConfig, callerScopes?: string[]): Promise<McpServer>;
|
|
20
|
+
export declare function createUnifiedMcpServer(access: CapabilityAccess, exposure?: ExposureConfig, callerScopes?: string[], requestedTool?: string): Promise<McpServer>;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Created per-request in stateless mode (pure in-memory, no IO).
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SHIPPED_SERVERS = void 0;
|
|
10
11
|
exports.createUnifiedMcpServer = createUnifiedMcpServer;
|
|
11
12
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
12
13
|
const logger_1 = require("../../lib/logger");
|
|
@@ -44,7 +45,7 @@ async function buildInstructions() {
|
|
|
44
45
|
// ── Shipped server allowlist ─────────────────────────────────────────────────
|
|
45
46
|
// Only these servers are exposed via the /mcp endpoint.
|
|
46
47
|
// Example servers (playwright, gmail, image-tools) are excluded.
|
|
47
|
-
|
|
48
|
+
exports.SHIPPED_SERVERS = new Set([
|
|
48
49
|
'long-tail-admin',
|
|
49
50
|
'long-tail-human-queue',
|
|
50
51
|
'long-tail-file-storage',
|
|
@@ -74,7 +75,7 @@ async function getOrCreateServer(name) {
|
|
|
74
75
|
}
|
|
75
76
|
// ── Exposure filtering ───────────────────────────────────────────────────────
|
|
76
77
|
function isServerAllowed(name, exposure) {
|
|
77
|
-
if (!SHIPPED_SERVERS.has(name))
|
|
78
|
+
if (!exports.SHIPPED_SERVERS.has(name))
|
|
78
79
|
return false;
|
|
79
80
|
if (exposure?.allowServers?.length) {
|
|
80
81
|
if (!exposure.allowServers.includes(name))
|
|
@@ -94,6 +95,15 @@ function isServerAllowed(name, exposure) {
|
|
|
94
95
|
}
|
|
95
96
|
return true;
|
|
96
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Whether the caller holds the capability the tool's manifest entry declares.
|
|
100
|
+
* Fails closed: a tool without a manifest entry or a gate is never exposed.
|
|
101
|
+
*/
|
|
102
|
+
async function isToolPermitted(toolName, serverName, access) {
|
|
103
|
+
const manifest = system_1.builtinMcpServerFactories[serverName]?.config?.toolManifest;
|
|
104
|
+
const gate = manifest?.find((t) => t.name === toolName)?.gate;
|
|
105
|
+
return gate !== undefined && (await access(gate));
|
|
106
|
+
}
|
|
97
107
|
function isToolAllowed(toolName, serverName, exposure, callerScopes) {
|
|
98
108
|
// Per-caller scope filtering: mcp:read callers only see read_safe tools
|
|
99
109
|
const isReadOnly = exposure?.readOnly
|
|
@@ -114,12 +124,16 @@ function isToolAllowed(toolName, serverName, exposure, callerScopes) {
|
|
|
114
124
|
}
|
|
115
125
|
// ── Unified server creation ──────────────────────────────────────────────────
|
|
116
126
|
/**
|
|
117
|
-
* Create a unified McpServer with tools
|
|
118
|
-
* Called per-request in stateless mode
|
|
119
|
-
* the
|
|
127
|
+
* Create a unified McpServer with the tools this caller may use from all
|
|
128
|
+
* qualifying shipped servers. Called per-request in stateless mode, so a tool
|
|
129
|
+
* the caller lacks the capability for is neither listed nor callable. When
|
|
130
|
+
* the request calls one tool, only that tool is registered and only its gate
|
|
131
|
+
* is checked. Server instances are cached; only the McpServer wrapper and
|
|
132
|
+
* tool registrations are fresh (pure in-memory).
|
|
120
133
|
*/
|
|
121
|
-
async function createUnifiedMcpServer(exposure, callerScopes) {
|
|
134
|
+
async function createUnifiedMcpServer(access, exposure, callerScopes, requestedTool) {
|
|
122
135
|
const unified = new mcp_js_1.McpServer({ name: 'long-tail', version: '1.0.0' }, { instructions: await buildInstructions() });
|
|
136
|
+
const named = new Set();
|
|
123
137
|
const registered = new Set();
|
|
124
138
|
for (const [name] of Object.entries(system_1.builtinMcpServerFactories)) {
|
|
125
139
|
if (!isServerAllowed(name, exposure))
|
|
@@ -137,16 +151,22 @@ async function createUnifiedMcpServer(exposure, callerScopes) {
|
|
|
137
151
|
for (const [toolName, tool] of Object.entries(tools)) {
|
|
138
152
|
if (!tool?.handler || !tool.enabled)
|
|
139
153
|
continue;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// Deduplicate: prefix with server short name on collision
|
|
154
|
+
// Deduplicate: prefix with server short name on collision. Names are
|
|
155
|
+
// claimed before filtering so a tool keeps its name for every caller.
|
|
143
156
|
let finalName = toolName;
|
|
144
|
-
if (
|
|
157
|
+
if (named.has(toolName)) {
|
|
145
158
|
const prefix = name.replace('long-tail-', '').replace(/-/g, '_');
|
|
146
159
|
finalName = `${prefix}_${toolName}`;
|
|
147
|
-
if (
|
|
160
|
+
if (named.has(finalName))
|
|
148
161
|
continue; // still a collision — skip
|
|
149
162
|
}
|
|
163
|
+
named.add(finalName);
|
|
164
|
+
if (requestedTool !== undefined && finalName !== requestedTool)
|
|
165
|
+
continue;
|
|
166
|
+
if (!(await isToolPermitted(toolName, name, access)))
|
|
167
|
+
continue;
|
|
168
|
+
if (!isToolAllowed(toolName, name, exposure, callerScopes))
|
|
169
|
+
continue;
|
|
150
170
|
registered.add(finalName);
|
|
151
171
|
// Re-register the tool handler on the unified server.
|
|
152
172
|
// Use the low-level `tool()` API since we already have the parsed handler.
|
|
@@ -162,6 +182,9 @@ async function createUnifiedMcpServer(exposure, callerScopes) {
|
|
|
162
182
|
logger_1.loggerRegistry.error(`[lt-mcp:endpoint] server "${name}" failed to load, skipping its tools: ${err?.stack || err?.message || err}`);
|
|
163
183
|
}
|
|
164
184
|
}
|
|
185
|
+
// A call to one denied or unknown tool registers none; the tool handlers
|
|
186
|
+
// still answer it the way the SDK answers any unknown tool.
|
|
187
|
+
unified.setToolRequestHandlers();
|
|
165
188
|
logger_1.loggerRegistry.info(`[lt-mcp:endpoint] unified server ready (${registered.size} tools)`);
|
|
166
189
|
return unified;
|
|
167
190
|
}
|
|
@@ -4,6 +4,7 @@ exports.stopPlaywrightServer = void 0;
|
|
|
4
4
|
exports.createPlaywrightServer = createPlaywrightServer;
|
|
5
5
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
6
6
|
const logger_1 = require("../../../lib/logger");
|
|
7
|
+
const registered_tools_1 = require("../registered-tools");
|
|
7
8
|
const tools_1 = require("./tools");
|
|
8
9
|
var lifecycle_1 = require("./lifecycle");
|
|
9
10
|
Object.defineProperty(exports, "stopPlaywrightServer", { enumerable: true, get: function () { return lifecycle_1.stopPlaywrightServer; } });
|
|
@@ -20,6 +21,6 @@ async function createPlaywrightServer(options) {
|
|
|
20
21
|
const name = options?.name || 'long-tail-playwright';
|
|
21
22
|
const instance = new mcp_js_1.McpServer({ name, version: '1.0.0' });
|
|
22
23
|
(0, tools_1.registerTools)(instance);
|
|
23
|
-
logger_1.loggerRegistry.info(`[lt-mcp:playwright] ${name} ready (
|
|
24
|
+
logger_1.loggerRegistry.info(`[lt-mcp:playwright] ${name} ready (${(0, registered_tools_1.registeredToolCount)(instance)} tools registered)`);
|
|
24
25
|
return instance;
|
|
25
26
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registeredToolCount = registeredToolCount;
|
|
4
|
+
/** How many tools a server registered, for its ready log line. */
|
|
5
|
+
function registeredToolCount(server) {
|
|
6
|
+
return Object.keys(server._registeredTools ?? {}).length;
|
|
7
|
+
}
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* - `mcp:full` — all tools (automation, orchestration)
|
|
7
7
|
*
|
|
8
8
|
* Idempotent — skips creation if the account already exists.
|
|
9
|
-
*
|
|
9
|
+
* With LT_SEED_SERVICE_KEYS=true (local docker compose) the keys are
|
|
10
|
+
* generated once and printed to stdout, never to the logger; they cannot be
|
|
11
|
+
* retrieved again. Otherwise the account is created without keys and a
|
|
12
|
+
* superadmin mints them from the dashboard or the bot-accounts API.
|
|
10
13
|
*/
|
|
11
14
|
export declare function seedMcpServiceAccount(): Promise<void>;
|
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
* - `mcp:full` — all tools (automation, orchestration)
|
|
8
8
|
*
|
|
9
9
|
* Idempotent — skips creation if the account already exists.
|
|
10
|
-
*
|
|
10
|
+
* With LT_SEED_SERVICE_KEYS=true (local docker compose) the keys are
|
|
11
|
+
* generated once and printed to stdout, never to the logger; they cannot be
|
|
12
|
+
* retrieved again. Otherwise the account is created without keys and a
|
|
13
|
+
* superadmin mints them from the dashboard or the bot-accounts API.
|
|
11
14
|
*/
|
|
12
15
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
16
|
if (k2 === undefined) k2 = k;
|
|
@@ -45,6 +48,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
45
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
49
|
exports.seedMcpServiceAccount = seedMcpServiceAccount;
|
|
47
50
|
const logger_1 = require("../../lib/logger");
|
|
51
|
+
const config_1 = require("../../modules/config");
|
|
48
52
|
const crud_1 = require("../user/crud");
|
|
49
53
|
const iam = __importStar(require("../iam"));
|
|
50
54
|
const SERVICE_ACCOUNT_NAME = 'mcp-service';
|
|
@@ -63,13 +67,14 @@ async function seedMcpServiceAccount() {
|
|
|
63
67
|
display_name: 'MCP Service',
|
|
64
68
|
roles: [{ role: 'system', type: 'member' }],
|
|
65
69
|
});
|
|
66
|
-
|
|
70
|
+
if (!config_1.config.LT_SEED_SERVICE_KEYS) {
|
|
71
|
+
logger_1.loggerRegistry.info(`[seed-mcp] ${SERVICE_ACCOUNT_NAME} created; mint its API keys from the dashboard`);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
67
74
|
const readKey = await iam.createBotKey(bot.id, 'read', ['mcp:read']);
|
|
68
|
-
logger_1.loggerRegistry.info(`[seed-mcp] read key: ${readKey.rawKey}`);
|
|
69
|
-
// Generate full key (scoped to mcp:full)
|
|
70
75
|
const fullKey = await iam.createBotKey(bot.id, 'full', ['mcp:read', 'mcp:full']);
|
|
71
|
-
|
|
72
|
-
logger_1.loggerRegistry.info(`[seed-mcp] ${SERVICE_ACCOUNT_NAME} created with read + full API keys`);
|
|
76
|
+
process.stdout.write(`[seed-mcp] read key: ${readKey.rawKey}\n[seed-mcp] full key: ${fullKey.rawKey}\n`);
|
|
77
|
+
logger_1.loggerRegistry.info(`[seed-mcp] ${SERVICE_ACCOUNT_NAME} created with read + full API keys (printed to stdout)`);
|
|
73
78
|
}
|
|
74
79
|
catch (err) {
|
|
75
80
|
logger_1.loggerRegistry.warn(`[seed-mcp] failed to seed: ${err.message}`);
|
|
@@ -5,6 +5,7 @@ exports.getServer = getServer;
|
|
|
5
5
|
exports.stopServer = stopServer;
|
|
6
6
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
7
7
|
const logger_1 = require("../../lib/logger");
|
|
8
|
+
const registered_tools_1 = require("./registered-tools");
|
|
8
9
|
const server_tools_1 = require("./server-tools");
|
|
9
10
|
let server = null;
|
|
10
11
|
/**
|
|
@@ -28,7 +29,7 @@ async function createHumanQueueServer(options) {
|
|
|
28
29
|
const name = options?.name || 'long-tail-human-queue';
|
|
29
30
|
server = new mcp_js_1.McpServer({ name, version: '1.0.0' });
|
|
30
31
|
(0, server_tools_1.registerHumanQueueTools)(server);
|
|
31
|
-
logger_1.loggerRegistry.info(`[lt-mcp:server] ${name} ready (
|
|
32
|
+
logger_1.loggerRegistry.info(`[lt-mcp:server] ${name} ready (${(0, registered_tools_1.registeredToolCount)(server)} tools registered)`);
|
|
32
33
|
return server;
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
@@ -53,7 +53,20 @@ export declare class InvocationError extends Error {
|
|
|
53
53
|
*/
|
|
54
54
|
export declare function invokeWorkflow(input: InvokeWorkflowInput): Promise<InvokeWorkflowResult>;
|
|
55
55
|
/**
|
|
56
|
-
* Check
|
|
57
|
-
*
|
|
56
|
+
* Check a caller against the workflow's invocation rules, from the caller's
|
|
57
|
+
* live grants rather than any role claim a token carries. A workflow with no
|
|
58
|
+
* invocation roles is open, except a system-authority workflow, which needs a
|
|
59
|
+
* superadmin.
|
|
58
60
|
*/
|
|
59
|
-
export declare function checkInvocationRoles(workflowType: string, userId: string
|
|
61
|
+
export declare function checkInvocationRoles(workflowType: string, userId: string): Promise<void>;
|
|
62
|
+
/** Refuse an execute_as override that would exceed the caller's own authority. */
|
|
63
|
+
export declare function assertMayActAs(userId: string, executeAs: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Authorize an invocation that arrives from outside the process (REST, /mcp):
|
|
66
|
+
* the workflow's invocation rules, then any execute_as override.
|
|
67
|
+
*/
|
|
68
|
+
export declare function authorizeInvocation(input: {
|
|
69
|
+
workflowType: string;
|
|
70
|
+
userId: string;
|
|
71
|
+
executeAs?: string;
|
|
72
|
+
}): Promise<void>;
|
|
@@ -45,8 +45,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
45
45
|
exports.InvocationError = void 0;
|
|
46
46
|
exports.invokeWorkflow = invokeWorkflow;
|
|
47
47
|
exports.checkInvocationRoles = checkInvocationRoles;
|
|
48
|
+
exports.assertMayActAs = assertMayActAs;
|
|
49
|
+
exports.authorizeInvocation = authorizeInvocation;
|
|
48
50
|
const hotmesh_1 = require("@hotmeshio/hotmesh");
|
|
49
51
|
const invocation_access_1 = require("./invocation-access");
|
|
52
|
+
const uuid_1 = require("../lib/uuid");
|
|
50
53
|
const workers_1 = require("../workers");
|
|
51
54
|
const configService = __importStar(require("./config"));
|
|
52
55
|
const userService = __importStar(require("./user"));
|
|
@@ -138,26 +141,55 @@ async function resolveTaskQueue(workflowType) {
|
|
|
138
141
|
}
|
|
139
142
|
return worker.taskQueue;
|
|
140
143
|
}
|
|
144
|
+
/** A principal's grants by uuid or external_id, or null when no such user exists. */
|
|
145
|
+
async function grantsOf(identifier) {
|
|
146
|
+
const user = (0, uuid_1.isUuid)(identifier)
|
|
147
|
+
? await userService.getUser(identifier)
|
|
148
|
+
: await userService.getUserByExternalId(identifier);
|
|
149
|
+
return user ? user.roles.map((r) => ({ role: r.role, type: r.type })) : null;
|
|
150
|
+
}
|
|
141
151
|
/**
|
|
142
|
-
* Check
|
|
143
|
-
*
|
|
152
|
+
* Check a caller against the workflow's invocation rules, from the caller's
|
|
153
|
+
* live grants rather than any role claim a token carries. A workflow with no
|
|
154
|
+
* invocation roles is open, except a system-authority workflow, which needs a
|
|
155
|
+
* superadmin.
|
|
144
156
|
*/
|
|
145
|
-
async function checkInvocationRoles(workflowType, userId
|
|
157
|
+
async function checkInvocationRoles(workflowType, userId) {
|
|
146
158
|
const wfConfig = await configService.getWorkflowConfig(workflowType);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// Superadmin from JWT bypasses all invocation role checks
|
|
150
|
-
if (authRole === 'superadmin')
|
|
159
|
+
const systemAuthority = invocation_access_1.SYSTEM_AUTHORITY_WORKFLOWS.has(workflowType);
|
|
160
|
+
if (!systemAuthority && (!wfConfig || wfConfig.invocation_roles.length === 0))
|
|
151
161
|
return;
|
|
152
|
-
const
|
|
153
|
-
if (!
|
|
162
|
+
const roles = await grantsOf(userId);
|
|
163
|
+
if (!roles) {
|
|
154
164
|
throw new InvocationError('User not registered', 403);
|
|
155
165
|
}
|
|
156
166
|
// invocable is resolveTaskQueue's concern; this gate decides roles only.
|
|
157
|
-
|
|
167
|
+
const rules = { workflow_type: workflowType, invocation_roles: wfConfig?.invocation_roles ?? [], invocable: true };
|
|
168
|
+
if (!(0, invocation_access_1.canInvokeWorkflow)(rules, roles)) {
|
|
158
169
|
throw new InvocationError('Insufficient role for invocation', 403);
|
|
159
170
|
}
|
|
160
171
|
}
|
|
172
|
+
/** Refuse an execute_as override that would exceed the caller's own authority. */
|
|
173
|
+
async function assertMayActAs(userId, executeAs) {
|
|
174
|
+
const caller = await grantsOf(userId);
|
|
175
|
+
if (!caller)
|
|
176
|
+
throw new InvocationError('User not registered', 403);
|
|
177
|
+
const target = await grantsOf(executeAs);
|
|
178
|
+
if (!target)
|
|
179
|
+
throw new InvocationError(`execute_as principal "${executeAs}" not found`, 404);
|
|
180
|
+
if (!(0, invocation_access_1.mayActAs)(caller, target)) {
|
|
181
|
+
throw new InvocationError('execute_as may not exceed your own authority', 403);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Authorize an invocation that arrives from outside the process (REST, /mcp):
|
|
186
|
+
* the workflow's invocation rules, then any execute_as override.
|
|
187
|
+
*/
|
|
188
|
+
async function authorizeInvocation(input) {
|
|
189
|
+
await checkInvocationRoles(input.workflowType, input.userId);
|
|
190
|
+
if (input.executeAs)
|
|
191
|
+
await assertMayActAs(input.userId, input.executeAs);
|
|
192
|
+
}
|
|
161
193
|
/**
|
|
162
194
|
* Build the LTEnvelope with IAM context.
|
|
163
195
|
*/
|
|
@@ -27,10 +27,18 @@ export declare function deployYamlWorkflow(appId: string, yamlContent: string):
|
|
|
27
27
|
* Activate a deployed version of a YAML workflow.
|
|
28
28
|
*/
|
|
29
29
|
export declare function activateYamlWorkflow(appId: string, version: string): Promise<boolean>;
|
|
30
|
+
/** The key compiled workflow activities read their identity context from. */
|
|
31
|
+
export declare const SCOPE_KEY = "_scope";
|
|
32
|
+
/**
|
|
33
|
+
* The trigger data a compiled workflow starts with. Identity context is never
|
|
34
|
+
* taken from the data a caller supplied: any `_scope` there is dropped, and
|
|
35
|
+
* only the scope the server resolved is set.
|
|
36
|
+
*/
|
|
37
|
+
export declare function withTrustedScope(data: Record<string, unknown>, scope?: Record<string, unknown>): Record<string, unknown>;
|
|
30
38
|
/**
|
|
31
39
|
* Invoke a YAML workflow (fire-and-forget). Returns the job ID.
|
|
32
40
|
*/
|
|
33
|
-
export declare function invokeYamlWorkflow(appId: string, topic: string, data: Record<string, unknown>, entity?: string, context?: Record<string, any>): Promise<string>;
|
|
41
|
+
export declare function invokeYamlWorkflow(appId: string, topic: string, data: Record<string, unknown>, entity?: string, context?: Record<string, any>, scope?: Record<string, unknown>): Promise<string>;
|
|
34
42
|
/**
|
|
35
43
|
* Invoke a YAML workflow and wait for the result.
|
|
36
44
|
*
|
|
@@ -40,7 +48,7 @@ export declare function invokeYamlWorkflow(appId: string, topic: string, data: R
|
|
|
40
48
|
*
|
|
41
49
|
* Source: @hotmeshio/hotmesh engine/index.js pubsub()
|
|
42
50
|
*/
|
|
43
|
-
export declare function invokeYamlWorkflowSync(appId: string, topic: string, data: Record<string, unknown>, timeout?: number, entity?: string): Promise<{
|
|
51
|
+
export declare function invokeYamlWorkflowSync(appId: string, topic: string, data: Record<string, unknown>, timeout?: number, entity?: string, scope?: Record<string, unknown>): Promise<{
|
|
44
52
|
job_id: string;
|
|
45
53
|
result: Record<string, unknown>;
|
|
46
54
|
}>;
|