@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Router } from '
|
|
1
|
+
import { Router } from '../lib/http';
|
|
2
2
|
import type { Server as HttpServer } from 'http';
|
|
3
3
|
/**
|
|
4
4
|
* Express adapter for mounting the Long Tail dashboard at an arbitrary subpath
|
|
@@ -65,5 +65,15 @@ export declare class LTExpressAdapter {
|
|
|
65
65
|
* - SPA fallback with injected `<base href>` and `window.__LT_BASE__`
|
|
66
66
|
*/
|
|
67
67
|
getRouter(): Router;
|
|
68
|
+
/**
|
|
69
|
+
* The OAuth well-known documents. Mount at the host's root, not under the
|
|
70
|
+
* base path: clients look for them at the origin. It answers only its two
|
|
71
|
+
* paths and passes everything else on. Warns when the issuer's path is not
|
|
72
|
+
* the base path: the router would then publish metadata for a server that
|
|
73
|
+
* is not the one mounted here, possibly over the host's own.
|
|
74
|
+
*/
|
|
75
|
+
getWellKnownRouter(): Router;
|
|
76
|
+
/** Whether a built dashboard was found to serve. */
|
|
77
|
+
hasDashboard(): boolean;
|
|
68
78
|
private resolveDashboardDist;
|
|
69
79
|
}
|
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
@@ -39,13 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
6
|
exports.LTExpressAdapter = void 0;
|
|
40
7
|
const fs_1 = require("fs");
|
|
41
8
|
const path_1 = __importDefault(require("path"));
|
|
42
|
-
const
|
|
9
|
+
const http_1 = require("../lib/http");
|
|
10
|
+
const CONSENT_PAGE_PATH = '/oauth/consent';
|
|
43
11
|
const routes_1 = __importDefault(require("../routes"));
|
|
44
12
|
const mcp_endpoint_1 = __importDefault(require("../routes/mcp-endpoint"));
|
|
13
|
+
const oauth_well_known_1 = require("../routes/oauth-well-known");
|
|
45
14
|
const events_1 = require("../lib/events");
|
|
46
15
|
const socketio_1 = require("../lib/events/socketio");
|
|
47
16
|
const nats_1 = require("../lib/events/nats");
|
|
48
17
|
const nats_ws_proxy_1 = require("../lib/events/nats-ws-proxy");
|
|
18
|
+
const logger_1 = require("../lib/logger");
|
|
19
|
+
const oauth_server_1 = require("../modules/oauth-server");
|
|
49
20
|
/**
|
|
50
21
|
* Express adapter for mounting the Long Tail dashboard at an arbitrary subpath
|
|
51
22
|
* inside an existing Express-based application (NestJS, Fastify-Express, etc.).
|
|
@@ -124,6 +95,7 @@ class LTExpressAdapter {
|
|
|
124
95
|
}
|
|
125
96
|
(0, nats_ws_proxy_1.attachNatsWsProxy)(server, natsAdapter.wsProxyTarget, {
|
|
126
97
|
basePath: this.basePath,
|
|
98
|
+
authToken: natsAdapter.authToken,
|
|
127
99
|
onWsUrlDerived: (url) => {
|
|
128
100
|
if (!natsAdapter.wsUrl) {
|
|
129
101
|
natsAdapter.setWsUrl(url);
|
|
@@ -141,8 +113,8 @@ class LTExpressAdapter {
|
|
|
141
113
|
* - SPA fallback with injected `<base href>` and `window.__LT_BASE__`
|
|
142
114
|
*/
|
|
143
115
|
getRouter() {
|
|
144
|
-
const router = (0,
|
|
145
|
-
router.use(
|
|
116
|
+
const router = (0, http_1.Router)();
|
|
117
|
+
router.use((0, http_1.jsonBody)());
|
|
146
118
|
// Health check
|
|
147
119
|
router.get('/health', (_req, res) => {
|
|
148
120
|
res.json({ status: 'ok', timestamp: new Date().toISOString() });
|
|
@@ -154,16 +126,25 @@ class LTExpressAdapter {
|
|
|
154
126
|
// Dashboard static assets
|
|
155
127
|
const dashboardDist = this.resolveDashboardDist();
|
|
156
128
|
if (dashboardDist) {
|
|
157
|
-
router.use(
|
|
158
|
-
// SPA fallback — inject base path into index.html
|
|
159
|
-
|
|
129
|
+
router.use((0, http_1.serveStatic)(dashboardDist, { index: false }));
|
|
130
|
+
// SPA fallback — inject base path into index.html. Outside production
|
|
131
|
+
// the file is re-read per request so dashboard rebuilds show without a restart.
|
|
132
|
+
const indexPath = path_1.default.join(dashboardDist, 'index.html');
|
|
133
|
+
const cachedIndex = process.env.NODE_ENV === 'production' ? (0, fs_1.readFileSync)(indexPath, 'utf-8') : null;
|
|
160
134
|
const basePath = this.basePath;
|
|
161
135
|
// Serve __LT_BASE__ as external script (CSP-safe, no inline scripts)
|
|
162
136
|
router.get('/config.js', (_req, res) => {
|
|
163
137
|
res.type('application/javascript').send(`window.__LT_BASE__="${basePath}";`);
|
|
164
138
|
});
|
|
165
|
-
router.get('/{*splat}', (
|
|
166
|
-
|
|
139
|
+
router.get('/{*splat}', (req, res) => {
|
|
140
|
+
// The consent page grants access to a person's account: never inside
|
|
141
|
+
// a frame. Browsers enforce every CSP header, so appending a second
|
|
142
|
+
// policy keeps the host's and still refuses framing.
|
|
143
|
+
if (req.path.startsWith(CONSENT_PAGE_PATH)) {
|
|
144
|
+
res.setHeader('X-Frame-Options', 'DENY');
|
|
145
|
+
res.append('Content-Security-Policy', "frame-ancestors 'none'");
|
|
146
|
+
}
|
|
147
|
+
const html = (cachedIndex ?? (0, fs_1.readFileSync)(indexPath, 'utf-8')).replace('<head>', '<head>' +
|
|
167
148
|
`<base href="${basePath}/">` +
|
|
168
149
|
`<script src="./config.js"></script>`);
|
|
169
150
|
res.type('html').send(html);
|
|
@@ -171,6 +152,26 @@ class LTExpressAdapter {
|
|
|
171
152
|
}
|
|
172
153
|
return router;
|
|
173
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* The OAuth well-known documents. Mount at the host's root, not under the
|
|
157
|
+
* base path: clients look for them at the origin. It answers only its two
|
|
158
|
+
* paths and passes everything else on. Warns when the issuer's path is not
|
|
159
|
+
* the base path: the router would then publish metadata for a server that
|
|
160
|
+
* is not the one mounted here, possibly over the host's own.
|
|
161
|
+
*/
|
|
162
|
+
getWellKnownRouter() {
|
|
163
|
+
const settings = (0, oauth_server_1.getOAuthServerSettings)();
|
|
164
|
+
const issuerPath = settings ? new URL(settings.issuer).pathname.replace(/\/+$/, '') : null;
|
|
165
|
+
if (issuerPath !== null && issuerPath !== this.basePath) {
|
|
166
|
+
logger_1.loggerRegistry.warn(`[long-tail] OAuth issuer path "${issuerPath || '/'}" differs from the mount path "${this.basePath || '/'}"; `
|
|
167
|
+
+ `set the issuer to https://<host>${this.basePath}`);
|
|
168
|
+
}
|
|
169
|
+
return (0, oauth_well_known_1.createWellKnownRouter)();
|
|
170
|
+
}
|
|
171
|
+
/** Whether a built dashboard was found to serve. */
|
|
172
|
+
hasDashboard() {
|
|
173
|
+
return this.resolveDashboardDist() !== null;
|
|
174
|
+
}
|
|
174
175
|
resolveDashboardDist() {
|
|
175
176
|
// Check multiple paths relative to the compiled output location:
|
|
176
177
|
// - Dev (ts-node from repo root): adapters/ -> dashboard/dist
|
package/build/api/auth-sso.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ exports.removeBotRole = removeBotRole;
|
|
|
44
44
|
exports.listBotKeys = listBotKeys;
|
|
45
45
|
exports.createBotKey = createBotKey;
|
|
46
46
|
exports.revokeBotKey = revokeBotKey;
|
|
47
|
+
const bot_api_key_1 = require("../services/auth/bot-api-key");
|
|
47
48
|
const iam = __importStar(require("../services/iam"));
|
|
48
49
|
const user_1 = require("../services/user");
|
|
49
50
|
/**
|
|
@@ -292,6 +293,9 @@ async function createBotKey(input) {
|
|
|
292
293
|
*/
|
|
293
294
|
async function revokeBotKey(input) {
|
|
294
295
|
try {
|
|
296
|
+
if (input.botId !== undefined && (await (0, bot_api_key_1.getBotApiKeyOwner)(input.keyId)) !== input.botId) {
|
|
297
|
+
return { status: 404, error: 'API key not found' };
|
|
298
|
+
}
|
|
295
299
|
const revoked = await iam.revokeBotKey(input.keyId);
|
|
296
300
|
if (!revoked) {
|
|
297
301
|
return { status: 404, error: 'API key not found' };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import type { LTApiResult } from '../types/sdk';
|
|
2
|
-
|
|
1
|
+
import type { LTApiAuth, LTApiResult } from '../types/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Every tool the caller may run, by category. A built-in server's tool is
|
|
4
|
+
* listed only when its manifest gate admits the caller, the same rule the
|
|
5
|
+
* tool-call route applies; an external server's tools are listed as before.
|
|
6
|
+
*/
|
|
7
|
+
export declare function listCapabilities(auth?: LTApiAuth): Promise<LTApiResult>;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listCapabilities = listCapabilities;
|
|
4
4
|
const db_1 = require("../lib/db");
|
|
5
|
+
const capabilities_1 = require("../modules/capabilities");
|
|
6
|
+
const tools_1 = require("./mcp/tools");
|
|
5
7
|
const LIST_SERVERS_WITH_TOOLS = `
|
|
6
8
|
SELECT id, name, description, tags, tool_manifest, compile_hints, category
|
|
7
9
|
FROM lt_mcp_servers
|
|
@@ -40,18 +42,27 @@ function resolveCategory(server) {
|
|
|
40
42
|
}
|
|
41
43
|
return 'Other';
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Every tool the caller may run, by category. A built-in server's tool is
|
|
47
|
+
* listed only when its manifest gate admits the caller, the same rule the
|
|
48
|
+
* tool-call route applies; an external server's tools are listed as before.
|
|
49
|
+
*/
|
|
50
|
+
async function listCapabilities(auth) {
|
|
44
51
|
try {
|
|
45
52
|
const pool = (0, db_1.getPool)();
|
|
46
53
|
const { rows } = await pool.query(LIST_SERVERS_WITH_TOOLS);
|
|
47
54
|
const categoryMap = new Map();
|
|
55
|
+
const access = (0, capabilities_1.capabilityAccess)(auth?.userId ? { userId: auth.userId } : undefined);
|
|
48
56
|
for (const server of rows) {
|
|
49
57
|
const category = resolveCategory(server);
|
|
50
58
|
const tools = (server.tool_manifest || []);
|
|
51
59
|
if (!categoryMap.has(category)) {
|
|
52
60
|
categoryMap.set(category, []);
|
|
53
61
|
}
|
|
62
|
+
const builtin = await (0, tools_1.builtinServerFor)(server.name);
|
|
54
63
|
for (const tool of tools) {
|
|
64
|
+
if (builtin && !(await access((0, tools_1.builtinToolGate)(builtin, tool.name))))
|
|
65
|
+
continue;
|
|
55
66
|
categoryMap.get(category).push({
|
|
56
67
|
name: tool.name,
|
|
57
68
|
description: tool.description || '',
|
|
@@ -62,7 +73,7 @@ async function listCapabilities() {
|
|
|
62
73
|
}
|
|
63
74
|
}
|
|
64
75
|
const categories = CATEGORY_ORDER
|
|
65
|
-
.filter((name) => categoryMap.
|
|
76
|
+
.filter((name) => (categoryMap.get(name)?.length ?? 0) > 0)
|
|
66
77
|
.map((name) => ({
|
|
67
78
|
name,
|
|
68
79
|
tools: categoryMap.get(name).sort((a, b) => a.name.localeCompare(b.name)),
|
|
@@ -73,6 +73,11 @@ async function effectiveRoles(query) {
|
|
|
73
73
|
// query will actually touch. Resolution throws AnalyticsInputError (→ 400)
|
|
74
74
|
// for unknown keys, before any scope decision.
|
|
75
75
|
if (query?.entity) {
|
|
76
|
+
// The gate covers the entity's roles only, so a role filter beside it is
|
|
77
|
+
// refused here, before the gate, rather than reaching the query unchecked.
|
|
78
|
+
if (query.role !== undefined || query.roles !== undefined) {
|
|
79
|
+
throw new escalation_1.AnalyticsInputError('query.entity and query.role/roles are two scoping mechanisms: use one');
|
|
80
|
+
}
|
|
76
81
|
return (await escalationService.resolveEntitySystem(query.entity)).map((s) => s.role);
|
|
77
82
|
}
|
|
78
83
|
if (query?.role)
|
|
@@ -43,6 +43,8 @@ export declare function bulkClaim(input: {
|
|
|
43
43
|
*
|
|
44
44
|
* Non-superadmin callers must verify the target user holds each
|
|
45
45
|
* escalation's role (the query form requires exactly the declared role).
|
|
46
|
+
* The query form also requires the caller to manage that role's queue
|
|
47
|
+
* (write_scope all); read-only and self-scope members may not assign.
|
|
46
48
|
* Publishes claim events for assigned items.
|
|
47
49
|
*
|
|
48
50
|
* @param input.ids — array of escalation UUIDs (ids form)
|
|
@@ -128,6 +128,8 @@ async function bulkClaim(input, auth) {
|
|
|
128
128
|
*
|
|
129
129
|
* Non-superadmin callers must verify the target user holds each
|
|
130
130
|
* escalation's role (the query form requires exactly the declared role).
|
|
131
|
+
* The query form also requires the caller to manage that role's queue
|
|
132
|
+
* (write_scope all); read-only and self-scope members may not assign.
|
|
131
133
|
* Publishes claim events for assigned items.
|
|
132
134
|
*
|
|
133
135
|
* @param input.ids — array of escalation UUIDs (ids form)
|
|
@@ -163,14 +165,17 @@ async function bulkAssign(input, auth) {
|
|
|
163
165
|
if (!query.role || typeof query.role !== 'string') {
|
|
164
166
|
return { status: 400, error: 'query.role is required' };
|
|
165
167
|
}
|
|
166
|
-
// RBAC, query form: the caller must
|
|
167
|
-
// and the target user must hold
|
|
168
|
+
// RBAC, query form: the caller must manage the queried role's queue
|
|
169
|
+
// (write_scope all, or global), and the target user must hold the role.
|
|
168
170
|
const hasGlobal = await (0, helpers_1.hasGlobalEscalationAccess)(auth.userId);
|
|
169
171
|
if (!hasGlobal) {
|
|
170
|
-
const
|
|
171
|
-
if (!
|
|
172
|
+
const callerScope = await userService.getRoleScope(auth.userId, query.role);
|
|
173
|
+
if (!callerScope) {
|
|
172
174
|
return { status: 404, error: 'One or more escalations not found' };
|
|
173
175
|
}
|
|
176
|
+
if (callerScope.write !== 'all') {
|
|
177
|
+
return { status: 403, error: `You do not have permission to manage the "${query.role}" queue` };
|
|
178
|
+
}
|
|
174
179
|
const targetHasRole = await userService.hasRole(targetUserId, query.role);
|
|
175
180
|
if (!targetHasRole) {
|
|
176
181
|
return { status: 400, error: `Target user does not hold the "${query.role}" role` };
|
|
@@ -15,6 +15,11 @@ export interface EscalationReadScope {
|
|
|
15
15
|
selfRoles: string[];
|
|
16
16
|
}
|
|
17
17
|
export declare function getEscalationReadScope(userId: string): Promise<EscalationReadScope>;
|
|
18
|
+
/** Whether a read scope admits one escalation: the same rule as assertReadAccess, with no lookup. */
|
|
19
|
+
export declare function scopeAdmits(scope: EscalationReadScope, userId: string, escalation: {
|
|
20
|
+
role: string;
|
|
21
|
+
assigned_to?: string | null;
|
|
22
|
+
}): boolean;
|
|
18
23
|
export declare function validateIds(ids: unknown): ids is string[];
|
|
19
24
|
/**
|
|
20
25
|
* Write-scope partition for metadata-driven resolve. Splits the user's roles by
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.hasGlobalEscalationAccess = void 0;
|
|
37
37
|
exports.getEscalationReadScope = getEscalationReadScope;
|
|
38
|
+
exports.scopeAdmits = scopeAdmits;
|
|
38
39
|
exports.validateIds = validateIds;
|
|
39
40
|
exports.getEscalationWriteScope = getEscalationWriteScope;
|
|
40
41
|
exports.assertReadAccess = assertReadAccess;
|
|
@@ -70,6 +71,12 @@ async function getEscalationReadScope(userId) {
|
|
|
70
71
|
}
|
|
71
72
|
return { global: false, allRoles, selfRoles };
|
|
72
73
|
}
|
|
74
|
+
/** Whether a read scope admits one escalation: the same rule as assertReadAccess, with no lookup. */
|
|
75
|
+
function scopeAdmits(scope, userId, escalation) {
|
|
76
|
+
if (scope.global || scope.allRoles.includes(escalation.role))
|
|
77
|
+
return true;
|
|
78
|
+
return scope.selfRoles.includes(escalation.role) && escalation.assigned_to === userId;
|
|
79
|
+
}
|
|
73
80
|
function validateIds(ids) {
|
|
74
81
|
return Array.isArray(ids) && ids.length > 0;
|
|
75
82
|
}
|
|
@@ -73,6 +73,9 @@ async function findByMetadata(input, auth) {
|
|
|
73
73
|
// WHERE and COUNT. Global access → no filter. Never filter a fetched page
|
|
74
74
|
// controller-side — that shrinks the page and reports a wrong total.
|
|
75
75
|
const scope = await (0, helpers_1.getEscalationReadScope)(auth.userId);
|
|
76
|
+
if (!scope.global && scope.allRoles.length === 0 && scope.selfRoles.length === 0) {
|
|
77
|
+
return { status: 200, data: { escalations: [], total: 0 } };
|
|
78
|
+
}
|
|
76
79
|
const result = await escalationService.findByMetadata(input.key, input.value, input.status, input.limit, input.offset, scope.global
|
|
77
80
|
? undefined
|
|
78
81
|
: { allRoles: scope.allRoles, selfRoles: scope.selfRoles, meUserId: auth.userId });
|
|
@@ -12,14 +12,15 @@ export declare function getEscalation(input: {
|
|
|
12
12
|
id: string;
|
|
13
13
|
}, auth: LTApiAuth): Promise<LTApiResult>;
|
|
14
14
|
/**
|
|
15
|
-
* List
|
|
15
|
+
* List the escalations for a given workflow ID. With `auth`, only the rows
|
|
16
|
+
* that caller may read; without it (in-process callers), every row.
|
|
16
17
|
*
|
|
17
18
|
* @param input.workflowId — HotMesh workflow ID
|
|
18
19
|
* @returns `{ status: 200, data: { escalations } }`
|
|
19
20
|
*/
|
|
20
21
|
export declare function getEscalationsByWorkflowId(input: {
|
|
21
22
|
workflowId: string;
|
|
22
|
-
}): Promise<LTApiResult>;
|
|
23
|
+
}, auth?: LTApiAuth): Promise<LTApiResult>;
|
|
23
24
|
/**
|
|
24
25
|
* Route a pending escalation to a different role.
|
|
25
26
|
*
|
|
@@ -69,14 +69,19 @@ async function getEscalation(input, auth) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* List
|
|
72
|
+
* List the escalations for a given workflow ID. With `auth`, only the rows
|
|
73
|
+
* that caller may read; without it (in-process callers), every row.
|
|
73
74
|
*
|
|
74
75
|
* @param input.workflowId — HotMesh workflow ID
|
|
75
76
|
* @returns `{ status: 200, data: { escalations } }`
|
|
76
77
|
*/
|
|
77
|
-
async function getEscalationsByWorkflowId(input) {
|
|
78
|
+
async function getEscalationsByWorkflowId(input, auth) {
|
|
78
79
|
try {
|
|
79
|
-
const
|
|
80
|
+
const all = await escalationService.getEscalationsByWorkflowId(input.workflowId);
|
|
81
|
+
if (!auth?.userId)
|
|
82
|
+
return { status: 200, data: { escalations: all } };
|
|
83
|
+
const scope = await (0, helpers_1.getEscalationReadScope)(auth.userId);
|
|
84
|
+
const escalations = all.filter((e) => (0, helpers_1.scopeAdmits)(scope, auth.userId, e));
|
|
80
85
|
return { status: 200, data: { escalations } };
|
|
81
86
|
}
|
|
82
87
|
catch (err) {
|
package/build/api/mcp/tools.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import type { CapabilityGate } from '../../types';
|
|
1
2
|
import type { LTApiResult, LTApiAuth } from '../../types/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* The built-in server a server id or name refers to: the one a tool call would
|
|
5
|
+
* dispatch to, else a shipped factory whose name matches. Null for an external
|
|
6
|
+
* server. Matching both keeps the gate in force wherever the code runs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function builtinServerFor(serverIdOrName: string): Promise<string | null>;
|
|
9
|
+
/**
|
|
10
|
+
* The capability a built-in tool's manifest gates it at, from the manifest the
|
|
11
|
+
* server was registered with (Long Tail's or the host's). A tool without a gate needs builder.
|
|
12
|
+
*/
|
|
13
|
+
export declare function builtinToolGate(serverName: string, toolName: string): CapabilityGate;
|
|
2
14
|
/**
|
|
3
15
|
* List all tools exposed by a connected MCP server.
|
|
4
16
|
*
|
package/build/api/mcp/tools.js
CHANGED
|
@@ -1,8 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.builtinServerFor = builtinServerFor;
|
|
37
|
+
exports.builtinToolGate = builtinToolGate;
|
|
3
38
|
exports.listMcpServerTools = listMcpServerTools;
|
|
4
39
|
exports.callMcpTool = callMcpTool;
|
|
5
40
|
const mcp_1 = require("../../services/mcp");
|
|
41
|
+
const mcpClient = __importStar(require("../../services/mcp/client"));
|
|
42
|
+
const userService = __importStar(require("../../services/user"));
|
|
43
|
+
const capabilities_1 = require("../../modules/capabilities");
|
|
44
|
+
const workflow_invocation_1 = require("../../services/workflow-invocation");
|
|
45
|
+
const system_1 = require("../../system");
|
|
46
|
+
const uuid_1 = require("../../lib/uuid");
|
|
47
|
+
const ROLE_TYPE_ORDER = ['superadmin', 'admin', 'member'];
|
|
48
|
+
const normalizeName = (name) => name.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
|
|
49
|
+
/**
|
|
50
|
+
* The built-in server a server id or name refers to: the one a tool call would
|
|
51
|
+
* dispatch to, else a shipped factory whose name matches. Null for an external
|
|
52
|
+
* server. Matching both keeps the gate in force wherever the code runs.
|
|
53
|
+
*/
|
|
54
|
+
async function builtinServerFor(serverIdOrName) {
|
|
55
|
+
const registered = await mcpClient.resolveBuiltinServerName(serverIdOrName);
|
|
56
|
+
if (registered)
|
|
57
|
+
return registered;
|
|
58
|
+
if (system_1.builtinMcpServerFactories[serverIdOrName])
|
|
59
|
+
return serverIdOrName;
|
|
60
|
+
const wanted = normalizeName(serverIdOrName);
|
|
61
|
+
if (!wanted)
|
|
62
|
+
return null;
|
|
63
|
+
return Object.keys(system_1.builtinMcpServerFactories).find((name) => {
|
|
64
|
+
const have = normalizeName(name);
|
|
65
|
+
return have.includes(wanted) || wanted.includes(have);
|
|
66
|
+
}) ?? null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The capability a built-in tool's manifest gates it at, from the manifest the
|
|
70
|
+
* server was registered with (Long Tail's or the host's). A tool without a gate needs builder.
|
|
71
|
+
*/
|
|
72
|
+
function builtinToolGate(serverName, toolName) {
|
|
73
|
+
const manifest = mcpClient.getBuiltinToolManifest(serverName)
|
|
74
|
+
?? system_1.builtinMcpServerFactories[serverName]?.config?.toolManifest;
|
|
75
|
+
return manifest?.find((t) => t.name === toolName)?.gate ?? 'builder';
|
|
76
|
+
}
|
|
77
|
+
/** The principal a tool call acts as: the caller, or an execute_as target the caller outranks. */
|
|
78
|
+
async function actingPrincipal(auth, executeAs) {
|
|
79
|
+
if (!executeAs)
|
|
80
|
+
return { userId: auth.userId, role: auth.role };
|
|
81
|
+
await (0, workflow_invocation_1.assertMayActAs)(auth.userId, executeAs);
|
|
82
|
+
const target = (0, uuid_1.isUuid)(executeAs)
|
|
83
|
+
? await userService.getUser(executeAs)
|
|
84
|
+
: await userService.getUserByExternalId(executeAs);
|
|
85
|
+
if (!target)
|
|
86
|
+
throw new workflow_invocation_1.InvocationError(`execute_as principal "${executeAs}" not found`, 404);
|
|
87
|
+
const role = ROLE_TYPE_ORDER.find((type) => target.roles.some((r) => r.type === type));
|
|
88
|
+
return { userId: target.id, role };
|
|
89
|
+
}
|
|
6
90
|
/**
|
|
7
91
|
* List all tools exposed by a connected MCP server.
|
|
8
92
|
*
|
|
@@ -41,22 +125,42 @@ async function listMcpServerTools(input) {
|
|
|
41
125
|
*/
|
|
42
126
|
async function callMcpTool(input, auth) {
|
|
43
127
|
try {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
const effectiveUserId = input.execute_as || auth?.userId;
|
|
49
|
-
const authContext = effectiveUserId ? { userId: effectiveUserId } : undefined;
|
|
128
|
+
if (!auth?.userId)
|
|
129
|
+
return { status: 401, error: 'Authentication required' };
|
|
130
|
+
const actor = await actingPrincipal(auth, input.execute_as);
|
|
50
131
|
// Inject user_id into arguments so builtin tools can resolve
|
|
51
132
|
// the calling user's credentials (OAuth tokens, etc.)
|
|
52
133
|
const args = { ...(input.arguments || {}) };
|
|
53
|
-
if (
|
|
54
|
-
args.user_id =
|
|
134
|
+
if (!args.user_id)
|
|
135
|
+
args.user_id = actor.userId;
|
|
136
|
+
// A built-in tool runs in this process. It is gated as /mcp gates it, by
|
|
137
|
+
// the tool's manifest capability for the acting principal (live, never a
|
|
138
|
+
// role claim), and runs as that principal rather than as lt-system.
|
|
139
|
+
const builtin = await builtinServerFor(input.id);
|
|
140
|
+
if (builtin) {
|
|
141
|
+
const permitted = await (0, capabilities_1.capabilityAccess)({ userId: actor.userId })(builtinToolGate(builtin, input.toolName));
|
|
142
|
+
if (!permitted)
|
|
143
|
+
return { status: 403, error: `Forbidden: ${input.toolName} is not available to you` };
|
|
144
|
+
const result = await mcpClient.callBuiltinToolAs(builtin, input.toolName, args, actor);
|
|
145
|
+
return { status: 200, data: { result } };
|
|
146
|
+
}
|
|
147
|
+
// An external server's tools run on its stored credential (headers, env),
|
|
148
|
+
// which carries that server's authority: a builder's to use.
|
|
149
|
+
if (!(await (0, capabilities_1.capabilityAccess)({ userId: actor.userId })('builder'))) {
|
|
150
|
+
return { status: 403, error: `Forbidden: tools on an external MCP server need builder access` };
|
|
151
|
+
}
|
|
152
|
+
const adapter = mcp_1.mcpRegistry.current;
|
|
153
|
+
if (!adapter) {
|
|
154
|
+
return { status: 400, error: 'MCP adapter not registered' };
|
|
55
155
|
}
|
|
56
|
-
const result = await adapter.callTool(input.id, input.toolName, args,
|
|
156
|
+
const result = await adapter.callTool(input.id, input.toolName, args, { userId: actor.userId });
|
|
57
157
|
return { status: 200, data: { result } };
|
|
58
158
|
}
|
|
59
159
|
catch (err) {
|
|
160
|
+
if (err instanceof workflow_invocation_1.InvocationError)
|
|
161
|
+
return { status: err.statusCode, error: err.message };
|
|
162
|
+
if (err.name === 'ToolNotFoundError')
|
|
163
|
+
return { status: 404, error: err.message };
|
|
60
164
|
if (err.name === 'MissingCredentialError') {
|
|
61
165
|
return {
|
|
62
166
|
status: 422,
|
|
@@ -39,6 +39,7 @@ const escalationService = __importStar(require("../../services/escalation"));
|
|
|
39
39
|
const types_1 = require("../../types");
|
|
40
40
|
const identity_1 = require("./identity");
|
|
41
41
|
const grant_1 = require("./grant");
|
|
42
|
+
const helpers_1 = require("../escalations/helpers");
|
|
42
43
|
const context_1 = require("./context");
|
|
43
44
|
const locate_1 = require("./locate");
|
|
44
45
|
const verbs_1 = require("./verbs");
|
|
@@ -84,9 +85,21 @@ async function executeScanChoice(input, auth) {
|
|
|
84
85
|
effectiveAuth = peeked.auth;
|
|
85
86
|
grant = peeked.grant;
|
|
86
87
|
}
|
|
87
|
-
// 3.
|
|
88
|
-
//
|
|
89
|
-
|
|
88
|
+
// 3. With no live grant, a choice that needs a badge parks for the next
|
|
89
|
+
// badge scan before any row is read, whatever the station may read.
|
|
90
|
+
if (!grant && choice.requireActingIdentity
|
|
91
|
+
&& !(await (0, identity_1.actingIdentitySatisfied)(step, { stationAuth: auth, acting: false }))) {
|
|
92
|
+
return stampPointer((0, context_1.notPrimed)({ rule }), rule, input);
|
|
93
|
+
}
|
|
94
|
+
// 4. The row anchors the target: the scheme's facet on the escalation the
|
|
95
|
+
// screen presented. A missing binding is loud misconfiguration. A row the
|
|
96
|
+
// actor may not read answers as one that left the presented state, and
|
|
97
|
+
// discloses nothing of the row.
|
|
98
|
+
const loaded = await escalationService.getEscalation(input.escalationId);
|
|
99
|
+
if (loaded && (await (0, helpers_1.assertReadAccess)(effectiveAuth.userId, loaded))) {
|
|
100
|
+
return stampPointer((0, context_1.conflict)('the item is no longer in the presented state'), rule, input);
|
|
101
|
+
}
|
|
102
|
+
const row = loaded;
|
|
90
103
|
const target = row?.metadata?.[scheme.target_facet];
|
|
91
104
|
if (!row || typeof target !== 'string' || !target) {
|
|
92
105
|
return {
|
|
@@ -104,11 +117,11 @@ async function executeScanChoice(input, auth) {
|
|
|
104
117
|
acting: !!grant,
|
|
105
118
|
grant,
|
|
106
119
|
};
|
|
107
|
-
//
|
|
120
|
+
// 5. The identity gate, per the choice.
|
|
108
121
|
if (choice.requireActingIdentity && !(await (0, identity_1.actingIdentitySatisfied)(step, ctx))) {
|
|
109
122
|
return decorate((0, context_1.notPrimed)(ctx), ctx, input);
|
|
110
123
|
}
|
|
111
|
-
//
|
|
124
|
+
// 6. The row must still match the step's query — the reality the screen
|
|
112
125
|
// showed. A row that moved on (resolved, claimed away, re-routed) is the
|
|
113
126
|
// same double-actor race a second scan loses.
|
|
114
127
|
const located = await (0, locate_1.locateForStep)(step, ctx, 2);
|
|
@@ -116,10 +129,10 @@ async function executeScanChoice(input, auth) {
|
|
|
116
129
|
if (!presented) {
|
|
117
130
|
return decorate((0, context_1.conflict)('the item is no longer in the presented state'), ctx, input);
|
|
118
131
|
}
|
|
119
|
-
//
|
|
132
|
+
// 7. Dispatch through the same atomic executors a direct scan uses.
|
|
120
133
|
const synthesized = { query: step.query, verb: choice.verb, params: choice.params };
|
|
121
134
|
const result = decorate(await (0, verbs_1.dispatchChoiceVerb)(synthesized, ctx, presented), ctx, input);
|
|
122
|
-
//
|
|
135
|
+
// 8. Settle the badge: refund a spend whose act did not land
|
|
123
136
|
const acting = await (0, grant_1.settleGrant)(ctx, result);
|
|
124
137
|
if (acting && result.data)
|
|
125
138
|
result.data = { ...result.data, acting };
|
|
@@ -129,6 +142,17 @@ async function executeScanChoice(input, auth) {
|
|
|
129
142
|
return { status: 500, error: err.message };
|
|
130
143
|
}
|
|
131
144
|
}
|
|
145
|
+
/** Stamp the rule and pointer onto an outcome decided before the row was read. */
|
|
146
|
+
function stampPointer(result, rule, input) {
|
|
147
|
+
if (result.data && typeof result.data === 'object' && 'outcome' in result.data) {
|
|
148
|
+
result.data = {
|
|
149
|
+
...result.data,
|
|
150
|
+
rule: { schemeVersion: rule.scheme_version, category: rule.category, name: rule.name },
|
|
151
|
+
stepIndex: input.stepIndex,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
132
156
|
/** Stamp the rule + pointer identity onto the outcome, mirroring execute. */
|
|
133
157
|
function decorate(result, ctx, input) {
|
|
134
158
|
if (result.data && typeof result.data === 'object' && 'outcome' in result.data) {
|