@mastra/factory 0.0.0-aggregate-trace-20261015182851
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/LICENSE.md +32 -0
- package/README.md +671 -0
- package/dist/auth.d.ts +201 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +623 -0
- package/dist/auth.js.map +1 -0
- package/dist/boards/define-board.d.ts +111 -0
- package/dist/boards/define-board.d.ts.map +1 -0
- package/dist/boards/define-board.js +156 -0
- package/dist/boards/define-board.js.map +1 -0
- package/dist/boards/index.d.ts +14 -0
- package/dist/boards/index.d.ts.map +1 -0
- package/dist/boards/index.js +21 -0
- package/dist/boards/index.js.map +1 -0
- package/dist/boards/registry.d.ts +16 -0
- package/dist/boards/registry.d.ts.map +1 -0
- package/dist/boards/registry.js +25 -0
- package/dist/boards/registry.js.map +1 -0
- package/dist/boards/relocate.d.ts +21 -0
- package/dist/boards/relocate.d.ts.map +1 -0
- package/dist/boards/relocate.js +58 -0
- package/dist/boards/relocate.js.map +1 -0
- package/dist/boards/review.d.ts +6 -0
- package/dist/boards/review.d.ts.map +1 -0
- package/dist/boards/review.js +104 -0
- package/dist/boards/review.js.map +1 -0
- package/dist/boards/semantics.d.ts +68 -0
- package/dist/boards/semantics.d.ts.map +1 -0
- package/dist/boards/semantics.js +119 -0
- package/dist/boards/semantics.js.map +1 -0
- package/dist/boards/transition-policy.d.ts +67 -0
- package/dist/boards/transition-policy.d.ts.map +1 -0
- package/dist/boards/transition-policy.js +36 -0
- package/dist/boards/transition-policy.js.map +1 -0
- package/dist/boards/work-tool-rules.d.ts +8 -0
- package/dist/boards/work-tool-rules.d.ts.map +1 -0
- package/dist/boards/work-tool-rules.js +20 -0
- package/dist/boards/work-tool-rules.js.map +1 -0
- package/dist/boards/work-transition-policy.d.ts +3 -0
- package/dist/boards/work-transition-policy.d.ts.map +1 -0
- package/dist/boards/work-transition-policy.js +46 -0
- package/dist/boards/work-transition-policy.js.map +1 -0
- package/dist/boards/work.d.ts +4 -0
- package/dist/boards/work.d.ts.map +1 -0
- package/dist/boards/work.js +222 -0
- package/dist/boards/work.js.map +1 -0
- package/dist/capabilities/connection.d.ts +9 -0
- package/dist/capabilities/connection.d.ts.map +1 -0
- package/dist/capabilities/connection.js +1 -0
- package/dist/capabilities/intake.d.ts +153 -0
- package/dist/capabilities/intake.d.ts.map +1 -0
- package/dist/capabilities/intake.js +1 -0
- package/dist/capabilities/version-control.d.ts +268 -0
- package/dist/capabilities/version-control.d.ts.map +1 -0
- package/dist/capabilities/version-control.js +1 -0
- package/dist/environment/build-runner.d.ts +72 -0
- package/dist/environment/build-runner.d.ts.map +1 -0
- package/dist/environment/build-runner.js +131 -0
- package/dist/environment/build-runner.js.map +1 -0
- package/dist/environment/build-schedule.d.ts +40 -0
- package/dist/environment/build-schedule.d.ts.map +1 -0
- package/dist/environment/build-schedule.js +94 -0
- package/dist/environment/build-schedule.js.map +1 -0
- package/dist/environment/build-workflow.d.ts +62 -0
- package/dist/environment/build-workflow.d.ts.map +1 -0
- package/dist/environment/build-workflow.js +149 -0
- package/dist/environment/build-workflow.js.map +1 -0
- package/dist/environment/build.d.ts +111 -0
- package/dist/environment/build.d.ts.map +1 -0
- package/dist/environment/build.js +344 -0
- package/dist/environment/build.js.map +1 -0
- package/dist/environment/heads.d.ts +36 -0
- package/dist/environment/heads.d.ts.map +1 -0
- package/dist/environment/heads.js +60 -0
- package/dist/environment/heads.js.map +1 -0
- package/dist/factory.d.ts +225 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +1006 -0
- package/dist/factory.js.map +1 -0
- package/dist/feed-events.d.ts +13 -0
- package/dist/feed-events.d.ts.map +1 -0
- package/dist/feed-events.js +25 -0
- package/dist/feed-events.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/integrations/base.d.ts +302 -0
- package/dist/integrations/base.d.ts.map +1 -0
- package/dist/integrations/base.js +1 -0
- package/dist/integrations/github/acceptance-labels.d.ts +16 -0
- package/dist/integrations/github/acceptance-labels.d.ts.map +1 -0
- package/dist/integrations/github/acceptance-labels.js +55 -0
- package/dist/integrations/github/acceptance-labels.js.map +1 -0
- package/dist/integrations/github/app-identity.d.ts +43 -0
- package/dist/integrations/github/app-identity.d.ts.map +1 -0
- package/dist/integrations/github/app-identity.js +62 -0
- package/dist/integrations/github/app-identity.js.map +1 -0
- package/dist/integrations/github/commits.d.ts +40 -0
- package/dist/integrations/github/commits.d.ts.map +1 -0
- package/dist/integrations/github/commits.js +48 -0
- package/dist/integrations/github/commits.js.map +1 -0
- package/dist/integrations/github/config.d.ts +60 -0
- package/dist/integrations/github/config.d.ts.map +1 -0
- package/dist/integrations/github/config.js +42 -0
- package/dist/integrations/github/config.js.map +1 -0
- package/dist/integrations/github/default-rules.d.ts +218 -0
- package/dist/integrations/github/default-rules.d.ts.map +1 -0
- package/dist/integrations/github/default-rules.js +296 -0
- package/dist/integrations/github/default-rules.js.map +1 -0
- package/dist/integrations/github/integration.d.ts +270 -0
- package/dist/integrations/github/integration.d.ts.map +1 -0
- package/dist/integrations/github/integration.js +1375 -0
- package/dist/integrations/github/integration.js.map +1 -0
- package/dist/integrations/github/issue-reconciler.d.ts +28 -0
- package/dist/integrations/github/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/github/issue-reconciler.js +138 -0
- package/dist/integrations/github/issue-reconciler.js.map +1 -0
- package/dist/integrations/github/pat.d.ts +38 -0
- package/dist/integrations/github/pat.d.ts.map +1 -0
- package/dist/integrations/github/pat.js +59 -0
- package/dist/integrations/github/pat.js.map +1 -0
- package/dist/integrations/github/provenance.d.ts +34 -0
- package/dist/integrations/github/provenance.d.ts.map +1 -0
- package/dist/integrations/github/provenance.js +91 -0
- package/dist/integrations/github/provenance.js.map +1 -0
- package/dist/integrations/github/reconcile-worker.d.ts +45 -0
- package/dist/integrations/github/reconcile-worker.d.ts.map +1 -0
- package/dist/integrations/github/reconcile-worker.js +189 -0
- package/dist/integrations/github/reconcile-worker.js.map +1 -0
- package/dist/integrations/github/reconciliation-config.d.ts +3 -0
- package/dist/integrations/github/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/github/reconciliation-config.js +19 -0
- package/dist/integrations/github/reconciliation-config.js.map +1 -0
- package/dist/integrations/github/routes.d.ts +90 -0
- package/dist/integrations/github/routes.d.ts.map +1 -0
- package/dist/integrations/github/routes.js +1362 -0
- package/dist/integrations/github/routes.js.map +1 -0
- package/dist/integrations/github/rules.d.ts +173 -0
- package/dist/integrations/github/rules.d.ts.map +1 -0
- package/dist/integrations/github/rules.js +1021 -0
- package/dist/integrations/github/rules.js.map +1 -0
- package/dist/integrations/github/sandbox-release.d.ts +25 -0
- package/dist/integrations/github/sandbox-release.d.ts.map +1 -0
- package/dist/integrations/github/sandbox-release.js +38 -0
- package/dist/integrations/github/sandbox-release.js.map +1 -0
- package/dist/integrations/github/sandbox.d.ts +234 -0
- package/dist/integrations/github/sandbox.d.ts.map +1 -0
- package/dist/integrations/github/sandbox.js +947 -0
- package/dist/integrations/github/sandbox.js.map +1 -0
- package/dist/integrations/github/session-subscriptions.d.ts +28 -0
- package/dist/integrations/github/session-subscriptions.d.ts.map +1 -0
- package/dist/integrations/github/session-subscriptions.js +283 -0
- package/dist/integrations/github/session-subscriptions.js.map +1 -0
- package/dist/integrations/github/settle-or-abort.d.ts +7 -0
- package/dist/integrations/github/settle-or-abort.d.ts.map +1 -0
- package/dist/integrations/github/settle-or-abort.js +25 -0
- package/dist/integrations/github/settle-or-abort.js.map +1 -0
- package/dist/integrations/github/stale-reviews.d.ts +22 -0
- package/dist/integrations/github/stale-reviews.d.ts.map +1 -0
- package/dist/integrations/github/stale-reviews.js +70 -0
- package/dist/integrations/github/stale-reviews.js.map +1 -0
- package/dist/integrations/github/subscriptions.d.ts +54 -0
- package/dist/integrations/github/subscriptions.d.ts.map +1 -0
- package/dist/integrations/github/subscriptions.js +64 -0
- package/dist/integrations/github/subscriptions.js.map +1 -0
- package/dist/integrations/github/token-refresh.d.ts +31 -0
- package/dist/integrations/github/token-refresh.d.ts.map +1 -0
- package/dist/integrations/github/token-refresh.js +42 -0
- package/dist/integrations/github/token-refresh.js.map +1 -0
- package/dist/integrations/github/webhook.d.ts +139 -0
- package/dist/integrations/github/webhook.d.ts.map +1 -0
- package/dist/integrations/github/webhook.js +432 -0
- package/dist/integrations/github/webhook.js.map +1 -0
- package/dist/integrations/gitlab/agent-tools.d.ts +14 -0
- package/dist/integrations/gitlab/agent-tools.d.ts.map +1 -0
- package/dist/integrations/gitlab/agent-tools.js +42 -0
- package/dist/integrations/gitlab/agent-tools.js.map +1 -0
- package/dist/integrations/gitlab/api.d.ts +222 -0
- package/dist/integrations/gitlab/api.d.ts.map +1 -0
- package/dist/integrations/gitlab/api.js +274 -0
- package/dist/integrations/gitlab/api.js.map +1 -0
- package/dist/integrations/gitlab/default-rules.d.ts +125 -0
- package/dist/integrations/gitlab/default-rules.d.ts.map +1 -0
- package/dist/integrations/gitlab/default-rules.js +180 -0
- package/dist/integrations/gitlab/default-rules.js.map +1 -0
- package/dist/integrations/gitlab/integration.d.ts +138 -0
- package/dist/integrations/gitlab/integration.d.ts.map +1 -0
- package/dist/integrations/gitlab/integration.js +705 -0
- package/dist/integrations/gitlab/integration.js.map +1 -0
- package/dist/integrations/gitlab/issue-reconciler.d.ts +6 -0
- package/dist/integrations/gitlab/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/gitlab/issue-reconciler.js +123 -0
- package/dist/integrations/gitlab/issue-reconciler.js.map +1 -0
- package/dist/integrations/gitlab/merge-request-reconciler.d.ts +6 -0
- package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -0
- package/dist/integrations/gitlab/merge-request-reconciler.js +267 -0
- package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -0
- package/dist/integrations/gitlab/reconciler.d.ts +5 -0
- package/dist/integrations/gitlab/reconciler.d.ts.map +1 -0
- package/dist/integrations/gitlab/reconciler.js +31 -0
- package/dist/integrations/gitlab/reconciler.js.map +1 -0
- package/dist/integrations/gitlab/reconciliation-config.d.ts +3 -0
- package/dist/integrations/gitlab/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/gitlab/reconciliation-config.js +17 -0
- package/dist/integrations/gitlab/reconciliation-config.js.map +1 -0
- package/dist/integrations/gitlab/routes.d.ts +20 -0
- package/dist/integrations/gitlab/routes.d.ts.map +1 -0
- package/dist/integrations/gitlab/routes.js +474 -0
- package/dist/integrations/gitlab/routes.js.map +1 -0
- package/dist/integrations/gitlab/rules.d.ts +35 -0
- package/dist/integrations/gitlab/rules.d.ts.map +1 -0
- package/dist/integrations/gitlab/rules.js +502 -0
- package/dist/integrations/gitlab/rules.js.map +1 -0
- package/dist/integrations/gitlab/session-subscriptions.d.ts +32 -0
- package/dist/integrations/gitlab/session-subscriptions.d.ts.map +1 -0
- package/dist/integrations/gitlab/session-subscriptions.js +193 -0
- package/dist/integrations/gitlab/session-subscriptions.js.map +1 -0
- package/dist/integrations/gitlab/subscriptions.d.ts +70 -0
- package/dist/integrations/gitlab/subscriptions.d.ts.map +1 -0
- package/dist/integrations/gitlab/subscriptions.js +76 -0
- package/dist/integrations/gitlab/subscriptions.js.map +1 -0
- package/dist/integrations/gitlab/version-control.d.ts +16 -0
- package/dist/integrations/gitlab/version-control.d.ts.map +1 -0
- package/dist/integrations/gitlab/version-control.js +621 -0
- package/dist/integrations/gitlab/version-control.js.map +1 -0
- package/dist/integrations/gitlab/webhook-dispatch.d.ts +75 -0
- package/dist/integrations/gitlab/webhook-dispatch.d.ts.map +1 -0
- package/dist/integrations/gitlab/webhook-dispatch.js +235 -0
- package/dist/integrations/gitlab/webhook-dispatch.js.map +1 -0
- package/dist/integrations/gitlab/webhook.d.ts +72 -0
- package/dist/integrations/gitlab/webhook.d.ts.map +1 -0
- package/dist/integrations/gitlab/webhook.js +201 -0
- package/dist/integrations/gitlab/webhook.js.map +1 -0
- package/dist/integrations/incidentio/agent-tools.d.ts +49 -0
- package/dist/integrations/incidentio/agent-tools.d.ts.map +1 -0
- package/dist/integrations/incidentio/agent-tools.js +90 -0
- package/dist/integrations/incidentio/agent-tools.js.map +1 -0
- package/dist/integrations/incidentio/api.d.ts +400 -0
- package/dist/integrations/incidentio/api.d.ts.map +1 -0
- package/dist/integrations/incidentio/api.js +192 -0
- package/dist/integrations/incidentio/api.js.map +1 -0
- package/dist/integrations/incidentio/claim.d.ts +8 -0
- package/dist/integrations/incidentio/claim.d.ts.map +1 -0
- package/dist/integrations/incidentio/claim.js +14 -0
- package/dist/integrations/incidentio/claim.js.map +1 -0
- package/dist/integrations/incidentio/default-rules.d.ts +46 -0
- package/dist/integrations/incidentio/default-rules.d.ts.map +1 -0
- package/dist/integrations/incidentio/default-rules.js +68 -0
- package/dist/integrations/incidentio/default-rules.js.map +1 -0
- package/dist/integrations/incidentio/intake.d.ts +10 -0
- package/dist/integrations/incidentio/intake.d.ts.map +1 -0
- package/dist/integrations/incidentio/intake.js +307 -0
- package/dist/integrations/incidentio/intake.js.map +1 -0
- package/dist/integrations/incidentio/integration.d.ts +63 -0
- package/dist/integrations/incidentio/integration.d.ts.map +1 -0
- package/dist/integrations/incidentio/integration.js +141 -0
- package/dist/integrations/incidentio/integration.js.map +1 -0
- package/dist/integrations/incidentio/issue-reconciler.d.ts +10 -0
- package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/incidentio/issue-reconciler.js +75 -0
- package/dist/integrations/incidentio/issue-reconciler.js.map +1 -0
- package/dist/integrations/incidentio/reconciliation-config.d.ts +3 -0
- package/dist/integrations/incidentio/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/incidentio/reconciliation-config.js +17 -0
- package/dist/integrations/incidentio/reconciliation-config.js.map +1 -0
- package/dist/integrations/incidentio/routes.d.ts +76 -0
- package/dist/integrations/incidentio/routes.d.ts.map +1 -0
- package/dist/integrations/incidentio/routes.js +249 -0
- package/dist/integrations/incidentio/routes.js.map +1 -0
- package/dist/integrations/incidentio/rules.d.ts +55 -0
- package/dist/integrations/incidentio/rules.d.ts.map +1 -0
- package/dist/integrations/incidentio/rules.js +189 -0
- package/dist/integrations/incidentio/rules.js.map +1 -0
- package/dist/integrations/issue-reconcile-worker.d.ts +19 -0
- package/dist/integrations/issue-reconcile-worker.d.ts.map +1 -0
- package/dist/integrations/issue-reconcile-worker.js +97 -0
- package/dist/integrations/issue-reconcile-worker.js.map +1 -0
- package/dist/integrations/issue-reconciler.d.ts +51 -0
- package/dist/integrations/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/issue-reconciler.js +158 -0
- package/dist/integrations/issue-reconciler.js.map +1 -0
- package/dist/integrations/jira/adf.d.ts +26 -0
- package/dist/integrations/jira/adf.d.ts.map +1 -0
- package/dist/integrations/jira/adf.js +73 -0
- package/dist/integrations/jira/adf.js.map +1 -0
- package/dist/integrations/jira/agent-tools.d.ts +45 -0
- package/dist/integrations/jira/agent-tools.d.ts.map +1 -0
- package/dist/integrations/jira/agent-tools.js +87 -0
- package/dist/integrations/jira/agent-tools.js.map +1 -0
- package/dist/integrations/jira/api.d.ts +157 -0
- package/dist/integrations/jira/api.d.ts.map +1 -0
- package/dist/integrations/jira/api.js +141 -0
- package/dist/integrations/jira/api.js.map +1 -0
- package/dist/integrations/jira/claim.d.ts +9 -0
- package/dist/integrations/jira/claim.d.ts.map +1 -0
- package/dist/integrations/jira/claim.js +15 -0
- package/dist/integrations/jira/claim.js.map +1 -0
- package/dist/integrations/jira/default-rules.d.ts +47 -0
- package/dist/integrations/jira/default-rules.d.ts.map +1 -0
- package/dist/integrations/jira/default-rules.js +69 -0
- package/dist/integrations/jira/default-rules.js.map +1 -0
- package/dist/integrations/jira/integration.d.ts +114 -0
- package/dist/integrations/jira/integration.d.ts.map +1 -0
- package/dist/integrations/jira/integration.js +407 -0
- package/dist/integrations/jira/integration.js.map +1 -0
- package/dist/integrations/jira/issue-reconciler.d.ts +10 -0
- package/dist/integrations/jira/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/jira/issue-reconciler.js +70 -0
- package/dist/integrations/jira/issue-reconciler.js.map +1 -0
- package/dist/integrations/jira/reconciliation-config.d.ts +3 -0
- package/dist/integrations/jira/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/jira/reconciliation-config.js +17 -0
- package/dist/integrations/jira/reconciliation-config.js.map +1 -0
- package/dist/integrations/jira/routes.d.ts +54 -0
- package/dist/integrations/jira/routes.d.ts.map +1 -0
- package/dist/integrations/jira/routes.js +260 -0
- package/dist/integrations/jira/routes.js.map +1 -0
- package/dist/integrations/jira/rules.d.ts +57 -0
- package/dist/integrations/jira/rules.d.ts.map +1 -0
- package/dist/integrations/jira/rules.js +189 -0
- package/dist/integrations/jira/rules.js.map +1 -0
- package/dist/integrations/linear/agent-tools.d.ts +34 -0
- package/dist/integrations/linear/agent-tools.d.ts.map +1 -0
- package/dist/integrations/linear/agent-tools.js +87 -0
- package/dist/integrations/linear/agent-tools.js.map +1 -0
- package/dist/integrations/linear/claim.d.ts +8 -0
- package/dist/integrations/linear/claim.d.ts.map +1 -0
- package/dist/integrations/linear/claim.js +14 -0
- package/dist/integrations/linear/claim.js.map +1 -0
- package/dist/integrations/linear/default-rules.d.ts +46 -0
- package/dist/integrations/linear/default-rules.d.ts.map +1 -0
- package/dist/integrations/linear/default-rules.js +70 -0
- package/dist/integrations/linear/default-rules.js.map +1 -0
- package/dist/integrations/linear/integration.d.ts +260 -0
- package/dist/integrations/linear/integration.d.ts.map +1 -0
- package/dist/integrations/linear/integration.js +900 -0
- package/dist/integrations/linear/integration.js.map +1 -0
- package/dist/integrations/linear/issue-reconciler.d.ts +8 -0
- package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/linear/issue-reconciler.js +73 -0
- package/dist/integrations/linear/issue-reconciler.js.map +1 -0
- package/dist/integrations/linear/reconciliation-config.d.ts +3 -0
- package/dist/integrations/linear/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/linear/reconciliation-config.js +21 -0
- package/dist/integrations/linear/reconciliation-config.js.map +1 -0
- package/dist/integrations/linear/routes.d.ts +81 -0
- package/dist/integrations/linear/routes.d.ts.map +1 -0
- package/dist/integrations/linear/routes.js +380 -0
- package/dist/integrations/linear/routes.js.map +1 -0
- package/dist/integrations/linear/rules.d.ts +54 -0
- package/dist/integrations/linear/rules.d.ts.map +1 -0
- package/dist/integrations/linear/rules.js +189 -0
- package/dist/integrations/linear/rules.js.map +1 -0
- package/dist/integrations/linear/storage.d.ts +65 -0
- package/dist/integrations/linear/storage.d.ts.map +1 -0
- package/dist/integrations/linear/storage.js +1 -0
- package/dist/integrations/platform/api-client.d.ts +26 -0
- package/dist/integrations/platform/api-client.d.ts.map +1 -0
- package/dist/integrations/platform/api-client.js +177 -0
- package/dist/integrations/platform/api-client.js.map +1 -0
- package/dist/integrations/platform/connect/routes.d.ts +39 -0
- package/dist/integrations/platform/connect/routes.d.ts.map +1 -0
- package/dist/integrations/platform/connect/routes.js +133 -0
- package/dist/integrations/platform/connect/routes.js.map +1 -0
- package/dist/integrations/platform/github/event-worker.d.ts +58 -0
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -0
- package/dist/integrations/platform/github/event-worker.js +449 -0
- package/dist/integrations/platform/github/event-worker.js.map +1 -0
- package/dist/integrations/platform/github/integration.d.ts +89 -0
- package/dist/integrations/platform/github/integration.d.ts.map +1 -0
- package/dist/integrations/platform/github/integration.js +1266 -0
- package/dist/integrations/platform/github/integration.js.map +1 -0
- package/dist/integrations/platform/gitlab/event-worker.d.ts +64 -0
- package/dist/integrations/platform/gitlab/event-worker.d.ts.map +1 -0
- package/dist/integrations/platform/gitlab/event-worker.js +305 -0
- package/dist/integrations/platform/gitlab/event-worker.js.map +1 -0
- package/dist/integrations/platform/gitlab/integration.d.ts +57 -0
- package/dist/integrations/platform/gitlab/integration.d.ts.map +1 -0
- package/dist/integrations/platform/gitlab/integration.js +113 -0
- package/dist/integrations/platform/gitlab/integration.js.map +1 -0
- package/dist/integrations/platform/incidentio/integration.d.ts +74 -0
- package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -0
- package/dist/integrations/platform/incidentio/integration.js +406 -0
- package/dist/integrations/platform/incidentio/integration.js.map +1 -0
- package/dist/integrations/platform/jira/agent-tools.d.ts +36 -0
- package/dist/integrations/platform/jira/agent-tools.d.ts.map +1 -0
- package/dist/integrations/platform/jira/agent-tools.js +85 -0
- package/dist/integrations/platform/jira/agent-tools.js.map +1 -0
- package/dist/integrations/platform/jira/integration.d.ts +65 -0
- package/dist/integrations/platform/jira/integration.d.ts.map +1 -0
- package/dist/integrations/platform/jira/integration.js +546 -0
- package/dist/integrations/platform/jira/integration.js.map +1 -0
- package/dist/integrations/platform/jira/routes.d.ts +55 -0
- package/dist/integrations/platform/jira/routes.d.ts.map +1 -0
- package/dist/integrations/platform/jira/routes.js +274 -0
- package/dist/integrations/platform/jira/routes.js.map +1 -0
- package/dist/integrations/platform/linear/event-worker.d.ts +105 -0
- package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -0
- package/dist/integrations/platform/linear/event-worker.js +379 -0
- package/dist/integrations/platform/linear/event-worker.js.map +1 -0
- package/dist/integrations/platform/linear/integration.d.ts +92 -0
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -0
- package/dist/integrations/platform/linear/integration.js +754 -0
- package/dist/integrations/platform/linear/integration.js.map +1 -0
- package/dist/integrations/pull-request-head.d.ts +18 -0
- package/dist/integrations/pull-request-head.d.ts.map +1 -0
- package/dist/integrations/pull-request-head.js +45 -0
- package/dist/integrations/pull-request-head.js.map +1 -0
- package/dist/integrations/reconciliation-config.d.ts +3 -0
- package/dist/integrations/reconciliation-config.d.ts.map +1 -0
- package/dist/integrations/reconciliation-config.js +16 -0
- package/dist/integrations/reconciliation-config.js.map +1 -0
- package/dist/integrations/slack/connect-route.d.ts +46 -0
- package/dist/integrations/slack/connect-route.d.ts.map +1 -0
- package/dist/integrations/slack/connect-route.js +186 -0
- package/dist/integrations/slack/connect-route.js.map +1 -0
- package/dist/integrations/slack/emoji-shortcodes.generated.d.ts +8 -0
- package/dist/integrations/slack/emoji-shortcodes.generated.d.ts.map +1 -0
- package/dist/integrations/slack/emoji-shortcodes.generated.js +1985 -0
- package/dist/integrations/slack/emoji-shortcodes.generated.js.map +1 -0
- package/dist/integrations/slack/emoji.d.ts +3 -0
- package/dist/integrations/slack/emoji.d.ts.map +1 -0
- package/dist/integrations/slack/emoji.js +12 -0
- package/dist/integrations/slack/emoji.js.map +1 -0
- package/dist/integrations/slack/feed-publisher.d.ts +26 -0
- package/dist/integrations/slack/feed-publisher.d.ts.map +1 -0
- package/dist/integrations/slack/feed-publisher.js +44 -0
- package/dist/integrations/slack/feed-publisher.js.map +1 -0
- package/dist/integrations/slack/integration.d.ts +80 -0
- package/dist/integrations/slack/integration.d.ts.map +1 -0
- package/dist/integrations/slack/integration.js +93 -0
- package/dist/integrations/slack/integration.js.map +1 -0
- package/dist/integrations/slack/slack.d.ts +205 -0
- package/dist/integrations/slack/slack.d.ts.map +1 -0
- package/dist/integrations/slack/slack.js +653 -0
- package/dist/integrations/slack/slack.js.map +1 -0
- package/dist/integrations/subscription-session.d.ts +49 -0
- package/dist/integrations/subscription-session.d.ts.map +1 -0
- package/dist/integrations/subscription-session.js +103 -0
- package/dist/integrations/subscription-session.js.map +1 -0
- package/dist/integrations/workos/integration.d.ts +39 -0
- package/dist/integrations/workos/integration.d.ts.map +1 -0
- package/dist/integrations/workos/integration.js +91 -0
- package/dist/integrations/workos/integration.js.map +1 -0
- package/dist/packages/_internals/workspace/dist/index.js +48 -0
- package/dist/packages/_internals/workspace/dist/index.js.map +1 -0
- package/dist/platform-auth-host.d.ts +4 -0
- package/dist/platform-auth-host.d.ts.map +1 -0
- package/dist/platform-auth-host.js +18 -0
- package/dist/platform-auth-host.js.map +1 -0
- package/dist/review-verdict.d.ts +6 -0
- package/dist/review-verdict.d.ts.map +1 -0
- package/dist/review-verdict.js +14 -0
- package/dist/review-verdict.js.map +1 -0
- package/dist/routes/attention-activity.d.ts +23 -0
- package/dist/routes/attention-activity.d.ts.map +1 -0
- package/dist/routes/attention-activity.js +152 -0
- package/dist/routes/attention-activity.js.map +1 -0
- package/dist/routes/attention-parked.d.ts +22 -0
- package/dist/routes/attention-parked.d.ts.map +1 -0
- package/dist/routes/attention-parked.js +136 -0
- package/dist/routes/attention-parked.js.map +1 -0
- package/dist/routes/attention-proposed.d.ts +3 -0
- package/dist/routes/attention-proposed.d.ts.map +1 -0
- package/dist/routes/attention-proposed.js +21 -0
- package/dist/routes/attention-proposed.js.map +1 -0
- package/dist/routes/attention-providers.d.ts +159 -0
- package/dist/routes/attention-providers.d.ts.map +1 -0
- package/dist/routes/attention-providers.js +524 -0
- package/dist/routes/attention-providers.js.map +1 -0
- package/dist/routes/attention.d.ts +23 -0
- package/dist/routes/attention.d.ts.map +1 -0
- package/dist/routes/attention.js +219 -0
- package/dist/routes/attention.js.map +1 -0
- package/dist/routes/automation-runs.d.ts +37 -0
- package/dist/routes/automation-runs.d.ts.map +1 -0
- package/dist/routes/automation-runs.js +196 -0
- package/dist/routes/automation-runs.js.map +1 -0
- package/dist/routes/config.d.ts +238 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +1011 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/contracts.d.ts +1080 -0
- package/dist/routes/contracts.d.ts.map +1 -0
- package/dist/routes/contracts.js +673 -0
- package/dist/routes/contracts.js.map +1 -0
- package/dist/routes/custom-provider-source.d.ts +52 -0
- package/dist/routes/custom-provider-source.d.ts.map +1 -0
- package/dist/routes/custom-provider-source.js +124 -0
- package/dist/routes/custom-provider-source.js.map +1 -0
- package/dist/routes/fs.d.ts +189 -0
- package/dist/routes/fs.d.ts.map +1 -0
- package/dist/routes/fs.js +916 -0
- package/dist/routes/fs.js.map +1 -0
- package/dist/routes/intake.d.ts +64 -0
- package/dist/routes/intake.d.ts.map +1 -0
- package/dist/routes/intake.js +627 -0
- package/dist/routes/intake.js.map +1 -0
- package/dist/routes/knowledge.d.ts +247 -0
- package/dist/routes/knowledge.d.ts.map +1 -0
- package/dist/routes/knowledge.js +1128 -0
- package/dist/routes/knowledge.js.map +1 -0
- package/dist/routes/oauth.d.ts +43 -0
- package/dist/routes/oauth.d.ts.map +1 -0
- package/dist/routes/oauth.js +477 -0
- package/dist/routes/oauth.js.map +1 -0
- package/dist/routes/projects.d.ts +68 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +919 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/provider-credentials.d.ts +82 -0
- package/dist/routes/provider-credentials.d.ts.map +1 -0
- package/dist/routes/provider-credentials.js +80 -0
- package/dist/routes/provider-credentials.js.map +1 -0
- package/dist/routes/route.d.ts +48 -0
- package/dist/routes/route.d.ts.map +1 -0
- package/dist/routes/route.js +15 -0
- package/dist/routes/route.js.map +1 -0
- package/dist/routes/skills.d.ts +30 -0
- package/dist/routes/skills.d.ts.map +1 -0
- package/dist/routes/skills.js +198 -0
- package/dist/routes/skills.js.map +1 -0
- package/dist/routes/source-control-sessions.d.ts +22 -0
- package/dist/routes/source-control-sessions.d.ts.map +1 -0
- package/dist/routes/source-control-sessions.js +356 -0
- package/dist/routes/source-control-sessions.js.map +1 -0
- package/dist/routes/source-control-settings.d.ts +10 -0
- package/dist/routes/source-control-settings.d.ts.map +1 -0
- package/dist/routes/source-control-settings.js +87 -0
- package/dist/routes/source-control-settings.js.map +1 -0
- package/dist/routes/supervisor.d.ts +25 -0
- package/dist/routes/supervisor.d.ts.map +1 -0
- package/dist/routes/supervisor.js +35 -0
- package/dist/routes/supervisor.js.map +1 -0
- package/dist/routes/surface.d.ts +133 -0
- package/dist/routes/surface.d.ts.map +1 -0
- package/dist/routes/surface.js +518 -0
- package/dist/routes/surface.js.map +1 -0
- package/dist/routes/telemetry.d.ts +13 -0
- package/dist/routes/telemetry.d.ts.map +1 -0
- package/dist/routes/telemetry.js +60 -0
- package/dist/routes/telemetry.js.map +1 -0
- package/dist/routes/tenant-credentials.d.ts +87 -0
- package/dist/routes/tenant-credentials.d.ts.map +1 -0
- package/dist/routes/tenant-credentials.js +219 -0
- package/dist/routes/tenant-credentials.js.map +1 -0
- package/dist/routes/work-items.d.ts +49 -0
- package/dist/routes/work-items.d.ts.map +1 -0
- package/dist/routes/work-items.js +633 -0
- package/dist/routes/work-items.js.map +1 -0
- package/dist/rules/binding-context.d.ts +59 -0
- package/dist/rules/binding-context.d.ts.map +1 -0
- package/dist/rules/binding-context.js +134 -0
- package/dist/rules/binding-context.js.map +1 -0
- package/dist/rules/decision-applicability.d.ts +32 -0
- package/dist/rules/decision-applicability.d.ts.map +1 -0
- package/dist/rules/decision-applicability.js +56 -0
- package/dist/rules/decision-applicability.js.map +1 -0
- package/dist/rules/dispatch-errors.d.ts +13 -0
- package/dist/rules/dispatch-errors.d.ts.map +1 -0
- package/dist/rules/dispatch-errors.js +105 -0
- package/dist/rules/dispatch-errors.js.map +1 -0
- package/dist/rules/dispatcher.d.ts +86 -0
- package/dist/rules/dispatcher.d.ts.map +1 -0
- package/dist/rules/dispatcher.js +1159 -0
- package/dist/rules/dispatcher.js.map +1 -0
- package/dist/rules/event-rules.d.ts +23 -0
- package/dist/rules/event-rules.d.ts.map +1 -0
- package/dist/rules/event-rules.js +46 -0
- package/dist/rules/event-rules.js.map +1 -0
- package/dist/rules/index.d.ts +6 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +4 -0
- package/dist/rules/processor.d.ts +90 -0
- package/dist/rules/processor.d.ts.map +1 -0
- package/dist/rules/processor.js +486 -0
- package/dist/rules/processor.js.map +1 -0
- package/dist/rules/resolve.d.ts +15 -0
- package/dist/rules/resolve.d.ts.map +1 -0
- package/dist/rules/resolve.js +23 -0
- package/dist/rules/resolve.js.map +1 -0
- package/dist/rules/review-source-tool.d.ts +105 -0
- package/dist/rules/review-source-tool.d.ts.map +1 -0
- package/dist/rules/review-source-tool.js +109 -0
- package/dist/rules/review-source-tool.js.map +1 -0
- package/dist/rules/start-coordinator.d.ts +64 -0
- package/dist/rules/start-coordinator.d.ts.map +1 -0
- package/dist/rules/start-coordinator.js +246 -0
- package/dist/rules/start-coordinator.js.map +1 -0
- package/dist/rules/terminal-cleanup.d.ts +38 -0
- package/dist/rules/terminal-cleanup.d.ts.map +1 -0
- package/dist/rules/terminal-cleanup.js +68 -0
- package/dist/rules/terminal-cleanup.js.map +1 -0
- package/dist/rules/tools.d.ts +15 -0
- package/dist/rules/tools.d.ts.map +1 -0
- package/dist/rules/tools.js +185 -0
- package/dist/rules/tools.js.map +1 -0
- package/dist/rules/transition-service.d.ts +93 -0
- package/dist/rules/transition-service.d.ts.map +1 -0
- package/dist/rules/transition-service.js +402 -0
- package/dist/rules/transition-service.js.map +1 -0
- package/dist/rules/types.d.ts +553 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +154 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/rules/validation.d.ts +21 -0
- package/dist/rules/validation.d.ts.map +1 -0
- package/dist/rules/validation.js +327 -0
- package/dist/rules/validation.js.map +1 -0
- package/dist/sandbox/callback-factory-sandbox.d.ts +15 -0
- package/dist/sandbox/callback-factory-sandbox.d.ts.map +1 -0
- package/dist/sandbox/callback-factory-sandbox.js +22 -0
- package/dist/sandbox/callback-factory-sandbox.js.map +1 -0
- package/dist/sandbox/git-ref.d.ts +7 -0
- package/dist/sandbox/git-ref.d.ts.map +1 -0
- package/dist/sandbox/git-ref.js +15 -0
- package/dist/sandbox/git-ref.js.map +1 -0
- package/dist/sandbox/local-factory-sandbox.d.ts +20 -0
- package/dist/sandbox/local-factory-sandbox.d.ts.map +1 -0
- package/dist/sandbox/local-factory-sandbox.js +27 -0
- package/dist/sandbox/local-factory-sandbox.js.map +1 -0
- package/dist/sandbox/materialization.d.ts +41 -0
- package/dist/sandbox/materialization.d.ts.map +1 -0
- package/dist/sandbox/materialization.js +18 -0
- package/dist/sandbox/materialization.js.map +1 -0
- package/dist/sandbox/session-retirement.d.ts +45 -0
- package/dist/sandbox/session-retirement.d.ts.map +1 -0
- package/dist/sandbox/session-retirement.js +153 -0
- package/dist/sandbox/session-retirement.js.map +1 -0
- package/dist/sandbox/session-sandbox.d.ts +185 -0
- package/dist/sandbox/session-sandbox.d.ts.map +1 -0
- package/dist/sandbox/session-sandbox.js +248 -0
- package/dist/sandbox/session-sandbox.js.map +1 -0
- package/dist/sandbox/workdir.d.ts +45 -0
- package/dist/sandbox/workdir.d.ts.map +1 -0
- package/dist/sandbox/workdir.js +64 -0
- package/dist/sandbox/workdir.js.map +1 -0
- package/dist/secret-encryption.d.ts +25 -0
- package/dist/secret-encryption.d.ts.map +1 -0
- package/dist/secret-encryption.js +107 -0
- package/dist/secret-encryption.js.map +1 -0
- package/dist/server-error.d.ts +12 -0
- package/dist/server-error.d.ts.map +1 -0
- package/dist/server-error.js +16 -0
- package/dist/server-error.js.map +1 -0
- package/dist/session/credential-policy.d.ts +20 -0
- package/dist/session/credential-policy.d.ts.map +1 -0
- package/dist/session/credential-policy.js +70 -0
- package/dist/session/credential-policy.js.map +1 -0
- package/dist/session/default-model-hydration.d.ts +46 -0
- package/dist/session/default-model-hydration.d.ts.map +1 -0
- package/dist/session/default-model-hydration.js +85 -0
- package/dist/session/default-model-hydration.js.map +1 -0
- package/dist/session/environment-repositories.d.ts +31 -0
- package/dist/session/environment-repositories.d.ts.map +1 -0
- package/dist/session/environment-repositories.js +89 -0
- package/dist/session/environment-repositories.js.map +1 -0
- package/dist/session/environment-state-processor.d.ts +59 -0
- package/dist/session/environment-state-processor.d.ts.map +1 -0
- package/dist/session/environment-state-processor.js +105 -0
- package/dist/session/environment-state-processor.js.map +1 -0
- package/dist/session/factory-session.d.ts +159 -0
- package/dist/session/factory-session.d.ts.map +1 -0
- package/dist/session/factory-session.js +226 -0
- package/dist/session/factory-session.js.map +1 -0
- package/dist/session/filesystem-capture.d.ts +50 -0
- package/dist/session/filesystem-capture.d.ts.map +1 -0
- package/dist/session/filesystem-capture.js +231 -0
- package/dist/session/filesystem-capture.js.map +1 -0
- package/dist/session/first-exec-capture.d.ts +38 -0
- package/dist/session/first-exec-capture.d.ts.map +1 -0
- package/dist/session/first-exec-capture.js +91 -0
- package/dist/session/first-exec-capture.js.map +1 -0
- package/dist/session/first-message-capture.d.ts +33 -0
- package/dist/session/first-message-capture.d.ts.map +1 -0
- package/dist/session/first-message-capture.js +35 -0
- package/dist/session/first-message-capture.js.map +1 -0
- package/dist/session/live-sessions.d.ts +63 -0
- package/dist/session/live-sessions.d.ts.map +1 -0
- package/dist/session/live-sessions.js +90 -0
- package/dist/session/live-sessions.js.map +1 -0
- package/dist/session/memory-settings-hydration.d.ts +36 -0
- package/dist/session/memory-settings-hydration.d.ts.map +1 -0
- package/dist/session/memory-settings-hydration.js +43 -0
- package/dist/session/memory-settings-hydration.js.map +1 -0
- package/dist/session/org-seed.d.ts +67 -0
- package/dist/session/org-seed.d.ts.map +1 -0
- package/dist/session/org-seed.js +53 -0
- package/dist/session/org-seed.js.map +1 -0
- package/dist/session/run-audit.d.ts +54 -0
- package/dist/session/run-audit.d.ts.map +1 -0
- package/dist/session/run-audit.js +124 -0
- package/dist/session/run-audit.js.map +1 -0
- package/dist/session/session-title.d.ts +7 -0
- package/dist/session/session-title.d.ts.map +1 -0
- package/dist/session/session-title.js +14 -0
- package/dist/session/session-title.js.map +1 -0
- package/dist/session/shell-commands.d.ts +5 -0
- package/dist/session/shell-commands.d.ts.map +1 -0
- package/dist/session/shell-commands.js +25 -0
- package/dist/session/shell-commands.js.map +1 -0
- package/dist/session/source-control-tools.d.ts +25 -0
- package/dist/session/source-control-tools.d.ts.map +1 -0
- package/dist/session/source-control-tools.js +594 -0
- package/dist/session/source-control-tools.js.map +1 -0
- package/dist/session/thread-title-mirror.d.ts +35 -0
- package/dist/session/thread-title-mirror.d.ts.map +1 -0
- package/dist/session/thread-title-mirror.js +51 -0
- package/dist/session/thread-title-mirror.js.map +1 -0
- package/dist/session/work-item-repository.d.ts +21 -0
- package/dist/session/work-item-repository.d.ts.map +1 -0
- package/dist/session/work-item-repository.js +113 -0
- package/dist/session/work-item-repository.js.map +1 -0
- package/dist/skills/catalog.d.ts +14 -0
- package/dist/skills/catalog.d.ts.map +1 -0
- package/dist/skills/catalog.js +62 -0
- package/dist/skills/catalog.js.map +1 -0
- package/dist/skills/service.d.ts +70 -0
- package/dist/skills/service.d.ts.map +1 -0
- package/dist/skills/service.js +88 -0
- package/dist/skills/service.js.map +1 -0
- package/dist/spa-static.d.ts +33 -0
- package/dist/spa-static.d.ts.map +1 -0
- package/dist/spa-static.js +104 -0
- package/dist/spa-static.js.map +1 -0
- package/dist/state-signing.d.ts +59 -0
- package/dist/state-signing.d.ts.map +1 -0
- package/dist/state-signing.js +83 -0
- package/dist/state-signing.js.map +1 -0
- package/dist/storage/domains/audit/actions.d.ts +24 -0
- package/dist/storage/domains/audit/actions.d.ts.map +1 -0
- package/dist/storage/domains/audit/actions.js +69 -0
- package/dist/storage/domains/audit/actions.js.map +1 -0
- package/dist/storage/domains/audit/actors.d.ts +5 -0
- package/dist/storage/domains/audit/actors.d.ts.map +1 -0
- package/dist/storage/domains/audit/actors.js +25 -0
- package/dist/storage/domains/audit/actors.js.map +1 -0
- package/dist/storage/domains/audit/agent-audit.d.ts +30 -0
- package/dist/storage/domains/audit/agent-audit.d.ts.map +1 -0
- package/dist/storage/domains/audit/agent-audit.js +93 -0
- package/dist/storage/domains/audit/agent-audit.js.map +1 -0
- package/dist/storage/domains/audit/base.d.ts +133 -0
- package/dist/storage/domains/audit/base.d.ts.map +1 -0
- package/dist/storage/domains/audit/base.js +206 -0
- package/dist/storage/domains/audit/base.js.map +1 -0
- package/dist/storage/domains/audit/domain.d.ts +79 -0
- package/dist/storage/domains/audit/domain.d.ts.map +1 -0
- package/dist/storage/domains/audit/domain.js +248 -0
- package/dist/storage/domains/audit/domain.js.map +1 -0
- package/dist/storage/domains/audit/wire.d.ts +24 -0
- package/dist/storage/domains/audit/wire.d.ts.map +1 -0
- package/dist/storage/domains/audit/wire.js +16 -0
- package/dist/storage/domains/audit/wire.js.map +1 -0
- package/dist/storage/domains/channel-identity/base.d.ts +100 -0
- package/dist/storage/domains/channel-identity/base.d.ts.map +1 -0
- package/dist/storage/domains/channel-identity/base.js +164 -0
- package/dist/storage/domains/channel-identity/base.js.map +1 -0
- package/dist/storage/domains/comments/activity.d.ts +40 -0
- package/dist/storage/domains/comments/activity.d.ts.map +1 -0
- package/dist/storage/domains/comments/activity.js +94 -0
- package/dist/storage/domains/comments/activity.js.map +1 -0
- package/dist/storage/domains/comments/actor.d.ts +51 -0
- package/dist/storage/domains/comments/actor.d.ts.map +1 -0
- package/dist/storage/domains/comments/actor.js +38 -0
- package/dist/storage/domains/comments/actor.js.map +1 -0
- package/dist/storage/domains/comments/base.d.ts +245 -0
- package/dist/storage/domains/comments/base.d.ts.map +1 -0
- package/dist/storage/domains/comments/base.js +533 -0
- package/dist/storage/domains/comments/base.js.map +1 -0
- package/dist/storage/domains/comments/domain.d.ts +135 -0
- package/dist/storage/domains/comments/domain.d.ts.map +1 -0
- package/dist/storage/domains/comments/domain.js +285 -0
- package/dist/storage/domains/comments/domain.js.map +1 -0
- package/dist/storage/domains/comments/feed-context.d.ts +22 -0
- package/dist/storage/domains/comments/feed-context.d.ts.map +1 -0
- package/dist/storage/domains/comments/feed-context.js +89 -0
- package/dist/storage/domains/comments/feed-context.js.map +1 -0
- package/dist/storage/domains/comments/feed-sync.d.ts +21 -0
- package/dist/storage/domains/comments/feed-sync.d.ts.map +1 -0
- package/dist/storage/domains/comments/feed-sync.js +1 -0
- package/dist/storage/domains/comments/parse.d.ts +23 -0
- package/dist/storage/domains/comments/parse.d.ts.map +1 -0
- package/dist/storage/domains/comments/parse.js +90 -0
- package/dist/storage/domains/comments/parse.js.map +1 -0
- package/dist/storage/domains/comments/routes.d.ts +24 -0
- package/dist/storage/domains/comments/routes.d.ts.map +1 -0
- package/dist/storage/domains/comments/routes.js +302 -0
- package/dist/storage/domains/comments/routes.js.map +1 -0
- package/dist/storage/domains/comments/schema.d.ts +5 -0
- package/dist/storage/domains/comments/schema.d.ts.map +1 -0
- package/dist/storage/domains/comments/schema.js +179 -0
- package/dist/storage/domains/comments/schema.js.map +1 -0
- package/dist/storage/domains/comments/wire.d.ts +40 -0
- package/dist/storage/domains/comments/wire.d.ts.map +1 -0
- package/dist/storage/domains/comments/wire.js +37 -0
- package/dist/storage/domains/comments/wire.js.map +1 -0
- package/dist/storage/domains/credentials/base.d.ts +136 -0
- package/dist/storage/domains/credentials/base.d.ts.map +1 -0
- package/dist/storage/domains/credentials/base.js +294 -0
- package/dist/storage/domains/credentials/base.js.map +1 -0
- package/dist/storage/domains/custom-providers/base.d.ts +59 -0
- package/dist/storage/domains/custom-providers/base.d.ts.map +1 -0
- package/dist/storage/domains/custom-providers/base.js +176 -0
- package/dist/storage/domains/custom-providers/base.js.map +1 -0
- package/dist/storage/domains/filesystem/base.d.ts +26 -0
- package/dist/storage/domains/filesystem/base.d.ts.map +1 -0
- package/dist/storage/domains/filesystem/base.js +74 -0
- package/dist/storage/domains/filesystem/base.js.map +1 -0
- package/dist/storage/domains/intake/base.d.ts +150 -0
- package/dist/storage/domains/intake/base.d.ts.map +1 -0
- package/dist/storage/domains/intake/base.js +431 -0
- package/dist/storage/domains/intake/base.js.map +1 -0
- package/dist/storage/domains/integrations/base.d.ts +128 -0
- package/dist/storage/domains/integrations/base.d.ts.map +1 -0
- package/dist/storage/domains/integrations/base.js +333 -0
- package/dist/storage/domains/integrations/base.js.map +1 -0
- package/dist/storage/domains/memory-settings/base.d.ts +58 -0
- package/dist/storage/domains/memory-settings/base.d.ts.map +1 -0
- package/dist/storage/domains/memory-settings/base.js +129 -0
- package/dist/storage/domains/memory-settings/base.js.map +1 -0
- package/dist/storage/domains/model-defaults/base.d.ts +29 -0
- package/dist/storage/domains/model-defaults/base.d.ts.map +1 -0
- package/dist/storage/domains/model-defaults/base.js +79 -0
- package/dist/storage/domains/model-defaults/base.js.map +1 -0
- package/dist/storage/domains/projects/base.d.ts +191 -0
- package/dist/storage/domains/projects/base.d.ts.map +1 -0
- package/dist/storage/domains/projects/base.js +352 -0
- package/dist/storage/domains/projects/base.js.map +1 -0
- package/dist/storage/domains/queue-health/base.d.ts +52 -0
- package/dist/storage/domains/queue-health/base.d.ts.map +1 -0
- package/dist/storage/domains/queue-health/base.js +122 -0
- package/dist/storage/domains/queue-health/base.js.map +1 -0
- package/dist/storage/domains/source-control/base.d.ts +422 -0
- package/dist/storage/domains/source-control/base.d.ts.map +1 -0
- package/dist/storage/domains/source-control/base.js +1114 -0
- package/dist/storage/domains/source-control/base.js.map +1 -0
- package/dist/storage/domains/source-control/inmemory.d.ts +147 -0
- package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/source-control/inmemory.js +416 -0
- package/dist/storage/domains/source-control/inmemory.js.map +1 -0
- package/dist/storage/domains/work-items/base.d.ts +794 -0
- package/dist/storage/domains/work-items/base.d.ts.map +1 -0
- package/dist/storage/domains/work-items/base.js +2747 -0
- package/dist/storage/domains/work-items/base.js.map +1 -0
- package/dist/storage/domains/work-items/board-version.d.ts +26 -0
- package/dist/storage/domains/work-items/board-version.d.ts.map +1 -0
- package/dist/storage/domains/work-items/board-version.js +110 -0
- package/dist/storage/domains/work-items/board-version.js.map +1 -0
- package/dist/storage/domains/work-items/metrics.d.ts +97 -0
- package/dist/storage/domains/work-items/metrics.d.ts.map +1 -0
- package/dist/storage/domains/work-items/metrics.js +226 -0
- package/dist/storage/domains/work-items/metrics.js.map +1 -0
- package/dist/supervisor/health-worker.d.ts +19 -0
- package/dist/supervisor/health-worker.d.ts.map +1 -0
- package/dist/supervisor/health-worker.js +74 -0
- package/dist/supervisor/health-worker.js.map +1 -0
- package/dist/supervisor/health.d.ts +79 -0
- package/dist/supervisor/health.d.ts.map +1 -0
- package/dist/supervisor/health.js +228 -0
- package/dist/supervisor/health.js.map +1 -0
- package/dist/supervisor/instructions.d.ts +6 -0
- package/dist/supervisor/instructions.d.ts.map +1 -0
- package/dist/supervisor/instructions.js +66 -0
- package/dist/supervisor/instructions.js.map +1 -0
- package/dist/supervisor/read-tools.d.ts +43 -0
- package/dist/supervisor/read-tools.d.ts.map +1 -0
- package/dist/supervisor/read-tools.js +343 -0
- package/dist/supervisor/read-tools.js.map +1 -0
- package/dist/supervisor/session-messaging.d.ts +26 -0
- package/dist/supervisor/session-messaging.d.ts.map +1 -0
- package/dist/supervisor/session-messaging.js +21 -0
- package/dist/supervisor/session-messaging.js.map +1 -0
- package/dist/supervisor/session.d.ts +38 -0
- package/dist/supervisor/session.d.ts.map +1 -0
- package/dist/supervisor/session.js +79 -0
- package/dist/supervisor/session.js.map +1 -0
- package/dist/supervisor/write-tools.d.ts +30 -0
- package/dist/supervisor/write-tools.d.ts.map +1 -0
- package/dist/supervisor/write-tools.js +231 -0
- package/dist/supervisor/write-tools.js.map +1 -0
- package/dist/telemetry-types.d.ts +7 -0
- package/dist/telemetry-types.d.ts.map +1 -0
- package/dist/telemetry-types.js +24 -0
- package/dist/telemetry-types.js.map +1 -0
- package/dist/telemetry.d.ts +9 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +47 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/timing.d.ts +15 -0
- package/dist/timing.d.ts.map +1 -0
- package/dist/timing.js +34 -0
- package/dist/timing.js.map +1 -0
- package/dist/work-item-branch.d.ts +33 -0
- package/dist/work-item-branch.d.ts.map +1 -0
- package/dist/work-item-branch.js +70 -0
- package/dist/work-item-branch.js.map +1 -0
- package/dist/workspace.d.ts +131 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +995 -0
- package/dist/workspace.js.map +1 -0
- package/factory-skills/configure-factory-rules/SKILL.md +122 -0
- package/factory-skills/factory-complete-issue/SKILL.md +24 -0
- package/factory-skills/factory-gitlab-rereview/SKILL.md +22 -0
- package/factory-skills/factory-gitlab-review/SKILL.md +48 -0
- package/factory-skills/factory-plan/SKILL.md +72 -0
- package/factory-skills/factory-rereview/SKILL.md +225 -0
- package/factory-skills/factory-review/SKILL.md +214 -0
- package/factory-skills/factory-review/references/archaeology.md +225 -0
- package/factory-skills/factory-review/references/categories/README.md +34 -0
- package/factory-skills/factory-review/references/categories/behavior-change.md +36 -0
- package/factory-skills/factory-review/references/categories/bug-fix.md +37 -0
- package/factory-skills/factory-review/references/categories/docs.md +32 -0
- package/factory-skills/factory-review/references/categories/experimental-flagged.md +34 -0
- package/factory-skills/factory-review/references/categories/infra-tooling.md +37 -0
- package/factory-skills/factory-review/references/categories/internal-capability.md +35 -0
- package/factory-skills/factory-review/references/categories/large-cross-cutting.md +35 -0
- package/factory-skills/factory-review/references/categories/mechanical.md +36 -0
- package/factory-skills/factory-review/references/categories/performance.md +33 -0
- package/factory-skills/factory-review/references/categories/public-api.md +38 -0
- package/factory-skills/factory-review/references/categories/refactor.md +35 -0
- package/factory-skills/factory-review/references/categories/revert.md +31 -0
- package/factory-skills/factory-review/references/categories/schema-storage.md +39 -0
- package/factory-skills/factory-review/references/categories/security.md +35 -0
- package/factory-skills/factory-review/references/categories/tests-only.md +38 -0
- package/factory-skills/factory-triage/SKILL.md +197 -0
- package/package.json +92 -0
package/dist/auth.js
ADDED
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
import { CUSTOM_DOMAIN_UNSUPPORTED_ERROR, isPlatformAuthSupportedHost } from "./platform-auth-host.js";
|
|
2
|
+
import { actorFromAuthUser } from "./storage/domains/comments/actor.js";
|
|
3
|
+
import { isFactoryTelemetryEnabled } from "./telemetry.js";
|
|
4
|
+
import { timedAboveThreshold } from "./timing.js";
|
|
5
|
+
import { MastraAuthWorkos } from "@mastra/auth-workos";
|
|
6
|
+
import { MASTRA_MESSAGE_AUTHOR_KEY } from "@mastra/core/request-context";
|
|
7
|
+
import { isAuthHttpHandler, isCredentialsProvider, isOrganizationsProvider, isSSOProvider, isSessionProvider, registerApiRoute } from "@mastra/core/server";
|
|
8
|
+
import { HTTPException } from "hono/http-exception";
|
|
9
|
+
//#region src/auth.ts
|
|
10
|
+
const ORGANIZATION_ID_HEADER = "X-Mastra-Organization-Id";
|
|
11
|
+
/**
|
|
12
|
+
* Validate that a `returnTo` value is a safe same-site path, to prevent
|
|
13
|
+
* open-redirect attacks. Only absolute local paths (`/foo`) are allowed;
|
|
14
|
+
* protocol-relative (`//evil.com`) and absolute URLs are rejected.
|
|
15
|
+
*/
|
|
16
|
+
function sanitizeReturnTo(raw) {
|
|
17
|
+
if (!raw) return "/";
|
|
18
|
+
if (!raw.startsWith("/")) return "/";
|
|
19
|
+
if (raw.startsWith("//") || raw.startsWith("/\\")) return "/";
|
|
20
|
+
return raw;
|
|
21
|
+
}
|
|
22
|
+
/** Extract a bearer token from the Authorization header, if present. */
|
|
23
|
+
function getBearerToken(authorization) {
|
|
24
|
+
if (!authorization) return "";
|
|
25
|
+
return /^Bearer\s+(.+)$/i.exec(authorization)?.[1] ?? "";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Whether the SPA is served cross-origin from this API (platform deploy). When
|
|
29
|
+
* `MASTRACODE_ALLOWED_ORIGINS` is set the browser talks to us cross-site, so
|
|
30
|
+
* session cookies must be `SameSite=None; Secure` for the browser to send them.
|
|
31
|
+
* Same-origin local dev leaves this unset and keeps the stricter `SameSite=Lax`.
|
|
32
|
+
*/
|
|
33
|
+
function isCrossSiteAuth() {
|
|
34
|
+
return Boolean(process.env.MASTRACODE_ALLOWED_ORIGINS?.trim());
|
|
35
|
+
}
|
|
36
|
+
/** Context key under which the gate stashes the authenticated user. */
|
|
37
|
+
const FACTORY_AUTH_USER_KEY = "factoryAuthUser";
|
|
38
|
+
/**
|
|
39
|
+
* Read the authenticated user the gate stashed on the context, or
|
|
40
|
+
* `undefined` when unauthenticated / auth disabled. Used by downstream routes
|
|
41
|
+
* (e.g. GitHub) to scope rows per user.
|
|
42
|
+
*/
|
|
43
|
+
function getFactoryAuthUser(c) {
|
|
44
|
+
return c.get(FACTORY_AUTH_USER_KEY);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read the authenticated user off a request context, normalizing whatever the
|
|
48
|
+
* active auth provider put there.
|
|
49
|
+
*
|
|
50
|
+
* The server's auth layer writes the provider's `authenticateToken` result into
|
|
51
|
+
* the request context's `user` slot verbatim, so the value's shape follows the
|
|
52
|
+
* provider: WorkOS writes a flat user, better-auth writes a `{ session, user }`
|
|
53
|
+
* wrapper whose org lives on the session. Reading that slot as a
|
|
54
|
+
* {@link FactoryAuthUser} therefore yields `undefined` for both the id and the
|
|
55
|
+
* org under better-auth, which reads as "this session belongs to somebody else"
|
|
56
|
+
* at every ownership check. Normalize on the way in instead.
|
|
57
|
+
*/
|
|
58
|
+
function getFactoryAuthUserFromContext(requestContext) {
|
|
59
|
+
if (!requestContext || typeof requestContext.get !== "function") return void 0;
|
|
60
|
+
return toFactoryAuthUser(requestContext.get("user")) ?? void 0;
|
|
61
|
+
}
|
|
62
|
+
/** Resolve the stable user id from an authenticated user shape. */
|
|
63
|
+
function getFactoryAuthUserId(user) {
|
|
64
|
+
return user?.workosId ?? user?.id;
|
|
65
|
+
}
|
|
66
|
+
/** Resolve the organization id from a user shape, if present. */
|
|
67
|
+
function getFactoryAuthOrgId(user) {
|
|
68
|
+
return user?.organizationId;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The org rung a user's rows are keyed by: the organization they belong to, or a
|
|
72
|
+
* per-user rung for personal (no-org) accounts so their rows never land in the
|
|
73
|
+
* shared `local` scope. Every writer and reader of a `(org, user)` row must
|
|
74
|
+
* agree on this, so it lives here rather than being re-derived per call site.
|
|
75
|
+
*/
|
|
76
|
+
function factoryUserOrgId(user) {
|
|
77
|
+
const userId = getFactoryAuthUserId(user);
|
|
78
|
+
if (!userId) return void 0;
|
|
79
|
+
return getFactoryAuthOrgId(user) ?? `user:${userId}`;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Resolve the tenant identity `(orgId, userId)` from the authenticated user on
|
|
83
|
+
* the context. Returns `undefined` when there is no signed-in user (auth
|
|
84
|
+
* disabled or unauthenticated). `orgId` is `undefined` for personal accounts;
|
|
85
|
+
* callers gate org-scoped GitHub features on its presence while agent state
|
|
86
|
+
* falls back to a user-only tenant.
|
|
87
|
+
*/
|
|
88
|
+
function factoryAuthTenant(c) {
|
|
89
|
+
const user = getFactoryAuthUser(c);
|
|
90
|
+
const userId = getFactoryAuthUserId(user);
|
|
91
|
+
if (!userId) return void 0;
|
|
92
|
+
return {
|
|
93
|
+
orgId: getFactoryAuthOrgId(user),
|
|
94
|
+
userId
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function messageAuthor(user) {
|
|
98
|
+
const userId = getFactoryAuthUserId(user);
|
|
99
|
+
if (!userId) return void 0;
|
|
100
|
+
const actor = actorFromAuthUser(userId, user);
|
|
101
|
+
return {
|
|
102
|
+
id: actor.id,
|
|
103
|
+
...actor.displayName ? { name: actor.displayName } : {},
|
|
104
|
+
...actor.avatarUrl ? { avatarUrl: actor.avatarUrl } : {}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** True when both WorkOS credential env vars are present (legacy env gate). */
|
|
108
|
+
function envWorkosConfigured() {
|
|
109
|
+
return Boolean(process.env.WORKOS_API_KEY && process.env.WORKOS_CLIENT_ID);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* WorkOS provider implied by the `WORKOS_*` env vars — back-compat for test
|
|
113
|
+
* suites exercised without booting the factory (route suites set `WORKOS_*`
|
|
114
|
+
* directly and call {@link mountFactoryAuth} without an explicit provider).
|
|
115
|
+
* `fetchMemberships: true` lets `authenticateToken` resolve `organizationId`
|
|
116
|
+
* from a single membership when the JWT has no org claim — required so a
|
|
117
|
+
* bootstrapped personal org resolves without re-auth.
|
|
118
|
+
*/
|
|
119
|
+
function envFallbackAuthProvider(redirectUri) {
|
|
120
|
+
if (!envWorkosConfigured()) return void 0;
|
|
121
|
+
return new MastraAuthWorkos({
|
|
122
|
+
redirectUri: redirectUri ?? process.env.WORKOS_REDIRECT_URI,
|
|
123
|
+
fetchMemberships: true
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Map a provider `authenticateToken` result onto the neutral SPA user shape.
|
|
128
|
+
*
|
|
129
|
+
* Two result families exist today:
|
|
130
|
+
* - flat provider users (WorkOS `WorkOSUser` et al.): `id`/`workosId`/`email`/
|
|
131
|
+
* `name`/`organizationId` directly on the object;
|
|
132
|
+
* - session-shaped results (better-auth `BetterAuthUser`): `{ session, user }`
|
|
133
|
+
* with the active org on the session.
|
|
134
|
+
*/
|
|
135
|
+
function toFactoryAuthUser(result) {
|
|
136
|
+
if (!result || typeof result !== "object") return null;
|
|
137
|
+
const record = result;
|
|
138
|
+
if (record.user && typeof record.user === "object" && record.session && typeof record.session === "object") {
|
|
139
|
+
const user = record.user;
|
|
140
|
+
const session = record.session;
|
|
141
|
+
if (typeof user.id !== "string") return null;
|
|
142
|
+
return {
|
|
143
|
+
id: user.id,
|
|
144
|
+
email: typeof user.email === "string" ? user.email : void 0,
|
|
145
|
+
name: typeof user.name === "string" ? user.name : void 0,
|
|
146
|
+
avatarUrl: typeof user.avatarUrl === "string" ? user.avatarUrl : void 0,
|
|
147
|
+
organizationId: typeof session.activeOrganizationId === "string" ? session.activeOrganizationId : void 0
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const flat = record;
|
|
151
|
+
const id = typeof flat.id === "string" ? flat.id : void 0;
|
|
152
|
+
const workosId = typeof flat.workosId === "string" ? flat.workosId : void 0;
|
|
153
|
+
if (!id && !workosId) return null;
|
|
154
|
+
const membershipOrganizationIds = Array.isArray(flat.memberships) ? flat.memberships.flatMap((membership) => {
|
|
155
|
+
if (!membership || typeof membership !== "object") return [];
|
|
156
|
+
const organizationId = membership.organizationId;
|
|
157
|
+
return typeof organizationId === "string" ? [organizationId] : [];
|
|
158
|
+
}) : [];
|
|
159
|
+
const memberOrgIds = Array.isArray(flat.memberOrgIds) ? flat.memberOrgIds.filter((organizationId) => typeof organizationId === "string") : [];
|
|
160
|
+
const organizationMembershipIds = [.../* @__PURE__ */ new Set([...membershipOrganizationIds, ...memberOrgIds])];
|
|
161
|
+
return {
|
|
162
|
+
id,
|
|
163
|
+
workosId,
|
|
164
|
+
email: typeof flat.email === "string" ? flat.email : void 0,
|
|
165
|
+
name: typeof flat.name === "string" ? flat.name : void 0,
|
|
166
|
+
avatarUrl: typeof flat.avatarUrl === "string" ? flat.avatarUrl : void 0,
|
|
167
|
+
organizationId: typeof flat.organizationId === "string" ? flat.organizationId : void 0,
|
|
168
|
+
organizationMembershipIds
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Resolve the authenticated user for a request via the provider. Never throws:
|
|
173
|
+
* ordinary invalid/expired sessions resolve to `null`.
|
|
174
|
+
*/
|
|
175
|
+
async function authenticateRequest(provider, token, raw) {
|
|
176
|
+
try {
|
|
177
|
+
return toFactoryAuthUser(await provider.authenticateToken(token, raw));
|
|
178
|
+
} catch {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Bootstrap a personal org for no-org accounts so org-scoped features (GitHub
|
|
184
|
+
* connect) work without leaving the app. Mutates the resolved user so the
|
|
185
|
+
* current request sees the org immediately; subsequent requests resolve it via
|
|
186
|
+
* the provider's own session/membership lookup (providers cache internally).
|
|
187
|
+
* Best-effort: providers swallow their own bootstrap failures, and any
|
|
188
|
+
* unexpected throw leaves the user no-org.
|
|
189
|
+
*/
|
|
190
|
+
async function ensureUserOrg(provider, user) {
|
|
191
|
+
if (getFactoryAuthOrgId(user)) return;
|
|
192
|
+
if (!isOrganizationsProvider(provider)) return;
|
|
193
|
+
const userId = getFactoryAuthUserId(user);
|
|
194
|
+
if (!userId) return;
|
|
195
|
+
try {
|
|
196
|
+
const orgId = await provider.ensureOrganization(userId);
|
|
197
|
+
if (orgId) user.organizationId = orgId;
|
|
198
|
+
} catch {}
|
|
199
|
+
}
|
|
200
|
+
function selectRequestedOrganization(user, requestedOrganizationId) {
|
|
201
|
+
if (user.organizationId === requestedOrganizationId) return true;
|
|
202
|
+
if (!user.organizationMembershipIds?.includes(requestedOrganizationId)) return false;
|
|
203
|
+
user.organizationId = requestedOrganizationId;
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* `Set-Cookie` values that clear the provider's session cookie(s), from the
|
|
208
|
+
* provider's (possibly partial) `ISessionProvider.getClearSessionHeaders`.
|
|
209
|
+
*/
|
|
210
|
+
function providerClearCookies(provider) {
|
|
211
|
+
const getClearSessionHeaders = provider.getClearSessionHeaders;
|
|
212
|
+
if (typeof getClearSessionHeaders !== "function") return [];
|
|
213
|
+
const setCookie = (getClearSessionHeaders.call(provider) ?? {})["Set-Cookie"];
|
|
214
|
+
if (!setCookie) return [];
|
|
215
|
+
return setCookie.split(/,(?=\s*[^;=,\s]+=)/).map((cookie) => cookie.trim());
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Fail-closed authorization for organization-level administrative mutations.
|
|
219
|
+
* The caller must belong to the same active organization and the provider must
|
|
220
|
+
* explicitly confirm an admin/owner role.
|
|
221
|
+
*/
|
|
222
|
+
async function isOrganizationAdmin(provider, c, organizationId) {
|
|
223
|
+
const user = await ensureFactoryAuthUser(provider, c);
|
|
224
|
+
if (!user || user.organizationId !== organizationId || !provider || !isOrganizationsProvider(provider)) return false;
|
|
225
|
+
const userId = getFactoryAuthUserId(user);
|
|
226
|
+
if (!userId) return false;
|
|
227
|
+
try {
|
|
228
|
+
return await provider.isOrganizationAdmin(organizationId, userId);
|
|
229
|
+
} catch {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Build the factory's implementation of the `RouteAuth` seam over the
|
|
235
|
+
* resolved provider (`undefined` = auth disabled). Constructed once per boot
|
|
236
|
+
* by `MastraFactory.prepare()` and handed to factory route modules at
|
|
237
|
+
* construction — they never import the factory auth module directly.
|
|
238
|
+
*/
|
|
239
|
+
function createFactoryRouteAuth(provider) {
|
|
240
|
+
return {
|
|
241
|
+
enabled: () => provider !== void 0,
|
|
242
|
+
ensureUser: (c) => ensureFactoryAuthUser(provider, c),
|
|
243
|
+
tenant: (c) => factoryAuthTenant(c),
|
|
244
|
+
isOrganizationAdmin: (c, organizationId) => isOrganizationAdmin(provider, c, organizationId)
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/** True when the given provider is WorkOS. Gates WorkOS-only capabilities. */
|
|
248
|
+
function isWorkOSAuth(provider) {
|
|
249
|
+
return provider instanceof MastraAuthWorkos;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* The raw WorkOS provider, for features that need the WorkOS client directly
|
|
253
|
+
* (audit-log export, Admin Portal links). Callers must gate on
|
|
254
|
+
* {@link isWorkOSAuth} first — throws when the provider is not WorkOS.
|
|
255
|
+
*/
|
|
256
|
+
function getWorkOSProvider(provider) {
|
|
257
|
+
if (provider instanceof MastraAuthWorkos) return provider;
|
|
258
|
+
throw new Error("WorkOS provider requested but the active factory auth provider is not WorkOS");
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Resolve the authenticated user for a request, stashing it on the context.
|
|
262
|
+
*
|
|
263
|
+
* The gate only authenticates non-`/auth/*` requests via the `Authorization`
|
|
264
|
+
* header, so cookie-based browser navigations to public `/auth/*` routes (the
|
|
265
|
+
* GitHub connect/callback flow) arrive without a gate-stashed user. This reads
|
|
266
|
+
* the session cookie from the raw request the same way `/auth/me` does,
|
|
267
|
+
* caches the result on the context, and returns it so downstream helpers like
|
|
268
|
+
* {@link factoryAuthTenant} work uniformly on both gated and public routes.
|
|
269
|
+
*
|
|
270
|
+
* Returns `undefined` when there is no valid session (or auth is disabled).
|
|
271
|
+
*/
|
|
272
|
+
function forwardPendingResponseHeaders(provider, c) {
|
|
273
|
+
try {
|
|
274
|
+
const pending = provider.consumePendingResponseHeaders?.(c.req.raw);
|
|
275
|
+
for (const [name, value] of Object.entries(pending ?? {})) c.header(name, value, { append: true });
|
|
276
|
+
} catch {}
|
|
277
|
+
}
|
|
278
|
+
async function ensureFactoryAuthUser(provider, c) {
|
|
279
|
+
const existing = getFactoryAuthUser(c);
|
|
280
|
+
if (existing) return existing;
|
|
281
|
+
if (!provider) return void 0;
|
|
282
|
+
const token = getBearerToken(c.req.header("Authorization"));
|
|
283
|
+
const user = await authenticateRequest(provider, token, c.req.raw);
|
|
284
|
+
forwardPendingResponseHeaders(provider, c);
|
|
285
|
+
if (!user) return void 0;
|
|
286
|
+
const requestedOrganizationId = token ? c.req.header(ORGANIZATION_ID_HEADER)?.trim() : void 0;
|
|
287
|
+
if (requestedOrganizationId) {
|
|
288
|
+
if (!selectRequestedOrganization(user, requestedOrganizationId)) throw new HTTPException(403, { message: "organization_forbidden" });
|
|
289
|
+
} else await ensureUserOrg(provider, user);
|
|
290
|
+
c.set(FACTORY_AUTH_USER_KEY, user);
|
|
291
|
+
return user;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Decide whether a request is a top-level browser navigation (which should be
|
|
295
|
+
* redirected to `/signin`) versus an API/XHR call (which should get a 401 JSON
|
|
296
|
+
* response the SPA can react to).
|
|
297
|
+
*/
|
|
298
|
+
function isNavigationRequest(path, accept) {
|
|
299
|
+
if (path.startsWith("/api/")) return false;
|
|
300
|
+
return (accept ?? "").includes("text/html");
|
|
301
|
+
}
|
|
302
|
+
function isPlatformAuthCustomDomain(provider, publicUrl) {
|
|
303
|
+
return provider.name === "mastra-studio" && Boolean(publicUrl && !isPlatformAuthSupportedHost(new URL(publicUrl).hostname));
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Handle the provider-neutral `/auth/me` route: validate the session with the
|
|
307
|
+
* active provider and report the signed-in user (no tokens) to the SPA.
|
|
308
|
+
* `/auth/me` is public (the gate skips `/auth/*`), so it validates the session
|
|
309
|
+
* itself rather than reading a value the gate would have stashed.
|
|
310
|
+
*/
|
|
311
|
+
async function handleAuthMe(provider, c, publicUrl) {
|
|
312
|
+
const user = await authenticateRequest(provider, getBearerToken(c.req.header("Authorization")), c.req.raw);
|
|
313
|
+
const signUpDisabled = isCredentialsProvider(provider) && provider.isSignUpEnabled?.() === false;
|
|
314
|
+
const customDomainUnsupported = isPlatformAuthCustomDomain(provider, publicUrl);
|
|
315
|
+
const meta = {
|
|
316
|
+
provider: provider.name,
|
|
317
|
+
...signUpDisabled ? { signUpDisabled: true } : {},
|
|
318
|
+
...customDomainUnsupported ? { customDomainUnsupported: true } : {}
|
|
319
|
+
};
|
|
320
|
+
if (!user) return c.json({
|
|
321
|
+
authenticated: false,
|
|
322
|
+
user: null,
|
|
323
|
+
...meta
|
|
324
|
+
});
|
|
325
|
+
await ensureUserOrg(provider, user);
|
|
326
|
+
return c.json({
|
|
327
|
+
authenticated: true,
|
|
328
|
+
telemetryEnabled: isFactoryTelemetryEnabled(provider.name),
|
|
329
|
+
user: {
|
|
330
|
+
userId: getFactoryAuthUserId(user),
|
|
331
|
+
email: user.email,
|
|
332
|
+
name: user.name,
|
|
333
|
+
avatarUrl: user.avatarUrl,
|
|
334
|
+
organizationId: user.organizationId
|
|
335
|
+
},
|
|
336
|
+
...meta
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Encode a validated returnTo path into the OAuth `state` parameter.
|
|
341
|
+
*
|
|
342
|
+
* Pipe format (`uuid|encodedPath`) is the contract `MastraAuthStudio` parses
|
|
343
|
+
* to forward the path as the platform's `post_login_redirect`; a JSON blob
|
|
344
|
+
* here silently degrades every post-login redirect to `/`.
|
|
345
|
+
*/
|
|
346
|
+
function encodeState(returnTo) {
|
|
347
|
+
return `${crypto.randomUUID()}|${encodeURIComponent(returnTo)}`;
|
|
348
|
+
}
|
|
349
|
+
/** Decode the OAuth `state` parameter back into a sanitized returnTo path. */
|
|
350
|
+
function decodeState(state) {
|
|
351
|
+
if (!state) return "/";
|
|
352
|
+
const pipeIndex = state.indexOf("|");
|
|
353
|
+
if (pipeIndex !== -1) try {
|
|
354
|
+
return sanitizeReturnTo(decodeURIComponent(state.slice(pipeIndex + 1)));
|
|
355
|
+
} catch {
|
|
356
|
+
return "/";
|
|
357
|
+
}
|
|
358
|
+
return "/";
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Short-lived cookie stashing the post-login destination across the hosted
|
|
362
|
+
* OAuth round-trip. Providers/platforms differ in whether they echo `state`
|
|
363
|
+
* back to the callback, so the cookie is the reliable channel; `state` (when
|
|
364
|
+
* echoed) takes precedence only if the cookie is missing.
|
|
365
|
+
*/
|
|
366
|
+
const RETURN_TO_COOKIE = "mastra_factory_return_to";
|
|
367
|
+
function returnToCookieHeader(returnTo) {
|
|
368
|
+
const crossSite = isCrossSiteAuth() ? "; SameSite=None; Secure" : "; SameSite=Lax";
|
|
369
|
+
return `${RETURN_TO_COOKIE}=${encodeURIComponent(returnTo)}; Path=/; Max-Age=600; HttpOnly${crossSite}`;
|
|
370
|
+
}
|
|
371
|
+
function clearReturnToCookieHeader() {
|
|
372
|
+
const crossSite = isCrossSiteAuth() ? "; SameSite=None; Secure" : "; SameSite=Lax";
|
|
373
|
+
return `${RETURN_TO_COOKIE}=; Path=/; Max-Age=0; HttpOnly${crossSite}`;
|
|
374
|
+
}
|
|
375
|
+
function readReturnToCookie(c) {
|
|
376
|
+
const header = c.req.header("Cookie");
|
|
377
|
+
if (!header) return void 0;
|
|
378
|
+
for (const part of header.split(";")) {
|
|
379
|
+
const [name, ...rest] = part.trim().split("=");
|
|
380
|
+
if (name === RETURN_TO_COOKIE) try {
|
|
381
|
+
return decodeURIComponent(rest.join("="));
|
|
382
|
+
} catch {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Derive the public `/auth/*` routes from the provider's capabilities:
|
|
389
|
+
*
|
|
390
|
+
* - `IAuthHttpHandler` → `ALL /auth/api/*` proxy to the provider's own HTTP
|
|
391
|
+
* surface (better-auth sign-in/up/out/session — what the SPA's
|
|
392
|
+
* email/password form posts to).
|
|
393
|
+
* - `ISSOProvider` → hosted-login `GET /auth/login` / `GET /auth/callback` /
|
|
394
|
+
* `GET /auth/logout` (returnTo preserved through the OAuth `state` param).
|
|
395
|
+
* - handler-shaped, non-SSO providers → `GET /auth/login` redirects to the
|
|
396
|
+
* SPA's `/signin` form, `GET /auth/logout` revokes via the provider's
|
|
397
|
+
* sign-out endpoint and clears the session cookie.
|
|
398
|
+
*/
|
|
399
|
+
function providerAuthRoutes(provider, publicUrl) {
|
|
400
|
+
const routes = [];
|
|
401
|
+
if (isAuthHttpHandler(provider)) routes.push({
|
|
402
|
+
path: "/auth/api/*",
|
|
403
|
+
method: "ALL",
|
|
404
|
+
handler: (c) => provider.handleAuthRequest(c.req.raw)
|
|
405
|
+
});
|
|
406
|
+
if (isSSOProvider(provider)) routes.push({
|
|
407
|
+
path: "/auth/login",
|
|
408
|
+
method: "GET",
|
|
409
|
+
handler: async (c) => {
|
|
410
|
+
const returnTo = sanitizeReturnTo(c.req.query("returnTo"));
|
|
411
|
+
if (isPlatformAuthCustomDomain(provider, publicUrl)) {
|
|
412
|
+
const query = new URLSearchParams({ error: CUSTOM_DOMAIN_UNSUPPORTED_ERROR });
|
|
413
|
+
if (returnTo !== "/") query.set("returnTo", returnTo);
|
|
414
|
+
return c.redirect(`/signin?${query.toString()}`);
|
|
415
|
+
}
|
|
416
|
+
const state = encodeState(returnTo);
|
|
417
|
+
const redirectUri = publicUrl ? new URL("/auth/callback", publicUrl).toString() : "";
|
|
418
|
+
const loginUrl = await provider.getLoginUrl(redirectUri, state);
|
|
419
|
+
for (const cookie of await provider.getLoginCookies?.(redirectUri, state) ?? []) c.header("Set-Cookie", cookie, { append: true });
|
|
420
|
+
if (returnTo !== "/") c.header("Set-Cookie", returnToCookieHeader(returnTo), { append: true });
|
|
421
|
+
return c.redirect(loginUrl);
|
|
422
|
+
}
|
|
423
|
+
}, {
|
|
424
|
+
path: "/auth/callback",
|
|
425
|
+
method: "GET",
|
|
426
|
+
handler: async (c) => {
|
|
427
|
+
const code = c.req.query("code");
|
|
428
|
+
const stateReturnTo = decodeState(c.req.query("state"));
|
|
429
|
+
const cookieReturnTo = sanitizeReturnTo(readReturnToCookie(c));
|
|
430
|
+
const returnTo = cookieReturnTo !== "/" ? cookieReturnTo : stateReturnTo;
|
|
431
|
+
c.header("Set-Cookie", clearReturnToCookieHeader(), { append: true });
|
|
432
|
+
const idpError = c.req.query("error");
|
|
433
|
+
if (idpError) {
|
|
434
|
+
const query = new URLSearchParams({ error: idpError.slice(0, 64) });
|
|
435
|
+
const description = c.req.query("error_description");
|
|
436
|
+
if (description) query.set("error_description", description.slice(0, 256));
|
|
437
|
+
if (returnTo !== "/") query.set("returnTo", returnTo);
|
|
438
|
+
return c.redirect(`/signin?${query.toString()}`);
|
|
439
|
+
}
|
|
440
|
+
if (!code) return c.redirect("/auth/login");
|
|
441
|
+
try {
|
|
442
|
+
const result = await provider.handleCallback(code, c.req.query("state") ?? "");
|
|
443
|
+
if (result.cookies?.length) for (const cookie of result.cookies) c.header("Set-Cookie", cookie, { append: true });
|
|
444
|
+
else if (isSessionProvider(provider) && result.tokens) {
|
|
445
|
+
const resultUser = result.user;
|
|
446
|
+
const session = await provider.createSession(resultUser.id, {
|
|
447
|
+
accessToken: result.tokens.accessToken,
|
|
448
|
+
refreshToken: result.tokens.refreshToken,
|
|
449
|
+
expiresAt: result.tokens.expiresAt,
|
|
450
|
+
organizationId: resultUser.organizationId
|
|
451
|
+
});
|
|
452
|
+
for (const [key, value] of Object.entries(provider.getSessionHeaders(session))) c.header(key, value, { append: true });
|
|
453
|
+
}
|
|
454
|
+
return c.redirect(returnTo);
|
|
455
|
+
} catch {
|
|
456
|
+
return c.redirect("/auth/login");
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}, {
|
|
460
|
+
path: "/auth/logout",
|
|
461
|
+
method: "GET",
|
|
462
|
+
handler: async (c) => {
|
|
463
|
+
let logoutUrl = null;
|
|
464
|
+
try {
|
|
465
|
+
logoutUrl = await provider.getLogoutUrl?.("/", c.req.raw) ?? null;
|
|
466
|
+
} catch {
|
|
467
|
+
logoutUrl = null;
|
|
468
|
+
}
|
|
469
|
+
for (const cookie of providerClearCookies(provider)) c.header("Set-Cookie", cookie, { append: true });
|
|
470
|
+
return c.redirect(logoutUrl ?? "/");
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
else if (isAuthHttpHandler(provider)) routes.push({
|
|
474
|
+
path: "/auth/login",
|
|
475
|
+
method: "GET",
|
|
476
|
+
handler: (c) => {
|
|
477
|
+
const returnTo = sanitizeReturnTo(c.req.query("returnTo"));
|
|
478
|
+
return c.redirect(`/signin?returnTo=${encodeURIComponent(returnTo)}`);
|
|
479
|
+
}
|
|
480
|
+
}, {
|
|
481
|
+
path: "/auth/logout",
|
|
482
|
+
method: "GET",
|
|
483
|
+
handler: async (c) => {
|
|
484
|
+
try {
|
|
485
|
+
const origin = new URL(c.req.url).origin;
|
|
486
|
+
const response = await provider.handleAuthRequest(new Request(`${origin}/auth/api/sign-out`, {
|
|
487
|
+
method: "POST",
|
|
488
|
+
headers: c.req.raw.headers
|
|
489
|
+
}));
|
|
490
|
+
for (const cookie of response.headers.getSetCookie()) c.header("Set-Cookie", cookie, { append: true });
|
|
491
|
+
} catch {}
|
|
492
|
+
for (const cookie of providerClearCookies(provider)) c.header("Set-Cookie", cookie, { append: true });
|
|
493
|
+
return c.redirect("/");
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
return routes;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Register the public `/auth/*` routes on a Hono app: the capability-derived
|
|
500
|
+
* provider routes (login/callback/logout/provider APIs) plus the
|
|
501
|
+
* provider-neutral `/auth/me`. Split out from `mountFactoryAuth` so both the local
|
|
502
|
+
* Hono server and the platform Mastra entry can reuse the exact same handlers.
|
|
503
|
+
*/
|
|
504
|
+
function registerAuthRoutes(app, provider, options = {}) {
|
|
505
|
+
for (const route of providerAuthRoutes(provider, options.publicUrl)) {
|
|
506
|
+
const methods = route.method === "ALL" ? [
|
|
507
|
+
"GET",
|
|
508
|
+
"POST",
|
|
509
|
+
"PUT",
|
|
510
|
+
"DELETE",
|
|
511
|
+
"PATCH"
|
|
512
|
+
] : [route.method];
|
|
513
|
+
app.on(methods, route.path, (c) => route.handler(c));
|
|
514
|
+
}
|
|
515
|
+
app.get("/auth/me", (c) => handleAuthMe(provider, c, options.publicUrl));
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Build the public `/auth/*` routes (provider routes + `/auth/me`) as Mastra
|
|
519
|
+
* `server.apiRoutes`. Used by the platform Mastra entry (`src/mastra/index.ts`),
|
|
520
|
+
* which can't register plain Hono routes on the deployer-generated app the way
|
|
521
|
+
* the local server does via {@link registerAuthRoutes}.
|
|
522
|
+
*
|
|
523
|
+
* Handlers are identical to {@link registerAuthRoutes}. All are `requiresAuth: false`
|
|
524
|
+
* (they must be reachable while unauthenticated), and the gate middleware skips
|
|
525
|
+
* `/auth/*` so it never blocks them. `/auth/*` is not under `/api`, so it is a
|
|
526
|
+
* valid custom-route path.
|
|
527
|
+
*/
|
|
528
|
+
function buildAuthRoutes(provider, options = {}) {
|
|
529
|
+
return [...providerAuthRoutes(provider, options.publicUrl).map((route) => registerApiRoute(route.path, {
|
|
530
|
+
method: route.method,
|
|
531
|
+
requiresAuth: false,
|
|
532
|
+
handler: (c) => route.handler(c)
|
|
533
|
+
})), registerApiRoute("/auth/me", {
|
|
534
|
+
method: "GET",
|
|
535
|
+
requiresAuth: false,
|
|
536
|
+
handler: (c) => handleAuthMe(provider, c, options.publicUrl)
|
|
537
|
+
})];
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* `/auth/*` routes for auth-disabled mode (`auth: null`). Only `/auth/me`, answering
|
|
541
|
+
* 404 — the UI's "auth disabled" signal. Without it the deployer's HTML catch-all
|
|
542
|
+
* answers `/auth/me` with 200 text/html and the UI retries forever.
|
|
543
|
+
*/
|
|
544
|
+
function buildAuthDisabledRoutes() {
|
|
545
|
+
return [registerApiRoute("/auth/me", {
|
|
546
|
+
method: "GET",
|
|
547
|
+
requiresAuth: false,
|
|
548
|
+
handler: (c) => c.json({
|
|
549
|
+
authEnabled: false,
|
|
550
|
+
authenticated: false
|
|
551
|
+
}, 404)
|
|
552
|
+
})];
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Channel webhook paths whose adapter verifies the platform's request signature,
|
|
556
|
+
* making the delivery self-authenticating. Add a platform here only once its
|
|
557
|
+
* adapter rejects unsigned or mis-signed requests.
|
|
558
|
+
*/
|
|
559
|
+
const SIGNATURE_VERIFYING_CHANNEL_WEBHOOK = /^\/api\/agent-controllers\/[^/]+\/channels\/slack\/webhook$/;
|
|
560
|
+
const SESSION_FAVICON_PATHS = /* @__PURE__ */ new Set([
|
|
561
|
+
"/favicon-session-initializing.svg",
|
|
562
|
+
"/favicon-session-working.svg",
|
|
563
|
+
"/favicon-session-awaiting.svg",
|
|
564
|
+
"/favicon-session-error.svg"
|
|
565
|
+
]);
|
|
566
|
+
/**
|
|
567
|
+
* Build the auth gate as a plain Hono middleware handler `(c, next)`. Protects
|
|
568
|
+
* everything that is not a public `/auth/*` route: authenticated requests stash
|
|
569
|
+
* the user on the context and continue; unauthenticated navigations redirect to
|
|
570
|
+
* login and XHR/API calls get a 401 JSON. Shared by the local Hono server
|
|
571
|
+
* (`mountFactoryAuth`) and the platform Mastra entry (`server.middleware`).
|
|
572
|
+
*/
|
|
573
|
+
function createFactoryAuthGate(provider) {
|
|
574
|
+
return async (c, next) => {
|
|
575
|
+
const path = c.req.path;
|
|
576
|
+
if (path.startsWith("/auth/")) return next();
|
|
577
|
+
if (c.req.method === "POST" && (path === "/web/github/webhook" || path === "/web/gitlab/webhook")) return next();
|
|
578
|
+
if (c.req.method === "POST" && SIGNATURE_VERIFYING_CHANNEL_WEBHOOK.test(path)) return next();
|
|
579
|
+
if (c.req.method === "GET" && (path === "/connect/slack" || path.startsWith("/connect/slack/"))) return next();
|
|
580
|
+
if (c.req.method === "GET" && path === "/login") return c.redirect(`/signin${new URL(c.req.url).search}`);
|
|
581
|
+
if (path === "/signin" || path.startsWith("/assets/") || path === "/manifest.webmanifest" || path === "/mastra.svg" || path === "/pwa-192.png" || path === "/pwa-512.png" || path === "/apple-touch-icon.png" || c.req.method === "GET" && SESSION_FAVICON_PATHS.has(path)) return next();
|
|
582
|
+
const token = getBearerToken(c.req.header("Authorization"));
|
|
583
|
+
const user = await timedAboveThreshold("auth.gate.authenticate", 1e3, () => authenticateRequest(provider, token, c.req.raw));
|
|
584
|
+
forwardPendingResponseHeaders(provider, c);
|
|
585
|
+
if (user) {
|
|
586
|
+
const requestedOrganizationId = token ? c.req.header(ORGANIZATION_ID_HEADER)?.trim() : void 0;
|
|
587
|
+
if (requestedOrganizationId) {
|
|
588
|
+
if (!selectRequestedOrganization(user, requestedOrganizationId)) return c.json({ error: "organization_forbidden" }, 403);
|
|
589
|
+
} else await ensureUserOrg(provider, user);
|
|
590
|
+
c.set(FACTORY_AUTH_USER_KEY, user);
|
|
591
|
+
const requestContext = c.get("requestContext");
|
|
592
|
+
requestContext?.set("user", user);
|
|
593
|
+
requestContext?.set(MASTRA_MESSAGE_AUTHOR_KEY, messageAuthor(user));
|
|
594
|
+
return next();
|
|
595
|
+
}
|
|
596
|
+
if (isNavigationRequest(path, c.req.header("Accept"))) {
|
|
597
|
+
const url = new URL(c.req.url);
|
|
598
|
+
const returnTo = sanitizeReturnTo(url.pathname + url.search);
|
|
599
|
+
return c.redirect(`/signin?returnTo=${encodeURIComponent(returnTo)}`);
|
|
600
|
+
}
|
|
601
|
+
return c.json({ error: "unauthorized" }, 401);
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Mount factory auth gating onto the host app. No-op when auth is disabled
|
|
606
|
+
* (no provider active).
|
|
607
|
+
*
|
|
608
|
+
* Must be called before the Mastra adapter routes, the `/web/*` routes, and
|
|
609
|
+
* the static UI handlers so the gate covers every request. Composes the shared
|
|
610
|
+
* `registerAuthRoutes` + `createFactoryAuthGate` factories so the local Hono server
|
|
611
|
+
* and the platform Mastra entry stay behavior-identical.
|
|
612
|
+
*/
|
|
613
|
+
function mountFactoryAuth(app, options = {}) {
|
|
614
|
+
const provider = options.provider ?? envFallbackAuthProvider(options.redirectUri);
|
|
615
|
+
if (!provider) return false;
|
|
616
|
+
registerAuthRoutes(app, provider, { publicUrl: options.publicUrl });
|
|
617
|
+
app.use("*", createFactoryAuthGate(provider));
|
|
618
|
+
return true;
|
|
619
|
+
}
|
|
620
|
+
//#endregion
|
|
621
|
+
export { buildAuthDisabledRoutes, buildAuthRoutes, createFactoryAuthGate, createFactoryRouteAuth, ensureFactoryAuthUser, factoryAuthTenant, factoryUserOrgId, getBearerToken, getFactoryAuthOrgId, getFactoryAuthUser, getFactoryAuthUserFromContext, getFactoryAuthUserId, getWorkOSProvider, isCrossSiteAuth, isOrganizationAdmin, isWorkOSAuth, mountFactoryAuth, registerAuthRoutes, sanitizeReturnTo };
|
|
622
|
+
|
|
623
|
+
//# sourceMappingURL=auth.js.map
|