@hotmeshio/long-tail 0.23.1 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/adapters/express.d.ts +9 -1
- package/build/adapters/express.js +32 -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/index.d.ts +1 -0
- package/build/api/escalations/index.js +4 -1
- package/build/api/escalations/list.d.ts +5 -0
- package/build/api/escalations/list.js +19 -5
- package/build/api/escalations/metadata.js +3 -0
- package/build/api/escalations/related.d.ts +18 -0
- package/build/api/escalations/related.js +205 -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/roles.js +4 -0
- package/build/api/scan-codes/choice.js +31 -7
- package/build/api/scan-codes/present.js +5 -1
- package/build/api/settings.d.ts +1 -1
- package/build/api/settings.js +12 -1
- 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/deploy.d.ts +10 -2
- package/build/api/yaml-workflows/deploy.js +42 -2
- package/build/lib/db/schemas/038_oauth_server.sql +46 -0
- package/build/lib/events/browser-view.d.ts +15 -0
- package/build/lib/events/browser-view.js +101 -0
- package/build/lib/events/nats-ws-filter.d.ts +29 -0
- package/build/lib/events/nats-ws-filter.js +94 -0
- package/build/lib/events/nats-ws-proxy.d.ts +2 -0
- package/build/lib/events/nats-ws-proxy.js +39 -5
- 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 +10 -0
- package/build/lib/events/nats-ws-ticket.js +42 -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 +14 -0
- package/build/modules/config.js +20 -0
- package/build/modules/defaults.d.ts +10 -0
- package/build/modules/defaults.js +12 -1
- package/build/modules/display.d.ts +15 -0
- package/build/modules/display.js +27 -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 +46 -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 +5 -2
- package/build/routes/escalations/list.d.ts +1 -1
- package/build/routes/escalations/list.js +2 -0
- package/build/routes/escalations/metadata.d.ts +1 -1
- package/build/routes/escalations/related.d.ts +7 -0
- package/build/routes/escalations/related.js +60 -0
- 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 +108 -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 +19 -6
- 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/scripts/consolidation-sim.d.ts +25 -0
- package/build/scripts/consolidation-sim.js +141 -0
- package/build/sdk/index.d.ts +12 -0
- package/build/sdk/index.js +2 -0
- package/build/services/agent/authority.d.ts +14 -0
- package/build/services/agent/authority.js +53 -0
- 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 +26 -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 +34 -0
- package/build/services/auth/oauth-server/sql.js +123 -0
- package/build/services/auth/oauth-server/store.d.ts +74 -0
- package/build/services/auth/oauth-server/store.js +151 -0
- package/build/services/auth/sql.d.ts +1 -0
- package/build/services/auth/sql.js +3 -1
- package/build/services/escalation/grouped-list.d.ts +19 -0
- package/build/services/escalation/grouped-list.js +54 -0
- package/build/services/escalation/index.d.ts +4 -0
- package/build/services/escalation/index.js +9 -1
- package/build/services/escalation/queries.d.ts +17 -13
- package/build/services/escalation/queries.js +38 -42
- package/build/services/escalation/read-scope-sql.d.ts +13 -0
- package/build/services/escalation/read-scope-sql.js +19 -0
- package/build/services/escalation/related.d.ts +58 -0
- package/build/services/escalation/related.js +196 -0
- 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/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/server-lifecycle.js +2 -1
- package/build/services/role/index.js +6 -0
- package/build/services/role/seed.js +4 -0
- package/build/services/scan-code/validate-facts.d.ts +1 -1
- package/build/services/scan-code/validate-facts.js +12 -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 +27 -26
- package/build/shared/form-validation/x-lt-scan.d.ts +8 -0
- package/build/shared/form-validation/x-lt-scan.js +20 -1
- package/build/shared/list-schema/index.d.ts +3 -0
- package/build/shared/list-schema/index.js +27 -0
- package/build/shared/list-schema/template.d.ts +14 -0
- package/build/shared/list-schema/template.js +85 -0
- package/build/shared/list-schema/types.d.ts +154 -0
- package/build/shared/list-schema/types.js +55 -0
- package/build/shared/list-schema/validate.d.ts +12 -0
- package/build/shared/list-schema/validate.js +204 -0
- package/build/shared/roles/segment.d.ts +22 -0
- package/build/shared/roles/segment.js +42 -0
- package/build/start/adapters.js +2 -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 +24 -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 +20 -20
- package/build/system/mcp-servers/admin/tasks.js +7 -2
- package/build/system/mcp-servers/admin/users.js +39 -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 +7 -1
- 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/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 +5 -3
- package/build/types/index.js +2 -1
- 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/scan-code/constants.d.ts +7 -0
- package/build/types/scan-code/constants.js +7 -1
- package/build/types/scan-code/response.d.ts +3 -2
- package/build/types/scan-code/rule.d.ts +6 -1
- package/build/types/startup.d.ts +23 -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-DKrqLGjn.js → AdminDashboard-B3mkMIOT.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-DKrqLGjn.js.map → AdminDashboard-B3mkMIOT.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-BoQhRW6U.js → AgentConfigPage-CQj2B678.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-BoQhRW6U.js.map → AgentConfigPage-CQj2B678.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-DZhzuZmO.js → AgentDetailPage-CzrD8JJI.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-DZhzuZmO.js.map → AgentDetailPage-CzrD8JJI.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-5MynmbWX.js → AgentsPage-jg2OFwyW.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-5MynmbWX.js.map → AgentsPage-jg2OFwyW.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-IS28XBRe.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-IS28XBRe.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-C3LR6Sqy.js → BotPicker-DvEJFpwS.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-C3LR6Sqy.js.map → BotPicker-DvEJFpwS.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-COjoOIIH.js → BulkAssignModal-BoQCi-YC.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-COjoOIIH.js.map → BulkAssignModal-BoQCi-YC.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-kwlrcb_t.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-DKxLvOfB.js.map → CapabilitiesPage-kwlrcb_t.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-Cz5sRx-r.js → CollapsibleSection-UMIV4KIj.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-Cz5sRx-r.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-LG03dVgR.js +2 -0
- package/dashboard/dist/assets/CountdownTimer-LG03dVgR.js.map +1 -0
- package/dashboard/dist/assets/{CredentialsPage-DhiHiPsG.js → CredentialsPage-CaFQ6vLb.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-DhiHiPsG.js.map → CredentialsPage-CaFQ6vLb.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-C9SkawB-.js → CronLabel-Co5j7tzW.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-C9SkawB-.js.map → CronLabel-Co5j7tzW.js.map} +1 -1
- package/dashboard/dist/assets/DataTable-FjFhx0SE.js +2 -0
- package/dashboard/dist/assets/DataTable-FjFhx0SE.js.map +1 -0
- package/dashboard/dist/assets/{ElapsedCell-BeK1SUDK.js → ElapsedCell-WJyE9G0T.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-BeK1SUDK.js.map → ElapsedCell-WJyE9G0T.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-BThdefKj.js → EntityTimelinePanel-CDFFfX9d.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-BThdefKj.js.map → EntityTimelinePanel-CDFFfX9d.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-DlDIYb-p.js → EscalationListSchemaPage-CMrUlaKI.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-DlDIYb-p.js.map → EscalationListSchemaPage-CMrUlaKI.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-CQt-Embr.js → EscalationSchemaPage-Dx2Lyfrz.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-CQt-Embr.js.map → EscalationSchemaPage-Dx2Lyfrz.js.map} +1 -1
- package/dashboard/dist/assets/EscalationTimeline-d3nvshOk.js +2 -0
- package/dashboard/dist/assets/EscalationTimeline-d3nvshOk.js.map +1 -0
- package/dashboard/dist/assets/{EscalationTitleSelect-Dewrv8wX.js → EscalationTitleSelect-DWQieOM9.js} +2 -2
- package/dashboard/dist/assets/{EscalationTitleSelect-Dewrv8wX.js.map → EscalationTitleSelect-DWQieOM9.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-BzH-Y-5x.js → EscalationsOverview-BX8Cpi0X.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-BzH-Y-5x.js.map → EscalationsOverview-BX8Cpi0X.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-C97m6IZv.js → EventTable-D1-ITVXS.js} +2 -2
- package/dashboard/dist/assets/{EventTable-C97m6IZv.js.map → EventTable-D1-ITVXS.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-D-6xVHIw.js → FilterBar-ABC9ctin.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-D-6xVHIw.js.map → FilterBar-ABC9ctin.js.map} +1 -1
- package/dashboard/dist/assets/FormattedValue-k27T4bG7.js +2 -0
- package/dashboard/dist/assets/FormattedValue-k27T4bG7.js.map +1 -0
- package/dashboard/dist/assets/{GraphInvokePage-Bwi8EF9Y.js → GraphInvokePage-DKUErxWc.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-Bwi8EF9Y.js.map → GraphInvokePage-DKUErxWc.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-Z_Q03C0z.js → HomePage-C6u9dIpR.js} +2 -2
- package/dashboard/dist/assets/{HomePage-Z_Q03C0z.js.map → HomePage-C6u9dIpR.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-_jWTw5no.js → ListToolbar-gA5rFzkz.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-_jWTw5no.js.map → ListToolbar-gA5rFzkz.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-CjqTuP0N.js → McpOverview-BOPo3J_i.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-CjqTuP0N.js.map → McpOverview-BOPo3J_i.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-leCsje1U.js → McpQueryDetailPage-BRVVi0Zh.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-leCsje1U.js.map → McpQueryDetailPage-BRVVi0Zh.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-C-PyXYX4.js → McpQueryPage-Dmbb6SAc.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-C-PyXYX4.js.map → McpQueryPage-Dmbb6SAc.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-JDrr3uUQ.js → McpRunDetailPage-bMXNO-6V.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-JDrr3uUQ.js.map → McpRunDetailPage-bMXNO-6V.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-DERXQLgZ.js → McpRunsPage-Bi9AMWja.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-DERXQLgZ.js.map → McpRunsPage-Bi9AMWja.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-B2DA7n9m.js → OperationsPage-CvR74ZUJ.js} +3 -3
- package/dashboard/dist/assets/OperationsPage-CvR74ZUJ.js.map +1 -0
- package/dashboard/dist/assets/OperatorDashboard-DctmZw10.js +2 -0
- package/dashboard/dist/assets/OperatorDashboard-DctmZw10.js.map +1 -0
- package/dashboard/dist/assets/{PersonaDetailPage-ChXwJ6u5.js → PersonaDetailPage-Ubqm2rQH.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-ChXwJ6u5.js.map → PersonaDetailPage-Ubqm2rQH.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-BFFxncSE.js → PersonasPage-BpFL2rpo.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-BFFxncSE.js.map → PersonasPage-BpFL2rpo.js.map} +1 -1
- package/dashboard/dist/assets/PortalPage-Dfc_Q02R.js +2 -0
- package/dashboard/dist/assets/PortalPage-Dfc_Q02R.js.map +1 -0
- package/dashboard/dist/assets/ProcessDetailPage-liJspvQh.js +2 -0
- package/dashboard/dist/assets/{ProcessDetailPage-D7EYwW-j.js.map → ProcessDetailPage-liJspvQh.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-CakYRtnE.js → ProcessesListPage-C3OM5ZUy.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-CakYRtnE.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-CKbGwezP.js → RoleDetailPage-CrlYCh-R.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-CKbGwezP.js.map → RoleDetailPage-CrlYCh-R.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-Czu7Zku4.js → RolesPage-BaazL_pt.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-Czu7Zku4.js.map → RolesPage-BaazL_pt.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-6BLScYTX.js → RunAsSelector-DxuV0fa1.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-6BLScYTX.js.map → RunAsSelector-DxuV0fa1.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-Cv9q8Bvt.js → ScanCodesPage-C0mvmYTq.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-Cv9q8Bvt.js.map → ScanCodesPage-C0mvmYTq.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-BxazXYIc.js → ScanSchemeDetailPage-CiJgt5dZ.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-BxazXYIc.js.map → ScanSchemeDetailPage-CiJgt5dZ.js.map} +1 -1
- package/dashboard/dist/assets/ScanStationPage-DzGaXc40.js +2 -0
- package/dashboard/dist/assets/ScanStationPage-DzGaXc40.js.map +1 -0
- package/dashboard/dist/assets/{StickyPagination-DsdtYoXR.js → StickyPagination-CqbjVY6T.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-DsdtYoXR.js.map → StickyPagination-CqbjVY6T.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-CT3FQoT3.js → StreamMessageDetail-wX3i0aqs.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-CT3FQoT3.js.map → StreamMessageDetail-wX3i0aqs.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-C8TjkJ10.js → SwimlaneTimeline-C50PsFoV.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-C8TjkJ10.js.map → SwimlaneTimeline-C50PsFoV.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-DGUzdBFN.js → TaskDetailPage-bbNSv4Ae.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-DGUzdBFN.js.map → TaskDetailPage-bbNSv4Ae.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-BVIP6-EZ.js → TasksListPage-CDWnm_d9.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-BVIP6-EZ.js.map → TasksListPage-CDWnm_d9.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-C-rd9F9g.js → TimeAgo-BLjqlfoX.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-C-rd9F9g.js.map → TimeAgo-BLjqlfoX.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DPbchDOI.js → TimestampCell-CnW0ENb5.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DPbchDOI.js.map → TimestampCell-CnW0ENb5.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-DAUC8DHK.js → ToolTestPanel-DkMgCB-k.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-DAUC8DHK.js.map → ToolTestPanel-DkMgCB-k.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-70mMKBzG.js → TopicDetailPage-g3pljKKX.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-70mMKBzG.js.map → TopicDetailPage-g3pljKKX.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-CE3hBthn.js → TopicsPage-CVcCYdy-.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-CE3hBthn.js.map → TopicsPage-CVcCYdy-.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-BDBDA-LR.js → UserName-D6zGIK2i.js} +2 -2
- package/dashboard/dist/assets/{UserName-BDBDA-LR.js.map → UserName-D6zGIK2i.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-BbkLZ1co.js → WorkflowExecutionPage-B8g81FCJ.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-BbkLZ1co.js.map → WorkflowExecutionPage-B8g81FCJ.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-Bp1L7Ggz.js → WorkflowsDashboard-nxT3bv6W.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-Bp1L7Ggz.js.map → WorkflowsDashboard-nxT3bv6W.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-IeTKHAi4.js → WorkflowsOverview-grI-KAI2.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-IeTKHAi4.js.map → WorkflowsOverview-grI-KAI2.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DtKCXnKt.js → YamlWorkflowDetailPage-BoZ-hfBE.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DtKCXnKt.js.map → YamlWorkflowDetailPage-BoZ-hfBE.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-CEcZBV_3.js → YamlWorkflowsPage-Bf04rwRv.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-CEcZBV_3.js.map → YamlWorkflowsPage-Bf04rwRv.js.map} +1 -1
- package/dashboard/dist/assets/{agents-BT-sEk81.js → agents-Dphpdi8l.js} +2 -2
- package/dashboard/dist/assets/{agents-BT-sEk81.js.map → agents-Dphpdi8l.js.map} +1 -1
- package/dashboard/dist/assets/{bots-DRoAdLek.js → bots-DIFE298x.js} +2 -2
- package/dashboard/dist/assets/{bots-DRoAdLek.js.map → bots-DIFE298x.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-Bc-nJk6y.js → capabilities-D7Y7LClY.js} +2 -2
- package/dashboard/dist/assets/{capabilities-Bc-nJk6y.js.map → capabilities-D7Y7LClY.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-aXceSIRf.js → controlplane-D1TGcYsS.js} +2 -2
- package/dashboard/dist/assets/{controlplane-aXceSIRf.js.map → controlplane-D1TGcYsS.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-cwZE6xyo.js +2 -0
- package/dashboard/dist/assets/escalation-columns-cwZE6xyo.js.map +1 -0
- package/dashboard/dist/assets/{index-CuBGGwXf.js → index-BzYcUPdD.js} +2 -2
- package/dashboard/dist/assets/{index-CuBGGwXf.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-h2gX31B2.js → index-ChV7pBjM.js} +2 -2
- package/dashboard/dist/assets/{index-h2gX31B2.js.map → index-ChV7pBjM.js.map} +1 -1
- package/dashboard/dist/assets/index-CniRa65p.js +3 -0
- package/dashboard/dist/assets/index-CniRa65p.js.map +1 -0
- package/dashboard/dist/assets/index-CxdjT1Yk.js +2 -0
- package/dashboard/dist/assets/{index-BCFEQEMC.js.map → index-CxdjT1Yk.js.map} +1 -1
- package/dashboard/dist/assets/{index-CZyO9hRb.js → index-DAvi5_2T.js} +2 -2
- package/dashboard/dist/assets/{index-CZyO9hRb.js.map → index-DAvi5_2T.js.map} +1 -1
- package/dashboard/dist/assets/{index-Djsoi8DI.js → index-DN-kX7hL.js} +2 -2
- package/dashboard/dist/assets/{index-Djsoi8DI.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-DBxpyIw5.js → index-DpKOr311.js} +2 -2
- package/dashboard/dist/assets/{index-DBxpyIw5.js.map → index-DpKOr311.js.map} +1 -1
- package/dashboard/dist/assets/{index-Ba-s5Yb5.js → index-Dy1wWu2e.js} +2 -2
- package/dashboard/dist/assets/{index-Ba-s5Yb5.js.map → index-Dy1wWu2e.js.map} +1 -1
- package/dashboard/dist/assets/{index-DH03y-UT.js → index-HLu98Sqh.js} +2 -2
- package/dashboard/dist/assets/{index-DH03y-UT.js.map → index-HLu98Sqh.js.map} +1 -1
- package/dashboard/dist/assets/{index-C3VTJcrp.js → index-ag2pCAPu.js} +2 -2
- package/dashboard/dist/assets/{index-C3VTJcrp.js.map → index-ag2pCAPu.js.map} +1 -1
- package/dashboard/dist/assets/index-gkxPN7Vx.js +13 -0
- package/dashboard/dist/assets/{index-BEPKAjna.js.map → index-gkxPN7Vx.js.map} +1 -1
- package/dashboard/dist/assets/index-m9A3UYst.css +1 -0
- package/dashboard/dist/assets/{knowledge-BhW8V-Hq.js → knowledge-DnMs-SOJ.js} +2 -2
- package/dashboard/dist/assets/{knowledge-BhW8V-Hq.js.map → knowledge-DnMs-SOJ.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-BYfSMQzh.js → mcp-CwW-K3r4.js} +2 -2
- package/dashboard/dist/assets/{mcp-BYfSMQzh.js.map → mcp-CwW-K3r4.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-DUJoOk_q.js → mcp-query-BZt5e8_Q.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-DUJoOk_q.js.map → mcp-query-BZt5e8_Q.js.map} +1 -1
- package/dashboard/dist/assets/{personas-jT1O_SB4.js → personas-UA-Xn60f.js} +2 -2
- package/dashboard/dist/assets/{personas-jT1O_SB4.js.map → personas-UA-Xn60f.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-Bp-wIaz2.js → pipelines-Cu3PARum.js} +2 -2
- package/dashboard/dist/assets/{pipelines-Bp-wIaz2.js.map → pipelines-Cu3PARum.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-CCrvnXbz.js → tasks-BO6h8GJE.js} +2 -2
- package/dashboard/dist/assets/{tasks-CCrvnXbz.js.map → tasks-BO6h8GJE.js.map} +1 -1
- package/dashboard/dist/assets/{topics-Blft0I1L.js → topics-CWjCR-17.js} +2 -2
- package/dashboard/dist/assets/{topics-Blft0I1L.js.map → topics-CWjCR-17.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-BYqbcism.js → useDebouncedValue-6t0jx1RB.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-BYqbcism.js.map → useDebouncedValue-6t0jx1RB.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-BfxJAUgG.js → useNamespace-CqpoQx6D.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-BfxJAUgG.js.map → useNamespace-CqpoQx6D.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BukJuWpb.js → useYamlActivityEvents-hmCQQwzB.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BukJuWpb.js.map → useYamlActivityEvents-hmCQQwzB.js.map} +1 -1
- package/dashboard/dist/assets/validate-BIRn4a6d.js +2 -0
- package/dashboard/dist/assets/validate-BIRn4a6d.js.map +1 -0
- package/dashboard/dist/assets/{yaml-workflows-DeRWqMGk.js → yaml-workflows-ziUdZhKY.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-DeRWqMGk.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 +49 -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 +5 -2
- 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 +18 -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/code-owned-configuration.md +12 -0
- 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/hitl/portal.md +2 -0
- package/docs/hitl/x-lt-list-schema.md +88 -1
- package/docs/hitl/x-lt-scan.md +4 -1
- package/docs/iam.md +7 -5
- package/docs/mcp.md +159 -210
- package/docs/oauth-and-delegation.md +32 -21
- package/docs/scan-codes.md +7 -1
- package/docs/topics.md +2 -0
- package/docs/workflows.md +14 -112
- package/package.json +6 -3
- package/dashboard/dist/assets/AvailableEscalationsPage-CWMyy3IL.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-CWMyy3IL.js.map +0 -1
- package/dashboard/dist/assets/CapabilitiesPage-DKxLvOfB.js +0 -2
- package/dashboard/dist/assets/ConfirmDeleteModal-Beq1vQtY.js +0 -2
- package/dashboard/dist/assets/ConfirmDeleteModal-Beq1vQtY.js.map +0 -1
- package/dashboard/dist/assets/CountdownTimer-BUBl_4mP.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-BUBl_4mP.js.map +0 -1
- package/dashboard/dist/assets/DataTable-spX1dFyb.js +0 -2
- package/dashboard/dist/assets/DataTable-spX1dFyb.js.map +0 -1
- package/dashboard/dist/assets/EscalationListView-DTIVuym4.js +0 -2
- package/dashboard/dist/assets/EscalationListView-DTIVuym4.js.map +0 -1
- package/dashboard/dist/assets/EscalationTimeline-DNKNp6pL.js +0 -2
- package/dashboard/dist/assets/EscalationTimeline-DNKNp6pL.js.map +0 -1
- package/dashboard/dist/assets/OperationsPage-B2DA7n9m.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-C8RtPv8P.js +0 -2
- package/dashboard/dist/assets/OperatorDashboard-C8RtPv8P.js.map +0 -1
- package/dashboard/dist/assets/PortalPage-Xk1zVneM.js +0 -2
- package/dashboard/dist/assets/PortalPage-Xk1zVneM.js.map +0 -1
- package/dashboard/dist/assets/ProcessDetailPage-D7EYwW-j.js +0 -2
- package/dashboard/dist/assets/ResolverForm-BwVOJUpJ.js +0 -8
- package/dashboard/dist/assets/ResolverForm-BwVOJUpJ.js.map +0 -1
- package/dashboard/dist/assets/ScanStationPage-Cg8LCFR7.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-Cg8LCFR7.js.map +0 -1
- package/dashboard/dist/assets/escalation-columns-Bf09Q89t.js +0 -2
- package/dashboard/dist/assets/escalation-columns-Bf09Q89t.js.map +0 -1
- package/dashboard/dist/assets/index-BCFEQEMC.js +0 -2
- package/dashboard/dist/assets/index-BEPKAjna.js +0 -13
- package/dashboard/dist/assets/index-BUYokcrl.js +0 -67
- package/dashboard/dist/assets/index-BUYokcrl.js.map +0 -1
- package/dashboard/dist/assets/index-CcgmR-7-.js +0 -2
- package/dashboard/dist/assets/index-CcgmR-7-.js.map +0 -1
- package/dashboard/dist/assets/index-D1mKf_qz.js +0 -3
- package/dashboard/dist/assets/index-D1mKf_qz.js.map +0 -1
- package/dashboard/dist/assets/index-DcppjzP5.css +0 -1
|
@@ -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
|
+
}
|
|
@@ -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
|
/**
|
|
@@ -19,6 +19,7 @@ exports.getRoleFormSchema = getRoleFormSchema;
|
|
|
19
19
|
exports.getRoleMetadataSchema = getRoleMetadataSchema;
|
|
20
20
|
exports.getRoleProperties = getRoleProperties;
|
|
21
21
|
exports.deleteRole = deleteRole;
|
|
22
|
+
const list_schema_1 = require("../../shared/list-schema");
|
|
22
23
|
const db_1 = require("../../lib/db");
|
|
23
24
|
const user_1 = require("../user");
|
|
24
25
|
const sql_1 = require("./sql");
|
|
@@ -128,6 +129,11 @@ async function createRole(role) {
|
|
|
128
129
|
* resets to {}). One atomic UPDATE — see UPDATE_ROLE_METADATA.
|
|
129
130
|
*/
|
|
130
131
|
async function updateRoleMetadata(role, input) {
|
|
132
|
+
if (input.list_schema != null) {
|
|
133
|
+
const listSchemaError = (0, list_schema_1.listSchemaRelationsError)(input.list_schema);
|
|
134
|
+
if (listSchemaError)
|
|
135
|
+
throw new Error(`list_schema: ${listSchemaError}`);
|
|
136
|
+
}
|
|
131
137
|
const pool = (0, db_1.getPool)();
|
|
132
138
|
const provided = (key) => input[key] !== undefined;
|
|
133
139
|
const upstreams = [...new Set(input.upstream_roles ?? [])].sort();
|
|
@@ -9,6 +9,7 @@ const logger_1 = require("../../lib/logger");
|
|
|
9
9
|
const index_1 = require("./index");
|
|
10
10
|
const sql_1 = require("./sql");
|
|
11
11
|
const badge_grant_1 = require("./badge-grant");
|
|
12
|
+
const list_schema_1 = require("../../shared/list-schema");
|
|
12
13
|
const types_1 = require("./types");
|
|
13
14
|
/** Recorded on schema snapshots written by the startup apply. */
|
|
14
15
|
exports.STARTUP_CHANGE_SUMMARY = 'startup apply (code)';
|
|
@@ -84,6 +85,9 @@ async function applyRoleConfig(cfg, codeOwned) {
|
|
|
84
85
|
const grantError = (0, badge_grant_1.badgeGrantError)(cfg.properties?.[types_1.ROLE_PROPERTY_KEYS.BADGE_GRANT]);
|
|
85
86
|
if (grantError)
|
|
86
87
|
throw new Error(`role ${cfg.role}: ${grantError}`);
|
|
88
|
+
const listSchemaError = cfg.list_schema != null ? (0, list_schema_1.listSchemaRelationsError)(cfg.list_schema) : null;
|
|
89
|
+
if (listSchemaError)
|
|
90
|
+
throw new Error(`role ${cfg.role}: list_schema: ${listSchemaError}`);
|
|
87
91
|
const created = await (0, index_1.createRole)(cfg.role);
|
|
88
92
|
const pool = (0, db_1.getPool)();
|
|
89
93
|
const { rows } = await pool.query(sql_1.GET_ROLE_ROW, [cfg.role]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ScanStep } from '../../types';
|
|
2
2
|
/** The most facts a station screen states before it reads as a data dump. */
|
|
3
3
|
export declare const SCAN_FACTS_MAX = 12;
|
|
4
|
-
/** `facts` on a present step: labeled template values the station states. */
|
|
4
|
+
/** `facts` on a present step: labeled template values the station states, optionally formatted. */
|
|
5
5
|
export declare function assertValidFacts(step: ScanStep, at: string): void;
|
|
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SCAN_FACTS_MAX = void 0;
|
|
4
4
|
exports.assertValidFacts = assertValidFacts;
|
|
5
5
|
const types_1 = require("../../types");
|
|
6
|
+
const FACT_FORMATS = new Set(Object.values(types_1.SCAN_FACT_FORMATS));
|
|
7
|
+
/** A formatted fact reads one value: a single `{bag.key}` token. */
|
|
8
|
+
const SINGLE_TOKEN = /^\{[a-z]+\.[^{}]+\}$/;
|
|
6
9
|
/** The most facts a station screen states before it reads as a data dump. */
|
|
7
10
|
exports.SCAN_FACTS_MAX = 12;
|
|
8
|
-
/** `facts` on a present step: labeled template values the station states. */
|
|
11
|
+
/** `facts` on a present step: labeled template values the station states, optionally formatted. */
|
|
9
12
|
function assertValidFacts(step, at) {
|
|
10
13
|
if (step.facts === undefined)
|
|
11
14
|
return;
|
|
@@ -20,5 +23,13 @@ function assertValidFacts(step, at) {
|
|
|
20
23
|
}
|
|
21
24
|
if (typeof fact.value !== 'string')
|
|
22
25
|
throw new Error(`${at}: facts[${i}].value must be a template string`);
|
|
26
|
+
if (fact.format === undefined)
|
|
27
|
+
return;
|
|
28
|
+
if (!FACT_FORMATS.has(fact.format)) {
|
|
29
|
+
throw new Error(`${at}: facts[${i}].format must be one of ${[...FACT_FORMATS].join(', ')}`);
|
|
30
|
+
}
|
|
31
|
+
if (!SINGLE_TOKEN.test(fact.value.trim())) {
|
|
32
|
+
throw new Error(`${at}: facts[${i}] with a format must read a single token, e.g. {item.releaseAt}`);
|
|
33
|
+
}
|
|
23
34
|
});
|
|
24
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
|
}>;
|
|
@@ -33,11 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.buildMergedYaml = void 0;
|
|
36
|
+
exports.SCOPE_KEY = exports.buildMergedYaml = void 0;
|
|
37
37
|
exports.getEngine = getEngine;
|
|
38
38
|
exports.deployAppId = deployAppId;
|
|
39
39
|
exports.deployYamlWorkflow = deployYamlWorkflow;
|
|
40
40
|
exports.activateYamlWorkflow = activateYamlWorkflow;
|
|
41
|
+
exports.withTrustedScope = withTrustedScope;
|
|
41
42
|
exports.invokeYamlWorkflow = invokeYamlWorkflow;
|
|
42
43
|
exports.invokeYamlWorkflowSync = invokeYamlWorkflowSync;
|
|
43
44
|
exports.stopEngine = stopEngine;
|
|
@@ -142,12 +143,23 @@ async function activateYamlWorkflow(appId, version) {
|
|
|
142
143
|
logger_1.loggerRegistry.info(`[yaml-workflow] activated ${appId} v${version}`);
|
|
143
144
|
return result;
|
|
144
145
|
}
|
|
146
|
+
/** The key compiled workflow activities read their identity context from. */
|
|
147
|
+
exports.SCOPE_KEY = '_scope';
|
|
148
|
+
/**
|
|
149
|
+
* The trigger data a compiled workflow starts with. Identity context is never
|
|
150
|
+
* taken from the data a caller supplied: any `_scope` there is dropped, and
|
|
151
|
+
* only the scope the server resolved is set.
|
|
152
|
+
*/
|
|
153
|
+
function withTrustedScope(data, scope) {
|
|
154
|
+
const { [exports.SCOPE_KEY]: _dropped, ...rest } = data ?? {};
|
|
155
|
+
return scope ? { ...rest, [exports.SCOPE_KEY]: scope } : rest;
|
|
156
|
+
}
|
|
145
157
|
/**
|
|
146
158
|
* Invoke a YAML workflow (fire-and-forget). Returns the job ID.
|
|
147
159
|
*/
|
|
148
|
-
async function invokeYamlWorkflow(appId, topic, data, entity, context) {
|
|
160
|
+
async function invokeYamlWorkflow(appId, topic, data, entity, context, scope) {
|
|
149
161
|
const engine = await getEngine(appId);
|
|
150
|
-
return engine.pub(topic, data, context, entity ? { entity } : undefined);
|
|
162
|
+
return engine.pub(topic, withTrustedScope(data, scope), context, entity ? { entity } : undefined);
|
|
151
163
|
}
|
|
152
164
|
/**
|
|
153
165
|
* Invoke a YAML workflow and wait for the result.
|
|
@@ -158,7 +170,7 @@ async function invokeYamlWorkflow(appId, topic, data, entity, context) {
|
|
|
158
170
|
*
|
|
159
171
|
* Source: @hotmeshio/hotmesh engine/index.js pubsub()
|
|
160
172
|
*/
|
|
161
|
-
async function invokeYamlWorkflowSync(appId, topic, data, timeout, entity) {
|
|
173
|
+
async function invokeYamlWorkflowSync(appId, topic, data, timeout, entity, scope) {
|
|
162
174
|
const hotmesh = await getEngine(appId);
|
|
163
175
|
const engine = hotmesh.engine;
|
|
164
176
|
const timeoutMs = timeout ?? defaults_1.WORKFLOW_SYNC_TIMEOUT_MS;
|
|
@@ -171,7 +183,7 @@ async function invokeYamlWorkflowSync(appId, topic, data, timeout, entity) {
|
|
|
171
183
|
};
|
|
172
184
|
// Publish with entity via extended param
|
|
173
185
|
const extended = entity ? { entity } : undefined;
|
|
174
|
-
const jobId = await engine.pub(topic, data, context, extended);
|
|
186
|
+
const jobId = await engine.pub(topic, withTrustedScope(data, scope), context, extended);
|
|
175
187
|
return new Promise((resolve, reject) => {
|
|
176
188
|
engine.registerJobCallback(jobId, (_topic, output) => {
|
|
177
189
|
if (output.metadata.err) {
|
|
@@ -37,36 +37,37 @@ exports.invokeYamlWorkflow = invokeYamlWorkflow;
|
|
|
37
37
|
const yamlDeployer = __importStar(require("./deployer"));
|
|
38
38
|
const principal_1 = require("../iam/principal");
|
|
39
39
|
const publish_1 = require("../../lib/events/publish");
|
|
40
|
+
/**
|
|
41
|
+
* The identity context compiled workflow activities run under, from the
|
|
42
|
+
* server-side identity: execute_as with the invoker as initiator, else the
|
|
43
|
+
* invoker. Never read from the caller's data.
|
|
44
|
+
*/
|
|
45
|
+
async function resolveScope(executeAs, userId) {
|
|
46
|
+
if (executeAs) {
|
|
47
|
+
const [botPrincipal, invokerPrincipal] = await Promise.all([
|
|
48
|
+
(0, principal_1.resolvePrincipal)(executeAs),
|
|
49
|
+
userId ? (0, principal_1.resolvePrincipal)(userId) : Promise.resolve(null),
|
|
50
|
+
]);
|
|
51
|
+
if (!botPrincipal)
|
|
52
|
+
return undefined;
|
|
53
|
+
return {
|
|
54
|
+
principal: botPrincipal,
|
|
55
|
+
scopes: ['mcp:tool:call'],
|
|
56
|
+
...(invokerPrincipal ? { initiatedBy: userId, initiatingPrincipal: invokerPrincipal } : {}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (!userId)
|
|
60
|
+
return undefined;
|
|
61
|
+
const principal = await (0, principal_1.resolvePrincipal)(userId);
|
|
62
|
+
return principal ? { principal, scopes: ['mcp:tool:call'] } : undefined;
|
|
63
|
+
}
|
|
40
64
|
/**
|
|
41
65
|
* Invoke a YAML workflow with scope injection.
|
|
42
66
|
* Shared by HTTP route and cron callback.
|
|
43
67
|
*/
|
|
44
68
|
async function invokeYamlWorkflow(wf, options = {}) {
|
|
45
69
|
const data = { ...(options.data || {}) };
|
|
46
|
-
|
|
47
|
-
if (!data._scope) {
|
|
48
|
-
const executeAs = options.execute_as;
|
|
49
|
-
const userId = options.userId;
|
|
50
|
-
if (executeAs) {
|
|
51
|
-
const [botPrincipal, invokerPrincipal] = await Promise.all([
|
|
52
|
-
(0, principal_1.resolvePrincipal)(executeAs),
|
|
53
|
-
userId ? (0, principal_1.resolvePrincipal)(userId) : Promise.resolve(null),
|
|
54
|
-
]);
|
|
55
|
-
if (botPrincipal) {
|
|
56
|
-
data._scope = {
|
|
57
|
-
principal: botPrincipal,
|
|
58
|
-
scopes: ['mcp:tool:call'],
|
|
59
|
-
...(invokerPrincipal ? { initiatedBy: userId, initiatingPrincipal: invokerPrincipal } : {}),
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else if (userId) {
|
|
64
|
-
const principal = await (0, principal_1.resolvePrincipal)(userId);
|
|
65
|
-
if (principal) {
|
|
66
|
-
data._scope = { principal, scopes: ['mcp:tool:call'] };
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
+
const scope = await resolveScope(options.execute_as, options.userId);
|
|
70
71
|
if (options.source) {
|
|
71
72
|
if (!data._metadata)
|
|
72
73
|
data._metadata = {};
|
|
@@ -85,7 +86,7 @@ async function invokeYamlWorkflow(wf, options = {}) {
|
|
|
85
86
|
status: 'running',
|
|
86
87
|
});
|
|
87
88
|
try {
|
|
88
|
-
const { job_id, result } = await yamlDeployer.invokeYamlWorkflowSync(wf.app_id, wf.graph_topic, data, options.timeout, wf.graph_topic);
|
|
89
|
+
const { job_id, result } = await yamlDeployer.invokeYamlWorkflowSync(wf.app_id, wf.graph_topic, data, options.timeout, wf.graph_topic, scope);
|
|
89
90
|
(0, publish_1.publishWorkflowEvent)({
|
|
90
91
|
type: 'workflow.completed',
|
|
91
92
|
source: 'graph',
|
|
@@ -121,7 +122,7 @@ async function invokeYamlWorkflow(wf, options = {}) {
|
|
|
121
122
|
},
|
|
122
123
|
}
|
|
123
124
|
: undefined;
|
|
124
|
-
const jobId = await yamlDeployer.invokeYamlWorkflow(wf.app_id, wf.graph_topic, data, wf.graph_topic, context);
|
|
125
|
+
const jobId = await yamlDeployer.invokeYamlWorkflow(wf.app_id, wf.graph_topic, data, wf.graph_topic, context, scope);
|
|
125
126
|
(0, publish_1.publishWorkflowEvent)({
|
|
126
127
|
type: 'workflow.started',
|
|
127
128
|
source: 'graph',
|
|
@@ -10,6 +10,8 @@ export interface ScanSink {
|
|
|
10
10
|
expectError: string;
|
|
11
11
|
/** Array fields: 'count' takes a value as many times as it is expected. */
|
|
12
12
|
multiplicity: 'count' | 'once';
|
|
13
|
+
/** Array fields: the instruction shown while the field is empty. */
|
|
14
|
+
prompt?: string;
|
|
13
15
|
}
|
|
14
16
|
/** The parts of a parsed scan a sink reads. */
|
|
15
17
|
export interface SinkScan {
|
|
@@ -30,6 +32,12 @@ export declare function resolveScanExpected(sink: ScanSink, ctx: Record<string,
|
|
|
30
32
|
* each expected value once (or as many times as expected, with 'count').
|
|
31
33
|
*/
|
|
32
34
|
export declare function scanSinkError(value: unknown, fieldSchema: Schema | undefined, ctx: Record<string, unknown> | undefined): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* How many scans complete an array field: the scans its expected list admits
|
|
37
|
+
* (each listing under 'count', each distinct value otherwise), else
|
|
38
|
+
* `maxItems`, else null. The checklist and the admission gate share it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function scanTargetCount(fieldSchema: Schema | undefined, ctx: Record<string, unknown> | undefined): number | null;
|
|
33
41
|
/** What a scan does to a field: the next value, or the error to show (nothing written). */
|
|
34
42
|
export declare function applyScanToField(current: unknown, scan: SinkScan, fieldSchema: Schema, ctx: Record<string, unknown> | undefined): {
|
|
35
43
|
ok: true;
|