@hotmeshio/long-tail 0.23.2 → 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/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/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/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 +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 +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/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/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/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/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/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 +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 +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 +3 -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/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 +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 +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/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
|
@@ -33,24 +33,25 @@ 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/yaml-workflows"));
|
|
38
|
-
const
|
|
38
|
+
const auth_1 = require("../../modules/auth");
|
|
39
|
+
const router = (0, http_1.Router)();
|
|
39
40
|
/**
|
|
40
41
|
* POST /api/yaml-workflows/:id/deploy
|
|
41
42
|
* Deploy all YAML workflows sharing this workflow's app_id as a merged version.
|
|
42
43
|
* Bumps the version and deploys all graphs together.
|
|
43
44
|
*/
|
|
44
|
-
router.post('/:id/deploy', async (req, res) => {
|
|
45
|
-
const result = await api.deployYamlWorkflow({ id: req.params.id });
|
|
45
|
+
router.post('/:id/deploy', auth_1.requireBuilder, async (req, res) => {
|
|
46
|
+
const result = await api.deployYamlWorkflow({ id: String(req.params.id) }, req.auth);
|
|
46
47
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
47
48
|
});
|
|
48
49
|
/**
|
|
49
50
|
* POST /api/yaml-workflows/:id/activate
|
|
50
51
|
* Activate the deployed version for this workflow's app_id and register all workers.
|
|
51
52
|
*/
|
|
52
|
-
router.post('/:id/activate', async (req, res) => {
|
|
53
|
-
const result = await api.activateYamlWorkflow({ id: req.params.id });
|
|
53
|
+
router.post('/:id/activate', auth_1.requireBuilder, async (req, res) => {
|
|
54
|
+
const result = await api.activateYamlWorkflow({ id: String(req.params.id) }, req.auth);
|
|
54
55
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
55
56
|
});
|
|
56
57
|
/**
|
|
@@ -72,16 +73,16 @@ router.post('/:id/invoke', async (req, res) => {
|
|
|
72
73
|
* POST /api/yaml-workflows/:id/archive
|
|
73
74
|
* Archive a YAML workflow (stops accepting new invocations).
|
|
74
75
|
*/
|
|
75
|
-
router.post('/:id/archive', async (req, res) => {
|
|
76
|
-
const result = await api.archiveYamlWorkflow({ id: req.params.id });
|
|
76
|
+
router.post('/:id/archive', auth_1.requireBuilder, async (req, res) => {
|
|
77
|
+
const result = await api.archiveYamlWorkflow({ id: String(req.params.id) });
|
|
77
78
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
78
79
|
});
|
|
79
80
|
/**
|
|
80
81
|
* POST /api/yaml-workflows/:id/restore
|
|
81
82
|
* Restore an archived YAML workflow back to draft status for redeployment.
|
|
82
83
|
*/
|
|
83
|
-
router.post('/:id/restore', async (req, res) => {
|
|
84
|
-
const result = await api.restoreYamlWorkflow({ id: req.params.id });
|
|
84
|
+
router.post('/:id/restore', auth_1.requireBuilder, async (req, res) => {
|
|
85
|
+
const result = await api.restoreYamlWorkflow({ id: String(req.params.id) });
|
|
85
86
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
86
87
|
});
|
|
87
88
|
exports.default = router;
|
|
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const http_1 = require("../../lib/http");
|
|
7
7
|
const cron_1 = __importDefault(require("./cron"));
|
|
8
8
|
const crud_1 = __importDefault(require("./crud"));
|
|
9
9
|
const deployment_1 = __importDefault(require("./deployment"));
|
|
10
10
|
const versions_1 = __importDefault(require("./versions"));
|
|
11
|
-
const router = (0,
|
|
11
|
+
const router = (0, http_1.Router)();
|
|
12
12
|
// cron.ts handles: GET /cron/status, PUT /:id/cron, DELETE /:id/cron
|
|
13
13
|
// Mount before crud so /cron/status doesn't match /:id
|
|
14
14
|
router.use(cron_1.default);
|
|
@@ -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/yaml-workflows"));
|
|
38
|
-
const router = (0,
|
|
38
|
+
const router = (0, http_1.Router)();
|
|
39
39
|
/**
|
|
40
40
|
* GET /api/yaml-workflows/:id/versions
|
|
41
41
|
* Return version history for a YAML workflow.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentBehaviors } from '../../types/agent';
|
|
2
|
+
/** Refuse an agent create or update whose schedules the caller could not run themselves. */
|
|
3
|
+
export declare function assertMayConfigureAgent(callerId: string, input: {
|
|
4
|
+
id?: string;
|
|
5
|
+
user_id?: string | null;
|
|
6
|
+
behaviors?: AgentBehaviors;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
/** Refuse a subscription create or update the caller could not run themselves. */
|
|
9
|
+
export declare function assertMayConfigureSubscription(callerId: string, input: {
|
|
10
|
+
agentId: string;
|
|
11
|
+
subscriptionId?: string;
|
|
12
|
+
reaction_type?: string;
|
|
13
|
+
execute_as?: string | null;
|
|
14
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertMayConfigureAgent = assertMayConfigureAgent;
|
|
4
|
+
exports.assertMayConfigureSubscription = assertMayConfigureSubscription;
|
|
5
|
+
/**
|
|
6
|
+
* Who may configure automation. Agents run on their own, as the identity they
|
|
7
|
+
* name (an execute_as, else the agent's user_id) or, with none, as lt-system.
|
|
8
|
+
* Whoever configures one must be able to run as that identity: the same rule
|
|
9
|
+
* as an execute_as override. Automation that would run as lt-system, or a
|
|
10
|
+
* capability subscription (a tool called with lt-system authority), is a
|
|
11
|
+
* superadmin's to configure.
|
|
12
|
+
*/
|
|
13
|
+
const workflow_invocation_1 = require("../workflow-invocation");
|
|
14
|
+
const user_1 = require("../user");
|
|
15
|
+
const index_1 = require("./index");
|
|
16
|
+
const subscriptions_1 = require("./subscriptions");
|
|
17
|
+
const SYSTEM_AUTHORITY = 'runs as lt-system; only superadmin can configure it';
|
|
18
|
+
async function assertIdentity(callerId, identity, what) {
|
|
19
|
+
if (!identity)
|
|
20
|
+
throw new workflow_invocation_1.InvocationError(`${what} has no identity, so it ${SYSTEM_AUTHORITY}`, 403);
|
|
21
|
+
await (0, workflow_invocation_1.assertMayActAs)(callerId, identity);
|
|
22
|
+
}
|
|
23
|
+
/** Refuse an agent create or update whose schedules the caller could not run themselves. */
|
|
24
|
+
async function assertMayConfigureAgent(callerId, input) {
|
|
25
|
+
if (await (0, user_1.isSuperAdmin)(callerId))
|
|
26
|
+
return;
|
|
27
|
+
const existing = input.id ? await (0, index_1.getAgent)(input.id) : null;
|
|
28
|
+
const userId = input.user_id !== undefined ? input.user_id : existing?.user_id ?? null;
|
|
29
|
+
const behaviors = input.behaviors ?? existing?.behaviors;
|
|
30
|
+
if (userId)
|
|
31
|
+
await (0, workflow_invocation_1.assertMayActAs)(callerId, userId);
|
|
32
|
+
if (behaviors?.cron)
|
|
33
|
+
await assertIdentity(callerId, userId, 'the agent schedule');
|
|
34
|
+
for (const schedule of behaviors?.schedules ?? []) {
|
|
35
|
+
await assertIdentity(callerId, schedule.execute_as || userId, 'an agent schedule');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** Refuse a subscription create or update the caller could not run themselves. */
|
|
39
|
+
async function assertMayConfigureSubscription(callerId, input) {
|
|
40
|
+
if (await (0, user_1.isSuperAdmin)(callerId))
|
|
41
|
+
return;
|
|
42
|
+
const existing = input.subscriptionId ? await (0, subscriptions_1.getSubscription)(input.subscriptionId) : null;
|
|
43
|
+
if (input.subscriptionId && (!existing || existing.agent_id !== input.agentId)) {
|
|
44
|
+
throw new workflow_invocation_1.InvocationError('Subscription not found', 404);
|
|
45
|
+
}
|
|
46
|
+
const reaction = input.reaction_type ?? existing?.reaction_type;
|
|
47
|
+
if (reaction === 'capability') {
|
|
48
|
+
throw new workflow_invocation_1.InvocationError(`a capability subscription calls a tool directly, so it ${SYSTEM_AUTHORITY}`, 403);
|
|
49
|
+
}
|
|
50
|
+
const agent = await (0, index_1.getAgent)(input.agentId);
|
|
51
|
+
const executeAs = input.execute_as !== undefined ? input.execute_as : existing?.execute_as;
|
|
52
|
+
await assertIdentity(callerId, executeAs || agent?.user_id, 'the subscription');
|
|
53
|
+
}
|
|
@@ -29,4 +29,6 @@ export declare function revokeBotApiKey(id: string): Promise<boolean>;
|
|
|
29
29
|
/**
|
|
30
30
|
* List API keys for a bot account (without hashes).
|
|
31
31
|
*/
|
|
32
|
+
/** The bot account a key belongs to, or null when there is no such key. */
|
|
33
|
+
export declare function getBotApiKeyOwner(keyId: string): Promise<string | null>;
|
|
32
34
|
export declare function listBotApiKeys(userId: string): Promise<BotApiKeyRecord[]>;
|
|
@@ -39,8 +39,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.generateBotApiKey = generateBotApiKey;
|
|
40
40
|
exports.validateBotApiKey = validateBotApiKey;
|
|
41
41
|
exports.revokeBotApiKey = revokeBotApiKey;
|
|
42
|
+
exports.getBotApiKeyOwner = getBotApiKeyOwner;
|
|
42
43
|
exports.listBotApiKeys = listBotApiKeys;
|
|
43
44
|
const crypto = __importStar(require("crypto"));
|
|
45
|
+
const uuid_1 = require("../../lib/uuid");
|
|
44
46
|
const bcryptjs_1 = __importDefault(require("bcryptjs"));
|
|
45
47
|
const db_1 = require("../../lib/db");
|
|
46
48
|
const sql_1 = require("./sql");
|
|
@@ -87,6 +89,14 @@ async function revokeBotApiKey(id) {
|
|
|
87
89
|
/**
|
|
88
90
|
* List API keys for a bot account (without hashes).
|
|
89
91
|
*/
|
|
92
|
+
/** The bot account a key belongs to, or null when there is no such key. */
|
|
93
|
+
async function getBotApiKeyOwner(keyId) {
|
|
94
|
+
if (!(0, uuid_1.isUuid)(keyId))
|
|
95
|
+
return null;
|
|
96
|
+
const pool = await (0, db_1.getPool)();
|
|
97
|
+
const { rows } = await pool.query(sql_1.GET_BOT_KEY_OWNER, [keyId]);
|
|
98
|
+
return rows[0]?.user_id ?? null;
|
|
99
|
+
}
|
|
90
100
|
async function listBotApiKeys(userId) {
|
|
91
101
|
const pool = await (0, db_1.getPool)();
|
|
92
102
|
const { rows } = await pool.query(sql_1.LIST_BOT_KEYS_BY_USER, [userId]);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AuthPayload, LTGrantPolicy, LTGrantRole, LTGrantSnapshot } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Access tokens are HS256 JWTs for one resource (`aud`, the `/mcp` URL). They
|
|
4
|
+
* name the grant (`gid`) and the person (`sub`) and carry no `userId` claim,
|
|
5
|
+
* so `requireAuth` refuses them on `/api`. A verified token is honored only
|
|
6
|
+
* while its grant is live: `/mcp` reads the grant on each request and acts on
|
|
7
|
+
* its current roles, policy and scope.
|
|
8
|
+
*/
|
|
9
|
+
export interface AccessTokenTarget {
|
|
10
|
+
issuer: string;
|
|
11
|
+
audience: string;
|
|
12
|
+
}
|
|
13
|
+
export interface LTAccessTokenClaims {
|
|
14
|
+
iss: string;
|
|
15
|
+
aud: string;
|
|
16
|
+
sub: string;
|
|
17
|
+
client_id: string;
|
|
18
|
+
gid: string;
|
|
19
|
+
scope: string;
|
|
20
|
+
policy: LTGrantPolicy;
|
|
21
|
+
roles: LTGrantRole[];
|
|
22
|
+
iat: number;
|
|
23
|
+
exp: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function signAccessToken(snapshot: LTGrantSnapshot, target: AccessTokenTarget, ttlSeconds?: number): {
|
|
26
|
+
token: string;
|
|
27
|
+
expiresIn: number;
|
|
28
|
+
};
|
|
29
|
+
/** The claims of a valid access token for `target`; null for anything else. */
|
|
30
|
+
export declare function verifyAccessToken(token: string, target: AccessTokenTarget): LTAccessTokenClaims | null;
|
|
31
|
+
/**
|
|
32
|
+
* The request identity for a verified access token and its live grant, in the
|
|
33
|
+
* shape other credentials produce. Roles, policy and scope come from the grant
|
|
34
|
+
* as it stands now, not as the token recorded them.
|
|
35
|
+
*/
|
|
36
|
+
export declare function accessTokenPrincipal(claims: LTAccessTokenClaims, live: LTGrantSnapshot): AuthPayload;
|
|
@@ -0,0 +1,80 @@
|
|
|
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.signAccessToken = signAccessToken;
|
|
7
|
+
exports.verifyAccessToken = verifyAccessToken;
|
|
8
|
+
exports.accessTokenPrincipal = accessTokenPrincipal;
|
|
9
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
10
|
+
const config_1 = require("../../../modules/config");
|
|
11
|
+
const defaults_1 = require("../../../modules/defaults");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
function signAccessToken(snapshot, target, ttlSeconds = defaults_1.OAUTH_ACCESS_TOKEN_TTL_SECONDS) {
|
|
14
|
+
if (!config_1.config.JWT_SECRET)
|
|
15
|
+
throw new Error('signAccessToken: JWT_SECRET is not configured');
|
|
16
|
+
const token = jsonwebtoken_1.default.sign({
|
|
17
|
+
client_id: snapshot.client_id,
|
|
18
|
+
gid: snapshot.grant_id,
|
|
19
|
+
scope: snapshot.scope,
|
|
20
|
+
policy: snapshot.policy,
|
|
21
|
+
roles: snapshot.roles,
|
|
22
|
+
}, config_1.config.JWT_SECRET, {
|
|
23
|
+
algorithm: 'HS256',
|
|
24
|
+
header: { alg: 'HS256', typ: constants_1.ACCESS_TOKEN_TYPE },
|
|
25
|
+
issuer: target.issuer,
|
|
26
|
+
audience: target.audience,
|
|
27
|
+
subject: snapshot.user_id,
|
|
28
|
+
expiresIn: ttlSeconds,
|
|
29
|
+
});
|
|
30
|
+
return { token, expiresIn: ttlSeconds };
|
|
31
|
+
}
|
|
32
|
+
/** The claims of a valid access token for `target`; null for anything else. */
|
|
33
|
+
function verifyAccessToken(token, target) {
|
|
34
|
+
if (!config_1.config.JWT_SECRET)
|
|
35
|
+
return null;
|
|
36
|
+
try {
|
|
37
|
+
const decoded = jsonwebtoken_1.default.verify(token, config_1.config.JWT_SECRET, {
|
|
38
|
+
algorithms: ['HS256'],
|
|
39
|
+
issuer: target.issuer,
|
|
40
|
+
audience: target.audience,
|
|
41
|
+
complete: true,
|
|
42
|
+
});
|
|
43
|
+
if (decoded.header.typ !== constants_1.ACCESS_TOKEN_TYPE)
|
|
44
|
+
return null;
|
|
45
|
+
const claims = decoded.payload;
|
|
46
|
+
if (typeof claims.exp !== 'number')
|
|
47
|
+
return null;
|
|
48
|
+
if (!claims.sub || !claims.gid || !claims.client_id || !Array.isArray(claims.roles))
|
|
49
|
+
return null;
|
|
50
|
+
return claims;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function highestRoleType(roles) {
|
|
57
|
+
if (roles.some((r) => r.type === 'superadmin'))
|
|
58
|
+
return 'superadmin';
|
|
59
|
+
if (roles.some((r) => r.type === 'admin'))
|
|
60
|
+
return 'admin';
|
|
61
|
+
return 'member';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The request identity for a verified access token and its live grant, in the
|
|
65
|
+
* shape other credentials produce. Roles, policy and scope come from the grant
|
|
66
|
+
* as it stands now, not as the token recorded them.
|
|
67
|
+
*/
|
|
68
|
+
function accessTokenPrincipal(claims, live) {
|
|
69
|
+
return {
|
|
70
|
+
userId: claims.sub,
|
|
71
|
+
role: highestRoleType(live.roles),
|
|
72
|
+
roles: live.roles.map((r) => ({ role: r.role, type: r.type })),
|
|
73
|
+
scopes: [live.scope],
|
|
74
|
+
principalType: constants_1.OAUTH_PRINCIPAL_TYPE,
|
|
75
|
+
clientId: live.client_id,
|
|
76
|
+
grantId: live.grant_id,
|
|
77
|
+
policy: live.policy,
|
|
78
|
+
grantRoles: live.roles,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { OAuthServerSettings } from '../../../modules/oauth-server';
|
|
2
|
+
import type { LTGrantPreset, LTOAuthClient } from '../../../types/oauth-server';
|
|
3
|
+
/**
|
|
4
|
+
* Validation of an authorization request (RFC 6749 §4.1.1 with PKCE, RFC 7636,
|
|
5
|
+
* and resource indicators, RFC 8707). Used by the authorize redirect and again
|
|
6
|
+
* when the person approves, so the consent page is never trusted.
|
|
7
|
+
*/
|
|
8
|
+
export interface AuthorizationRequest {
|
|
9
|
+
client: LTOAuthClient;
|
|
10
|
+
redirectUri: string;
|
|
11
|
+
codeChallenge: string;
|
|
12
|
+
state?: string;
|
|
13
|
+
scope?: string;
|
|
14
|
+
resource: string;
|
|
15
|
+
}
|
|
16
|
+
export type AuthorizationCheck = {
|
|
17
|
+
ok: true;
|
|
18
|
+
request: AuthorizationRequest;
|
|
19
|
+
}
|
|
20
|
+
/** The client or redirect URI can't be trusted: answer here, never redirect. */
|
|
21
|
+
| {
|
|
22
|
+
ok: false;
|
|
23
|
+
redirect: false;
|
|
24
|
+
error: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}
|
|
27
|
+
/** The client and redirect URI are known: report the error to the client. */
|
|
28
|
+
| {
|
|
29
|
+
ok: false;
|
|
30
|
+
redirect: true;
|
|
31
|
+
redirectUri: string;
|
|
32
|
+
state?: string;
|
|
33
|
+
error: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
export declare function checkAuthorizationRequest(params: Record<string, unknown>, settings: OAuthServerSettings): Promise<AuthorizationCheck>;
|
|
37
|
+
export declare function isGrantPreset(value: unknown): value is LTGrantPreset;
|
|
38
|
+
/** `uri` with `params` added to its query, keeping any query it already has. */
|
|
39
|
+
export declare function withQuery(uri: string, params: Record<string, string | undefined>): string;
|
|
40
|
+
/**
|
|
41
|
+
* The presets the person may grant. Read-only always; Just be me only when it
|
|
42
|
+
* adds something: a membership that can write, or an admin tier.
|
|
43
|
+
*/
|
|
44
|
+
export declare function grantablePresets(roles: Array<{
|
|
45
|
+
type: string;
|
|
46
|
+
write_scope?: string | null;
|
|
47
|
+
}>): LTGrantPreset[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkAuthorizationRequest = checkAuthorizationRequest;
|
|
4
|
+
exports.isGrantPreset = isGrantPreset;
|
|
5
|
+
exports.withQuery = withQuery;
|
|
6
|
+
exports.grantablePresets = grantablePresets;
|
|
7
|
+
const registration_1 = require("./registration");
|
|
8
|
+
const store_1 = require("./store");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const CODE_CHALLENGE = /^[A-Za-z0-9_-]{43,128}$/;
|
|
11
|
+
const PRESETS = new Set(Object.keys(constants_1.PRESET_SCOPE));
|
|
12
|
+
const text = (value) => (typeof value === 'string' && value !== '' && !(0, registration_1.hasControlCharacters)(value) ? value : undefined);
|
|
13
|
+
async function checkAuthorizationRequest(params, settings) {
|
|
14
|
+
const clientId = text(params.client_id);
|
|
15
|
+
const redirectUri = text(params.redirect_uri);
|
|
16
|
+
const client = clientId ? await (0, store_1.getClient)(clientId) : null;
|
|
17
|
+
if (!client)
|
|
18
|
+
return { ok: false, redirect: false, error: 'invalid_client', description: 'unknown client_id' };
|
|
19
|
+
if (!redirectUri || !client.redirect_uris.includes(redirectUri)) {
|
|
20
|
+
return { ok: false, redirect: false, error: 'invalid_request', description: 'redirect_uri is not registered for this client' };
|
|
21
|
+
}
|
|
22
|
+
const state = text(params.state);
|
|
23
|
+
const fail = (error, description) => ({ ok: false, redirect: true, redirectUri, state, error, description });
|
|
24
|
+
if (params.response_type !== 'code')
|
|
25
|
+
return fail('unsupported_response_type', 'response_type must be code');
|
|
26
|
+
const codeChallenge = text(params.code_challenge);
|
|
27
|
+
if (!codeChallenge || !CODE_CHALLENGE.test(codeChallenge))
|
|
28
|
+
return fail('invalid_request', 'a PKCE code_challenge is required');
|
|
29
|
+
if (params.code_challenge_method !== 'S256')
|
|
30
|
+
return fail('invalid_request', 'code_challenge_method must be S256');
|
|
31
|
+
const resource = text(params.resource) ?? settings.resource;
|
|
32
|
+
if (resource !== settings.resource)
|
|
33
|
+
return fail('invalid_target', `resource must be ${settings.resource}`);
|
|
34
|
+
return { ok: true, request: { client, redirectUri, codeChallenge, state, scope: text(params.scope), resource } };
|
|
35
|
+
}
|
|
36
|
+
function isGrantPreset(value) {
|
|
37
|
+
return typeof value === 'string' && PRESETS.has(value);
|
|
38
|
+
}
|
|
39
|
+
/** `uri` with `params` added to its query, keeping any query it already has. */
|
|
40
|
+
function withQuery(uri, params) {
|
|
41
|
+
const url = new URL(uri);
|
|
42
|
+
for (const [key, value] of Object.entries(params))
|
|
43
|
+
if (value !== undefined)
|
|
44
|
+
url.searchParams.set(key, value);
|
|
45
|
+
return url.toString();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The presets the person may grant. Read-only always; Just be me only when it
|
|
49
|
+
* adds something: a membership that can write, or an admin tier.
|
|
50
|
+
*/
|
|
51
|
+
function grantablePresets(roles) {
|
|
52
|
+
const canWrite = roles.some((r) => r.type === 'admin' || r.type === 'superadmin' || (r.write_scope ?? 'all') !== 'none');
|
|
53
|
+
return canWrite ? ['read_only', 'just_me'] : ['read_only'];
|
|
54
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LTGrantPreset } from '../../../types/oauth-server';
|
|
2
|
+
export declare const MCP_SCOPES: {
|
|
3
|
+
readonly READ: "mcp:read";
|
|
4
|
+
readonly FULL: "mcp:full";
|
|
5
|
+
};
|
|
6
|
+
/** The coarse scope a grant preset is reported as. */
|
|
7
|
+
export declare const PRESET_SCOPE: Record<LTGrantPreset, string>;
|
|
8
|
+
/** JOSE `typ` for access tokens (RFC 9068). */
|
|
9
|
+
export declare const ACCESS_TOKEN_TYPE = "at+jwt";
|
|
10
|
+
/** `principalType` of a request authenticated by an OAuth access token. */
|
|
11
|
+
export declare const OAUTH_PRINCIPAL_TYPE = "oauth";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OAUTH_PRINCIPAL_TYPE = exports.ACCESS_TOKEN_TYPE = exports.PRESET_SCOPE = exports.MCP_SCOPES = void 0;
|
|
4
|
+
exports.MCP_SCOPES = {
|
|
5
|
+
READ: 'mcp:read',
|
|
6
|
+
FULL: 'mcp:full',
|
|
7
|
+
};
|
|
8
|
+
/** The coarse scope a grant preset is reported as. */
|
|
9
|
+
exports.PRESET_SCOPE = {
|
|
10
|
+
read_only: exports.MCP_SCOPES.READ,
|
|
11
|
+
just_me: exports.MCP_SCOPES.FULL,
|
|
12
|
+
};
|
|
13
|
+
/** JOSE `typ` for access tokens (RFC 9068). */
|
|
14
|
+
exports.ACCESS_TOKEN_TYPE = 'at+jwt';
|
|
15
|
+
/** `principalType` of a request authenticated by an OAuth access token. */
|
|
16
|
+
exports.OAUTH_PRINCIPAL_TYPE = 'oauth';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { REFRESH_REUSE_GRACE_SECONDS, createSecret, hashSecret, pkceChallenge, registerClient, getClient, issueAuthorizationCode, exchangeAuthorizationCode, rotateRefreshToken, getLiveGrant, revokeByRefreshToken, revokeGrant, listGrants, type RevokedGrant, } from './store';
|
|
2
|
+
export { signAccessToken, verifyAccessToken, accessTokenPrincipal, type AccessTokenTarget, type LTAccessTokenClaims, } from './access-token';
|
|
3
|
+
export { MCP_SCOPES, PRESET_SCOPE, ACCESS_TOKEN_TYPE, OAUTH_PRINCIPAL_TYPE } from './constants';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OAUTH_PRINCIPAL_TYPE = exports.ACCESS_TOKEN_TYPE = exports.PRESET_SCOPE = exports.MCP_SCOPES = exports.accessTokenPrincipal = exports.verifyAccessToken = exports.signAccessToken = exports.listGrants = exports.revokeGrant = exports.revokeByRefreshToken = exports.getLiveGrant = exports.rotateRefreshToken = exports.exchangeAuthorizationCode = exports.issueAuthorizationCode = exports.getClient = exports.registerClient = exports.pkceChallenge = exports.hashSecret = exports.createSecret = exports.REFRESH_REUSE_GRACE_SECONDS = void 0;
|
|
4
|
+
var store_1 = require("./store");
|
|
5
|
+
Object.defineProperty(exports, "REFRESH_REUSE_GRACE_SECONDS", { enumerable: true, get: function () { return store_1.REFRESH_REUSE_GRACE_SECONDS; } });
|
|
6
|
+
Object.defineProperty(exports, "createSecret", { enumerable: true, get: function () { return store_1.createSecret; } });
|
|
7
|
+
Object.defineProperty(exports, "hashSecret", { enumerable: true, get: function () { return store_1.hashSecret; } });
|
|
8
|
+
Object.defineProperty(exports, "pkceChallenge", { enumerable: true, get: function () { return store_1.pkceChallenge; } });
|
|
9
|
+
Object.defineProperty(exports, "registerClient", { enumerable: true, get: function () { return store_1.registerClient; } });
|
|
10
|
+
Object.defineProperty(exports, "getClient", { enumerable: true, get: function () { return store_1.getClient; } });
|
|
11
|
+
Object.defineProperty(exports, "issueAuthorizationCode", { enumerable: true, get: function () { return store_1.issueAuthorizationCode; } });
|
|
12
|
+
Object.defineProperty(exports, "exchangeAuthorizationCode", { enumerable: true, get: function () { return store_1.exchangeAuthorizationCode; } });
|
|
13
|
+
Object.defineProperty(exports, "rotateRefreshToken", { enumerable: true, get: function () { return store_1.rotateRefreshToken; } });
|
|
14
|
+
Object.defineProperty(exports, "getLiveGrant", { enumerable: true, get: function () { return store_1.getLiveGrant; } });
|
|
15
|
+
Object.defineProperty(exports, "revokeByRefreshToken", { enumerable: true, get: function () { return store_1.revokeByRefreshToken; } });
|
|
16
|
+
Object.defineProperty(exports, "revokeGrant", { enumerable: true, get: function () { return store_1.revokeGrant; } });
|
|
17
|
+
Object.defineProperty(exports, "listGrants", { enumerable: true, get: function () { return store_1.listGrants; } });
|
|
18
|
+
var access_token_1 = require("./access-token");
|
|
19
|
+
Object.defineProperty(exports, "signAccessToken", { enumerable: true, get: function () { return access_token_1.signAccessToken; } });
|
|
20
|
+
Object.defineProperty(exports, "verifyAccessToken", { enumerable: true, get: function () { return access_token_1.verifyAccessToken; } });
|
|
21
|
+
Object.defineProperty(exports, "accessTokenPrincipal", { enumerable: true, get: function () { return access_token_1.accessTokenPrincipal; } });
|
|
22
|
+
var constants_1 = require("./constants");
|
|
23
|
+
Object.defineProperty(exports, "MCP_SCOPES", { enumerable: true, get: function () { return constants_1.MCP_SCOPES; } });
|
|
24
|
+
Object.defineProperty(exports, "PRESET_SCOPE", { enumerable: true, get: function () { return constants_1.PRESET_SCOPE; } });
|
|
25
|
+
Object.defineProperty(exports, "ACCESS_TOKEN_TYPE", { enumerable: true, get: function () { return constants_1.ACCESS_TOKEN_TYPE; } });
|
|
26
|
+
Object.defineProperty(exports, "OAUTH_PRINCIPAL_TYPE", { enumerable: true, get: function () { return constants_1.OAUTH_PRINCIPAL_TYPE; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OAuthServerSettings } from '../../../modules/oauth-server';
|
|
2
|
+
/** Endpoint paths under the issuer. */
|
|
3
|
+
export declare const OAUTH_ENDPOINT_PATHS: {
|
|
4
|
+
readonly AUTHORIZE: "/api/oauth/authorize";
|
|
5
|
+
readonly TOKEN: "/api/oauth/token";
|
|
6
|
+
readonly REGISTER: "/api/oauth/register";
|
|
7
|
+
readonly REVOKE: "/api/oauth/revoke";
|
|
8
|
+
};
|
|
9
|
+
/** RFC 8414 authorization server metadata. */
|
|
10
|
+
export declare function authorizationServerMetadata(settings: OAuthServerSettings): Record<string, unknown>;
|
|
11
|
+
/** RFC 9728 protected resource metadata for `/mcp`. */
|
|
12
|
+
export declare function protectedResourceMetadata(settings: OAuthServerSettings): Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Root-relative paths of the two well-known documents. The issuer's and the
|
|
15
|
+
* resource's paths are appended after the well-known segment (RFC 8414 §3,
|
|
16
|
+
* RFC 9728 §3).
|
|
17
|
+
*/
|
|
18
|
+
export declare function wellKnownPaths(settings: OAuthServerSettings): {
|
|
19
|
+
authorizationServer: string;
|
|
20
|
+
protectedResource: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OAUTH_ENDPOINT_PATHS = void 0;
|
|
4
|
+
exports.authorizationServerMetadata = authorizationServerMetadata;
|
|
5
|
+
exports.protectedResourceMetadata = protectedResourceMetadata;
|
|
6
|
+
exports.wellKnownPaths = wellKnownPaths;
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
/** Endpoint paths under the issuer. */
|
|
9
|
+
exports.OAUTH_ENDPOINT_PATHS = {
|
|
10
|
+
AUTHORIZE: '/api/oauth/authorize',
|
|
11
|
+
TOKEN: '/api/oauth/token',
|
|
12
|
+
REGISTER: '/api/oauth/register',
|
|
13
|
+
REVOKE: '/api/oauth/revoke',
|
|
14
|
+
};
|
|
15
|
+
const SCOPES_SUPPORTED = [constants_1.MCP_SCOPES.READ, constants_1.MCP_SCOPES.FULL];
|
|
16
|
+
/** RFC 8414 authorization server metadata. */
|
|
17
|
+
function authorizationServerMetadata(settings) {
|
|
18
|
+
const at = (path) => `${settings.issuer}${path}`;
|
|
19
|
+
return {
|
|
20
|
+
issuer: settings.issuer,
|
|
21
|
+
authorization_endpoint: at(exports.OAUTH_ENDPOINT_PATHS.AUTHORIZE),
|
|
22
|
+
token_endpoint: at(exports.OAUTH_ENDPOINT_PATHS.TOKEN),
|
|
23
|
+
registration_endpoint: at(exports.OAUTH_ENDPOINT_PATHS.REGISTER),
|
|
24
|
+
revocation_endpoint: at(exports.OAUTH_ENDPOINT_PATHS.REVOKE),
|
|
25
|
+
response_types_supported: ['code'],
|
|
26
|
+
grant_types_supported: ['authorization_code', 'refresh_token'],
|
|
27
|
+
code_challenge_methods_supported: ['S256'],
|
|
28
|
+
token_endpoint_auth_methods_supported: ['none'],
|
|
29
|
+
revocation_endpoint_auth_methods_supported: ['none'],
|
|
30
|
+
scopes_supported: SCOPES_SUPPORTED,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** RFC 9728 protected resource metadata for `/mcp`. */
|
|
34
|
+
function protectedResourceMetadata(settings) {
|
|
35
|
+
return {
|
|
36
|
+
resource: settings.resource,
|
|
37
|
+
authorization_servers: [settings.issuer],
|
|
38
|
+
bearer_methods_supported: ['header'],
|
|
39
|
+
scopes_supported: SCOPES_SUPPORTED,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Root-relative paths of the two well-known documents. The issuer's and the
|
|
44
|
+
* resource's paths are appended after the well-known segment (RFC 8414 §3,
|
|
45
|
+
* RFC 9728 §3).
|
|
46
|
+
*/
|
|
47
|
+
function wellKnownPaths(settings) {
|
|
48
|
+
const issuerPath = new URL(settings.issuer).pathname.replace(/\/+$/, '');
|
|
49
|
+
return {
|
|
50
|
+
authorizationServer: `/.well-known/oauth-authorization-server${issuerPath}`,
|
|
51
|
+
protectedResource: new URL(settings.resourceMetadataUrl).pathname,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic client registration (RFC 7591) for public MCP clients: validation
|
|
3
|
+
* of the requested client metadata, and a per-address registration limit.
|
|
4
|
+
*/
|
|
5
|
+
/** Whether a value carries a control character. */
|
|
6
|
+
export declare function hasControlCharacters(value: string): boolean;
|
|
7
|
+
/** A client name as the consent page may show it: no controls, no direction overrides, trimmed. */
|
|
8
|
+
export declare function displayableClientName(name: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* The address a registration counts against: IPv4 as is, IPv6 by its /64,
|
|
11
|
+
* which one host or network usually holds in full.
|
|
12
|
+
*/
|
|
13
|
+
export declare function registrationAddressKey(address: string): string;
|
|
14
|
+
export declare const REGISTRATION_ERRORS: {
|
|
15
|
+
readonly INVALID_REDIRECT_URI: "invalid_redirect_uri";
|
|
16
|
+
readonly INVALID_CLIENT_METADATA: "invalid_client_metadata";
|
|
17
|
+
};
|
|
18
|
+
export type RegistrationResult = {
|
|
19
|
+
ok: true;
|
|
20
|
+
clientName?: string;
|
|
21
|
+
redirectUris: string[];
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
error: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Loopback http or https on any port, or an https URI equal, in canonical
|
|
29
|
+
* form, to one the deployment allows. Matching whole URIs, not hosts, keeps a
|
|
30
|
+
* code from landing on any other path, query or port of an allowed host.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isAllowedRedirectUri(uri: string, allowedUris: string[]): boolean;
|
|
33
|
+
export declare function validateClientMetadata(body: unknown, allowedUris: string[]): RegistrationResult;
|
|
34
|
+
/** A fixed-window count of registrations per address, in memory, per process. */
|
|
35
|
+
export declare class RegistrationLimiter {
|
|
36
|
+
private readonly limit;
|
|
37
|
+
private readonly windowMs;
|
|
38
|
+
private windows;
|
|
39
|
+
constructor(limit: number, windowMs: number);
|
|
40
|
+
/** Count one registration from `address`; false when over the limit. */
|
|
41
|
+
allow(address: string, now?: number): boolean;
|
|
42
|
+
}
|