@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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.requireMcpAuth = void 0;
|
|
7
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
|
+
const auth_1 = require("./auth");
|
|
9
|
+
const oauth_server_1 = require("./oauth-server");
|
|
10
|
+
const oauth_server_2 = require("../services/auth/oauth-server");
|
|
11
|
+
const CHALLENGE_HEADER = 'WWW-Authenticate';
|
|
12
|
+
function bearerToken(req) {
|
|
13
|
+
const header = req.headers.authorization;
|
|
14
|
+
return header?.startsWith('Bearer ') ? header.slice(7) : null;
|
|
15
|
+
}
|
|
16
|
+
function isAccessToken(token) {
|
|
17
|
+
const decoded = jsonwebtoken_1.default.decode(token, { complete: true });
|
|
18
|
+
return decoded?.header?.typ === oauth_server_2.ACCESS_TOKEN_TYPE;
|
|
19
|
+
}
|
|
20
|
+
function challenge(settings, error) {
|
|
21
|
+
const base = `Bearer resource_metadata="${settings.resourceMetadataUrl}"`;
|
|
22
|
+
return error ? `${base}, error="${error}"` : base;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Authentication for `/mcp`. Only a credential the request carries itself
|
|
26
|
+
* authenticates: the host's SSO cookie fallback never applies here, since a
|
|
27
|
+
* cookie rides along on a request any page the person visits can send. With
|
|
28
|
+
* the OAuth server configured, an access token for this resource
|
|
29
|
+
* authenticates the request while its grant is live, and every 401 carries
|
|
30
|
+
* the RFC 9728 challenge so MCP clients can discover how to sign in. Any other
|
|
31
|
+
* credential goes through the configured auth adapter unchanged.
|
|
32
|
+
*/
|
|
33
|
+
const requireMcpAuth = async (req, res, next) => {
|
|
34
|
+
const settings = (0, oauth_server_1.getOAuthServerSettings)();
|
|
35
|
+
if (!settings)
|
|
36
|
+
return (0, auth_1.requireCredentialAuth)(req, res, next);
|
|
37
|
+
const token = bearerToken(req);
|
|
38
|
+
if (token && isAccessToken(token)) {
|
|
39
|
+
const claims = (0, oauth_server_2.verifyAccessToken)(token, { issuer: settings.issuer, audience: settings.resource });
|
|
40
|
+
const live = claims ? await (0, oauth_server_2.getLiveGrant)(claims.gid, claims.sub) : null;
|
|
41
|
+
if (!claims || !live || live.client_id !== claims.client_id) {
|
|
42
|
+
res.setHeader(CHALLENGE_HEADER, challenge(settings, 'invalid_token'));
|
|
43
|
+
res.status(401).json({ error: 'invalid_token' });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
req.auth = (0, oauth_server_2.accessTokenPrincipal)(claims, live);
|
|
47
|
+
next();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
res.setHeader(CHALLENGE_HEADER, challenge(settings));
|
|
51
|
+
return (0, auth_1.requireCredentialAuth)(req, res, (err) => {
|
|
52
|
+
res.removeHeader(CHALLENGE_HEADER);
|
|
53
|
+
next(err);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
exports.requireMcpAuth = requireMcpAuth;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LTOAuthServerConfig } from '../types/oauth-server';
|
|
2
|
+
/** The configured authorization server, with the URLs derived from its issuer. */
|
|
3
|
+
export interface OAuthServerSettings {
|
|
4
|
+
issuer: string;
|
|
5
|
+
/** The protected resource, and the audience of its access tokens. */
|
|
6
|
+
resource: string;
|
|
7
|
+
/** RFC 9728 protected-resource metadata URL for `resource`. */
|
|
8
|
+
resourceMetadataUrl: string;
|
|
9
|
+
/** Canonical https redirect URIs allowed beyond loopback. */
|
|
10
|
+
allowedRedirectUris: string[];
|
|
11
|
+
}
|
|
12
|
+
/** An https URI in canonical form, or null when it is not one (a malformed entry never matches). */
|
|
13
|
+
export declare function canonicalHttpsUri(uri: string): string | null;
|
|
14
|
+
export declare function setOAuthServerConfig(config: LTOAuthServerConfig): void;
|
|
15
|
+
/** Read per request: routers may be mounted before start() configures the server. */
|
|
16
|
+
export declare function getOAuthServerSettings(): OAuthServerSettings | null;
|
|
17
|
+
/** Reset. Used by tests. */
|
|
18
|
+
export declare function clearOAuthServerConfig(): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canonicalHttpsUri = canonicalHttpsUri;
|
|
4
|
+
exports.setOAuthServerConfig = setOAuthServerConfig;
|
|
5
|
+
exports.getOAuthServerSettings = getOAuthServerSettings;
|
|
6
|
+
exports.clearOAuthServerConfig = clearOAuthServerConfig;
|
|
7
|
+
/** An https URI in canonical form, or null when it is not one (a malformed entry never matches). */
|
|
8
|
+
function canonicalHttpsUri(uri) {
|
|
9
|
+
try {
|
|
10
|
+
const url = new URL(uri);
|
|
11
|
+
if (url.protocol !== 'https:' || url.username || url.password || url.hash)
|
|
12
|
+
return null;
|
|
13
|
+
return url.href;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
let settings = null;
|
|
20
|
+
function setOAuthServerConfig(config) {
|
|
21
|
+
const issuer = config.issuer.replace(/\/+$/, '');
|
|
22
|
+
const resource = `${issuer}/mcp`;
|
|
23
|
+
const url = new URL(resource);
|
|
24
|
+
settings = {
|
|
25
|
+
issuer,
|
|
26
|
+
resource,
|
|
27
|
+
resourceMetadataUrl: `${url.origin}/.well-known/oauth-protected-resource${url.pathname}`,
|
|
28
|
+
allowedRedirectUris: (config.allowedRedirectUris ?? [])
|
|
29
|
+
.map(canonicalHttpsUri)
|
|
30
|
+
.filter((uri) => uri !== null),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Read per request: routers may be mounted before start() configures the server. */
|
|
34
|
+
function getOAuthServerSettings() {
|
|
35
|
+
return settings;
|
|
36
|
+
}
|
|
37
|
+
/** Reset. Used by tests. */
|
|
38
|
+
function clearOAuthServerConfig() {
|
|
39
|
+
settings = null;
|
|
40
|
+
}
|
package/build/routes/agents.js
CHANGED
|
@@ -33,10 +33,26 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const api = __importStar(require("../api/agents"));
|
|
38
38
|
const subApi = __importStar(require("../api/agent-subscriptions"));
|
|
39
|
-
const
|
|
39
|
+
const auth_1 = require("../modules/auth");
|
|
40
|
+
const authority_1 = require("../services/agent/authority");
|
|
41
|
+
const workflow_invocation_1 = require("../services/workflow-invocation");
|
|
42
|
+
const router = (0, http_1.Router)();
|
|
43
|
+
/** Run an authority check; answer its refusal and return false when it refuses. */
|
|
44
|
+
async function authorized(check, res) {
|
|
45
|
+
try {
|
|
46
|
+
await check();
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
if (!(err instanceof workflow_invocation_1.InvocationError))
|
|
51
|
+
throw err;
|
|
52
|
+
res.status(err.statusCode).json({ error: err.message });
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
40
56
|
/**
|
|
41
57
|
* GET /api/agents
|
|
42
58
|
* List agents with optional filters.
|
|
@@ -63,12 +79,14 @@ router.get('/:id', async (req, res) => {
|
|
|
63
79
|
* POST /api/agents
|
|
64
80
|
* Create a new agent.
|
|
65
81
|
*/
|
|
66
|
-
router.post('/', async (req, res) => {
|
|
82
|
+
router.post('/', auth_1.requireBuilder, async (req, res) => {
|
|
67
83
|
const { id } = req.body;
|
|
68
84
|
if (!id) {
|
|
69
85
|
res.status(400).json({ error: 'id is required (kebab-case agent name, e.g. "content-triage")' });
|
|
70
86
|
return;
|
|
71
87
|
}
|
|
88
|
+
if (!(await authorized(() => (0, authority_1.assertMayConfigureAgent)(req.auth.userId, { ...req.body, id: undefined }), res)))
|
|
89
|
+
return;
|
|
72
90
|
const auth = { userId: req.userId, roles: req.roles };
|
|
73
91
|
const result = await api.createAgent(req.body, auth);
|
|
74
92
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
@@ -77,16 +95,19 @@ router.post('/', async (req, res) => {
|
|
|
77
95
|
* PUT /api/agents/:id
|
|
78
96
|
* Update an existing agent.
|
|
79
97
|
*/
|
|
80
|
-
router.put('/:id', async (req, res) => {
|
|
81
|
-
const
|
|
98
|
+
router.put('/:id', auth_1.requireBuilder, async (req, res) => {
|
|
99
|
+
const id = String(req.params.id);
|
|
100
|
+
if (!(await authorized(() => (0, authority_1.assertMayConfigureAgent)(req.auth.userId, { ...req.body, id }), res)))
|
|
101
|
+
return;
|
|
102
|
+
const result = await api.updateAgent({ ...req.body, id });
|
|
82
103
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
83
104
|
});
|
|
84
105
|
/**
|
|
85
106
|
* DELETE /api/agents/:id
|
|
86
107
|
* Delete an agent.
|
|
87
108
|
*/
|
|
88
|
-
router.delete('/:id', async (req, res) => {
|
|
89
|
-
const result = await api.deleteAgent({ id: req.params.id });
|
|
109
|
+
router.delete('/:id', auth_1.requireBuilder, async (req, res) => {
|
|
110
|
+
const result = await api.deleteAgent({ id: String(req.params.id) });
|
|
90
111
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
91
112
|
});
|
|
92
113
|
// ── Subscription routes (nested under agent) ─────────────────────────────────
|
|
@@ -102,29 +123,41 @@ router.get('/:agentId/subscriptions', async (req, res) => {
|
|
|
102
123
|
* POST /api/agents/:agentId/subscriptions
|
|
103
124
|
* Create an event subscription for an agent.
|
|
104
125
|
*/
|
|
105
|
-
router.post('/:agentId/subscriptions', async (req, res) => {
|
|
106
|
-
const { topic, reaction_type } = req.body;
|
|
126
|
+
router.post('/:agentId/subscriptions', auth_1.requireBuilder, async (req, res) => {
|
|
127
|
+
const { topic, reaction_type, workflow_type, execute_as } = req.body;
|
|
107
128
|
if (!topic || !reaction_type) {
|
|
108
129
|
res.status(400).json({ error: 'topic and reaction_type are required' });
|
|
109
130
|
return;
|
|
110
131
|
}
|
|
111
|
-
const
|
|
132
|
+
const agentId = String(req.params.agentId);
|
|
133
|
+
const check = () => (0, authority_1.assertMayConfigureSubscription)(req.auth.userId, { agentId, reaction_type, workflow_type, execute_as });
|
|
134
|
+
if (!(await authorized(check, res)))
|
|
135
|
+
return;
|
|
136
|
+
const result = await subApi.createSubscription({ ...req.body, agentId });
|
|
112
137
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
113
138
|
});
|
|
114
139
|
/**
|
|
115
140
|
* PUT /api/agents/:agentId/subscriptions/:subId
|
|
116
141
|
* Update an event subscription.
|
|
117
142
|
*/
|
|
118
|
-
router.put('/:agentId/subscriptions/:subId', async (req, res) => {
|
|
119
|
-
const
|
|
143
|
+
router.put('/:agentId/subscriptions/:subId', auth_1.requireBuilder, async (req, res) => {
|
|
144
|
+
const agentId = String(req.params.agentId);
|
|
145
|
+
const id = String(req.params.subId);
|
|
146
|
+
const check = () => (0, authority_1.assertMayConfigureSubscription)(req.auth.userId, {
|
|
147
|
+
agentId, subscriptionId: id, reaction_type: req.body?.reaction_type,
|
|
148
|
+
workflow_type: req.body?.workflow_type, execute_as: req.body?.execute_as,
|
|
149
|
+
});
|
|
150
|
+
if (!(await authorized(check, res)))
|
|
151
|
+
return;
|
|
152
|
+
const result = await subApi.updateSubscription({ ...req.body, id });
|
|
120
153
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
121
154
|
});
|
|
122
155
|
/**
|
|
123
156
|
* DELETE /api/agents/:agentId/subscriptions/:subId
|
|
124
157
|
* Delete an event subscription.
|
|
125
158
|
*/
|
|
126
|
-
router.delete('/:agentId/subscriptions/:subId', async (req, res) => {
|
|
127
|
-
const result = await subApi.deleteSubscription({ id: req.params.subId });
|
|
159
|
+
router.delete('/:agentId/subscriptions/:subId', auth_1.requireBuilder, async (req, res) => {
|
|
160
|
+
const result = await subApi.deleteSubscription({ id: String(req.params.subId) });
|
|
128
161
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
129
162
|
});
|
|
130
163
|
exports.default = router;
|
|
@@ -33,10 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const api = __importStar(require("../api/announcements"));
|
|
38
38
|
const auth_1 = require("../modules/auth");
|
|
39
|
-
const router = (0,
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
40
40
|
/**
|
|
41
41
|
* Dashboard announcements. Publishing and removal are role-manager acts
|
|
42
42
|
* (superadmin, admin type, or engineer); any authenticated user reads their
|
package/build/routes/auth-sso.js
CHANGED
|
@@ -33,9 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const api = __importStar(require("../api/auth-sso"));
|
|
38
|
-
const router = (0,
|
|
38
|
+
const router = (0, http_1.Router)();
|
|
39
39
|
/**
|
|
40
40
|
* POST /api/auth/sso
|
|
41
41
|
* Exchange host authentication for a Long Tail JWT.
|
package/build/routes/auth.js
CHANGED
|
@@ -33,9 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const api = __importStar(require("../api/auth"));
|
|
38
|
-
const router = (0,
|
|
38
|
+
const router = (0, http_1.Router)();
|
|
39
39
|
/**
|
|
40
40
|
* POST /api/auth/login
|
|
41
41
|
* Authenticate with username (external_id) and password.
|
|
@@ -33,10 +33,18 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const auth_1 = require("../modules/auth");
|
|
38
|
+
const capabilities_1 = require("../modules/capabilities");
|
|
38
39
|
const api = __importStar(require("../api/bot-accounts"));
|
|
39
|
-
const router = (0,
|
|
40
|
+
const router = (0, http_1.Router)();
|
|
41
|
+
/** Answer a refused decision with 403; true when the request may go on. */
|
|
42
|
+
function allowed(decision, res) {
|
|
43
|
+
if (decision.allowed)
|
|
44
|
+
return true;
|
|
45
|
+
res.status(403).json({ error: decision.error });
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
40
48
|
// All bot account routes require admin access
|
|
41
49
|
router.use(auth_1.requireBuilder);
|
|
42
50
|
// ── Bot CRUD ─────────────────────────────────────────────────────────────────
|
|
@@ -69,6 +77,8 @@ router.get('/:id', async (req, res) => {
|
|
|
69
77
|
*/
|
|
70
78
|
router.post('/', async (req, res) => {
|
|
71
79
|
const { name, description, display_name, roles } = req.body || {};
|
|
80
|
+
if (!allowed(await (0, capabilities_1.mayGrantRoles)(req.auth.userId, roles), res))
|
|
81
|
+
return;
|
|
72
82
|
const result = await api.createBot({ name, description, display_name, roles }, req.auth ? { userId: req.auth.userId } : undefined);
|
|
73
83
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
74
84
|
});
|
|
@@ -78,6 +88,8 @@ router.post('/', async (req, res) => {
|
|
|
78
88
|
* Body: { display_name?, description?, status? }
|
|
79
89
|
*/
|
|
80
90
|
router.put('/:id', async (req, res) => {
|
|
91
|
+
if (!allowed(await (0, capabilities_1.mayManageAccount)(req.auth.userId, String(req.params.id)), res))
|
|
92
|
+
return;
|
|
81
93
|
const result = await api.updateBot({ id: req.params.id, ...(req.body || {}) });
|
|
82
94
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
83
95
|
});
|
|
@@ -86,6 +98,8 @@ router.put('/:id', async (req, res) => {
|
|
|
86
98
|
* Delete a bot account.
|
|
87
99
|
*/
|
|
88
100
|
router.delete('/:id', async (req, res) => {
|
|
101
|
+
if (!allowed(await (0, capabilities_1.mayManageAccount)(req.auth.userId, String(req.params.id)), res))
|
|
102
|
+
return;
|
|
89
103
|
const result = await api.deleteBot({ id: req.params.id });
|
|
90
104
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
91
105
|
});
|
|
@@ -105,6 +119,8 @@ router.get('/:id/roles', async (req, res) => {
|
|
|
105
119
|
*/
|
|
106
120
|
router.post('/:id/roles', async (req, res) => {
|
|
107
121
|
const { role, type } = req.body || {};
|
|
122
|
+
if (!allowed(await (0, capabilities_1.mayGrantRole)(req.auth.userId, { role, type }), res))
|
|
123
|
+
return;
|
|
108
124
|
const result = await api.addBotRole({ id: req.params.id, role, type });
|
|
109
125
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
110
126
|
});
|
|
@@ -113,6 +129,8 @@ router.post('/:id/roles', async (req, res) => {
|
|
|
113
129
|
* Remove a role from a bot.
|
|
114
130
|
*/
|
|
115
131
|
router.delete('/:id/roles/:role', async (req, res) => {
|
|
132
|
+
if (!allowed(await (0, capabilities_1.mayRevokeRole)(req.auth.userId, String(req.params.id), String(req.params.role)), res))
|
|
133
|
+
return;
|
|
116
134
|
const result = await api.removeBotRole({ id: req.params.id, role: req.params.role });
|
|
117
135
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
118
136
|
});
|
|
@@ -132,6 +150,8 @@ router.get('/:id/api-keys', async (req, res) => {
|
|
|
132
150
|
* Returns the raw key ONCE — it cannot be retrieved again.
|
|
133
151
|
*/
|
|
134
152
|
router.post('/:id/api-keys', async (req, res) => {
|
|
153
|
+
if (!allowed(await (0, capabilities_1.mayManageAccount)(req.auth.userId, String(req.params.id)), res))
|
|
154
|
+
return;
|
|
135
155
|
const { name, scopes, expires_at } = req.body || {};
|
|
136
156
|
const result = await api.createBotKey({
|
|
137
157
|
id: req.params.id,
|
|
@@ -146,7 +166,10 @@ router.post('/:id/api-keys', async (req, res) => {
|
|
|
146
166
|
* Revoke (delete) a bot API key.
|
|
147
167
|
*/
|
|
148
168
|
router.delete('/:id/api-keys/:keyId', async (req, res) => {
|
|
149
|
-
const
|
|
169
|
+
const botId = String(req.params.id);
|
|
170
|
+
if (!allowed(await (0, capabilities_1.mayManageAccount)(req.auth.userId, botId), res))
|
|
171
|
+
return;
|
|
172
|
+
const result = await api.revokeBotKey({ keyId: String(req.params.keyId), botId });
|
|
150
173
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
151
174
|
});
|
|
152
175
|
exports.default = router;
|
|
@@ -33,15 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const api = __importStar(require("../api/capabilities"));
|
|
38
|
-
const router = (0,
|
|
38
|
+
const router = (0, http_1.Router)();
|
|
39
39
|
/**
|
|
40
40
|
* GET /api/capabilities
|
|
41
41
|
* List all platform capabilities grouped by category.
|
|
42
42
|
*/
|
|
43
|
-
router.get('/', async (
|
|
44
|
-
const result = await api.listCapabilities();
|
|
43
|
+
router.get('/', async (req, res) => {
|
|
44
|
+
const result = await api.listCapabilities(req.auth);
|
|
45
45
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
46
46
|
});
|
|
47
47
|
exports.default = router;
|
|
@@ -33,10 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const auth_1 = require("../modules/auth");
|
|
38
38
|
const api = __importStar(require("../api/controlplane"));
|
|
39
|
-
const router = (0,
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
40
40
|
/**
|
|
41
41
|
* GET /api/controlplane/apps
|
|
42
42
|
* List available HotMesh application namespaces.
|
package/build/routes/dba.js
CHANGED
|
@@ -33,10 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const api = __importStar(require("../api/dba"));
|
|
38
38
|
const auth_1 = require("../modules/auth");
|
|
39
|
-
const router = (0,
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
40
40
|
/**
|
|
41
41
|
* POST /api/dba/prune
|
|
42
42
|
* Prune expired jobs, streams, and execution artifacts.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const http_1 = require("../lib/http");
|
|
4
4
|
const delegation_1 = require("../services/auth/delegation");
|
|
5
5
|
const service_token_1 = require("../services/auth/service-token");
|
|
6
6
|
const oauth_1 = require("../services/oauth");
|
|
7
|
-
const router = (0,
|
|
7
|
+
const router = (0, http_1.Router)();
|
|
8
8
|
/**
|
|
9
9
|
* GET /api/delegation/oauth/:provider/token
|
|
10
10
|
*
|
|
@@ -33,10 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const api = __importStar(require("../api/diagnostics"));
|
|
38
38
|
const auth_1 = require("../modules/auth");
|
|
39
|
-
const router = (0,
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
40
40
|
const VALID_SECTIONS = new Set(['events', 'streams']);
|
|
41
41
|
/** Parse a comma-separated `include` query param into the recognized heavy sections. */
|
|
42
42
|
function parseInclude(raw) {
|
package/build/routes/docs.js
CHANGED
|
@@ -33,10 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
-
const router = (0,
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
40
40
|
function projectRoot() {
|
|
41
41
|
const candidates = [
|
|
42
42
|
path.join(__dirname, '..'),
|
package/build/routes/domain.js
CHANGED
|
@@ -33,10 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
37
|
const auth_1 = require("../modules/auth");
|
|
38
38
|
const api = __importStar(require("../api/domain"));
|
|
39
|
-
const router = (0,
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
40
40
|
/**
|
|
41
41
|
* GET /api/domain
|
|
42
42
|
* The deployment's domain dictionary: `{ doc, version, updated_at }`, or
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Request, Response } from '
|
|
1
|
+
import type { Request, Response } from '../../lib/http';
|
|
2
2
|
import type { LTApiAuth } from '../../types/sdk';
|
|
3
3
|
/** The header a shared station device rides its badge grant on. */
|
|
4
4
|
export declare const ACTING_TOKEN_HEADER = "x-lt-acting-token";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Router } from '
|
|
1
|
+
import { Router } from '../../lib/http';
|
|
2
2
|
export declare function registerBulkRoutes(router: Router): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const http_1 = require("../../lib/http");
|
|
4
4
|
const list_1 = require("./list");
|
|
5
5
|
const bulk_1 = require("./bulk");
|
|
6
6
|
const metadata_1 = require("./metadata");
|
|
@@ -10,7 +10,7 @@ const resolve_1 = require("./resolve");
|
|
|
10
10
|
const facets_1 = require("./facets");
|
|
11
11
|
const analytics_1 = require("./analytics");
|
|
12
12
|
const related_1 = require("./related");
|
|
13
|
-
const router = (0,
|
|
13
|
+
const router = (0, http_1.Router)();
|
|
14
14
|
// Registration order matters: literal paths before parameterized /:id routes.
|
|
15
15
|
// GET /, /available, /types, /stats
|
|
16
16
|
(0, list_1.registerListRoutes)(router);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Router } from '
|
|
1
|
+
import { Router } from '../../lib/http';
|
|
2
2
|
export declare function registerListRoutes(router: Router): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Router } from '
|
|
1
|
+
import { Router } from '../../lib/http';
|
|
2
2
|
export declare function registerResolveRoutes(router: Router): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Router } from '
|
|
1
|
+
import { Router } from '../../lib/http';
|
|
2
2
|
export declare function registerSingleRoutes(router: Router): void;
|
|
@@ -53,7 +53,7 @@ function registerSingleRoutes(router) {
|
|
|
53
53
|
router.get('/by-workflow/:workflowId', async (req, res) => {
|
|
54
54
|
const result = await api.getEscalationsByWorkflowId({
|
|
55
55
|
workflowId: req.params.workflowId,
|
|
56
|
-
});
|
|
56
|
+
}, req.auth);
|
|
57
57
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
58
58
|
});
|
|
59
59
|
// -- Parameterized routes (must come after literal paths) --
|
package/build/routes/exports.js
CHANGED
|
@@ -33,14 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const
|
|
36
|
+
const http_1 = require("../lib/http");
|
|
37
|
+
const auth_1 = require("../modules/auth");
|
|
37
38
|
const api = __importStar(require("../api/exports"));
|
|
38
|
-
const router = (0,
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
39
40
|
/**
|
|
40
41
|
* GET /api/workflow-states/jobs
|
|
41
42
|
* List workflow jobs with optional filtering and pagination.
|
|
42
43
|
*/
|
|
43
|
-
router.get('/jobs', async (req, res) => {
|
|
44
|
+
router.get('/jobs', auth_1.requireBuilder, async (req, res) => {
|
|
44
45
|
const app_id = (req.query.app_id || req.query.namespace);
|
|
45
46
|
if (!app_id) {
|
|
46
47
|
res.status(400).json({ error: 'app_id (or namespace) query parameter is required' });
|
|
@@ -63,7 +64,7 @@ router.get('/jobs', async (req, res) => {
|
|
|
63
64
|
* GET /api/workflow-states/:workflowId
|
|
64
65
|
* Export the full workflow state using HotMesh's durable export.
|
|
65
66
|
*/
|
|
66
|
-
router.get('/:workflowId', async (req, res) => {
|
|
67
|
+
router.get('/:workflowId', auth_1.requireBuilder, async (req, res) => {
|
|
67
68
|
const allow = req.query.allow
|
|
68
69
|
? req.query.allow.split(',')
|
|
69
70
|
: undefined;
|
|
@@ -72,7 +73,7 @@ router.get('/:workflowId', async (req, res) => {
|
|
|
72
73
|
: undefined;
|
|
73
74
|
const values = req.query.values === 'false' ? false : undefined;
|
|
74
75
|
const result = await api.exportWorkflowState({
|
|
75
|
-
workflowId: req.params.workflowId,
|
|
76
|
+
workflowId: String(req.params.workflowId),
|
|
76
77
|
allow,
|
|
77
78
|
block,
|
|
78
79
|
values,
|
|
@@ -83,9 +84,9 @@ router.get('/:workflowId', async (req, res) => {
|
|
|
83
84
|
* GET /api/workflow-states/:workflowId/execution
|
|
84
85
|
* Export workflow state as a structured execution event history.
|
|
85
86
|
*/
|
|
86
|
-
router.get('/:workflowId/execution', async (req, res) => {
|
|
87
|
+
router.get('/:workflowId/execution', auth_1.requireWorkflowReader, async (req, res) => {
|
|
87
88
|
const result = await api.exportWorkflowExecution({
|
|
88
|
-
workflowId: req.params.workflowId,
|
|
89
|
+
workflowId: String(req.params.workflowId),
|
|
89
90
|
excludeSystem: req.query.excludeSystem === 'true',
|
|
90
91
|
omitResults: req.query.omitResults === 'true',
|
|
91
92
|
mode: req.query.mode || undefined,
|
|
@@ -100,9 +101,9 @@ router.get('/:workflowId/execution', async (req, res) => {
|
|
|
100
101
|
* The workflow's input and output envelopes — two narrow lookups, no event
|
|
101
102
|
* stream. Output is null with status 'running' until the workflow completes.
|
|
102
103
|
*/
|
|
103
|
-
router.get('/:workflowId/envelopes', async (req, res) => {
|
|
104
|
+
router.get('/:workflowId/envelopes', auth_1.requireBuilder, async (req, res) => {
|
|
104
105
|
const result = await api.getWorkflowEnvelopes({
|
|
105
|
-
workflowId: req.params.workflowId,
|
|
106
|
+
workflowId: String(req.params.workflowId),
|
|
106
107
|
});
|
|
107
108
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
108
109
|
});
|
|
@@ -110,9 +111,9 @@ router.get('/:workflowId/envelopes', async (req, res) => {
|
|
|
110
111
|
* GET /api/workflow-states/:workflowId/status
|
|
111
112
|
* Return only the numeric status semaphore.
|
|
112
113
|
*/
|
|
113
|
-
router.get('/:workflowId/status', async (req, res) => {
|
|
114
|
+
router.get('/:workflowId/status', auth_1.requireBuilder, async (req, res) => {
|
|
114
115
|
const result = await api.getWorkflowStatus({
|
|
115
|
-
workflowId: req.params.workflowId,
|
|
116
|
+
workflowId: String(req.params.workflowId),
|
|
116
117
|
});
|
|
117
118
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
118
119
|
});
|
|
@@ -120,9 +121,9 @@ router.get('/:workflowId/status', async (req, res) => {
|
|
|
120
121
|
* GET /api/workflow-states/:workflowId/state
|
|
121
122
|
* Return the current job state of the workflow.
|
|
122
123
|
*/
|
|
123
|
-
router.get('/:workflowId/state', async (req, res) => {
|
|
124
|
+
router.get('/:workflowId/state', auth_1.requireBuilder, async (req, res) => {
|
|
124
125
|
const result = await api.getWorkflowState({
|
|
125
|
-
workflowId: req.params.workflowId,
|
|
126
|
+
workflowId: String(req.params.workflowId),
|
|
126
127
|
});
|
|
127
128
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
128
129
|
});
|