@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,268 @@
|
|
|
1
|
+
import type { FactoryRepositoryAccess } from '@mastra/core/workspace';
|
|
2
|
+
import type { SourceControlInstallation, SourceControlRepository, SourceControlStorageHandle } from '../storage/domains/source-control/base.js';
|
|
3
|
+
import type { IntegrationConnection } from './connection.js';
|
|
4
|
+
export interface InstallationInput {
|
|
5
|
+
externalId: string;
|
|
6
|
+
accountName?: string | null;
|
|
7
|
+
accountType?: string | null;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface RepositoryInput {
|
|
11
|
+
externalId: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
defaultBranch: string;
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export type RepositoryAccess = FactoryRepositoryAccess;
|
|
17
|
+
export interface RepositoryTarget {
|
|
18
|
+
connection: IntegrationConnection;
|
|
19
|
+
sourceId: string;
|
|
20
|
+
}
|
|
21
|
+
export type PullRequestState = 'open' | 'closed';
|
|
22
|
+
export interface PullRequest {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
url: string;
|
|
26
|
+
author: string | null;
|
|
27
|
+
assignees?: string[];
|
|
28
|
+
requestedReviewers?: string[];
|
|
29
|
+
labels?: string[];
|
|
30
|
+
body: string | null;
|
|
31
|
+
state: PullRequestState;
|
|
32
|
+
draft: boolean;
|
|
33
|
+
merged: boolean;
|
|
34
|
+
mergeable: boolean | null;
|
|
35
|
+
baseBranch: string;
|
|
36
|
+
headBranch: string;
|
|
37
|
+
headSha: string;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
export interface PullRequestPage {
|
|
42
|
+
pullRequests: PullRequest[];
|
|
43
|
+
nextCursor: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface PullRequestRef {
|
|
46
|
+
connection: IntegrationConnection;
|
|
47
|
+
sourceId: string;
|
|
48
|
+
pullRequestId: string;
|
|
49
|
+
/** End user the write should be attributed to, when the provider supports acting on a user's behalf. */
|
|
50
|
+
actingUserId?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ListPullRequestsInput {
|
|
53
|
+
connection: IntegrationConnection;
|
|
54
|
+
sourceId: string;
|
|
55
|
+
state?: PullRequestState | 'all';
|
|
56
|
+
includeDrafts?: boolean;
|
|
57
|
+
cursor?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface CreatePullRequestInput {
|
|
60
|
+
connection: IntegrationConnection;
|
|
61
|
+
sourceId: string;
|
|
62
|
+
title: string;
|
|
63
|
+
body?: string;
|
|
64
|
+
baseBranch: string;
|
|
65
|
+
headBranch: string;
|
|
66
|
+
draft?: boolean;
|
|
67
|
+
/** End user the write should be attributed to, when the provider supports acting on a user's behalf. */
|
|
68
|
+
actingUserId?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface UpdatePullRequestInput extends PullRequestRef {
|
|
71
|
+
title?: string;
|
|
72
|
+
body?: string | null;
|
|
73
|
+
baseBranch?: string;
|
|
74
|
+
state?: PullRequestState;
|
|
75
|
+
}
|
|
76
|
+
export interface MergePullRequestInput extends PullRequestRef {
|
|
77
|
+
commitTitle?: string;
|
|
78
|
+
commitMessage?: string;
|
|
79
|
+
method?: 'merge' | 'squash' | 'rebase';
|
|
80
|
+
}
|
|
81
|
+
export interface MergePullRequestResult {
|
|
82
|
+
merged: boolean;
|
|
83
|
+
message: string;
|
|
84
|
+
sha: string | null;
|
|
85
|
+
}
|
|
86
|
+
export interface PullRequestComment {
|
|
87
|
+
id: string;
|
|
88
|
+
url: string;
|
|
89
|
+
author: string | null;
|
|
90
|
+
body: string;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
}
|
|
94
|
+
export interface PullRequestCommentPage {
|
|
95
|
+
comments: PullRequestComment[];
|
|
96
|
+
nextCursor: string | null;
|
|
97
|
+
}
|
|
98
|
+
export interface ListPullRequestCommentsInput extends PullRequestRef {
|
|
99
|
+
cursor?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface CreatePullRequestCommentInput extends PullRequestRef {
|
|
102
|
+
body: string;
|
|
103
|
+
}
|
|
104
|
+
export interface UpdatePullRequestCommentInput {
|
|
105
|
+
connection: IntegrationConnection;
|
|
106
|
+
sourceId: string;
|
|
107
|
+
commentId: string;
|
|
108
|
+
body: string;
|
|
109
|
+
actingUserId?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface DeletePullRequestCommentInput {
|
|
112
|
+
connection: IntegrationConnection;
|
|
113
|
+
sourceId: string;
|
|
114
|
+
commentId: string;
|
|
115
|
+
actingUserId?: string;
|
|
116
|
+
}
|
|
117
|
+
export type ReviewState = 'pending' | 'commented' | 'approved' | 'changes-requested' | 'dismissed';
|
|
118
|
+
export interface Review {
|
|
119
|
+
id: string;
|
|
120
|
+
url: string | null;
|
|
121
|
+
author: string | null;
|
|
122
|
+
body: string | null;
|
|
123
|
+
state: ReviewState;
|
|
124
|
+
commitId: string | null;
|
|
125
|
+
submittedAt: string | null;
|
|
126
|
+
}
|
|
127
|
+
export interface ReviewPage {
|
|
128
|
+
reviews: Review[];
|
|
129
|
+
nextCursor: string | null;
|
|
130
|
+
}
|
|
131
|
+
export interface ListReviewsInput extends PullRequestRef {
|
|
132
|
+
cursor?: string;
|
|
133
|
+
}
|
|
134
|
+
type CreateReviewBase = PullRequestRef & {
|
|
135
|
+
commitId?: string;
|
|
136
|
+
};
|
|
137
|
+
type ReviewSubmission = {
|
|
138
|
+
event: 'approve';
|
|
139
|
+
body?: string;
|
|
140
|
+
} | {
|
|
141
|
+
event: 'request-changes' | 'comment';
|
|
142
|
+
body: string;
|
|
143
|
+
};
|
|
144
|
+
export type CreateReviewInput = CreateReviewBase & (ReviewSubmission | {
|
|
145
|
+
event?: undefined;
|
|
146
|
+
body?: string;
|
|
147
|
+
});
|
|
148
|
+
export interface ReviewRef extends PullRequestRef {
|
|
149
|
+
reviewId: string;
|
|
150
|
+
}
|
|
151
|
+
export interface UpdateReviewInput extends ReviewRef {
|
|
152
|
+
body: string;
|
|
153
|
+
}
|
|
154
|
+
export type SubmitReviewInput = ReviewRef & ReviewSubmission;
|
|
155
|
+
export interface DismissReviewInput extends ReviewRef {
|
|
156
|
+
message: string;
|
|
157
|
+
}
|
|
158
|
+
export interface ReviewComment extends PullRequestComment {
|
|
159
|
+
path: string;
|
|
160
|
+
line: number | null;
|
|
161
|
+
side: 'left' | 'right' | null;
|
|
162
|
+
commitId: string;
|
|
163
|
+
replyToId: string | null;
|
|
164
|
+
}
|
|
165
|
+
export interface ReviewCommentPage {
|
|
166
|
+
comments: ReviewComment[];
|
|
167
|
+
nextCursor: string | null;
|
|
168
|
+
}
|
|
169
|
+
export interface ListReviewCommentsInput extends PullRequestRef {
|
|
170
|
+
cursor?: string;
|
|
171
|
+
}
|
|
172
|
+
interface CreateReviewCommentBase extends PullRequestRef {
|
|
173
|
+
body: string;
|
|
174
|
+
}
|
|
175
|
+
export type CreateReviewCommentInput = CreateReviewCommentBase & ({
|
|
176
|
+
replyToId: string;
|
|
177
|
+
commitId?: never;
|
|
178
|
+
path?: never;
|
|
179
|
+
line?: never;
|
|
180
|
+
side?: never;
|
|
181
|
+
startLine?: never;
|
|
182
|
+
startSide?: never;
|
|
183
|
+
} | {
|
|
184
|
+
replyToId?: never;
|
|
185
|
+
commitId: string;
|
|
186
|
+
path: string;
|
|
187
|
+
line: number;
|
|
188
|
+
side: 'left' | 'right';
|
|
189
|
+
startLine?: number;
|
|
190
|
+
startSide?: 'left' | 'right';
|
|
191
|
+
});
|
|
192
|
+
export type UpdateReviewCommentInput = UpdatePullRequestCommentInput;
|
|
193
|
+
export type DeleteReviewCommentInput = DeletePullRequestCommentInput;
|
|
194
|
+
export interface ResolveReviewThreadInput extends DeleteReviewCommentInput {
|
|
195
|
+
resolved: boolean;
|
|
196
|
+
}
|
|
197
|
+
export interface RequestedReviewers {
|
|
198
|
+
users: string[];
|
|
199
|
+
teams: string[];
|
|
200
|
+
}
|
|
201
|
+
export interface UpdateReviewersInput extends PullRequestRef {
|
|
202
|
+
users?: string[];
|
|
203
|
+
teams?: string[];
|
|
204
|
+
}
|
|
205
|
+
/** Fixed repository, pull-request lifecycle, review, comment, and reviewer contract. */
|
|
206
|
+
export interface VersionControl {
|
|
207
|
+
initialize(input: {
|
|
208
|
+
storage: SourceControlStorageHandle;
|
|
209
|
+
}): void;
|
|
210
|
+
registerInstallation(input: {
|
|
211
|
+
orgId: string;
|
|
212
|
+
userId: string;
|
|
213
|
+
installation: InstallationInput;
|
|
214
|
+
}): Promise<SourceControlInstallation>;
|
|
215
|
+
registerRepositories(input: {
|
|
216
|
+
orgId: string;
|
|
217
|
+
installationId: string;
|
|
218
|
+
repositories: RepositoryInput[];
|
|
219
|
+
}): Promise<SourceControlRepository[]>;
|
|
220
|
+
/** Resolve the provider-owned reference for a durably registered repository. */
|
|
221
|
+
getRepositoryTarget(input: {
|
|
222
|
+
orgId: string;
|
|
223
|
+
repositoryId: string;
|
|
224
|
+
}): Promise<RepositoryTarget>;
|
|
225
|
+
getRepositoryAccess(input: {
|
|
226
|
+
orgId: string;
|
|
227
|
+
repositoryId: string;
|
|
228
|
+
}): Promise<RepositoryAccess>;
|
|
229
|
+
/**
|
|
230
|
+
* One credential that reaches every listed repository, for providers whose
|
|
231
|
+
* per-repository tokens would otherwise leave `gh` blind to the rest of an
|
|
232
|
+
* environment. Resolves `undefined` when the provider cannot cover the set
|
|
233
|
+
* (several installations, more repositories than one token allows); the
|
|
234
|
+
* caller then falls back to `getRepositoryAccess` for the primary.
|
|
235
|
+
*/
|
|
236
|
+
getRepositoriesAccess?(input: {
|
|
237
|
+
orgId: string;
|
|
238
|
+
repositoryIds: string[];
|
|
239
|
+
}): Promise<RepositoryAccess | undefined>;
|
|
240
|
+
listPullRequests(input: ListPullRequestsInput): Promise<PullRequestPage>;
|
|
241
|
+
getPullRequest(input: PullRequestRef): Promise<PullRequest | null>;
|
|
242
|
+
createPullRequest(input: CreatePullRequestInput): Promise<PullRequest>;
|
|
243
|
+
updatePullRequest(input: UpdatePullRequestInput): Promise<PullRequest>;
|
|
244
|
+
closePullRequest(input: PullRequestRef): Promise<PullRequest>;
|
|
245
|
+
mergePullRequest(input: MergePullRequestInput): Promise<MergePullRequestResult>;
|
|
246
|
+
listComments(input: ListPullRequestCommentsInput): Promise<PullRequestCommentPage>;
|
|
247
|
+
createComment(input: CreatePullRequestCommentInput): Promise<PullRequestComment>;
|
|
248
|
+
updateComment(input: UpdatePullRequestCommentInput): Promise<PullRequestComment>;
|
|
249
|
+
deleteComment(input: DeletePullRequestCommentInput): Promise<void>;
|
|
250
|
+
listReviews(input: ListReviewsInput): Promise<ReviewPage>;
|
|
251
|
+
getReview(input: ReviewRef): Promise<Review | null>;
|
|
252
|
+
createReview(input: CreateReviewInput): Promise<Review>;
|
|
253
|
+
updateReview(input: UpdateReviewInput): Promise<Review>;
|
|
254
|
+
submitReview(input: SubmitReviewInput): Promise<Review>;
|
|
255
|
+
dismissReview(input: DismissReviewInput): Promise<Review>;
|
|
256
|
+
deletePendingReview(input: ReviewRef): Promise<void>;
|
|
257
|
+
/** Optional because not every provider exposes resolvable review threads. */
|
|
258
|
+
resolveReviewThread?(input: ResolveReviewThreadInput): Promise<void>;
|
|
259
|
+
listReviewComments(input: ListReviewCommentsInput): Promise<ReviewCommentPage>;
|
|
260
|
+
createReviewComment(input: CreateReviewCommentInput): Promise<ReviewComment>;
|
|
261
|
+
updateReviewComment(input: UpdateReviewCommentInput): Promise<ReviewComment>;
|
|
262
|
+
deleteReviewComment(input: DeleteReviewCommentInput): Promise<void>;
|
|
263
|
+
listRequestedReviewers(input: PullRequestRef): Promise<RequestedReviewers>;
|
|
264
|
+
requestReviewers(input: UpdateReviewersInput): Promise<RequestedReviewers>;
|
|
265
|
+
removeRequestedReviewers(input: UpdateReviewersInput): Promise<RequestedReviewers>;
|
|
266
|
+
}
|
|
267
|
+
export {};
|
|
268
|
+
//# sourceMappingURL=version-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-control.d.ts","sourceRoot":"","sources":["../../src/capabilities/version-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MA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G,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC3E,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC3E,wBAAwB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Starts `factory-environment-build` runs on the booted `Mastra`. Every
|
|
3
|
+
* trigger goes through a workflow run so the start decision and the poll are
|
|
4
|
+
* recorded the same way whether a route, the scheduler or a webhook asked.
|
|
5
|
+
*/
|
|
6
|
+
import type { Mastra } from '@mastra/core/mastra';
|
|
7
|
+
import type { FactorySandboxContext } from '@mastra/core/workspace';
|
|
8
|
+
import type { RepositoryPushEvent } from '../integrations/base.js';
|
|
9
|
+
import type { ScheduleService } from './build-schedule.js';
|
|
10
|
+
import type { EnvironmentBuildWorkflowOptions } from './build-workflow.js';
|
|
11
|
+
import type { EnvironmentBuildDeps, EnvironmentBuildOutcome, EnvironmentBuildTrigger } from './build.js';
|
|
12
|
+
export type StartEnvironmentBuild = (projectId: string, trigger: EnvironmentBuildTrigger) => Promise<EnvironmentBuildOutcome>;
|
|
13
|
+
export interface EnvironmentBuildRunnerOptions extends Omit<EnvironmentBuildWorkflowOptions, 'onStart'> {
|
|
14
|
+
/** The booted instance; `undefined` until the host finished `finalize()`. */
|
|
15
|
+
getMastra: () => Mastra | undefined;
|
|
16
|
+
logger?: {
|
|
17
|
+
info: (msg: string, meta?: Record<string, unknown>) => void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** What a read of a build's status or history hands the provider. */
|
|
21
|
+
export interface EnvironmentBuildReadContext {
|
|
22
|
+
ctx: FactorySandboxContext;
|
|
23
|
+
settings: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export declare class EnvironmentBuildRunner {
|
|
26
|
+
#private;
|
|
27
|
+
readonly workflow: import("@mastra/core/workflows").Workflow<import("@mastra/core/workflows").DefaultEngineType, import("@mastra/core/workflows").Step<string, unknown, unknown, unknown, unknown, unknown, any, unknown>[], "factory-environment-build", unknown, {
|
|
28
|
+
projectId: string;
|
|
29
|
+
trigger: "manual" | "push" | "schedule";
|
|
30
|
+
}, {
|
|
31
|
+
outcome: "started" | "failed" | "skipped" | "unavailable";
|
|
32
|
+
buildId?: string | undefined;
|
|
33
|
+
templateId?: string | undefined;
|
|
34
|
+
reason?: string | undefined;
|
|
35
|
+
status?: "unknown" | "failed" | "ready" | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
outcome: "started" | "failed" | "skipped" | "unavailable";
|
|
38
|
+
buildId?: string | undefined;
|
|
39
|
+
templateId?: string | undefined;
|
|
40
|
+
reason?: string | undefined;
|
|
41
|
+
status?: "unknown" | "failed" | "ready" | undefined;
|
|
42
|
+
}, unknown>;
|
|
43
|
+
constructor(deps: EnvironmentBuildDeps, options: EnvironmentBuildRunnerOptions);
|
|
44
|
+
/** The schedule service of the booted host, `undefined` before boot. */
|
|
45
|
+
schedules(): ScheduleService | undefined;
|
|
46
|
+
/** Whether the host's storage implements schedules; false until `probeSchedules()` ran. */
|
|
47
|
+
get scheduleAvailable(): boolean;
|
|
48
|
+
/** Probe once after the host booted; a storage without the domain disables the cron trigger. */
|
|
49
|
+
probeSchedules(): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* The context a status or history read hands the provider. Heads come from
|
|
52
|
+
* the stored last attempt (the build being read was pinned to them), else
|
|
53
|
+
* the active template, so a read never calls GitHub; before the first build
|
|
54
|
+
* they are resolved live once.
|
|
55
|
+
*/
|
|
56
|
+
readContext(projectId: string): Promise<EnvironmentBuildReadContext | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* A push to an environment repository's default branch starts a `push` run
|
|
59
|
+
* when the project opted in; the run's debounce claim decides whether it
|
|
60
|
+
* builds. Fire and forget: the webhook never waits on it.
|
|
61
|
+
*/
|
|
62
|
+
readonly onRepositoryPush: (event: RepositoryPushEvent) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Start a run and resolve with the first step's answer; the poll step keeps
|
|
65
|
+
* running in the background. Resolves `unavailable` before the host booted
|
|
66
|
+
* or when the host never registered the workflow, and `failed` when the run
|
|
67
|
+
* could not be created; a caller that already saved its own change must not
|
|
68
|
+
* fail on the build it merely requested.
|
|
69
|
+
*/
|
|
70
|
+
readonly start: StartEnvironmentBuild;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=build-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-runner.d.ts","sourceRoot":"","sources":["../../src/environment/build-runner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAGzG,MAAM,MAAM,qBAAqB,GAAG,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,uBAAuB,KAC7B,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEtC,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CAAC,+BAA+B,EAAE,SAAS,CAAC;IACrG,6EAA6E;IAC7E,SAAS,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;KAAE,CAAC;CAC1E;AAED,qEAAqE;AACrE,MAAM,WAAW,2BAA2B;IAC1C,GAAG,EAAE,qBAAqB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,qBAAa,sBAAsB;;IACjC,QAAQ,CAAC,QAAQ;;;;;;;;;;;;;;;gBAAC;gBAON,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,6BAA6B;IAc9E,wEAAwE;IACxE,SAAS,IAAI,eAAe,GAAG,SAAS;IAIxC,2FAA2F;IAC3F,IAAI,iBAAiB,IAAI,OAAO,CAE/B;IAED,gGAAgG;IAC1F,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAMxC;;;;;OAKG;IACG,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC;IAgBtF;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,GAAI,OAAO,mBAAmB,KAAG,IAAI,CAa5D;IAEF;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAqCnC;CACH"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { environmentBuildContext, errorReason, resolveEnvironmentHeads } from "./build.js";
|
|
2
|
+
import { resolveProjectEnvironment } from "../workspace.js";
|
|
3
|
+
import { ENVIRONMENT_BUILD_WORKFLOW_ID, createEnvironmentBuildWorkflow } from "./build-workflow.js";
|
|
4
|
+
import { probeSchedulesAvailable } from "./build-schedule.js";
|
|
5
|
+
//#region src/environment/build-runner.ts
|
|
6
|
+
var EnvironmentBuildRunner = class {
|
|
7
|
+
workflow;
|
|
8
|
+
#deps;
|
|
9
|
+
#getMastra;
|
|
10
|
+
#logger;
|
|
11
|
+
#pending = /* @__PURE__ */ new Map();
|
|
12
|
+
#scheduleAvailable = false;
|
|
13
|
+
constructor(deps, options) {
|
|
14
|
+
const { getMastra, logger, ...workflowOptions } = options;
|
|
15
|
+
this.#deps = deps;
|
|
16
|
+
this.#getMastra = getMastra;
|
|
17
|
+
this.#logger = logger;
|
|
18
|
+
this.workflow = createEnvironmentBuildWorkflow(deps, {
|
|
19
|
+
...workflowOptions,
|
|
20
|
+
onStart: (runId, outcome) => {
|
|
21
|
+
this.#pending.get(runId)?.(outcome);
|
|
22
|
+
this.#pending.delete(runId);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** The schedule service of the booted host, `undefined` before boot. */
|
|
27
|
+
schedules() {
|
|
28
|
+
return this.#getMastra()?.schedules;
|
|
29
|
+
}
|
|
30
|
+
/** Whether the host's storage implements schedules; false until `probeSchedules()` ran. */
|
|
31
|
+
get scheduleAvailable() {
|
|
32
|
+
return this.#scheduleAvailable;
|
|
33
|
+
}
|
|
34
|
+
/** Probe once after the host booted; a storage without the domain disables the cron trigger. */
|
|
35
|
+
async probeSchedules() {
|
|
36
|
+
const schedules = this.schedules();
|
|
37
|
+
this.#scheduleAvailable = schedules ? await probeSchedulesAvailable(schedules) : false;
|
|
38
|
+
return this.#scheduleAvailable;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The context a status or history read hands the provider. Heads come from
|
|
42
|
+
* the stored last attempt (the build being read was pinned to them), else
|
|
43
|
+
* the active template, so a read never calls GitHub; before the first build
|
|
44
|
+
* they are resolved live once.
|
|
45
|
+
*/
|
|
46
|
+
async readContext(projectId) {
|
|
47
|
+
const sourceControl = this.#deps.sourceControl;
|
|
48
|
+
if (!sourceControl) return void 0;
|
|
49
|
+
const project = await this.#deps.projects.getById({ id: projectId });
|
|
50
|
+
if (!project) return void 0;
|
|
51
|
+
const environment = await resolveProjectEnvironment(sourceControl.storage, project);
|
|
52
|
+
return {
|
|
53
|
+
ctx: environmentBuildContext(project, environment, project.lastBuildHeads ?? project.activeTemplateHeads ?? await resolveEnvironmentHeads(sourceControl, project, environment), sourceControl.versionControl),
|
|
54
|
+
settings: environment.settings
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A push to an environment repository's default branch starts a `push` run
|
|
59
|
+
* when the project opted in; the run's debounce claim decides whether it
|
|
60
|
+
* builds. Fire and forget: the webhook never waits on it.
|
|
61
|
+
*/
|
|
62
|
+
onRepositoryPush = (event) => {
|
|
63
|
+
if (!event.projectRepository.inEnvironment) return;
|
|
64
|
+
const branch = event.defaultBranch;
|
|
65
|
+
if (event.ref !== `refs/heads/${branch}`) return;
|
|
66
|
+
this.#deps.projects.getById({ id: event.factoryProjectId }).then((project) => project?.buildOnPushEnabled ? this.start(project.id, "push") : void 0).catch((error) => {
|
|
67
|
+
this.#logger?.info("environment build push hand-off failed", {
|
|
68
|
+
factoryProjectId: event.factoryProjectId,
|
|
69
|
+
reason: errorReason(error)
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Start a run and resolve with the first step's answer; the poll step keeps
|
|
75
|
+
* running in the background. Resolves `unavailable` before the host booted
|
|
76
|
+
* or when the host never registered the workflow, and `failed` when the run
|
|
77
|
+
* could not be created; a caller that already saved its own change must not
|
|
78
|
+
* fail on the build it merely requested.
|
|
79
|
+
*/
|
|
80
|
+
start = async (projectId, trigger) => {
|
|
81
|
+
const mastra = this.#getMastra();
|
|
82
|
+
if (!mastra) return {
|
|
83
|
+
outcome: "unavailable",
|
|
84
|
+
reason: "not_ready"
|
|
85
|
+
};
|
|
86
|
+
let run;
|
|
87
|
+
try {
|
|
88
|
+
run = await mastra.getWorkflow(ENVIRONMENT_BUILD_WORKFLOW_ID).createRun();
|
|
89
|
+
} catch (error) {
|
|
90
|
+
const reason = errorReason(error);
|
|
91
|
+
this.#logger?.info("environment build run could not be created", {
|
|
92
|
+
factoryProjectId: projectId,
|
|
93
|
+
reason
|
|
94
|
+
});
|
|
95
|
+
return mastra.listWorkflows()["factory-environment-build"] ? {
|
|
96
|
+
outcome: "failed",
|
|
97
|
+
reason
|
|
98
|
+
} : {
|
|
99
|
+
outcome: "unavailable",
|
|
100
|
+
reason: "no_workflow"
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const outcome = new Promise((resolve) => this.#pending.set(run.runId, resolve));
|
|
104
|
+
run.start({ inputData: {
|
|
105
|
+
projectId,
|
|
106
|
+
trigger
|
|
107
|
+
} }).then((result) => {
|
|
108
|
+
if (result.status !== "success") this.#logger?.info("environment build run did not succeed", {
|
|
109
|
+
factoryProjectId: projectId,
|
|
110
|
+
runId: run.runId
|
|
111
|
+
});
|
|
112
|
+
}).catch((error) => {
|
|
113
|
+
this.#logger?.info("environment build run threw", {
|
|
114
|
+
factoryProjectId: projectId,
|
|
115
|
+
runId: run.runId,
|
|
116
|
+
reason: errorReason(error)
|
|
117
|
+
});
|
|
118
|
+
}).finally(() => {
|
|
119
|
+
this.#pending.get(run.runId)?.({
|
|
120
|
+
outcome: "failed",
|
|
121
|
+
reason: "The build run ended before it started a build."
|
|
122
|
+
});
|
|
123
|
+
this.#pending.delete(run.runId);
|
|
124
|
+
});
|
|
125
|
+
return outcome;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
//#endregion
|
|
129
|
+
export { EnvironmentBuildRunner };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=build-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-runner.js","names":["#deps","#getMastra","#logger","#pending","#scheduleAvailable"],"sources":["../../src/environment/build-runner.ts"],"sourcesContent":["/**\n * Starts `factory-environment-build` runs on the booted `Mastra`. Every\n * trigger goes through a workflow run so the start decision and the poll are\n * recorded the same way whether a route, the scheduler or a webhook asked.\n */\n\nimport type { Mastra } from '@mastra/core/mastra';\nimport type { FactorySandboxContext } from '@mastra/core/workspace';\nimport type { RepositoryPushEvent } from '../integrations/base.js';\nimport { resolveProjectEnvironment } from '../workspace.js';\nimport { probeSchedulesAvailable } from './build-schedule.js';\nimport type { ScheduleService } from './build-schedule.js';\nimport { createEnvironmentBuildWorkflow, ENVIRONMENT_BUILD_WORKFLOW_ID } from './build-workflow.js';\nimport type { EnvironmentBuildWorkflowOptions } from './build-workflow.js';\nimport type { EnvironmentBuildDeps, EnvironmentBuildOutcome, EnvironmentBuildTrigger } from './build.js';\nimport { environmentBuildContext, errorReason, resolveEnvironmentHeads } from './build.js';\n\nexport type StartEnvironmentBuild = (\n projectId: string,\n trigger: EnvironmentBuildTrigger,\n) => Promise<EnvironmentBuildOutcome>;\n\nexport interface EnvironmentBuildRunnerOptions extends Omit<EnvironmentBuildWorkflowOptions, 'onStart'> {\n /** The booted instance; `undefined` until the host finished `finalize()`. */\n getMastra: () => Mastra | undefined;\n logger?: { info: (msg: string, meta?: Record<string, unknown>) => void };\n}\n\n/** What a read of a build's status or history hands the provider. */\nexport interface EnvironmentBuildReadContext {\n ctx: FactorySandboxContext;\n settings: Record<string, unknown>;\n}\n\nexport class EnvironmentBuildRunner {\n readonly workflow;\n readonly #deps: EnvironmentBuildDeps;\n readonly #getMastra: () => Mastra | undefined;\n readonly #logger: EnvironmentBuildRunnerOptions['logger'];\n readonly #pending = new Map<string, (outcome: EnvironmentBuildOutcome) => void>();\n #scheduleAvailable = false;\n\n constructor(deps: EnvironmentBuildDeps, options: EnvironmentBuildRunnerOptions) {\n const { getMastra, logger, ...workflowOptions } = options;\n this.#deps = deps;\n this.#getMastra = getMastra;\n this.#logger = logger;\n this.workflow = createEnvironmentBuildWorkflow(deps, {\n ...workflowOptions,\n onStart: (runId, outcome) => {\n this.#pending.get(runId)?.(outcome);\n this.#pending.delete(runId);\n },\n });\n }\n\n /** The schedule service of the booted host, `undefined` before boot. */\n schedules(): ScheduleService | undefined {\n return this.#getMastra()?.schedules;\n }\n\n /** Whether the host's storage implements schedules; false until `probeSchedules()` ran. */\n get scheduleAvailable(): boolean {\n return this.#scheduleAvailable;\n }\n\n /** Probe once after the host booted; a storage without the domain disables the cron trigger. */\n async probeSchedules(): Promise<boolean> {\n const schedules = this.schedules();\n this.#scheduleAvailable = schedules ? await probeSchedulesAvailable(schedules) : false;\n return this.#scheduleAvailable;\n }\n\n /**\n * The context a status or history read hands the provider. Heads come from\n * the stored last attempt (the build being read was pinned to them), else\n * the active template, so a read never calls GitHub; before the first build\n * they are resolved live once.\n */\n async readContext(projectId: string): Promise<EnvironmentBuildReadContext | undefined> {\n const sourceControl = this.#deps.sourceControl;\n if (!sourceControl) return undefined;\n const project = await this.#deps.projects.getById({ id: projectId });\n if (!project) return undefined;\n const environment = await resolveProjectEnvironment(sourceControl.storage, project);\n const heads =\n project.lastBuildHeads ??\n project.activeTemplateHeads ??\n (await resolveEnvironmentHeads(sourceControl, project, environment));\n return {\n ctx: environmentBuildContext(project, environment, heads, sourceControl.versionControl),\n settings: environment.settings,\n };\n }\n\n /**\n * A push to an environment repository's default branch starts a `push` run\n * when the project opted in; the run's debounce claim decides whether it\n * builds. Fire and forget: the webhook never waits on it.\n */\n readonly onRepositoryPush = (event: RepositoryPushEvent): void => {\n if (!event.projectRepository.inEnvironment) return;\n const branch = event.defaultBranch;\n if (event.ref !== `refs/heads/${branch}`) return;\n void this.#deps.projects\n .getById({ id: event.factoryProjectId })\n .then(project => (project?.buildOnPushEnabled ? this.start(project.id, 'push') : undefined))\n .catch((error: unknown) => {\n this.#logger?.info('environment build push hand-off failed', {\n factoryProjectId: event.factoryProjectId,\n reason: errorReason(error),\n });\n });\n };\n\n /**\n * Start a run and resolve with the first step's answer; the poll step keeps\n * running in the background. Resolves `unavailable` before the host booted\n * or when the host never registered the workflow, and `failed` when the run\n * could not be created; a caller that already saved its own change must not\n * fail on the build it merely requested.\n */\n readonly start: StartEnvironmentBuild = async (projectId, trigger) => {\n const mastra = this.#getMastra();\n if (!mastra) return { outcome: 'unavailable', reason: 'not_ready' };\n let run: Awaited<ReturnType<typeof this.workflow.createRun>>;\n try {\n run = await mastra.getWorkflow(ENVIRONMENT_BUILD_WORKFLOW_ID).createRun();\n } catch (error) {\n const reason = errorReason(error);\n this.#logger?.info('environment build run could not be created', { factoryProjectId: projectId, reason });\n return mastra.listWorkflows()[ENVIRONMENT_BUILD_WORKFLOW_ID]\n ? { outcome: 'failed', reason }\n : { outcome: 'unavailable', reason: 'no_workflow' };\n }\n const outcome = new Promise<EnvironmentBuildOutcome>(resolve => this.#pending.set(run.runId, resolve));\n run\n .start({ inputData: { projectId, trigger } })\n .then(result => {\n if (result.status !== 'success') {\n this.#logger?.info('environment build run did not succeed', {\n factoryProjectId: projectId,\n runId: run.runId,\n });\n }\n })\n .catch((error: unknown) => {\n this.#logger?.info('environment build run threw', {\n factoryProjectId: projectId,\n runId: run.runId,\n reason: errorReason(error),\n });\n })\n .finally(() => {\n // A run that failed before its first step answered must not hang the caller.\n this.#pending.get(run.runId)?.({ outcome: 'failed', reason: 'The build run ended before it started a build.' });\n this.#pending.delete(run.runId);\n });\n return outcome;\n };\n}\n"],"mappings":";;;;;AAkCA,IAAa,yBAAb,MAAoC;CAClC;CACA;CACA;CACA;CACA,2BAAoB,IAAI,IAAwD;CAChF,qBAAqB;CAErB,YAAY,MAA4B,SAAwC;EAC9E,MAAM,EAAE,WAAW,QAAQ,GAAG,oBAAoB;EAClD,KAAKA,QAAQ;EACb,KAAKC,aAAa;EAClB,KAAKC,UAAU;EACf,KAAK,WAAW,+BAA+B,MAAM;GACnD,GAAG;GACH,UAAU,OAAO,YAAY;IAC3B,KAAKC,SAAS,IAAI,KAAK,CAAC,GAAG,OAAO;IAClC,KAAKA,SAAS,OAAO,KAAK;GAC5B;EACF,CAAC;CACH;;CAGA,YAAyC;EACvC,OAAO,KAAKF,WAAW,CAAC,EAAE;CAC5B;;CAGA,IAAI,oBAA6B;EAC/B,OAAO,KAAKG;C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C,KAAKC,SAAS,KAAK,8CAA8C;IAAE,kBAAkB;IAAW;GAAO,CAAC;GACxG,OAAO,OAAO,cAAc,CAAC,CAAA,+BACzB;IAAE,SAAS;IAAU;GAAO,IAC5B;IAAE,SAAS;IAAe,QAAQ;GAAc;EACtD;EACA,MAAM,UAAU,IAAI,SAAiC,YAAW,KAAKC,SAAS,IAAI,IAAI,OAAO,OAAO,CAAC;EACrG,IACG,MAAM,EAAE,WAAW;GAAE;GAAW;EAAQ,EAAE,CAAC,CAAC,CAC5C,MAAK,WAAU;GACd,IAAI,OAAO,WAAW,WACpB,KAAKD,SAAS,KAAK,yCAAyC;IAC1D,kBAAkB;IAClB,OAAO,IAAI;GACb,CAAC;EAEL,CAAC,CAAC,CACD,OAAO,UAAmB;GACzB,KAAKA,SAAS,KAAK,+BAA+B;IAChD,kBAAkB;IAClB,OAAO,IAAI;IACX,QAAQ,YAAY,KAAK;GAC3B,CAAC;EACH,CAAC,CAAC,CACD,cAAc;GAEb,KAAKC,SAAS,IAAI,IAAI,KAAK,CAAC,GAAG;IAAE,SAAS;IAAU,QAAQ;GAAiD,CAAC;GAC9G,KAAKA,SAAS,OAAO,IAAI,KAAK;EAChC,CAAC;EACH,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The per-project cron that fires the `factory-environment-build` workflow,
|
|
3
|
+
* kept in core `Schedules` (one row per project) rather than a factory
|
|
4
|
+
* column: the scheduler owns firing, claims and the run trigger log, factory
|
|
5
|
+
* only creates, pauses, resumes and reads the row.
|
|
6
|
+
*/
|
|
7
|
+
import type { Schedules } from '@mastra/core/schedules';
|
|
8
|
+
export declare const SCHEDULES_UNAVAILABLE_ERROR_ID = "SCHEDULES_NO_SCHEDULES_STORAGE";
|
|
9
|
+
/**
|
|
10
|
+
* The project's schedule id in its stored form. Core normalizes a created
|
|
11
|
+
* id to `schedule_<slug>` and resolves a bare id to `agent_<slug>` on reads,
|
|
12
|
+
* so factory always addresses the row by the normalized id (a project id is
|
|
13
|
+
* a lower-case uuid, which slugifies to itself).
|
|
14
|
+
*/
|
|
15
|
+
export declare function scheduleIdFor(projectId: string): string;
|
|
16
|
+
export interface EnvironmentBuildSchedule {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
cron: string | null;
|
|
19
|
+
timezone: string | null;
|
|
20
|
+
}
|
|
21
|
+
export type ScheduleService = Pick<Schedules, 'create' | 'get' | 'list' | 'update' | 'pause' | 'resume' | 'delete'>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the host's storage implements the schedules domain. `mastra.schedules`
|
|
24
|
+
* never throws on access; the missing store surfaces on the first call.
|
|
25
|
+
*/
|
|
26
|
+
export declare function probeSchedulesAvailable(schedules: ScheduleService): Promise<boolean>;
|
|
27
|
+
/** `undefined` when the cron parses; otherwise the validator's message. */
|
|
28
|
+
export declare function invalidCronMessage(cron: string, timezone?: string): string | undefined;
|
|
29
|
+
/** The project's build schedule as the environment reports it. */
|
|
30
|
+
export declare function readSchedule(schedules: ScheduleService, projectId: string): Promise<EnvironmentBuildSchedule>;
|
|
31
|
+
/**
|
|
32
|
+
* Create, update, pause or resume the project's schedule so it matches
|
|
33
|
+
* `input`. Disabling a project that never had a schedule creates nothing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function ensureSchedule(schedules: ScheduleService, projectId: string, input: {
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
cron: string;
|
|
38
|
+
timezone?: string;
|
|
39
|
+
}): Promise<EnvironmentBuildSchedule>;
|
|
40
|
+
//# sourceMappingURL=build-schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-schedule.d.ts","sourceRoot":"","sources":["../../src/environment/build-schedule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAe,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAIvF,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAE/E;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAQpH;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ1F;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtF;AAWD,kEAAkE;AAClE,wBAAsB,YAAY,CAAC,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAGnH;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,eAAe,EAC1B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3D,OAAO,CAAC,wBAAwB,CAAC,CA2BnC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ENVIRONMENT_BUILD_WORKFLOW_ID } from "./build-workflow.js";
|
|
2
|
+
import { validateCron } from "@mastra/core/workflows";
|
|
3
|
+
//#region src/environment/build-schedule.ts
|
|
4
|
+
const SCHEDULES_UNAVAILABLE_ERROR_ID = "SCHEDULES_NO_SCHEDULES_STORAGE";
|
|
5
|
+
/**
|
|
6
|
+
* The project's schedule id in its stored form. Core normalizes a created
|
|
7
|
+
* id to `schedule_<slug>` and resolves a bare id to `agent_<slug>` on reads,
|
|
8
|
+
* so factory always addresses the row by the normalized id (a project id is
|
|
9
|
+
* a lower-case uuid, which slugifies to itself).
|
|
10
|
+
*/
|
|
11
|
+
function scheduleIdFor(projectId) {
|
|
12
|
+
return `schedule_factory-environment-build-${projectId}`;
|
|
13
|
+
}
|
|
14
|
+
function isSchedulesUnavailable(error) {
|
|
15
|
+
return typeof error === "object" && error !== null && error.id === "SCHEDULES_NO_SCHEDULES_STORAGE";
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Whether the host's storage implements the schedules domain. `mastra.schedules`
|
|
19
|
+
* never throws on access; the missing store surfaces on the first call.
|
|
20
|
+
*/
|
|
21
|
+
async function probeSchedulesAvailable(schedules) {
|
|
22
|
+
try {
|
|
23
|
+
await schedules.list({ workflowId: ENVIRONMENT_BUILD_WORKFLOW_ID });
|
|
24
|
+
return true;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (isSchedulesUnavailable(error)) return false;
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** `undefined` when the cron parses; otherwise the validator's message. */
|
|
31
|
+
function invalidCronMessage(cron, timezone) {
|
|
32
|
+
try {
|
|
33
|
+
validateCron(cron, timezone);
|
|
34
|
+
return;
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return error instanceof Error ? error.message : String(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function isWorkflowSchedule(schedule) {
|
|
40
|
+
return schedule !== null && schedule.agentId === void 0;
|
|
41
|
+
}
|
|
42
|
+
function toView(schedule) {
|
|
43
|
+
if (!schedule) return {
|
|
44
|
+
enabled: false,
|
|
45
|
+
cron: null,
|
|
46
|
+
timezone: null
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
enabled: schedule.status === "active",
|
|
50
|
+
cron: schedule.cron,
|
|
51
|
+
timezone: schedule.timezone ?? null
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** The project's build schedule as the environment reports it. */
|
|
55
|
+
async function readSchedule(schedules, projectId) {
|
|
56
|
+
const schedule = await schedules.get(scheduleIdFor(projectId));
|
|
57
|
+
return toView(isWorkflowSchedule(schedule) ? schedule : null);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create, update, pause or resume the project's schedule so it matches
|
|
61
|
+
* `input`. Disabling a project that never had a schedule creates nothing.
|
|
62
|
+
*/
|
|
63
|
+
async function ensureSchedule(schedules, projectId, input) {
|
|
64
|
+
const id = scheduleIdFor(projectId);
|
|
65
|
+
const existing = await schedules.get(id);
|
|
66
|
+
const current = isWorkflowSchedule(existing) ? existing : null;
|
|
67
|
+
if (!current) {
|
|
68
|
+
if (!input.enabled) return toView(null);
|
|
69
|
+
return toView(await schedules.create({
|
|
70
|
+
id,
|
|
71
|
+
workflowId: ENVIRONMENT_BUILD_WORKFLOW_ID,
|
|
72
|
+
cron: input.cron,
|
|
73
|
+
...input.timezone ? { timezone: input.timezone } : {},
|
|
74
|
+
inputData: {
|
|
75
|
+
projectId,
|
|
76
|
+
trigger: "schedule"
|
|
77
|
+
},
|
|
78
|
+
resourceId: projectId
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
const timingChanged = current.cron !== input.cron || (current.timezone ?? void 0) !== input.timezone;
|
|
82
|
+
let next = current;
|
|
83
|
+
if (timingChanged) next = await schedules.update(current.id, {
|
|
84
|
+
cron: input.cron,
|
|
85
|
+
...input.timezone ? { timezone: input.timezone } : {}
|
|
86
|
+
});
|
|
87
|
+
if (input.enabled && next.status === "paused") next = await schedules.resume(current.id);
|
|
88
|
+
if (!input.enabled && next.status === "active") next = await schedules.pause(current.id);
|
|
89
|
+
return toView(isWorkflowSchedule(next) ? next : null);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { SCHEDULES_UNAVAILABLE_ERROR_ID, ensureSchedule, invalidCronMessage, probeSchedulesAvailable, readSchedule, scheduleIdFor };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=build-schedule.js.map
|