@mastra/factory 0.0.0-client-tool-results-20260912062135
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 +458 -0
- package/dist/auth.d.ts +200 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +578 -0
- package/dist/auth.js.map +1 -0
- package/dist/boards/define-board.d.ts +76 -0
- package/dist/boards/define-board.d.ts.map +1 -0
- package/dist/boards/define-board.js +110 -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 +27 -0
- package/dist/boards/registry.js.map +1 -0
- package/dist/boards/relocate.d.ts +17 -0
- package/dist/boards/relocate.d.ts.map +1 -0
- package/dist/boards/relocate.js +53 -0
- package/dist/boards/relocate.js.map +1 -0
- package/dist/boards/review.d.ts +4 -0
- package/dist/boards/review.d.ts.map +1 -0
- package/dist/boards/review.js +89 -0
- package/dist/boards/review.js.map +1 -0
- package/dist/boards/semantics.d.ts +28 -0
- package/dist/boards/semantics.d.ts.map +1 -0
- package/dist/boards/semantics.js +41 -0
- package/dist/boards/semantics.js.map +1 -0
- package/dist/boards/transition-policy.d.ts +63 -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 +31 -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 +167 -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 +143 -0
- package/dist/capabilities/intake.d.ts.map +1 -0
- package/dist/capabilities/intake.js +1 -0
- package/dist/capabilities/version-control.d.ts +248 -0
- package/dist/capabilities/version-control.d.ts.map +1 -0
- package/dist/capabilities/version-control.js +1 -0
- package/dist/factory.d.ts +164 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +702 -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 +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/integrations/base.d.ts +273 -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 +29 -0
- package/dist/integrations/github/commits.d.ts.map +1 -0
- package/dist/integrations/github/commits.js +29 -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 +194 -0
- package/dist/integrations/github/default-rules.d.ts.map +1 -0
- package/dist/integrations/github/default-rules.js +230 -0
- package/dist/integrations/github/default-rules.js.map +1 -0
- package/dist/integrations/github/integration.d.ts +247 -0
- package/dist/integrations/github/integration.d.ts.map +1 -0
- package/dist/integrations/github/integration.js +1277 -0
- package/dist/integrations/github/integration.js.map +1 -0
- package/dist/integrations/github/issue-reconciler.d.ts +24 -0
- package/dist/integrations/github/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/github/issue-reconciler.js +113 -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 +90 -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 +78 -0
- package/dist/integrations/github/routes.d.ts.map +1 -0
- package/dist/integrations/github/routes.js +1293 -0
- package/dist/integrations/github/routes.js.map +1 -0
- package/dist/integrations/github/rules.d.ts +134 -0
- package/dist/integrations/github/rules.d.ts.map +1 -0
- package/dist/integrations/github/rules.js +787 -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 +200 -0
- package/dist/integrations/github/sandbox.d.ts.map +1 -0
- package/dist/integrations/github/sandbox.js +557 -0
- package/dist/integrations/github/sandbox.js.map +1 -0
- package/dist/integrations/github/session-subscriptions.d.ts +35 -0
- package/dist/integrations/github/session-subscriptions.d.ts.map +1 -0
- package/dist/integrations/github/session-subscriptions.js +234 -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/subscriptions.d.ts +54 -0
- package/dist/integrations/github/subscriptions.d.ts.map +1 -0
- package/dist/integrations/github/subscriptions.js +62 -0
- package/dist/integrations/github/subscriptions.js.map +1 -0
- package/dist/integrations/github/token-refresh.d.ts +12 -0
- package/dist/integrations/github/token-refresh.d.ts.map +1 -0
- package/dist/integrations/github/token-refresh.js +24 -0
- package/dist/integrations/github/token-refresh.js.map +1 -0
- package/dist/integrations/github/webhook.d.ts +142 -0
- package/dist/integrations/github/webhook.d.ts.map +1 -0
- package/dist/integrations/github/webhook.js +472 -0
- package/dist/integrations/github/webhook.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/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 +17 -0
- package/dist/integrations/incidentio/integration.d.ts.map +1 -0
- package/dist/integrations/incidentio/integration.js +54 -0
- package/dist/integrations/incidentio/integration.js.map +1 -0
- package/dist/integrations/incidentio/issue-reconciler.d.ts +8 -0
- package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/incidentio/issue-reconciler.js +39 -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/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 +98 -0
- package/dist/integrations/issue-reconcile-worker.js.map +1 -0
- package/dist/integrations/issue-reconciler.d.ts +49 -0
- package/dist/integrations/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/issue-reconciler.js +102 -0
- package/dist/integrations/issue-reconciler.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/default-rules.d.ts +44 -0
- package/dist/integrations/linear/default-rules.d.ts.map +1 -0
- package/dist/integrations/linear/default-rules.js +65 -0
- package/dist/integrations/linear/default-rules.js.map +1 -0
- package/dist/integrations/linear/integration.d.ts +242 -0
- package/dist/integrations/linear/integration.d.ts.map +1 -0
- package/dist/integrations/linear/integration.js +698 -0
- package/dist/integrations/linear/integration.js.map +1 -0
- package/dist/integrations/linear/issue-reconciler.d.ts +6 -0
- package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -0
- package/dist/integrations/linear/issue-reconciler.js +70 -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 +71 -0
- package/dist/integrations/linear/routes.d.ts.map +1 -0
- package/dist/integrations/linear/routes.js +317 -0
- package/dist/integrations/linear/routes.js.map +1 -0
- package/dist/integrations/linear/rules.d.ts +53 -0
- package/dist/integrations/linear/rules.d.ts.map +1 -0
- package/dist/integrations/linear/rules.js +150 -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/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 +435 -0
- package/dist/integrations/platform/github/event-worker.js.map +1 -0
- package/dist/integrations/platform/github/integration.d.ts +81 -0
- package/dist/integrations/platform/github/integration.d.ts.map +1 -0
- package/dist/integrations/platform/github/integration.js +1143 -0
- package/dist/integrations/platform/github/integration.js.map +1 -0
- package/dist/integrations/platform/incidentio/integration.d.ts +17 -0
- package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -0
- package/dist/integrations/platform/incidentio/integration.js +56 -0
- package/dist/integrations/platform/incidentio/integration.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 +380 -0
- package/dist/integrations/platform/linear/event-worker.js.map +1 -0
- package/dist/integrations/platform/linear/integration.d.ts +59 -0
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -0
- package/dist/integrations/platform/linear/integration.js +530 -0
- package/dist/integrations/platform/linear/integration.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 +97 -0
- package/dist/integrations/slack/integration.js.map +1 -0
- package/dist/integrations/slack/slack.d.ts +218 -0
- package/dist/integrations/slack/slack.d.ts.map +1 -0
- package/dist/integrations/slack/slack.js +530 -0
- package/dist/integrations/slack/slack.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 +35 -0
- package/dist/packages/_internals/workspace/dist/index.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 +160 -0
- package/dist/routes/attention-providers.d.ts.map +1 -0
- package/dist/routes/attention-providers.js +517 -0
- package/dist/routes/attention-providers.js.map +1 -0
- package/dist/routes/attention.d.ts +21 -0
- package/dist/routes/attention.d.ts.map +1 -0
- package/dist/routes/attention.js +213 -0
- package/dist/routes/attention.js.map +1 -0
- package/dist/routes/config.d.ts +279 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +1114 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/contracts.d.ts +627 -0
- package/dist/routes/contracts.d.ts.map +1 -0
- package/dist/routes/contracts.js +468 -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 +163 -0
- package/dist/routes/fs.d.ts.map +1 -0
- package/dist/routes/fs.js +749 -0
- package/dist/routes/fs.js.map +1 -0
- package/dist/routes/intake.d.ts +61 -0
- package/dist/routes/intake.d.ts.map +1 -0
- package/dist/routes/intake.js +560 -0
- package/dist/routes/intake.js.map +1 -0
- package/dist/routes/knowledge.d.ts +153 -0
- package/dist/routes/knowledge.d.ts.map +1 -0
- package/dist/routes/knowledge.js +443 -0
- package/dist/routes/knowledge.js.map +1 -0
- package/dist/routes/oauth.d.ts +46 -0
- package/dist/routes/oauth.d.ts.map +1 -0
- package/dist/routes/oauth.js +488 -0
- package/dist/routes/oauth.js.map +1 -0
- package/dist/routes/om-seed.d.ts +22 -0
- package/dist/routes/om-seed.d.ts.map +1 -0
- package/dist/routes/om-seed.js +40 -0
- package/dist/routes/om-seed.js.map +1 -0
- package/dist/routes/projects.d.ts +41 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +480 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/provider-credentials.d.ts +81 -0
- package/dist/routes/provider-credentials.d.ts.map +1 -0
- package/dist/routes/provider-credentials.js +86 -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/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 +125 -0
- package/dist/routes/surface.d.ts.map +1 -0
- package/dist/routes/surface.js +374 -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 +74 -0
- package/dist/routes/tenant-credentials.d.ts.map +1 -0
- package/dist/routes/tenant-credentials.js +176 -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 +697 -0
- package/dist/routes/work-items.js.map +1 -0
- package/dist/rules/binding-context.d.ts +32 -0
- package/dist/rules/binding-context.d.ts.map +1 -0
- package/dist/rules/binding-context.js +96 -0
- package/dist/rules/binding-context.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 +89 -0
- package/dist/rules/dispatch-errors.js.map +1 -0
- package/dist/rules/dispatcher.d.ts +79 -0
- package/dist/rules/dispatcher.d.ts.map +1 -0
- package/dist/rules/dispatcher.js +938 -0
- package/dist/rules/dispatcher.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 +56 -0
- package/dist/rules/processor.d.ts.map +1 -0
- package/dist/rules/processor.js +402 -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/start-coordinator.d.ts +52 -0
- package/dist/rules/start-coordinator.d.ts.map +1 -0
- package/dist/rules/start-coordinator.js +167 -0
- package/dist/rules/start-coordinator.js.map +1 -0
- package/dist/rules/terminal-cleanup.d.ts +25 -0
- package/dist/rules/terminal-cleanup.d.ts.map +1 -0
- package/dist/rules/terminal-cleanup.js +48 -0
- package/dist/rules/terminal-cleanup.js.map +1 -0
- package/dist/rules/tools.d.ts +12 -0
- package/dist/rules/tools.d.ts.map +1 -0
- package/dist/rules/tools.js +82 -0
- package/dist/rules/tools.js.map +1 -0
- package/dist/rules/transition-service.d.ts +69 -0
- package/dist/rules/transition-service.d.ts.map +1 -0
- package/dist/rules/transition-service.js +316 -0
- package/dist/rules/transition-service.js.map +1 -0
- package/dist/rules/types.d.ts +331 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +116 -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 +291 -0
- package/dist/rules/validation.js.map +1 -0
- package/dist/sandbox/materialization.d.ts +36 -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 +133 -0
- package/dist/sandbox/session-retirement.js.map +1 -0
- package/dist/sandbox/session-sandbox.d.ts +131 -0
- package/dist/sandbox/session-sandbox.d.ts.map +1 -0
- package/dist/sandbox/session-sandbox.js +131 -0
- package/dist/sandbox/session-sandbox.js.map +1 -0
- package/dist/sandbox/workdir.d.ts +35 -0
- package/dist/sandbox/workdir.d.ts.map +1 -0
- package/dist/sandbox/workdir.js +55 -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 +96 -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/factory-session.d.ts +135 -0
- package/dist/session/factory-session.d.ts.map +1 -0
- package/dist/session/factory-session.js +177 -0
- package/dist/session/factory-session.js.map +1 -0
- package/dist/session/filesystem-capture.d.ts +34 -0
- package/dist/session/filesystem-capture.d.ts.map +1 -0
- package/dist/session/filesystem-capture.js +153 -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 +84 -0
- package/dist/session/memory-settings-hydration.d.ts.map +1 -0
- package/dist/session/memory-settings-hydration.js +75 -0
- package/dist/session/memory-settings-hydration.js.map +1 -0
- package/dist/session/model-pack-hydration.d.ts +55 -0
- package/dist/session/model-pack-hydration.d.ts.map +1 -0
- package/dist/session/model-pack-hydration.js +56 -0
- package/dist/session/model-pack-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/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/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/skills/catalog.d.ts +12 -0
- package/dist/skills/catalog.d.ts.map +1 -0
- package/dist/skills/catalog.js +52 -0
- package/dist/skills/catalog.js.map +1 -0
- package/dist/skills/service.d.ts +58 -0
- package/dist/skills/service.d.ts.map +1 -0
- package/dist/skills/service.js +52 -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/agent-audit.d.ts +27 -0
- package/dist/storage/domains/audit/agent-audit.d.ts.map +1 -0
- package/dist/storage/domains/audit/agent-audit.js +66 -0
- package/dist/storage/domains/audit/agent-audit.js.map +1 -0
- package/dist/storage/domains/audit/base.d.ts +139 -0
- package/dist/storage/domains/audit/base.d.ts.map +1 -0
- package/dist/storage/domains/audit/base.js +183 -0
- package/dist/storage/domains/audit/base.js.map +1 -0
- package/dist/storage/domains/audit/domain.d.ts +76 -0
- package/dist/storage/domains/audit/domain.d.ts.map +1 -0
- package/dist/storage/domains/audit/domain.js +266 -0
- package/dist/storage/domains/audit/domain.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 +242 -0
- package/dist/storage/domains/comments/base.d.ts.map +1 -0
- package/dist/storage/domains/comments/base.js +526 -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 +76 -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 +294 -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 +140 -0
- package/dist/storage/domains/credentials/base.d.ts.map +1 -0
- package/dist/storage/domains/credentials/base.js +298 -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 +165 -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 +128 -0
- package/dist/storage/domains/intake/base.d.ts.map +1 -0
- package/dist/storage/domains/intake/base.js +309 -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 +70 -0
- package/dist/storage/domains/memory-settings/base.d.ts.map +1 -0
- package/dist/storage/domains/memory-settings/base.js +136 -0
- package/dist/storage/domains/memory-settings/base.js.map +1 -0
- package/dist/storage/domains/model-packs/base.d.ts +75 -0
- package/dist/storage/domains/model-packs/base.d.ts.map +1 -0
- package/dist/storage/domains/model-packs/base.js +185 -0
- package/dist/storage/domains/model-packs/base.js.map +1 -0
- package/dist/storage/domains/projects/base.d.ts +65 -0
- package/dist/storage/domains/projects/base.d.ts.map +1 -0
- package/dist/storage/domains/projects/base.js +128 -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 +306 -0
- package/dist/storage/domains/source-control/base.d.ts.map +1 -0
- package/dist/storage/domains/source-control/base.js +741 -0
- package/dist/storage/domains/source-control/base.js.map +1 -0
- package/dist/storage/domains/source-control/inmemory.d.ts +134 -0
- package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/source-control/inmemory.js +329 -0
- package/dist/storage/domains/source-control/inmemory.js.map +1 -0
- package/dist/storage/domains/work-items/base.d.ts +717 -0
- package/dist/storage/domains/work-items/base.d.ts.map +1 -0
- package/dist/storage/domains/work-items/base.js +2444 -0
- package/dist/storage/domains/work-items/base.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 +216 -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 +338 -0
- package/dist/supervisor/read-tools.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 +63 -0
- package/dist/supervisor/session.js.map +1 -0
- package/dist/supervisor/write-tools.d.ts +26 -0
- package/dist/supervisor/write-tools.d.ts.map +1 -0
- package/dist/supervisor/write-tools.js +229 -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 +31 -0
- package/dist/work-item-branch.d.ts.map +1 -0
- package/dist/work-item-branch.js +50 -0
- package/dist/work-item-branch.js.map +1 -0
- package/dist/workspace.d.ts +62 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +486 -0
- package/dist/workspace.js.map +1 -0
- package/factory-skills/configure-factory-rules/SKILL.md +118 -0
- package/factory-skills/factory-complete-issue/SKILL.md +22 -0
- package/factory-skills/factory-plan/SKILL.md +61 -0
- package/factory-skills/factory-rereview/SKILL.md +178 -0
- package/factory-skills/factory-review/SKILL.md +167 -0
- package/factory-skills/factory-triage/SKILL.md +197 -0
- package/package.json +91 -0
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { MastraAuthWorkos } from '@mastra/auth-workos';
|
|
2
|
+
import type { ApiRoute, IMastraAuthProvider } from '@mastra/core/server';
|
|
3
|
+
import type { Context, Hono } from 'hono';
|
|
4
|
+
import type { RouteAuth } from './routes/route.js';
|
|
5
|
+
/**
|
|
6
|
+
* Provider-neutral factory auth gating for the MastraCode web server.
|
|
7
|
+
*
|
|
8
|
+
* When an auth provider is active (a `MastraAuthProvider` instance passed to
|
|
9
|
+
* `MastraFactory`'s `auth` slot, or — back-compat for suites/paths that never
|
|
10
|
+
* boot the factory — implied by the WorkOS env vars), every route on the web
|
|
11
|
+
* server is placed behind it: unauthenticated browser navigations are
|
|
12
|
+
* redirected to the SPA's `/signin` page, API/XHR calls receive a 401, and a
|
|
13
|
+
* small set of public routes stay reachable while signed out — the provider's
|
|
14
|
+
* `/auth/*` routes plus `/auth/me`, the `/signin` page, its `/assets/*` bundle,
|
|
15
|
+
* and the SPA manifest metadata. When no provider is active, `mountFactoryAuth` is a no-op and the server
|
|
16
|
+
* behaves exactly as it does without auth.
|
|
17
|
+
*
|
|
18
|
+
* Provider specifics stay in the providers (`@mastra/auth-workos`,
|
|
19
|
+
* `@mastra/auth-better-auth`, or any custom `IMastraAuthProvider`); this
|
|
20
|
+
* module composes them capability-first via the core type guards:
|
|
21
|
+
* - `authenticateToken` — session/bearer validation (all providers)
|
|
22
|
+
* - `ISSOProvider` — hosted-login `/auth/login`, `/auth/callback`, `/auth/logout`
|
|
23
|
+
* - `IAuthHttpHandler` — provider-owned `/auth/api/*` endpoints (better-auth)
|
|
24
|
+
* - `IOrganizationsProvider` — personal-org bootstrap + admin checks
|
|
25
|
+
* - `ICredentialsProvider.isSignUpEnabled` — SPA sign-up affordance
|
|
26
|
+
* - `getClearSessionHeaders` — session cookie clearing on logout
|
|
27
|
+
*/
|
|
28
|
+
/** Minimal shape of the signed-in user surfaced to the SPA (no tokens). */
|
|
29
|
+
export interface FactoryAuthUser {
|
|
30
|
+
/** Stable WorkOS user id used to scope per-user data (GitHub installs etc.). */
|
|
31
|
+
workosId?: string;
|
|
32
|
+
/** Provider user id; WorkOS shapes may use `workosId` instead (see {@link workosId}). */
|
|
33
|
+
id?: string;
|
|
34
|
+
email?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
/** Provider-supplied profile picture URL, when the auth provider exposes one. */
|
|
37
|
+
avatarUrl?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Organization id. The org is the top-level tenant: it owns the GitHub
|
|
40
|
+
* App installation and connected projects, while each user inside the org gets
|
|
41
|
+
* isolated building instances. Absent for personal (no-org) accounts.
|
|
42
|
+
*/
|
|
43
|
+
organizationId?: string;
|
|
44
|
+
/** Organization ids proven by the provider's authenticated membership response. */
|
|
45
|
+
organizationMembershipIds?: string[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Tenant identity: the org is the top-level tenant, and each user inside it is
|
|
49
|
+
* an isolated builder. Agent state, worktrees and sandboxes are scoped per
|
|
50
|
+
* `(orgId, userId)`. Personal (no-org) users have `orgId === undefined`.
|
|
51
|
+
*/
|
|
52
|
+
export interface FactoryAuthTenant {
|
|
53
|
+
/** Organization id, or `undefined` for personal (no-org) accounts. */
|
|
54
|
+
orgId?: string;
|
|
55
|
+
/** Stable provider user id. */
|
|
56
|
+
userId: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Validate that a `returnTo` value is a safe same-site path, to prevent
|
|
60
|
+
* open-redirect attacks. Only absolute local paths (`/foo`) are allowed;
|
|
61
|
+
* protocol-relative (`//evil.com`) and absolute URLs are rejected.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sanitizeReturnTo(raw: string | undefined): string;
|
|
64
|
+
/** Extract a bearer token from the Authorization header, if present. */
|
|
65
|
+
export declare function getBearerToken(authorization: string | undefined): string;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the SPA is served cross-origin from this API (platform deploy). When
|
|
68
|
+
* `MASTRACODE_ALLOWED_ORIGINS` is set the browser talks to us cross-site, so
|
|
69
|
+
* session cookies must be `SameSite=None; Secure` for the browser to send them.
|
|
70
|
+
* Same-origin local dev leaves this unset and keeps the stricter `SameSite=Lax`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function isCrossSiteAuth(): boolean;
|
|
73
|
+
/** Hono context variables set by the auth gate. */
|
|
74
|
+
export interface FactoryAuthVariables {
|
|
75
|
+
factoryAuthUser: FactoryAuthUser;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Read the authenticated user the gate stashed on the context, or
|
|
79
|
+
* `undefined` when unauthenticated / auth disabled. Used by downstream routes
|
|
80
|
+
* (e.g. GitHub) to scope rows per user.
|
|
81
|
+
*/
|
|
82
|
+
export declare function getFactoryAuthUser(c: Context): FactoryAuthUser | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Read the authenticated user off a request context, normalizing whatever the
|
|
85
|
+
* active auth provider put there.
|
|
86
|
+
*
|
|
87
|
+
* The server's auth layer writes the provider's `authenticateToken` result into
|
|
88
|
+
* the request context's `user` slot verbatim, so the value's shape follows the
|
|
89
|
+
* provider: WorkOS writes a flat user, better-auth writes a `{ session, user }`
|
|
90
|
+
* wrapper whose org lives on the session. Reading that slot as a
|
|
91
|
+
* {@link FactoryAuthUser} therefore yields `undefined` for both the id and the
|
|
92
|
+
* org under better-auth, which reads as "this session belongs to somebody else"
|
|
93
|
+
* at every ownership check. Normalize on the way in instead.
|
|
94
|
+
*/
|
|
95
|
+
export declare function getFactoryAuthUserFromContext(requestContext: {
|
|
96
|
+
get: (key: string) => unknown;
|
|
97
|
+
} | undefined): FactoryAuthUser | undefined;
|
|
98
|
+
/** Resolve the stable user id from an authenticated user shape. */
|
|
99
|
+
export declare function getFactoryAuthUserId(user: FactoryAuthUser | undefined): string | undefined;
|
|
100
|
+
/** Resolve the organization id from a user shape, if present. */
|
|
101
|
+
export declare function getFactoryAuthOrgId(user: FactoryAuthUser | undefined): string | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Resolve the tenant identity `(orgId, userId)` from the authenticated user on
|
|
104
|
+
* the context. Returns `undefined` when there is no signed-in user (auth
|
|
105
|
+
* disabled or unauthenticated). `orgId` is `undefined` for personal accounts;
|
|
106
|
+
* callers gate org-scoped GitHub features on its presence while agent state
|
|
107
|
+
* falls back to a user-only tenant.
|
|
108
|
+
*/
|
|
109
|
+
export declare function factoryAuthTenant(c: Context): FactoryAuthTenant | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Fail-closed authorization for organization-level administrative mutations.
|
|
112
|
+
* The caller must belong to the same active organization and the provider must
|
|
113
|
+
* explicitly confirm an admin/owner role.
|
|
114
|
+
*/
|
|
115
|
+
export declare function isOrganizationAdmin(provider: IMastraAuthProvider | undefined, c: Context, organizationId: string): Promise<boolean>;
|
|
116
|
+
/**
|
|
117
|
+
* Build the factory's implementation of the `RouteAuth` seam over the
|
|
118
|
+
* resolved provider (`undefined` = auth disabled). Constructed once per boot
|
|
119
|
+
* by `MastraFactory.prepare()` and handed to factory route modules at
|
|
120
|
+
* construction — they never import the factory auth module directly.
|
|
121
|
+
*/
|
|
122
|
+
export declare function createFactoryRouteAuth(provider: IMastraAuthProvider | undefined): RouteAuth;
|
|
123
|
+
/** True when the given provider is WorkOS. Gates WorkOS-only capabilities. */
|
|
124
|
+
export declare function isWorkOSAuth(provider: IMastraAuthProvider | undefined): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* The raw WorkOS provider, for features that need the WorkOS client directly
|
|
127
|
+
* (audit-log export, Admin Portal links). Callers must gate on
|
|
128
|
+
* {@link isWorkOSAuth} first — throws when the provider is not WorkOS.
|
|
129
|
+
*/
|
|
130
|
+
export declare function getWorkOSProvider(provider: IMastraAuthProvider | undefined): MastraAuthWorkos;
|
|
131
|
+
/**
|
|
132
|
+
* Resolve the authenticated user for a request, stashing it on the context.
|
|
133
|
+
*
|
|
134
|
+
* The gate only authenticates non-`/auth/*` requests via the `Authorization`
|
|
135
|
+
* header, so cookie-based browser navigations to public `/auth/*` routes (the
|
|
136
|
+
* GitHub connect/callback flow) arrive without a gate-stashed user. This reads
|
|
137
|
+
* the session cookie from the raw request the same way `/auth/me` does,
|
|
138
|
+
* caches the result on the context, and returns it so downstream helpers like
|
|
139
|
+
* {@link factoryAuthTenant} work uniformly on both gated and public routes.
|
|
140
|
+
*
|
|
141
|
+
* Returns `undefined` when there is no valid session (or auth is disabled).
|
|
142
|
+
*/
|
|
143
|
+
export declare function ensureFactoryAuthUser(provider: IMastraAuthProvider | undefined, c: Context): Promise<FactoryAuthUser | undefined>;
|
|
144
|
+
export interface MountFactoryAuthOptions {
|
|
145
|
+
/**
|
|
146
|
+
* Explicit auth provider to mount. When omitted, falls back to a WorkOS
|
|
147
|
+
* provider implied by the `WORKOS_*` env vars (back-compat for suites that
|
|
148
|
+
* never boot the factory).
|
|
149
|
+
*/
|
|
150
|
+
provider?: IMastraAuthProvider;
|
|
151
|
+
/**
|
|
152
|
+
* Absolute URL the identity provider redirects back to after login (WorkOS
|
|
153
|
+
* env-fallback path only). Defaults to the `WORKOS_REDIRECT_URI` env var.
|
|
154
|
+
*/
|
|
155
|
+
redirectUri?: string;
|
|
156
|
+
/** Browser-facing origin used to derive the SSO callback URL. */
|
|
157
|
+
publicUrl?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Register the public `/auth/*` routes on a Hono app: the capability-derived
|
|
161
|
+
* provider routes (login/callback/logout/provider APIs) plus the
|
|
162
|
+
* provider-neutral `/auth/me`. Split out from `mountFactoryAuth` so both the local
|
|
163
|
+
* Hono server and the platform Mastra entry can reuse the exact same handlers.
|
|
164
|
+
*/
|
|
165
|
+
export declare function registerAuthRoutes(app: Hono<any>, provider: IMastraAuthProvider, options?: {
|
|
166
|
+
publicUrl?: string;
|
|
167
|
+
}): void;
|
|
168
|
+
/**
|
|
169
|
+
* Build the public `/auth/*` routes (provider routes + `/auth/me`) as Mastra
|
|
170
|
+
* `server.apiRoutes`. Used by the platform Mastra entry (`src/mastra/index.ts`),
|
|
171
|
+
* which can't register plain Hono routes on the deployer-generated app the way
|
|
172
|
+
* the local server does via {@link registerAuthRoutes}.
|
|
173
|
+
*
|
|
174
|
+
* Handlers are identical to {@link registerAuthRoutes}. All are `requiresAuth: false`
|
|
175
|
+
* (they must be reachable while unauthenticated), and the gate middleware skips
|
|
176
|
+
* `/auth/*` so it never blocks them. `/auth/*` is not under `/api`, so it is a
|
|
177
|
+
* valid custom-route path.
|
|
178
|
+
*/
|
|
179
|
+
export declare function buildAuthRoutes(provider: IMastraAuthProvider, options?: {
|
|
180
|
+
publicUrl?: string;
|
|
181
|
+
}): ApiRoute[];
|
|
182
|
+
/**
|
|
183
|
+
* Build the auth gate as a plain Hono middleware handler `(c, next)`. Protects
|
|
184
|
+
* everything that is not a public `/auth/*` route: authenticated requests stash
|
|
185
|
+
* the user on the context and continue; unauthenticated navigations redirect to
|
|
186
|
+
* login and XHR/API calls get a 401 JSON. Shared by the local Hono server
|
|
187
|
+
* (`mountFactoryAuth`) and the platform Mastra entry (`server.middleware`).
|
|
188
|
+
*/
|
|
189
|
+
export declare function createFactoryAuthGate(provider: IMastraAuthProvider): (c: Context, next: () => Promise<void>) => Promise<Response | void>;
|
|
190
|
+
/**
|
|
191
|
+
* Mount factory auth gating onto the host app. No-op when auth is disabled
|
|
192
|
+
* (no provider active).
|
|
193
|
+
*
|
|
194
|
+
* Must be called before the Mastra adapter routes, the `/web/*` routes, and
|
|
195
|
+
* the static UI handlers so the gate covers every request. Composes the shared
|
|
196
|
+
* `registerAuthRoutes` + `createFactoryAuthGate` factories so the local Hono server
|
|
197
|
+
* and the platform Mastra entry stay behavior-identical.
|
|
198
|
+
*/
|
|
199
|
+
export declare function mountFactoryAuth(app: Hono<any>, options?: MountFactoryAuthOptions): boolean;
|
|
200
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAWvD,OAAO,K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