@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-control-sessions.js","names":[],"sources":["../../src/routes/source-control-sessions.ts"],"sourcesContent":["import type { MountedMastraCode } from '@mastra/code-sdk';\nimport { resolveModel } from '@mastra/code-sdk/agents/model';\nimport { RequestContext } from '@mastra/core/request-context';\nimport type { ApiRoute, IUserProvider } from '@mastra/core/server';\nimport { registerApiRoute } from '@mastra/core/server';\nimport { UniqueViolationError } from '@mastra/core/storage';\nimport type { Context } from 'hono';\n\nimport { reclaimDeletedSessionSandbox } from '../integrations/github/sandbox-release.js';\nimport { isValidGitRef } from '../sandbox/git-ref.js';\nimport type { SessionRetirementCoordinator } from '../sandbox/session-retirement.js';\nimport { waitForPendingFilesystemCapture } from '../session/filesystem-capture.js';\nimport { normalizeSessionTitle } from '../session/session-title.js';\nimport type { MemorySettingsStorage } from '../storage/domains/memory-settings/base.js';\nimport type { FactoryProjectsStorage } from '../storage/domains/projects/base.js';\nimport type {\n ProjectRepository,\n SourceControlSession,\n SourceControlStorageHandle,\n} from '../storage/domains/source-control/base.js';\nimport type { WorkItemsStorage } from '../storage/domains/work-items/base.js';\nimport type { RouteAuth } from './route.js';\n\ntype RouteContext = Context;\n\nfunction loose(c: unknown): RouteContext {\n return c as RouteContext;\n}\n\nconst USER_SESSION_BRANCH_PREFIX = 'user/session-';\nconst UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;\nconst MAX_SESSION_OWNER_PROFILES = 100;\nconst MAX_SESSION_OWNER_PROFILE_CACHE_ENTRIES = 500;\nconst SESSION_OWNER_PROFILE_TTL_MS = 5 * 60_000;\n\ninterface SessionOwnerProfile {\n id: string;\n name: string;\n avatarUrl?: string;\n}\n\ntype SessionOwnerUserProvider = Pick<IUserProvider, 'getUser'> & Partial<Pick<IUserProvider, 'getUsers'>>;\n\nexport interface SourceControlSessionRoutesOptions {\n auth: RouteAuth;\n sourceControls: readonly SourceControlStorageHandle[];\n projects: Pick<FactoryProjectsStorage, 'get'>;\n users?: SessionOwnerUserProvider;\n controller?: MountedMastraCode['controller'];\n memorySettings: Pick<MemorySettingsStorage, 'get'>;\n sessionRetirement?: SessionRetirementCoordinator;\n workItems?: Pick<WorkItemsStorage, 'clearSessionReferences'>;\n}\n\ninterface ResolvedProjectRepository {\n sourceControl: SourceControlStorageHandle;\n project: ProjectRepository;\n factoryProjectId: string;\n defaultBranch: string;\n}\n\nasync function resolveOrgTenant(\n c: RouteContext,\n auth: RouteAuth,\n): Promise<{ tenant: { orgId: string; userId: string } } | { response: Response }> {\n await auth.ensureUser(c);\n const tenant = auth.tenant(c);\n if (!tenant) return { response: c.json({ error: 'unauthorized', reason: 'auth_required' }, 401) };\n if (!tenant.orgId) {\n return {\n response: c.json(\n {\n error: 'organization_required',\n message: 'Source-control sessions require an organization.',\n },\n 403,\n ),\n };\n }\n return { tenant: { orgId: tenant.orgId, userId: tenant.userId } };\n}\n\nasync function resolveProjectRepository(\n sourceControls: readonly SourceControlStorageHandle[],\n orgId: string,\n projectRepositoryId: string,\n): Promise<ResolvedProjectRepository | null> {\n const matches = (\n await Promise.all(\n sourceControls.map(async sourceControl => {\n const project = await sourceControl.projectRepositories.get({ orgId, id: projectRepositoryId });\n if (!project) return null;\n const repository = await sourceControl.repositories.get({ orgId, id: project.repositoryId });\n if (!repository) return null;\n const connection = await sourceControl.connections.get({ orgId, id: project.connectionId });\n if (!connection) return null;\n return {\n sourceControl,\n project,\n factoryProjectId: connection.factoryProjectId,\n defaultBranch: project.branch ?? repository.defaultBranch,\n };\n }),\n )\n ).filter((match): match is ResolvedProjectRepository => match !== null);\n if (matches.length > 1) {\n throw new Error('Factory project repository exists in multiple source-control providers.');\n }\n return matches[0] ?? null;\n}\n\nasync function resolveSession(\n sourceControls: readonly SourceControlStorageHandle[],\n sessionId: string,\n): Promise<{ sourceControl: SourceControlStorageHandle; session: SourceControlSession } | null> {\n const matches = (\n await Promise.all(\n sourceControls.map(async sourceControl => ({\n sourceControl,\n session: await sourceControl.sessions.getBySessionId(sessionId),\n })),\n )\n ).filter(\n (match): match is { sourceControl: SourceControlStorageHandle; session: SourceControlSession } =>\n match.session !== null,\n );\n if (matches.length > 1) throw new Error('Factory session exists in multiple source-control providers.');\n return matches[0] ?? null;\n}\n\nfunction isJsonObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction createSessionNaming() {\n const inFlight = new Map<string, Promise<string | null>>();\n return (sessionId: string, run: () => Promise<string | null>) => {\n const pending = inFlight.get(sessionId);\n if (pending) return pending;\n const started = run().finally(() => inFlight.delete(sessionId));\n inFlight.set(sessionId, started);\n return started;\n };\n}\n\nfunction titleModel(modelId: string) {\n return ({ requestContext }: { requestContext: RequestContext }) =>\n resolveModel(modelId, { remapForCodexOAuth: true, requestContext });\n}\n\nfunction createSessionOwnerProfileResolver(users: SessionOwnerUserProvider | undefined) {\n const cache = new Map<string, { profile?: SessionOwnerProfile; expiresAt: number }>();\n const cacheProfile = (userId: string, profile: SessionOwnerProfile | undefined, expiresAt: number) => {\n cache.delete(userId);\n cache.set(userId, { profile, expiresAt });\n if (cache.size > MAX_SESSION_OWNER_PROFILE_CACHE_ENTRIES) {\n const oldestUserId = cache.keys().next().value;\n if (oldestUserId !== undefined) cache.delete(oldestUserId);\n }\n };\n\n return async (userIds: string[]): Promise<Map<string, SessionOwnerProfile>> => {\n if (!users) return new Map();\n const requestedUserIds = [...new Set(userIds)].slice(0, MAX_SESSION_OWNER_PROFILES);\n const profiles = new Map<string, SessionOwnerProfile>();\n const unresolvedUserIds: string[] = [];\n const now = Date.now();\n\n for (const userId of requestedUserIds) {\n const cached = cache.get(userId);\n if (!cached || cached.expiresAt <= now) {\n cache.delete(userId);\n unresolvedUserIds.push(userId);\n } else if (cached.profile) {\n profiles.set(userId, cached.profile);\n }\n }\n if (unresolvedUserIds.length === 0) return profiles;\n\n let resolvedUsers: Array<Awaited<ReturnType<SessionOwnerUserProvider['getUser']>>>;\n if (users.getUsers) {\n try {\n resolvedUsers = await users.getUsers(unresolvedUserIds);\n } catch (error) {\n console.warn('[Factory Sessions] Bulk owner profile lookup failed; falling back to individual lookups', {\n error: error instanceof Error ? error.message : String(error),\n });\n resolvedUsers = (await Promise.allSettled(unresolvedUserIds.map(userId => users.getUser(userId))))\n .filter(result => result.status === 'fulfilled')\n .map(result => result.value);\n }\n } else {\n resolvedUsers = (await Promise.allSettled(unresolvedUserIds.map(userId => users.getUser(userId))))\n .filter(result => result.status === 'fulfilled')\n .map(result => result.value);\n }\n\n for (const user of resolvedUsers) {\n if (!user) continue;\n const name = user.name?.trim() || user.email?.trim();\n if (!name) continue;\n profiles.set(user.id, {\n id: user.id,\n name,\n ...(user.avatarUrl ? { avatarUrl: user.avatarUrl } : {}),\n });\n }\n const expiresAt = now + SESSION_OWNER_PROFILE_TTL_MS;\n for (const userId of unresolvedUserIds) cacheProfile(userId, profiles.get(userId), expiresAt);\n return profiles;\n };\n}\n\nfunction withOwnerProfile(session: SourceControlSession, owners: Map<string, SessionOwnerProfile>) {\n const owner = owners.get(session.userId);\n return owner ? { ...session, owner } : session;\n}\n\nfunction projectSessionRoutes(\n path: '/web/source-control/projects/:id/sessions' | '/web/github/projects/:id/sessions',\n options: SourceControlSessionRoutesOptions,\n resolveOwnerProfiles: ReturnType<typeof createSessionOwnerProfileResolver>,\n): ApiRoute[] {\n return [\n registerApiRoute(path, {\n method: 'GET',\n requiresAuth: false,\n handler: async c => {\n const resolved = await resolveOrgTenant(loose(c), options.auth);\n if ('response' in resolved) return resolved.response;\n const { orgId, userId } = resolved.tenant;\n const projectRepositoryId = c.req.param('id');\n const project = projectRepositoryId\n ? await resolveProjectRepository(options.sourceControls, orgId, projectRepositoryId)\n : null;\n if (!project) return c.json({ error: 'Project repository not found' }, 404);\n const sessions = await project.sourceControl.sessions.list({\n projectRepositoryId: project.project.id,\n viewerUserId: userId,\n });\n const owners = await resolveOwnerProfiles(sessions.map(session => session.userId));\n return c.json({ sessions: sessions.map(session => withOwnerProfile(session, owners)) });\n },\n }),\n registerApiRoute(path, {\n method: 'POST',\n requiresAuth: false,\n handler: async c => {\n const resolved = await resolveOrgTenant(loose(c), options.auth);\n if ('response' in resolved) return resolved.response;\n const { orgId, userId } = resolved.tenant;\n const projectRepositoryId = c.req.param('id');\n const project = projectRepositoryId\n ? await resolveProjectRepository(options.sourceControls, orgId, projectRepositoryId)\n : null;\n if (!project) return c.json({ error: 'Project repository not found' }, 404);\n let body: unknown;\n try {\n body = await c.req.json();\n } catch {\n return c.json({ error: 'Invalid JSON body' }, 400);\n }\n if (!isJsonObject(body)) return c.json({ error: 'Invalid JSON body' }, 400);\n if (body.baseBranch !== undefined && typeof body.baseBranch !== 'string') {\n return c.json({ error: 'Invalid baseBranch' }, 400);\n }\n const baseBranch = body.baseBranch ?? project.defaultBranch;\n if (!isValidGitRef(baseBranch)) return c.json({ error: 'Invalid baseBranch' }, 400);\n if (\n body.sessionId !== undefined &&\n (typeof body.sessionId !== 'string' || !UUID_PATTERN.test(body.sessionId))\n ) {\n return c.json({ error: 'Invalid sessionId' }, 400);\n }\n const requestedSessionId = body.sessionId as string | undefined;\n const sessionId = requestedSessionId ?? globalThis.crypto.randomUUID();\n if (body.title !== undefined && typeof body.title !== 'string') {\n return c.json({ error: 'Invalid title' }, 400);\n }\n const normalizedTitle = body.title === undefined ? null : normalizeSessionTitle(body.title as string);\n let branch: string;\n if (body.branch === undefined) branch = `${USER_SESSION_BRANCH_PREFIX}${sessionId}`;\n else if (isValidGitRef(body.branch)) branch = body.branch;\n else return c.json({ error: 'Invalid branch' }, 400);\n\n if (requestedSessionId) {\n const existing = await project.sourceControl.sessions.getBySessionId(sessionId);\n if (existing) {\n if (\n existing.projectRepositoryId !== project.project.id ||\n existing.orgId !== orgId ||\n existing.userId !== userId ||\n existing.branch !== branch\n ) {\n return c.json({ error: 'Session ID conflict' }, 409);\n }\n return c.json({ session: existing });\n }\n }\n\n const session = await project.sourceControl.sessions\n .create({\n sessionId,\n projectRepositoryId: project.project.id,\n factoryProjectId: project.factoryProjectId,\n orgId,\n userId,\n branch,\n baseBranch,\n title: normalizedTitle,\n visibility: 'org',\n })\n .catch(async error => {\n if (!(error instanceof UniqueViolationError) || !requestedSessionId) throw error;\n const conflict = await project.sourceControl.sessions.getBySessionId(sessionId);\n if (!conflict) throw error;\n return conflict;\n });\n if (\n requestedSessionId &&\n (session.sessionId !== sessionId ||\n session.projectRepositoryId !== project.project.id ||\n session.orgId !== orgId ||\n session.userId !== userId ||\n session.branch !== branch)\n ) {\n return c.json({ error: 'Session ID conflict' }, 409);\n }\n return c.json({ session });\n },\n }),\n ];\n}\n\nexport function buildSourceControlSessionRoutes(options: SourceControlSessionRoutesOptions): ApiRoute[] {\n const nameSession = createSessionNaming();\n const resolveOwnerProfiles = createSessionOwnerProfileResolver(options.users);\n return [\n registerApiRoute('/web/factory/projects/:id/sessions', {\n method: 'GET',\n requiresAuth: false,\n handler: async c => {\n const resolved = await resolveOrgTenant(loose(c), options.auth);\n if ('response' in resolved) return resolved.response;\n const { orgId, userId } = resolved.tenant;\n const factoryProjectId = c.req.param('id');\n const project = factoryProjectId ? await options.projects.get({ orgId, id: factoryProjectId }) : null;\n if (!project) return c.json({ error: 'Factory not found' }, 404);\n // Storage is partitioned per provider; a Factory's sessions can live in any of them.\n const sessions = (\n await Promise.all(\n options.sourceControls.map(sourceControl =>\n sourceControl.sessions.listByProject({ orgId, factoryProjectId: project.id, viewerUserId: userId }),\n ),\n )\n ).flat();\n const owners = await resolveOwnerProfiles(sessions.map(session => session.userId));\n return c.json({ sessions: sessions.map(session => withOwnerProfile(session, owners)) });\n },\n }),\n ...projectSessionRoutes('/web/source-control/projects/:id/sessions', options, resolveOwnerProfiles),\n // Compatibility for existing clients; new code uses the provider-neutral path.\n ...projectSessionRoutes('/web/github/projects/:id/sessions', options, resolveOwnerProfiles),\n registerApiRoute('/web/user-sessions/:sessionId', {\n method: 'GET',\n requiresAuth: false,\n handler: async c => {\n const resolved = await resolveOrgTenant(loose(c), options.auth);\n if ('response' in resolved) return resolved.response;\n const match = await resolveSession(options.sourceControls, c.req.param('sessionId'));\n const session = match?.session;\n if (\n !session ||\n session.orgId !== resolved.tenant.orgId ||\n (session.visibility === 'private' && session.userId !== resolved.tenant.userId)\n ) {\n return c.json({ error: 'Session not found' }, 404);\n }\n const owners = await resolveOwnerProfiles([session.userId]);\n return c.json({ session: withOwnerProfile(session, owners) });\n },\n }),\n registerApiRoute('/web/user-sessions/:sessionId', {\n method: 'DELETE',\n requiresAuth: false,\n handler: async c => {\n const resolved = await resolveOrgTenant(loose(c), options.auth);\n if ('response' in resolved) return resolved.response;\n const match = await resolveSession(options.sourceControls, c.req.param('sessionId'));\n const session = match?.session;\n if (\n !match ||\n !session ||\n session.orgId !== resolved.tenant.orgId ||\n session.userId !== resolved.tenant.userId\n ) {\n return c.json({ error: 'Session not found' }, 404);\n }\n try {\n // Drain the turn's queued filesystem capture while the thread and sandbox still exist.\n // A failed drain only costs the snapshot; it must not block teardown.\n await waitForPendingFilesystemCapture(session.sessionId).catch(error => {\n console.warn('[Factory Sessions] Failed to drain filesystem capture before delete', {\n sessionId: session.sessionId,\n error,\n });\n });\n await options.controller?.deleteSession({ resourceId: session.sessionId });\n } catch (error) {\n console.error('[Factory Sessions] Failed to tear down live controller session', {\n sessionId: session.sessionId,\n error,\n });\n }\n if (options.sessionRetirement) {\n await options.sessionRetirement.retireSession({\n sourceControl: match.sourceControl,\n ...(options.workItems ? { workItems: options.workItems } : {}),\n orgId: session.orgId,\n sessionId: session.sessionId,\n deleteSession: true,\n });\n } else {\n await options.workItems?.clearSessionReferences({ orgId: session.orgId, sessionId: session.sessionId });\n await match.sourceControl.sessions.delete(session.id);\n void reclaimDeletedSessionSandbox({ session }).catch((error: unknown) => {\n console.error('[Factory Sessions] Failed to reclaim sandbox for deleted session', {\n sessionId: session.sessionId,\n sandboxId: session.sandboxId,\n error,\n });\n });\n }\n return c.json({ removed: true });\n },\n }),\n registerApiRoute('/web/user-sessions/:sessionId/title', {\n method: 'POST',\n requiresAuth: false,\n handler: async c => {\n const resolved = await resolveOrgTenant(loose(c), options.auth);\n if ('response' in resolved) return resolved.response;\n const sessionId = c.req.param('sessionId');\n const match = await resolveSession(options.sourceControls, sessionId);\n const row = match?.session;\n if (!match || !row || row.orgId !== resolved.tenant.orgId || row.userId !== resolved.tenant.userId) {\n return c.json({ error: 'Session not found' }, 404);\n }\n if (!options.controller) return c.json({ error: 'Sessions are not available on this server.' }, 503);\n const threads = await options.controller.queryThreads({ resourceId: sessionId });\n const thread = threads.sort((a, b) => b.updatedAt.getTime() - a.updatedAt.getTime())[0];\n if (!thread) return c.json({ error: 'This session has no conversation to name yet.' }, 409);\n const stored = await options.memorySettings.get({ orgId: row.orgId, userId: row.userId });\n const requestContext = new RequestContext();\n requestContext.set('user', { workosId: row.userId, organizationId: row.orgId });\n try {\n const title = await nameSession(sessionId, async () => {\n const generated = await options.controller!.generateThreadTitle({\n threadId: thread.id,\n resourceId: sessionId,\n requestContext,\n ...(stored?.observerModelId ? { model: titleModel(stored.observerModelId) } : {}),\n });\n const named = generated ? normalizeSessionTitle(generated) : null;\n if (named) await match.sourceControl.sessions.rename({ sessionId, title: named });\n return named;\n });\n if (!title) return c.json({ error: 'The model returned an empty title. Try again.' }, 502);\n return c.json({ title });\n } catch (error) {\n return c.json({ error: error instanceof Error ? error.message : String(error) }, 500);\n }\n },\n }),\n ];\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAS,MAAM,GAA0B;CACvC,OAAO;AACT;AAEA,MAAM,6BAA6B;AACnC,MAAM,eAAe;AACrB,MAAM,6BAA6B;AACnC,MAAM,0CAA0C;AAChD,MAAM,+BAA+B,IAAI;AA4BzC,eAAe,iBACb,GACA,MACiF;CACjF,MAAM,KAAK,WAAW,CAAC;CACvB,MAAM,SAAS,KAAK,OAAO,CAAC;CAC5B,IAAI,CAAC,QAAQ,OAAO,EAAE,UAAU,EAAE,KAAK;EAAE,OAAO;EAAgB,QAAQ;CAAgB,GAAG,GAAG,EAAE;CAChG,IAAI,CAAC,OAAO,OACV,OAAO,EACL,UAAU,EAAE,KACV;EACE,OAAO;EACP,SAAS;CACX,GACA,GACF,EACF;CAEF,OAAO,EAAE,QAAQ;EAAE,OAAO,OAAO;EAAO,QAAQ,OAAO;CAAO,EAAE;AAClE;AAEA,eAAe,yBACb,gBACA,OACA,qBAC2C;CAC3C,MAAM,WACJ,MAAM,QAAQ,IACZ,eAAe,IAAI,OAAM,kBAAiB;EACxC,MAAM,UAAU,MAAM,cAAc,oBAAoB,IAAI;GAAE;GAAO,IAAI;EAAoB,CAAC;EAC9F,IAAI,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;IAC1C,eAAe,IAAI,QAAQ;KAAE,UAAU,IAAI;KAAQ,gBAAgB,IAAI;IAAM,CAAC;IAC9E,IAAI;KACF,MAAM,QAAQ,MAAM,YAAY,WAAW,YAAY;MACrD,MAAM,YAAY,MAAM,QAAQ,WAAY,oBAAoB;OAC9D,UAAU,OAAO;OACjB,YAAY;OACZ;OACA,GAAI,QAAQ,kBAAkB,EAAE,OAAO,WAAW,OAAO,eAAe,EAAE,IAAI,CAAC;MACjF,CAAC;MACD,MAAM,QAAQ,YAAY,sBAAsB,SAAS,IAAI;MAC7D,IAAI,OAAO,MAAM,MAAM,cAAc,SAAS,OAAO;OAAE;OAAW,OAAO;MAAM,CAAC;MAChF,OAAO;KACT,CAAC;KACD,IAAI,CAAC,OAAO,OAAO,EAAE,KAAK,EAAE,OAAO,gDAAgD,GAAG,GAAG;KACzF,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC;IACzB,SAAS,OAAO;KACd,OAAO,EAAE,KAAK,EAAE,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,GAAG,GAAG;IACtF;GACF;EACF,CAAC;CACH;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiRoute } from '@mastra/core/server';
|
|
2
|
+
import type { SourceControlStorageHandle } from '../storage/domains/source-control/base.js';
|
|
3
|
+
import type { RouteAuth } from './route.js';
|
|
4
|
+
interface SourceControlSettingsRoutesOptions {
|
|
5
|
+
auth: RouteAuth;
|
|
6
|
+
sourceControls: readonly SourceControlStorageHandle[];
|
|
7
|
+
}
|
|
8
|
+
export declare function buildSourceControlSettingsRoutes(options: SourceControlSettingsRoutesOptions): ApiRoute[];
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=source-control-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-control-settings.d.ts","sourceRoot":"","sources":["../../src/routes/source-control-settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD,OAAO,KAAK,EAAqB,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC/G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,UAAU,kCAAkC;IAC1C,IAAI,EAAE,SAAS,CAAC;IAChB,cAAc,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACvD;AAuCD,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,kCAAkC,GAAG,QAAQ,EAAE,CAwDxG"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { registerApiRoute } from "@mastra/core/server";
|
|
2
|
+
//#region src/routes/source-control-settings.ts
|
|
3
|
+
async function loadRepository(c, options) {
|
|
4
|
+
await options.auth.ensureUser(c);
|
|
5
|
+
const tenant = options.auth.tenant(c);
|
|
6
|
+
if (!tenant) return c.json({ error: "unauthorized" }, 401);
|
|
7
|
+
const orgId = tenant.orgId;
|
|
8
|
+
if (!orgId) return c.json({ error: "organization_required" }, 403);
|
|
9
|
+
const id = c.req.param("id");
|
|
10
|
+
if (!id) return c.json({ error: "project_repository_not_found" }, 404);
|
|
11
|
+
const matches = (await Promise.all(options.sourceControls.map(async (sourceControl) => {
|
|
12
|
+
const repository = await sourceControl.projectRepositories.get({
|
|
13
|
+
orgId,
|
|
14
|
+
id
|
|
15
|
+
});
|
|
16
|
+
return repository ? {
|
|
17
|
+
sourceControl,
|
|
18
|
+
repository,
|
|
19
|
+
orgId
|
|
20
|
+
} : null;
|
|
21
|
+
}))).filter((match) => match !== null);
|
|
22
|
+
if (matches.length > 1) return c.json({ error: "ambiguous_project_repository" }, 409);
|
|
23
|
+
return matches[0] ?? c.json({ error: "project_repository_not_found" }, 404);
|
|
24
|
+
}
|
|
25
|
+
function commandFromBody(body, key) {
|
|
26
|
+
const value = body[key];
|
|
27
|
+
if (value === void 0) return void 0;
|
|
28
|
+
if (typeof value === "string") return value.trim() || null;
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
function buildSourceControlSettingsRoutes(options) {
|
|
32
|
+
const path = "/web/source-control/projects/:id/settings";
|
|
33
|
+
return [registerApiRoute(path, {
|
|
34
|
+
method: "GET",
|
|
35
|
+
requiresAuth: false,
|
|
36
|
+
handler: async (raw) => {
|
|
37
|
+
const c = raw;
|
|
38
|
+
const loaded = await loadRepository(c, options);
|
|
39
|
+
if (loaded instanceof Response) return loaded;
|
|
40
|
+
return c.json({
|
|
41
|
+
setupCommand: loaded.repository.setupCommand,
|
|
42
|
+
teardownCommand: loaded.repository.teardownCommand
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}), registerApiRoute(path, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
requiresAuth: false,
|
|
48
|
+
handler: async (raw) => {
|
|
49
|
+
const c = raw;
|
|
50
|
+
const loaded = await loadRepository(c, options);
|
|
51
|
+
if (loaded instanceof Response) return loaded;
|
|
52
|
+
let body;
|
|
53
|
+
try {
|
|
54
|
+
body = await c.req.json();
|
|
55
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) throw new Error("Invalid JSON body");
|
|
56
|
+
} catch {
|
|
57
|
+
return c.json({ error: "Invalid JSON body" }, 400);
|
|
58
|
+
}
|
|
59
|
+
for (const key of ["setupCommand", "teardownCommand"]) {
|
|
60
|
+
const value = body[key];
|
|
61
|
+
if (value === void 0) continue;
|
|
62
|
+
if (value !== null && typeof value !== "string") return c.json({ error: `Invalid ${key}` }, 400);
|
|
63
|
+
if (typeof value === "string" && value.length > 2e3) return c.json({ error: `${key} too long (max 2000 characters)` }, 400);
|
|
64
|
+
if (typeof value === "string" && /[\0-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(value)) return c.json({ error: `${key} contains control characters` }, 400);
|
|
65
|
+
}
|
|
66
|
+
const setupCommand = commandFromBody(body, "setupCommand");
|
|
67
|
+
const teardownCommand = commandFromBody(body, "teardownCommand");
|
|
68
|
+
const saved = await loaded.sourceControl.projectRepositories.update({
|
|
69
|
+
orgId: loaded.orgId,
|
|
70
|
+
id: loaded.repository.id,
|
|
71
|
+
input: {
|
|
72
|
+
...setupCommand !== void 0 ? { setupCommand } : {},
|
|
73
|
+
...teardownCommand !== void 0 ? { teardownCommand } : {}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
if (!saved) return c.json({ error: "project_repository_not_found" }, 404);
|
|
77
|
+
return c.json({
|
|
78
|
+
setupCommand: saved.setupCommand,
|
|
79
|
+
teardownCommand: saved.teardownCommand
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
})];
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { buildSourceControlSettingsRoutes };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=source-control-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-control-settings.js","names":[],"sources":["../../src/routes/source-control-settings.ts"],"sourcesContent":["import type { ApiRoute } from '@mastra/core/server';\nimport { registerApiRoute } from '@mastra/core/server';\nimport type { Context } from 'hono';\n\nimport type { ProjectRepository, SourceControlStorageHandle } from '../storage/domains/source-control/base.js';\nimport type { RouteAuth } from './route.js';\n\ninterface SourceControlSettingsRoutesOptions {\n auth: RouteAuth;\n sourceControls: readonly SourceControlStorageHandle[];\n}\n\nasync function loadRepository(\n c: Context,\n options: SourceControlSettingsRoutesOptions,\n): Promise<{ sourceControl: SourceControlStorageHandle; repository: ProjectRepository; orgId: string } | Response> {\n await options.auth.ensureUser(c);\n const tenant = options.auth.tenant(c);\n if (!tenant) return c.json({ error: 'unauthorized' }, 401);\n const orgId = tenant.orgId;\n if (!orgId) return c.json({ error: 'organization_required' }, 403);\n\n const id = c.req.param('id');\n if (!id) return c.json({ error: 'project_repository_not_found' }, 404);\n const matches = (\n await Promise.all(\n options.sourceControls.map(async sourceControl => {\n const repository = await sourceControl.projectRepositories.get({ orgId, id });\n return repository ? { sourceControl, repository, orgId } : null;\n }),\n )\n ).filter(\n (match): match is { sourceControl: SourceControlStorageHandle; repository: ProjectRepository; orgId: string } =>\n match !== null,\n );\n if (matches.length > 1) return c.json({ error: 'ambiguous_project_repository' }, 409);\n return matches[0] ?? c.json({ error: 'project_repository_not_found' }, 404);\n}\n\nfunction commandFromBody(\n body: Record<string, unknown>,\n key: 'setupCommand' | 'teardownCommand',\n): string | null | undefined {\n const value = body[key];\n if (value === undefined) return undefined;\n if (typeof value === 'string') return value.trim() || null;\n return null;\n}\n\nexport function buildSourceControlSettingsRoutes(options: SourceControlSettingsRoutesOptions): ApiRoute[] {\n const path = '/web/source-control/projects/:id/settings';\n return [\n registerApiRoute(path, {\n method: 'GET',\n requiresAuth: false,\n handler: async raw => {\n const c = raw as Context;\n const loaded = await loadRepository(c, options);\n if (loaded instanceof Response) return loaded;\n return c.json({\n setupCommand: loaded.repository.setupCommand,\n teardownCommand: loaded.repository.teardownCommand,\n });\n },\n }),\n registerApiRoute(path, {\n method: 'POST',\n requiresAuth: false,\n handler: async raw => {\n const c = raw as Context;\n const loaded = await loadRepository(c, options);\n if (loaded instanceof Response) return loaded;\n let body: Record<string, unknown>;\n try {\n body = await c.req.json();\n if (!body || typeof body !== 'object' || Array.isArray(body)) throw new Error('Invalid JSON body');\n } catch {\n return c.json({ error: 'Invalid JSON body' }, 400);\n }\n\n for (const key of ['setupCommand', 'teardownCommand'] as const) {\n const value = body[key];\n if (value === undefined) continue;\n if (value !== null && typeof value !== 'string') return c.json({ error: `Invalid ${key}` }, 400);\n if (typeof value === 'string' && value.length > 2000)\n return c.json({ error: `${key} too long (max 2000 characters)` }, 400);\n if (typeof value === 'string' && /[\\0-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/.test(value))\n return c.json({ error: `${key} contains control characters` }, 400);\n }\n\n const setupCommand = commandFromBody(body, 'setupCommand');\n const teardownCommand = commandFromBody(body, 'teardownCommand');\n const saved = await loaded.sourceControl.projectRepositories.update({\n orgId: loaded.orgId,\n id: loaded.repository.id,\n input: {\n ...(setupCommand !== undefined ? { setupCommand } : {}),\n ...(teardownCommand !== undefined ? { teardownCommand } : {}),\n },\n });\n if (!saved) return c.json({ error: 'project_repository_not_found' }, 404);\n return c.json({ setupCommand: saved.setupCommand, teardownCommand: saved.teardownCommand });\n },\n }),\n ];\n}\n"],"mappings":";;AAYA,eAAe,eACb,GACA,SACiH;CACjH,MAAM,QAAQ,KAAK,WAAW,CAAC;CAC/B,MAAM,SAAS,QAAQ,KAAK,OAAO,CAAC;CACpC,IAAI,CAAC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,eAAe,GAAG,GAAG;CACzD,MAAM,QAAQ,OAAO;CACrB,IAAI,CAAC,OAAO,OAAO,EAAE,KAAK,EAAE,OAAO,wBAAwB,GAAG,GAAG;CAEjE,MAAM,KAAK,EAAE,IAAI,MAAM,IAAI;CAC3B,IAAI,CAAC,IAAI,OAAO,EAAE,KAAK,EAAE,OAAO,+BAA+B,GAAG,GAAG;CACrE,MAAM,WACJ,MAAM,QAAQ,IACZ,QAAQ,eAAe,IAAI,OAAM,kBAAiB;EAChD,MAAM,aAAa,MAAM,cAAc,oBAAoB,IAAI;GAAE;GAAO;EAAG,CAAC;EAC5E,OAAO,aAAa;GAAE;GAAe;GAAY;EAAM,IAAI;CAC7D,CAAC,CACH,EAAA,CACA,QACC,UACC,UAAU,IACd;CACA,IAAI,QAAQ,SAAS,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,+BAA+B,GAAG,GAAG;CACpF,OAAO,QAAQ,MAAM,EAAE,KAAK,EAAE,OAAO,+BAA+B,GAAG,GAAG;AAC5E;AAEA,SAAS,gBACP,MACA,KAC2B;CAC3B,MAAM,QAAQ,KAAK;CACnB,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;CAChC,IAAI,OAAO,UAAU,UAAU,OAAO,MAAM,KAAK,KAAK;CACtD,OAAO;AACT;AAEA,SAAgB,iCAAiC,SAAyD;CACxG,MAAM,OAAO;CACb,OAAO,CACL,iBAAiB,MA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IACd,IAAI,OAAO,WAAW;IACtB,OAAO;KACL,GAAI,iBAAiB,KAAA,IAAY,EAAE,aAAa,IAAI,CAAC;KACrD,GAAI,oBAAoB,KAAA,IAAY,EAAE,gBAAgB,IAAI,CAAC;IAC7D;GACF,CAAC;GACD,IAAI,CAAC,OAAO,OAAO,EAAE,KAAK,EAAE,OAAO,+BAA+B,GAAG,GAAG;GACxE,OAAO,EAAE,KAAK;IAAE,cAAc,MAAM;IAAc,iBAAiB,MAAM;GAAgB,CAAC;EAC5F;CACF,CAAC,CACH;AACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supervisor routes: the per-factory supervisor session address and the
|
|
3
|
+
* deterministic health check the supervisor page pins above its transcript.
|
|
4
|
+
*
|
|
5
|
+
* Mounted from {@link WorkItemRoutes} so they share its tenant + project
|
|
6
|
+
* resolution: a caller can only address a supervisor for a project their org
|
|
7
|
+
* owns.
|
|
8
|
+
*/
|
|
9
|
+
import type { ApiRoute } from '@mastra/core/server';
|
|
10
|
+
import type { BoardRegistry } from '../boards/index.js';
|
|
11
|
+
import type { WorkItemsStorage } from '../storage/domains/work-items/base.js';
|
|
12
|
+
interface SupervisorRouteDependencies {
|
|
13
|
+
workItems: WorkItemsStorage;
|
|
14
|
+
boards: BoardRegistry;
|
|
15
|
+
resolveProject(context: unknown): Promise<{
|
|
16
|
+
orgId: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
factoryProjectId: string;
|
|
19
|
+
} | {
|
|
20
|
+
response: Response;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildSupervisorRoutes(dependencies: SupervisorRouteDependencies): ApiRoute[];
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=supervisor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../src/routes/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAK9E,UAAU,2BAA2B;IACnC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,CACZ,OAAO,EAAE,OAAO,GACf,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC;CAClG;AAED,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,2BAA2B,GAAG,QAAQ,EAAE,CA+B3F"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { supervisorResourceId, supervisorThreadId } from "../supervisor/session.js";
|
|
2
|
+
import { FACTORY_ROUTE_CONTRACTS } from "./contracts.js";
|
|
3
|
+
import { runFactoryHealthCheck } from "../supervisor/health.js";
|
|
4
|
+
import { registerApiRoute } from "@mastra/core/server";
|
|
5
|
+
//#region src/routes/supervisor.ts
|
|
6
|
+
function buildSupervisorRoutes(dependencies) {
|
|
7
|
+
const { workItems, boards } = dependencies;
|
|
8
|
+
return [registerApiRoute(FACTORY_ROUTE_CONTRACTS.supervisorSession.path, {
|
|
9
|
+
method: FACTORY_ROUTE_CONTRACTS.supervisorSession.method,
|
|
10
|
+
requiresAuth: false,
|
|
11
|
+
handler: async (context) => {
|
|
12
|
+
const resolved = await dependencies.resolveProject(context);
|
|
13
|
+
if ("response" in resolved) return resolved.response;
|
|
14
|
+
return context.json({
|
|
15
|
+
sessionId: supervisorResourceId(resolved.factoryProjectId),
|
|
16
|
+
threadId: supervisorThreadId(resolved.factoryProjectId),
|
|
17
|
+
factoryProjectId: resolved.factoryProjectId
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}), registerApiRoute(FACTORY_ROUTE_CONTRACTS.supervisorHealth.path, {
|
|
21
|
+
method: FACTORY_ROUTE_CONTRACTS.supervisorHealth.method,
|
|
22
|
+
requiresAuth: false,
|
|
23
|
+
handler: async (context) => {
|
|
24
|
+
const resolved = await dependencies.resolveProject(context);
|
|
25
|
+
if ("response" in resolved) return resolved.response;
|
|
26
|
+
await workItems.ensureReady();
|
|
27
|
+
const report = await runFactoryHealthCheck(workItems, boards, resolved);
|
|
28
|
+
return context.json(report);
|
|
29
|
+
}
|
|
30
|
+
})];
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { buildSupervisorRoutes };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=supervisor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervisor.js","names":[],"sources":["../../src/routes/supervisor.ts"],"sourcesContent":["/**\n * Supervisor routes: the per-factory supervisor session address and the\n * deterministic health check the supervisor page pins above its transcript.\n *\n * Mounted from {@link WorkItemRoutes} so they share its tenant + project\n * resolution: a caller can only address a supervisor for a project their org\n * owns.\n */\n\nimport type { ApiRoute } from '@mastra/core/server';\nimport { registerApiRoute } from '@mastra/core/server';\n\nimport type { BoardRegistry } from '../boards/index.js';\nimport type { WorkItemsStorage } from '../storage/domains/work-items/base.js';\nimport { runFactoryHealthCheck } from '../supervisor/health.js';\nimport { supervisorResourceId, supervisorThreadId } from '../supervisor/session.js';\nimport { FACTORY_ROUTE_CONTRACTS } from './contracts.js';\n\ninterface SupervisorRouteDependencies {\n workItems: WorkItemsStorage;\n boards: BoardRegistry;\n resolveProject(\n context: unknown,\n ): Promise<{ orgId: string; userId: string; factoryProjectId: string } | { response: Response }>;\n}\n\nexport function buildSupervisorRoutes(dependencies: SupervisorRouteDependencies): ApiRoute[] {\n const { workItems, boards } = dependencies;\n return [\n // The session is addressed deterministically and created lazily by the\n // agent controller on first reach (see hydrateSupervisorSession), so\n // \"ensure\" only has to hand back the address once ownership is verified.\n registerApiRoute(FACTORY_ROUTE_CONTRACTS.supervisorSession.path, {\n method: FACTORY_ROUTE_CONTRACTS.supervisorSession.method,\n requiresAuth: false,\n handler: async context => {\n const resolved = await dependencies.resolveProject(context);\n if ('response' in resolved) return resolved.response;\n return context.json({\n sessionId: supervisorResourceId(resolved.factoryProjectId),\n threadId: supervisorThreadId(resolved.factoryProjectId),\n factoryProjectId: resolved.factoryProjectId,\n });\n },\n }),\n registerApiRoute(FACTORY_ROUTE_CONTRACTS.supervisorHealth.path, {\n method: FACTORY_ROUTE_CONTRACTS.supervisorHealth.method,\n requiresAuth: false,\n handler: async context => {\n const resolved = await dependencies.resolveProject(context);\n if ('response' in resolved) return resolved.response;\n await workItems.ensureReady();\n const report = await runFactoryHealthCheck(workItems, boards, resolved);\n return context.json(report);\n },\n }),\n ];\n}\n"],"mappings":";;;;;AA0BA,SAAgB,sBAAsB,cAAuD;CAC3F,MAAM,EAAE,WAAW,WAAW;CAC9B,OAAO,CAIL,iBAAiB,wBAAwB,kBAAkB,MAAM;EAC/D,QAAQ,wBAAwB,kBAAkB;EAClD,cAAc;EACd,SAAS,OAAM,YAAW;GACxB,MAAM,WAAW,MAAM,aAAa,eAAe,OAAO;GAC1D,IAAI,cAAc,UAAU,OAAO,SAAS;GAC5C,OAAO,QAAQ,KAAK;IAClB,WAAW,qBAAqB,SAAS,gBAAgB;IACzD,UAAU,mBAAmB,SAAS,gBAAgB;IACtD,kBAAkB,SAAS;GAC7B,CAAC;EACH;CACF,CAAC,GACD,iBAAiB,wBAAwB,iBAAiB,MAAM;EAC9D,QAAQ,wBAAwB,iBAAiB;EACjD,cAAc;EACd,SAAS,OAAM,YAAW;GACxB,MAAM,WAAW,MAAM,aAAa,eAAe,OAAO;GAC1D,IAAI,cAAc,UAAU,OAAO,SAAS;GAC5C,MAAM,UAAU,YAAY;GAC5B,MAAM,SAAS,MAAM,sBAAsB,WAAW,QAAQ,QAAQ;GACtE,OAAO,QAAQ,KAAK,MAAM;EAC5B;CACF,CAAC,CACH;AACF"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { AuthStorage } from '@mastra/code-sdk/auth/storage';
|
|
2
|
+
import type { MastraCodeState } from '@mastra/code-sdk/schema';
|
|
3
|
+
import type { AgentController } from '@mastra/core/agent-controller';
|
|
4
|
+
import type { ApiRoute, IUserProvider } from '@mastra/core/server';
|
|
5
|
+
import type { FactoryStorage } from '@mastra/core/storage';
|
|
6
|
+
import type { FactorySandbox } from '@mastra/core/workspace';
|
|
7
|
+
import type { BoardRegistry } from '../boards/index.js';
|
|
8
|
+
import type { FactoryIntegration, IntegrationContext, IntegrationHooks } from '../integrations/base.js';
|
|
9
|
+
import type { GithubIntegration } from '../integrations/github/integration.js';
|
|
10
|
+
import type { FactoryBindingPreparationInput } from '../rules/dispatcher.js';
|
|
11
|
+
import { FactoryStartCoordinator } from '../rules/start-coordinator.js';
|
|
12
|
+
import { FactoryTransitionService } from '../rules/transition-service.js';
|
|
13
|
+
import type { LiveSessions } from '../session/live-sessions.js';
|
|
14
|
+
import type { StateSigner } from '../state-signing.js';
|
|
15
|
+
import type { AuditEmitter, AuditRecorder } from '../storage/domains/audit/domain.js';
|
|
16
|
+
import type { ChannelIdentityStorage } from '../storage/domains/channel-identity/base.js';
|
|
17
|
+
import type { WorkItemCommentsStorage } from '../storage/domains/comments/base.js';
|
|
18
|
+
import type { CommentsDomain } from '../storage/domains/comments/domain.js';
|
|
19
|
+
import type { ModelCredentialsStorage } from '../storage/domains/credentials/base.js';
|
|
20
|
+
import type { CustomProvidersStorage } from '../storage/domains/custom-providers/base.js';
|
|
21
|
+
import type { FilesystemStorage } from '../storage/domains/filesystem/base.js';
|
|
22
|
+
import type { IntakeStorage } from '../storage/domains/intake/base.js';
|
|
23
|
+
import type { IntegrationStorage } from '../storage/domains/integrations/base.js';
|
|
24
|
+
import type { MemorySettingsStorage } from '../storage/domains/memory-settings/base.js';
|
|
25
|
+
import type { ModelDefaultsStorage } from '../storage/domains/model-defaults/base.js';
|
|
26
|
+
import type { FactoryProjectsStorage } from '../storage/domains/projects/base.js';
|
|
27
|
+
import type { QueueHealthStorage } from '../storage/domains/queue-health/base.js';
|
|
28
|
+
import { type SourceControlStorage, type SourceControlStorageHandle } from '../storage/domains/source-control/base.js';
|
|
29
|
+
import { type WorkItemsStorage } from '../storage/domains/work-items/base.js';
|
|
30
|
+
import type { RouteAuth } from './route.js';
|
|
31
|
+
export interface IntegrationRegistration {
|
|
32
|
+
integration: FactoryIntegration;
|
|
33
|
+
ready: boolean;
|
|
34
|
+
ensureReady: () => Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export interface FactoryApiRoutesDeps {
|
|
37
|
+
controllerId: string;
|
|
38
|
+
controller: AgentController<MastraCodeState>;
|
|
39
|
+
/** Registry of the sessions this process holds, owned by the host so it can watch them too. */
|
|
40
|
+
liveSessions: LiveSessions;
|
|
41
|
+
/** Request-auth seam threaded from the host (no service locator). */
|
|
42
|
+
auth: RouteAuth;
|
|
43
|
+
/** Optional user directory for resolving persisted owners to display profiles. */
|
|
44
|
+
users?: Pick<IUserProvider, 'getUser' | 'getUsers'>;
|
|
45
|
+
authStorage: AuthStorage;
|
|
46
|
+
audit: AuditEmitter & AuditRecorder;
|
|
47
|
+
fsRoot?: string;
|
|
48
|
+
publicOrigin: string;
|
|
49
|
+
stateSigner?: StateSigner;
|
|
50
|
+
/** Sandbox surface (enablement, provider label, create callback). */
|
|
51
|
+
sandbox?: FactorySandbox;
|
|
52
|
+
/** Push hand-off for environment builds, present when the sandbox can build templates. */
|
|
53
|
+
onRepositoryPush?: IntegrationHooks['onRepositoryPush'];
|
|
54
|
+
/** Root factory storage backend (distributed locks, app-db diagnostics). */
|
|
55
|
+
factoryStorage?: FactoryStorage;
|
|
56
|
+
integrationStorage: IntegrationStorage;
|
|
57
|
+
sourceControlStorage: SourceControlStorage;
|
|
58
|
+
/** App-table domain handles, registered and owned by `MastraFactory.prepare()`. */
|
|
59
|
+
domains: {
|
|
60
|
+
intake: IntakeStorage;
|
|
61
|
+
modelCredentials: ModelCredentialsStorage;
|
|
62
|
+
memorySettings: MemorySettingsStorage;
|
|
63
|
+
customProviders: CustomProvidersStorage;
|
|
64
|
+
filesystem: FilesystemStorage;
|
|
65
|
+
modelDefaults: ModelDefaultsStorage;
|
|
66
|
+
projects: FactoryProjectsStorage;
|
|
67
|
+
queueHealth: QueueHealthStorage;
|
|
68
|
+
workItems: WorkItemsStorage;
|
|
69
|
+
channelIdentity: ChannelIdentityStorage;
|
|
70
|
+
comments: WorkItemCommentsStorage;
|
|
71
|
+
};
|
|
72
|
+
integrations?: IntegrationRegistration[];
|
|
73
|
+
intakeReady: boolean;
|
|
74
|
+
factoryReady: boolean;
|
|
75
|
+
knowledgeEnabled: boolean;
|
|
76
|
+
/** Organization this deployment serves; its admins may edit deployment-wide settings. */
|
|
77
|
+
deploymentOrganizationId?: string;
|
|
78
|
+
/** Providers the operator opted in to run on the server process's own credentials. */
|
|
79
|
+
deploymentModelProviders?: ReadonlySet<string>;
|
|
80
|
+
knowledgeKey?: string;
|
|
81
|
+
/** Resolved Factory rule set, threaded from the host (no service locator). */
|
|
82
|
+
configVersion: string;
|
|
83
|
+
/** Boards installed for this Factory instance. */
|
|
84
|
+
boardRegistry: BoardRegistry;
|
|
85
|
+
/** Work-item feed service, handed to integrations that ingest platform messages. */
|
|
86
|
+
feed: CommentsDomain;
|
|
87
|
+
factoryTransitionService?: FactoryTransitionService;
|
|
88
|
+
sessionRetirement?: import('../sandbox/session-retirement.js').SessionRetirementCoordinator;
|
|
89
|
+
onFactoryRuntime?: (runtime: {
|
|
90
|
+
transitionService: FactoryTransitionService;
|
|
91
|
+
prepareBinding?: (input: FactoryBindingPreparationInput) => Promise<void>;
|
|
92
|
+
}) => void;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Start a factory run for a rule binding: ensure the source-control session the
|
|
96
|
+
* coordinator requires, then hand it to `prepare` along with the factory's
|
|
97
|
+
* default model. Exported for tests — this is the autonomous entry point with no
|
|
98
|
+
* browser and no interactive user, so nothing else would catch a regression in
|
|
99
|
+
* what it forwards.
|
|
100
|
+
*/
|
|
101
|
+
export declare function prepareFactoryRuleBinding(sourceControlProvider: SourceControlStorageHandle | Pick<GithubIntegration, 'sourceControlStorage'>, coordinator: Pick<FactoryStartCoordinator, 'prepare'>, projects: FactoryProjectsStorage, boards: BoardRegistry, input: FactoryBindingPreparationInput, intake?: Pick<IntakeStorage, 'getConfig'>): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Build the {@link IntegrationContext} handed to an integration when the
|
|
104
|
+
* factory collects its capabilities (routes, workers). One shape everywhere:
|
|
105
|
+
* `assembleFactoryApiRoutes` uses it per registration, and `MastraFactory` uses it
|
|
106
|
+
* when collecting integration workers at finalize.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildIntegrationContext(deps: Pick<FactoryApiRoutesDeps, 'controller' | 'publicOrigin' | 'auth' | 'sandbox' | 'users' | 'factoryStorage' | 'integrationStorage' | 'sourceControlStorage' | 'integrations'> & {
|
|
109
|
+
stateSigner: StateSigner;
|
|
110
|
+
emitAudit?: AuditEmitter['emit'];
|
|
111
|
+
onRepositoryPush?: IntegrationHooks['onRepositoryPush'];
|
|
112
|
+
configVersion: string;
|
|
113
|
+
boardRegistry: BoardRegistry;
|
|
114
|
+
factoryReady: boolean;
|
|
115
|
+
/** Work-item feed service, so a channel integration can ingest platform messages. */
|
|
116
|
+
feed: CommentsDomain;
|
|
117
|
+
domains: Pick<FactoryApiRoutesDeps['domains'], 'projects' | 'intake' | 'workItems' | 'channelIdentity' | 'memorySettings' | 'modelDefaults'>;
|
|
118
|
+
/**
|
|
119
|
+
* Stable id of the registered source-control-owning integration (today:
|
|
120
|
+
* `'github'` when registered). Every call site must derive and pass it so
|
|
121
|
+
* `routes()`, `channels()`, and `workers()` all see the same context shape.
|
|
122
|
+
*/
|
|
123
|
+
sourceControlOwnerId?: string;
|
|
124
|
+
}, integrationId: string): IntegrationContext;
|
|
125
|
+
/**
|
|
126
|
+
* Assemble the custom `/web/*` API routes as Mastra `server.apiRoutes`:
|
|
127
|
+
* - fs browser routes (project picker), confined to `fsRoot`
|
|
128
|
+
* - config routes (provider/API-key/default-model/OM management)
|
|
129
|
+
* - every registered integration's `routes()` surface (full set when ready,
|
|
130
|
+
* disabled-status stub otherwise), plus stubs for absent known ids
|
|
131
|
+
*/
|
|
132
|
+
export declare function assembleFactoryApiRoutes(deps: FactoryApiRoutesDeps): ApiRoute[];
|
|
133
|
+
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/routes/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAQ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