@mastra/factory 0.28.0 → 0.29.0-alpha.1
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/README.md +26 -8
- package/dist/board-changes.d.ts +16 -0
- package/dist/board-changes.d.ts.map +1 -0
- package/dist/board-changes.js +40 -0
- package/dist/board-changes.js.map +1 -0
- package/dist/boards/index.js +2 -1
- package/dist/boards/reroute.d.ts +31 -0
- package/dist/boards/reroute.d.ts.map +1 -0
- package/dist/boards/reroute.js +71 -0
- package/dist/boards/reroute.js.map +1 -0
- package/dist/boards/semantics.d.ts +1 -3
- package/dist/boards/semantics.d.ts.map +1 -1
- package/dist/boards/semantics.js +1 -5
- package/dist/boards/semantics.js.map +1 -1
- package/dist/environment/repository-access.d.ts +2 -0
- package/dist/environment/repository-access.d.ts.map +1 -1
- package/dist/environment/repository-access.js +9 -4
- package/dist/environment/repository-access.js.map +1 -1
- package/dist/factory.d.ts +4 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +60 -9
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +17 -0
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/dependabot/default-rules.d.ts +38 -0
- package/dist/integrations/dependabot/default-rules.d.ts.map +1 -0
- package/dist/integrations/dependabot/default-rules.js +63 -0
- package/dist/integrations/dependabot/default-rules.js.map +1 -0
- package/dist/integrations/dependabot/rules.d.ts +42 -0
- package/dist/integrations/dependabot/rules.d.ts.map +1 -0
- package/dist/integrations/dependabot/rules.js +187 -0
- package/dist/integrations/dependabot/rules.js.map +1 -0
- package/dist/integrations/dependabot/sync.d.ts +76 -0
- package/dist/integrations/dependabot/sync.d.ts.map +1 -0
- package/dist/integrations/dependabot/sync.js +111 -0
- package/dist/integrations/dependabot/sync.js.map +1 -0
- package/dist/integrations/github/pull-request-source.js +2 -1
- package/dist/integrations/github/pull-request-source.js.map +1 -1
- package/dist/integrations/github/reconcile-worker.js +1 -1
- package/dist/integrations/github/reconcile-worker.js.map +1 -1
- package/dist/integrations/github/routes.d.ts.map +1 -1
- package/dist/integrations/github/routes.js +7 -2
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/rules.d.ts +5 -2
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +16 -13
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +12 -0
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +24 -3
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/gitlab/default-rules.js +2 -1
- package/dist/integrations/gitlab/default-rules.js.map +1 -1
- package/dist/integrations/gitlab/discovery.d.ts +16 -0
- package/dist/integrations/gitlab/discovery.d.ts.map +1 -0
- package/dist/integrations/gitlab/discovery.js +107 -0
- package/dist/integrations/gitlab/discovery.js.map +1 -0
- package/dist/integrations/gitlab/integration.d.ts.map +1 -1
- package/dist/integrations/gitlab/integration.js +1 -2
- package/dist/integrations/gitlab/integration.js.map +1 -1
- package/dist/integrations/gitlab/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/gitlab/issue-reconciler.js +1 -0
- package/dist/integrations/gitlab/issue-reconciler.js.map +1 -1
- package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -1
- package/dist/integrations/gitlab/merge-request-reconciler.js +26 -10
- package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -1
- package/dist/integrations/gitlab/reconciler.d.ts.map +1 -1
- package/dist/integrations/gitlab/reconciler.js +4 -2
- package/dist/integrations/gitlab/reconciler.js.map +1 -1
- package/dist/integrations/gitlab/reconciliation-config.d.ts +0 -1
- package/dist/integrations/gitlab/reconciliation-config.d.ts.map +1 -1
- package/dist/integrations/gitlab/reconciliation-config.js +2 -8
- package/dist/integrations/gitlab/reconciliation-config.js.map +1 -1
- package/dist/integrations/gitlab/routes.d.ts +17 -0
- package/dist/integrations/gitlab/routes.d.ts.map +1 -1
- package/dist/integrations/gitlab/routes.js +28 -22
- package/dist/integrations/gitlab/routes.js.map +1 -1
- package/dist/integrations/gitlab/rules.d.ts +10 -4
- package/dist/integrations/gitlab/rules.d.ts.map +1 -1
- package/dist/integrations/gitlab/rules.js +32 -8
- package/dist/integrations/gitlab/rules.js.map +1 -1
- package/dist/integrations/incidentio/integration.d.ts +2 -1
- package/dist/integrations/incidentio/integration.d.ts.map +1 -1
- package/dist/integrations/incidentio/integration.js +7 -7
- package/dist/integrations/incidentio/integration.js.map +1 -1
- package/dist/integrations/incidentio/issue-reconciler.d.ts +7 -0
- package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/incidentio/issue-reconciler.js +36 -1
- package/dist/integrations/incidentio/issue-reconciler.js.map +1 -1
- package/dist/integrations/incidentio/reconciliation-config.d.ts +0 -1
- package/dist/integrations/incidentio/reconciliation-config.d.ts.map +1 -1
- package/dist/integrations/incidentio/reconciliation-config.js +2 -5
- package/dist/integrations/incidentio/reconciliation-config.js.map +1 -1
- package/dist/integrations/incidentio/routes.d.ts +24 -8
- package/dist/integrations/incidentio/routes.d.ts.map +1 -1
- package/dist/integrations/incidentio/routes.js +33 -35
- package/dist/integrations/incidentio/routes.js.map +1 -1
- package/dist/integrations/incidentio/rules.d.ts +0 -4
- package/dist/integrations/incidentio/rules.d.ts.map +1 -1
- package/dist/integrations/incidentio/rules.js +17 -14
- package/dist/integrations/incidentio/rules.js.map +1 -1
- package/dist/integrations/intake-discovery.d.ts +44 -0
- package/dist/integrations/intake-discovery.d.ts.map +1 -0
- package/dist/integrations/intake-discovery.js +60 -0
- package/dist/integrations/intake-discovery.js.map +1 -0
- package/dist/integrations/issue-reconcile-worker.js +1 -1
- package/dist/integrations/issue-reconcile-worker.js.map +1 -1
- package/dist/integrations/issue-reconciler.d.ts +7 -0
- package/dist/integrations/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/issue-reconciler.js +47 -12
- package/dist/integrations/issue-reconciler.js.map +1 -1
- package/dist/integrations/jira/integration.d.ts +3 -2
- package/dist/integrations/jira/integration.d.ts.map +1 -1
- package/dist/integrations/jira/integration.js +5 -7
- package/dist/integrations/jira/integration.js.map +1 -1
- package/dist/integrations/jira/issue-reconciler.d.ts +17 -1
- package/dist/integrations/jira/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/jira/issue-reconciler.js +34 -1
- package/dist/integrations/jira/issue-reconciler.js.map +1 -1
- package/dist/integrations/jira/reconciliation-config.d.ts +0 -1
- package/dist/integrations/jira/reconciliation-config.d.ts.map +1 -1
- package/dist/integrations/jira/reconciliation-config.js +2 -5
- package/dist/integrations/jira/reconciliation-config.js.map +1 -1
- package/dist/integrations/jira/routes.d.ts +0 -7
- package/dist/integrations/jira/routes.d.ts.map +1 -1
- package/dist/integrations/jira/routes.js +2 -12
- package/dist/integrations/jira/routes.js.map +1 -1
- package/dist/integrations/jira/rules.d.ts +0 -4
- package/dist/integrations/jira/rules.d.ts.map +1 -1
- package/dist/integrations/jira/rules.js +3 -13
- package/dist/integrations/jira/rules.js.map +1 -1
- package/dist/integrations/kept-cards.d.ts +49 -0
- package/dist/integrations/kept-cards.d.ts.map +1 -0
- package/dist/integrations/kept-cards.js +97 -0
- package/dist/integrations/kept-cards.js.map +1 -0
- package/dist/integrations/linear/intake-discovery.d.ts +34 -0
- package/dist/integrations/linear/intake-discovery.d.ts.map +1 -0
- package/dist/integrations/linear/intake-discovery.js +112 -0
- package/dist/integrations/linear/intake-discovery.js.map +1 -0
- package/dist/integrations/linear/integration.d.ts.map +1 -1
- package/dist/integrations/linear/integration.js +1 -4
- package/dist/integrations/linear/integration.js.map +1 -1
- package/dist/integrations/linear/issue-reconciler.d.ts +13 -4
- package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -1
- package/dist/integrations/linear/issue-reconciler.js +24 -20
- package/dist/integrations/linear/issue-reconciler.js.map +1 -1
- package/dist/integrations/linear/reconciliation-config.d.ts +0 -1
- package/dist/integrations/linear/reconciliation-config.d.ts.map +1 -1
- package/dist/integrations/linear/reconciliation-config.js +2 -8
- package/dist/integrations/linear/reconciliation-config.js.map +1 -1
- package/dist/integrations/linear/routes.d.ts +0 -2
- package/dist/integrations/linear/routes.d.ts.map +1 -1
- package/dist/integrations/linear/routes.js +3 -9
- package/dist/integrations/linear/routes.js.map +1 -1
- package/dist/integrations/platform/api-client.d.ts +2 -0
- package/dist/integrations/platform/api-client.d.ts.map +1 -1
- package/dist/integrations/platform/api-client.js +6 -1
- package/dist/integrations/platform/api-client.js.map +1 -1
- package/dist/integrations/platform/connect/routes.d.ts.map +1 -1
- package/dist/integrations/platform/connect/routes.js +8 -1
- package/dist/integrations/platform/connect/routes.js.map +1 -1
- package/dist/integrations/platform/github/event-worker.d.ts +17 -0
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/github/event-worker.js +89 -7
- package/dist/integrations/platform/github/event-worker.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts +20 -1
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +54 -3
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/gitlab/event-worker.js +1 -1
- package/dist/integrations/platform/gitlab/event-worker.js.map +1 -1
- package/dist/integrations/platform/incidentio/integration.d.ts +3 -2
- package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -1
- package/dist/integrations/platform/incidentio/integration.js +7 -7
- package/dist/integrations/platform/incidentio/integration.js.map +1 -1
- package/dist/integrations/platform/jira/integration.d.ts.map +1 -1
- package/dist/integrations/platform/jira/integration.js +4 -7
- package/dist/integrations/platform/jira/integration.js.map +1 -1
- package/dist/integrations/platform/jira/routes.d.ts +0 -7
- package/dist/integrations/platform/jira/routes.d.ts.map +1 -1
- package/dist/integrations/platform/jira/routes.js +2 -12
- package/dist/integrations/platform/jira/routes.js.map +1 -1
- package/dist/integrations/platform/linear/event-worker.d.ts +2 -2
- package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/linear/event-worker.js +1 -1
- package/dist/integrations/platform/linear/event-worker.js.map +1 -1
- package/dist/integrations/platform/linear/integration.d.ts +1 -0
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
- package/dist/integrations/platform/linear/integration.js +7 -7
- package/dist/integrations/platform/linear/integration.js.map +1 -1
- package/dist/integrations/platform/vanta/integration.d.ts +38 -0
- package/dist/integrations/platform/vanta/integration.d.ts.map +1 -0
- package/dist/integrations/platform/vanta/integration.js +149 -0
- package/dist/integrations/platform/vanta/integration.js.map +1 -0
- package/dist/integrations/reconciliation-config.d.ts +0 -1
- package/dist/integrations/reconciliation-config.d.ts.map +1 -1
- package/dist/integrations/reconciliation-config.js +1 -8
- package/dist/integrations/reconciliation-config.js.map +1 -1
- package/dist/integrations/slack/channel-reply-processor.js +1 -1
- package/dist/integrations/slack/channel-reply-processor.js.map +1 -1
- package/dist/integrations/startup-summary.d.ts +8 -0
- package/dist/integrations/startup-summary.d.ts.map +1 -0
- package/dist/integrations/startup-summary.js +36 -0
- package/dist/integrations/startup-summary.js.map +1 -0
- package/dist/integrations/vanta/default-rules.d.ts +34 -0
- package/dist/integrations/vanta/default-rules.d.ts.map +1 -0
- package/dist/integrations/vanta/default-rules.js +61 -0
- package/dist/integrations/vanta/default-rules.js.map +1 -0
- package/dist/integrations/vanta/rules.d.ts +40 -0
- package/dist/integrations/vanta/rules.d.ts.map +1 -0
- package/dist/integrations/vanta/rules.js +208 -0
- package/dist/integrations/vanta/rules.js.map +1 -0
- package/dist/integrations/vanta/sync.d.ts +40 -0
- package/dist/integrations/vanta/sync.d.ts.map +1 -0
- package/dist/integrations/vanta/sync.js +81 -0
- package/dist/integrations/vanta/sync.js.map +1 -0
- package/dist/linked-repositories-changed.d.ts +14 -0
- package/dist/linked-repositories-changed.d.ts.map +1 -0
- package/dist/linked-repositories-changed.js +48 -0
- package/dist/linked-repositories-changed.js.map +1 -0
- package/dist/mcp/routes.d.ts.map +1 -1
- package/dist/mcp/routes.js +1 -1
- package/dist/mcp/routes.js.map +1 -1
- package/dist/routes/board-snapshot.d.ts +8 -1
- package/dist/routes/board-snapshot.d.ts.map +1 -1
- package/dist/routes/board-snapshot.js +23 -2
- package/dist/routes/board-snapshot.js.map +1 -1
- package/dist/routes/contracts.d.ts +322 -0
- package/dist/routes/contracts.d.ts.map +1 -1
- package/dist/routes/contracts.js +202 -5
- package/dist/routes/contracts.js.map +1 -1
- package/dist/routes/intake-routes.d.ts +3 -0
- package/dist/routes/intake-routes.d.ts.map +1 -1
- package/dist/routes/intake-routes.js +44 -0
- package/dist/routes/intake-routes.js.map +1 -1
- package/dist/routes/knowledge.d.ts.map +1 -1
- package/dist/routes/knowledge.js +3 -2
- package/dist/routes/knowledge.js.map +1 -1
- package/dist/routes/run-queue.d.ts +17 -0
- package/dist/routes/run-queue.d.ts.map +1 -0
- package/dist/routes/run-queue.js +69 -0
- package/dist/routes/run-queue.js.map +1 -0
- package/dist/routes/source-control-sessions.d.ts +1 -1
- package/dist/routes/source-control-sessions.d.ts.map +1 -1
- package/dist/routes/source-control-sessions.js +109 -3
- package/dist/routes/source-control-sessions.js.map +1 -1
- package/dist/routes/surface.d.ts +14 -1
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +76 -11
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/work-item-selection.d.ts +4 -5
- package/dist/routes/work-item-selection.d.ts.map +1 -1
- package/dist/routes/work-item-selection.js +11 -23
- package/dist/routes/work-item-selection.js.map +1 -1
- package/dist/routes/work-item-starters.d.ts.map +1 -1
- package/dist/routes/work-item-starters.js +4 -21
- package/dist/routes/work-item-starters.js.map +1 -1
- package/dist/routes/work-items.d.ts +5 -0
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +129 -36
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/dispatch-errors.d.ts +3 -0
- package/dist/rules/dispatch-errors.d.ts.map +1 -1
- package/dist/rules/dispatch-errors.js +5 -0
- package/dist/rules/dispatch-errors.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +15 -1
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +48 -20
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/index.d.ts +2 -2
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +2 -2
- package/dist/rules/review-source-tool.js +2 -1
- package/dist/rules/review-source-tool.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts +6 -1
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +6 -2
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +3 -2
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +71 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +10 -2
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +5 -0
- package/dist/rules/validation.js.map +1 -1
- package/dist/session/factory-session.d.ts +20 -5
- package/dist/session/factory-session.d.ts.map +1 -1
- package/dist/session/factory-session.js +20 -6
- package/dist/session/factory-session.js.map +1 -1
- package/dist/storage/domains/audit/actions.d.ts +1 -1
- package/dist/storage/domains/audit/actions.d.ts.map +1 -1
- package/dist/storage/domains/audit/actions.js +2 -1
- package/dist/storage/domains/audit/actions.js.map +1 -1
- package/dist/storage/domains/audit/actors.d.ts.map +1 -1
- package/dist/storage/domains/audit/actors.js +1 -1
- package/dist/storage/domains/audit/actors.js.map +1 -1
- package/dist/storage/domains/intake/base.d.ts +1 -1
- package/dist/storage/domains/intake/base.js +2 -2
- package/dist/storage/domains/intake/base.js.map +1 -1
- package/dist/storage/domains/projects/base.d.ts +10 -0
- package/dist/storage/domains/projects/base.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.js +24 -2
- package/dist/storage/domains/projects/base.js.map +1 -1
- package/dist/storage/domains/source-control/base.d.ts +32 -0
- package/dist/storage/domains/source-control/base.d.ts.map +1 -1
- package/dist/storage/domains/source-control/base.js +54 -4
- package/dist/storage/domains/source-control/base.js.map +1 -1
- package/dist/storage/domains/source-control/inmemory.d.ts +3 -0
- package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/source-control/inmemory.js +17 -0
- package/dist/storage/domains/source-control/inmemory.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +16 -4
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +28 -1
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/timing.d.ts +8 -1
- package/dist/timing.d.ts.map +1 -1
- package/dist/timing.js +10 -2
- package/dist/timing.js.map +1 -1
- package/dist/tools/approval-tools.d.ts +20 -0
- package/dist/tools/approval-tools.d.ts.map +1 -1
- package/dist/tools/approval-tools.js +79 -30
- package/dist/tools/approval-tools.js.map +1 -1
- package/dist/tools/audit-events-tool.d.ts +1 -1
- package/dist/tools/messaging-tools.d.ts.map +1 -1
- package/dist/tools/messaging-tools.js +1 -1
- package/dist/tools/messaging-tools.js.map +1 -1
- package/dist/tools/read-tools.d.ts +0 -2
- package/dist/tools/read-tools.d.ts.map +1 -1
- package/dist/tools/read-tools.js +2 -7
- package/dist/tools/read-tools.js.map +1 -1
- package/dist/tools/reports.d.ts +3 -0
- package/dist/tools/reports.d.ts.map +1 -1
- package/dist/tools/reports.js +3 -3
- package/dist/tools/reports.js.map +1 -1
- package/dist/tools/run-watch.d.ts +14 -2
- package/dist/tools/run-watch.d.ts.map +1 -1
- package/dist/tools/run-watch.js +24 -4
- package/dist/tools/run-watch.js.map +1 -1
- package/dist/tools/session-tools.d.ts.map +1 -1
- package/dist/tools/session-tools.js +17 -6
- package/dist/tools/session-tools.js.map +1 -1
- package/dist/tools/side-sessions.d.ts.map +1 -1
- package/dist/tools/side-sessions.js +1 -1
- package/dist/tools/side-sessions.js.map +1 -1
- package/dist/tools/work-item-tools.d.ts.map +1 -1
- package/dist/tools/work-item-tools.js +12 -2
- package/dist/tools/work-item-tools.js.map +1 -1
- package/dist/work-item-branch.d.ts +1 -1
- package/dist/work-item-branch.d.ts.map +1 -1
- package/dist/work-item-branch.js +2 -0
- package/dist/work-item-branch.js.map +1 -1
- package/dist/work-items/board-filter-options.d.ts +5 -0
- package/dist/work-items/board-filter-options.d.ts.map +1 -0
- package/dist/work-items/board-filter-options.js +27 -0
- package/dist/work-items/board-filter-options.js.map +1 -0
- package/dist/work-items/board-phases.d.ts +28 -0
- package/dist/work-items/board-phases.d.ts.map +1 -0
- package/dist/work-items/board-phases.js +165 -0
- package/dist/work-items/board-phases.js.map +1 -0
- package/dist/work-items/card-facts.d.ts +24 -0
- package/dist/work-items/card-facts.d.ts.map +1 -0
- package/dist/work-items/card-facts.js +75 -0
- package/dist/work-items/card-facts.js.map +1 -0
- package/dist/work-items/card-labels.d.ts +5 -0
- package/dist/work-items/card-labels.d.ts.map +1 -0
- package/dist/work-items/card-labels.js +13 -0
- package/dist/work-items/card-labels.js.map +1 -0
- package/dist/work-items/card-number.d.ts +10 -0
- package/dist/work-items/card-number.d.ts.map +1 -0
- package/dist/work-items/card-number.js +15 -0
- package/dist/work-items/card-number.js.map +1 -0
- package/dist/work-items/card-people.d.ts +25 -0
- package/dist/work-items/card-people.d.ts.map +1 -0
- package/dist/work-items/card-people.js +100 -0
- package/dist/work-items/card-people.js.map +1 -0
- package/dist/work-items/card-search-text.d.ts +4 -0
- package/dist/work-items/card-search-text.d.ts.map +1 -0
- package/dist/work-items/card-search-text.js +15 -0
- package/dist/work-items/card-search-text.js.map +1 -0
- package/dist/work-items/card-source-filters.d.ts +23 -0
- package/dist/work-items/card-source-filters.d.ts.map +1 -0
- package/dist/work-items/card-source-filters.js +25 -0
- package/dist/work-items/card-source-filters.js.map +1 -0
- package/dist/work-items/create-work-item.d.ts +0 -6
- package/dist/work-items/create-work-item.d.ts.map +1 -1
- package/dist/work-items/create-work-item.js +2 -7
- package/dist/work-items/create-work-item.js.map +1 -1
- package/dist/work-items/list-related-cards.d.ts +4 -0
- package/dist/work-items/list-related-cards.d.ts.map +1 -0
- package/dist/work-items/list-related-cards.js +24 -0
- package/dist/work-items/list-related-cards.js.map +1 -0
- package/dist/work-items/search-words.d.ts +5 -0
- package/dist/work-items/search-words.d.ts.map +1 -0
- package/dist/work-items/search-words.js +12 -0
- package/dist/work-items/search-words.js.map +1 -0
- package/dist/work-items/source-external-id.d.ts +4 -0
- package/dist/work-items/source-external-id.d.ts.map +1 -0
- package/dist/work-items/source-external-id.js +9 -0
- package/dist/work-items/source-external-id.js.map +1 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +92 -47
- package/dist/workspace.js.map +1 -1
- package/package.json +9 -8
|
@@ -7,6 +7,13 @@ const REPOSITORIES_PER_TOKEN = 10;
|
|
|
7
7
|
* group would add requests exactly when there is no budget for them.
|
|
8
8
|
*/
|
|
9
9
|
const GROUP_RETRY_AFTER_MS = 6e4;
|
|
10
|
+
/** Split repository ids into the groups one token each can name, keeping order and dropping repeats. */
|
|
11
|
+
function groupRepositoryIds(repositoryIds) {
|
|
12
|
+
const ids = [...new Set(repositoryIds)];
|
|
13
|
+
const groups = [];
|
|
14
|
+
for (let i = 0; i < ids.length; i += REPOSITORIES_PER_TOKEN) groups.push(ids.slice(i, i + REPOSITORIES_PER_TOKEN));
|
|
15
|
+
return groups;
|
|
16
|
+
}
|
|
10
17
|
/**
|
|
11
18
|
* Access to each of an environment's repositories, minted a group at a time.
|
|
12
19
|
* Asking for one repository asks for its group of up to ten, so a provider
|
|
@@ -18,9 +25,7 @@ const GROUP_RETRY_AFTER_MS = 6e4;
|
|
|
18
25
|
* repository's own token.
|
|
19
26
|
*/
|
|
20
27
|
function groupedRepositoryAccess(versionControl, orgId, repositoryIds, now = Date.now) {
|
|
21
|
-
const
|
|
22
|
-
const groups = [];
|
|
23
|
-
for (let i = 0; i < ids.length; i += REPOSITORIES_PER_TOKEN) groups.push(ids.slice(i, i + REPOSITORIES_PER_TOKEN));
|
|
28
|
+
const groups = groupRepositoryIds(repositoryIds);
|
|
24
29
|
const skipUntil = /* @__PURE__ */ new Map();
|
|
25
30
|
const pending = /* @__PURE__ */ new Map();
|
|
26
31
|
const groupAccess = (group, getRepositoriesAccess) => {
|
|
@@ -50,6 +55,6 @@ function groupedRepositoryAccess(versionControl, orgId, repositoryIds, now = Dat
|
|
|
50
55
|
});
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
|
-
export { groupedRepositoryAccess };
|
|
58
|
+
export { groupRepositoryIds, groupedRepositoryAccess };
|
|
54
59
|
|
|
55
60
|
//# sourceMappingURL=repository-access.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-access.js","names":[],"sources":["../../src/environment/repository-access.ts"],"sourcesContent":["import type { RepositoriesAccess, RepositoryAccess, VersionControl } from '../capabilities/version-control.js';\n\ntype GetRepositoriesAccess = NonNullable<VersionControl['getRepositoriesAccess']>;\n\n/** The most repositories one Platform GitHub token can name. */\nconst REPOSITORIES_PER_TOKEN = 10;\n/**\n * How long a group the provider refused or failed to mint is skipped. A failed\n * group mint is often a rate limit, so retrying it for every repository in the\n * group would add requests exactly when there is no budget for them.\n */\nconst GROUP_RETRY_AFTER_MS = 60_000;\n\n/**\n * Access to each of an environment's repositories, minted a group at a time.\n * Asking for one repository asks for its group of up to ten, so a provider\n * that can grant a group mints one token for it and serves every repository in\n * it from that token, instead of minting one per repository (eleven\n * repositories: two mints, not eleven). The group token stays with these\n * callers: a plain `getRepositoryAccess` elsewhere still gets a token for its\n * own repository only. A group the provider can't grant falls back to the\n * repository's own token.\n */\nexport function groupedRepositoryAccess(\n versionControl: Pick<VersionControl, 'getRepositoryAccess' | 'getRepositoriesAccess'>,\n orgId: string,\n repositoryIds: readonly string[],\n now: () => number = Date.now,\n): (repositoryId: string) => Promise<RepositoryAccess> {\n const
|
|
1
|
+
{"version":3,"file":"repository-access.js","names":[],"sources":["../../src/environment/repository-access.ts"],"sourcesContent":["import type { RepositoriesAccess, RepositoryAccess, VersionControl } from '../capabilities/version-control.js';\n\ntype GetRepositoriesAccess = NonNullable<VersionControl['getRepositoriesAccess']>;\n\n/** The most repositories one Platform GitHub token can name. */\nconst REPOSITORIES_PER_TOKEN = 10;\n/**\n * How long a group the provider refused or failed to mint is skipped. A failed\n * group mint is often a rate limit, so retrying it for every repository in the\n * group would add requests exactly when there is no budget for them.\n */\nconst GROUP_RETRY_AFTER_MS = 60_000;\n\n/** Split repository ids into the groups one token each can name, keeping order and dropping repeats. */\nexport function groupRepositoryIds(repositoryIds: readonly string[]): string[][] {\n const ids = [...new Set(repositoryIds)];\n const groups: string[][] = [];\n for (let i = 0; i < ids.length; i += REPOSITORIES_PER_TOKEN) groups.push(ids.slice(i, i + REPOSITORIES_PER_TOKEN));\n return groups;\n}\n\n/**\n * Access to each of an environment's repositories, minted a group at a time.\n * Asking for one repository asks for its group of up to ten, so a provider\n * that can grant a group mints one token for it and serves every repository in\n * it from that token, instead of minting one per repository (eleven\n * repositories: two mints, not eleven). The group token stays with these\n * callers: a plain `getRepositoryAccess` elsewhere still gets a token for its\n * own repository only. A group the provider can't grant falls back to the\n * repository's own token.\n */\nexport function groupedRepositoryAccess(\n versionControl: Pick<VersionControl, 'getRepositoryAccess' | 'getRepositoriesAccess'>,\n orgId: string,\n repositoryIds: readonly string[],\n now: () => number = Date.now,\n): (repositoryId: string) => Promise<RepositoryAccess> {\n const groups = groupRepositoryIds(repositoryIds);\n const skipUntil = new Map<string[], number>();\n const pending = new Map<string[], Promise<RepositoriesAccess | undefined>>();\n const groupAccess = (group: string[], getRepositoriesAccess: GetRepositoriesAccess) => {\n let request = pending.get(group);\n if (!request) {\n // Best-effort: the repository's own token still works without it.\n request = getRepositoriesAccess({ orgId, repositoryIds: group })\n .catch(() => undefined)\n .then(access => {\n if (!access) skipUntil.set(group, now() + GROUP_RETRY_AFTER_MS);\n return access;\n })\n .finally(() => pending.delete(group));\n pending.set(group, request);\n }\n return request;\n };\n return async repositoryId => {\n const group = groups.find(candidate => candidate.includes(repositoryId));\n const getRepositoriesAccess = versionControl.getRepositoriesAccess?.bind(versionControl);\n if (group && group.length > 1 && getRepositoriesAccess && (skipUntil.get(group) ?? 0) <= now()) {\n // Parallel callers share one group request.\n const own = (await groupAccess(group, getRepositoriesAccess))?.repositories?.[repositoryId];\n if (own) return own;\n }\n return versionControl.getRepositoryAccess({ orgId, repositoryId });\n };\n}\n"],"mappings":";;AAKA,MAAM,yBAAyB;;;;;;AAM/B,MAAM,uBAAuB;;AAG7B,SAAgB,mBAAmB,eAA8C;CAC/E,MAAM,MAAM,CAAC,GAAG,IAAI,IAAI,aAAa,CAAC;CACtC,MAAM,SAAqB,CAAC;CAC5B,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK,wBAAwB,OAAO,KAAK,IAAI,MAAM,GAAG,IAAI,sBAAsB,CAAC;CACjH,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,wBACd,gBACA,OACA,eACA,MAAoB,KAAK,KAC4B;CACrD,MAAM,SAAS,mBAAmB,aAAa;CAC/C,MAAM,4BAAY,IAAI,IAAsB;CAC5C,MAAM,0BAAU,IAAI,IAAuD;CAC3E,MAAM,eAAe,OAAiB,0BAAiD;EACrF,IAAI,UAAU,QAAQ,IAAI,KAAK;EAC/B,IAAI,CAAC,SAAS;GAEZ,UAAU,sBAAsB;IAAE;IAAO,eAAe;GAAM,CAAC,CAAC,CAC7D,YAAY,KAAA,CAAS,CAAC,CACtB,MAAK,WAAU;IACd,IAAI,CAAC,QAAQ,UAAU,IAAI,OAAO,IAAI,IAAI,oBAAoB;IAC9D,OAAO;GACT,CAAC,CAAC,CACD,cAAc,QAAQ,OAAO,KAAK,CAAC;GACtC,QAAQ,IAAI,OAAO,OAAO;EAC5B;EACA,OAAO;CACT;CACA,OAAO,OAAM,iBAAgB;EAC3B,MAAM,QAAQ,OAAO,MAAK,cAAa,UAAU,SAAS,YAAY,CAAC;EACvE,MAAM,wBAAwB,eAAe,uBAAuB,KAAK,cAAc;EACvF,IAAI,SAAS,MAAM,SAAS,KAAK,0BAA0B,UAAU,IAAI,KAAK,KAAK,MAAM,IAAI,GAAG;GAE9F,MAAM,OAAO,MAAM,YAAY,OAAO,qBAAqB,EAAA,EAAI,eAAe;GAC9E,IAAI,KAAK,OAAO;EAClB;EACA,OAAO,eAAe,oBAAoB;GAAE;GAAO;EAAa,CAAC;CACnE;AACF"}
|
package/dist/factory.d.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* Integration readiness is derived from each instance's declared capabilities
|
|
19
19
|
* and the storage domains those capabilities require.
|
|
20
20
|
*/
|
|
21
|
+
import type { MastraCodeConfig } from '@mastra/code-sdk';
|
|
21
22
|
import type { BuiltinToolId } from '@mastra/core/agent-controller';
|
|
22
23
|
import type { MastraBrowser } from '@mastra/core/browser';
|
|
23
24
|
import type { PubSub } from '@mastra/core/events';
|
|
@@ -70,6 +71,8 @@ export interface MastraFactoryConfig {
|
|
|
70
71
|
* one connection, every feature on.
|
|
71
72
|
*/
|
|
72
73
|
storage: FactoryStorage;
|
|
74
|
+
/** Scorers for the mounted code agent. None run by default. */
|
|
75
|
+
scorers?: MastraCodeConfig['scorers'];
|
|
73
76
|
/** Disable persistence of rich scorer results. Default: true. */
|
|
74
77
|
disableScoreStorage?: boolean;
|
|
75
78
|
/**
|
|
@@ -253,6 +256,7 @@ export type { FactorySandboxStart } from './workspace.js';
|
|
|
253
256
|
* limit shared across deployments.
|
|
254
257
|
*/
|
|
255
258
|
export interface MastraFactoryDispatcherConfig {
|
|
259
|
+
/** Automated agent runs one server process holds at once. Defaults to 10; runs past it wait in the run queue. */
|
|
256
260
|
maxInFlight?: number;
|
|
257
261
|
}
|
|
258
262
|
export declare class MastraFactory {
|
package/dist/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"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"}
|
package/dist/factory.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildAuthDisabledRoutes, buildAuthRoutes, createFactoryAuthGate, createFactoryInteractiveMarker, createFactoryRouteAuth, getFactoryAuthOrgId, getFactoryAuthUserFromContext, getFactoryAuthUserId } from "./auth.js";
|
|
2
|
+
import { publishBoardChange, subscribeBoardChanges } from "./board-changes.js";
|
|
2
3
|
import { BoardWriteError, BoardWrites } from "./boards/board-writes.js";
|
|
3
4
|
import { isDefinedBoard } from "./boards/define-board.js";
|
|
4
5
|
import "./boards/index.js";
|
|
@@ -14,10 +15,13 @@ import { boardForWorkItem, boundChangeRequestNumber, isTerminalWorkItem } from "
|
|
|
14
15
|
import { createGithubReviewStatusReporter, reviewStatusAnimationFromEnv } from "./integrations/github/review-status-reporter.js";
|
|
15
16
|
import { isFactoryGithubLogin, trustedCollaborator } from "./integrations/github/rules.js";
|
|
16
17
|
import { dismissStaleFactoryReviews } from "./integrations/github/stale-reviews.js";
|
|
18
|
+
import { KeptCards } from "./integrations/kept-cards.js";
|
|
17
19
|
import { PlatformApiClient, platformApiClientConfigFromEnv } from "./integrations/platform/api-client.js";
|
|
18
20
|
import { buildConnectToolsRoute, buildPlatformConnectRoutes } from "./integrations/platform/connect/routes.js";
|
|
19
21
|
import { platformConnectTools } from "./integrations/platform/connect/session-tools.js";
|
|
22
|
+
import { logIntegrationSummary } from "./integrations/startup-summary.js";
|
|
20
23
|
import { createSessionAsRowOwner, prepareSessionRunContext } from "./integrations/subscription-session.js";
|
|
24
|
+
import { shareLinkedRepositoryChanges } from "./linked-repositories-changed.js";
|
|
21
25
|
import { buildFactoryMcpRoutes, resolveMcpAuthorizationServers } from "./mcp/routes.js";
|
|
22
26
|
import { resolveDeploymentModelProviders } from "./routes/config.js";
|
|
23
27
|
import { createCustomProvidersPrimer, primeCustomProvidersForRequestContext, registerCustomProvidersSource } from "./routes/custom-provider-source.js";
|
|
@@ -39,8 +43,8 @@ import { createFactoryTransitionTools } from "./rules/tools.js";
|
|
|
39
43
|
import { FactoryTransitionService } from "./rules/transition-service.js";
|
|
40
44
|
import { assertFactoryConfigVersion } from "./rules/validation.js";
|
|
41
45
|
import { CallbackFactorySandbox } from "./sandbox/callback-factory-sandbox.js";
|
|
42
|
-
import { resolveFactoryToolScope } from "./tools/scope.js";
|
|
43
46
|
import { controllerRunInFlight, createContextSandboxStops, createTerminalSandboxStops } from "./sandbox/context-sandboxes.js";
|
|
47
|
+
import { resolveFactoryToolScope } from "./tools/scope.js";
|
|
44
48
|
import { isValidGitRef } from "./sandbox/git-ref.js";
|
|
45
49
|
import { LocalFactorySandbox } from "./sandbox/local-factory-sandbox.js";
|
|
46
50
|
import { CachedSandboxEnvs } from "./sandbox/sandbox-env-cache.js";
|
|
@@ -92,7 +96,7 @@ import { SkillOverridesStorage } from "./storage/domains/skill-overrides/base.js
|
|
|
92
96
|
import { SourceControlStorage } from "./storage/domains/source-control/base.js";
|
|
93
97
|
import { VoiceSettingsStorage } from "./storage/domains/voice-settings/base.js";
|
|
94
98
|
import { WorkItemSplitModeError, WorkItemsStorage } from "./storage/domains/work-items/base.js";
|
|
95
|
-
import { createRequestTimingMiddleware, factoryTimingEnabled, instrumentAsyncMethods, logTiming, timedPhase } from "./timing.js";
|
|
99
|
+
import { bootDiagnosticsEnabled, createRequestTimingMiddleware, factoryTimingEnabled, instrumentAsyncMethods, logTiming, timedPhase } from "./timing.js";
|
|
96
100
|
import { deliverFactorySessionNotification } from "./tools/deliver.js";
|
|
97
101
|
import { createFactoryTools } from "./tools/index.js";
|
|
98
102
|
import { createSessionApprovalNotifier, createSessionRunEndReporter, createStageChangeNotifier, createWorkItemRunEndReporter } from "./tools/reports.js";
|
|
@@ -252,7 +256,10 @@ var MastraFactory = class {
|
|
|
252
256
|
/** Names this replica on the dispatch-wake topic so it can skip its own echoes. */
|
|
253
257
|
#dispatchWakeOrigin = globalThis.crypto.randomUUID();
|
|
254
258
|
#unsubscribeDispatchWakes;
|
|
259
|
+
#unsubscribeBoardChanges;
|
|
260
|
+
#keptCards;
|
|
255
261
|
#unsubscribeSandboxEnvChanges;
|
|
262
|
+
#unsubscribeLinkedRepositoryChanges;
|
|
256
263
|
#startCoordinator;
|
|
257
264
|
#factoryProcessor;
|
|
258
265
|
#channelShutdowns = [];
|
|
@@ -263,6 +270,7 @@ var MastraFactory = class {
|
|
|
263
270
|
#sessionResourceMigration;
|
|
264
271
|
#workItemSplitBackfill;
|
|
265
272
|
#prepareStartedAt;
|
|
273
|
+
#integrations = [];
|
|
266
274
|
#reviewedChangeRequest;
|
|
267
275
|
#preparing = false;
|
|
268
276
|
constructor(config) {
|
|
@@ -441,6 +449,10 @@ var MastraFactory = class {
|
|
|
441
449
|
const { PlatformLinearIntegration } = await import("./integrations/platform/linear/integration.js");
|
|
442
450
|
integrations.push(new PlatformLinearIntegration());
|
|
443
451
|
}
|
|
452
|
+
if (!integrations.some((integration) => integration.id === "vanta")) {
|
|
453
|
+
const { PlatformVantaIntegration } = await import("./integrations/platform/vanta/integration.js");
|
|
454
|
+
integrations.push(new PlatformVantaIntegration());
|
|
455
|
+
}
|
|
444
456
|
}
|
|
445
457
|
if (this.#config.platform?.github && !installedPlatformGithub) console.warn("[factory] 'platform.github' config was provided but the factory installed no GitHub integration of its own " + (explicitGithub ? "(an explicit integration with id 'github' takes precedence, so these options were ignored)." : "(no Platform credentials are configured and no explicit GitHub integration was passed)."));
|
|
446
458
|
const integrationIds = /* @__PURE__ */ new Set();
|
|
@@ -448,11 +460,11 @@ var MastraFactory = class {
|
|
|
448
460
|
if (integrationIds.has(integration.id)) throw new Error(`MastraFactory: duplicate integration id '${integration.id}' in 'integrations'.`);
|
|
449
461
|
integrationIds.add(integration.id);
|
|
450
462
|
}
|
|
463
|
+
this.#integrations = integrations;
|
|
451
464
|
const configVersion = this.#configVersion;
|
|
452
465
|
const intakeStorage = storage.registerDomain(new IntakeStorage());
|
|
453
466
|
const auditStorage = storage.registerDomain(new AuditStorage());
|
|
454
467
|
const workItemsStorage = storage.registerDomain(new WorkItemsStorage());
|
|
455
|
-
workItemsStorage.onBoardChanged((scope) => touchFeed(eventBus, scope));
|
|
456
468
|
workItemsStorage.onClaimableWork(() => publishDispatchWake(eventBus, this.#dispatchWakeOrigin));
|
|
457
469
|
this.#unsubscribeDispatchWakes = subscribeDispatchWakes(eventBus, this.#dispatchWakeOrigin, () => this.#dispatcher?.wake()).catch((error) => {
|
|
458
470
|
console.warn(`[factory] subscribing to dispatcher wakes failed; other replicas' work waits for this replica's own wakes: ${error instanceof Error ? error.message : error}`);
|
|
@@ -473,8 +485,34 @@ var MastraFactory = class {
|
|
|
473
485
|
const queueHealthStorage = storage.registerDomain(new QueueHealthStorage());
|
|
474
486
|
const integrationStorage = storage.registerDomain(new IntegrationStorage(secretEncryption));
|
|
475
487
|
const factoryProjectsStorage = storage.registerDomain(new FactoryProjectsStorage());
|
|
488
|
+
const keptCards = new KeptCards({
|
|
489
|
+
projects: factoryProjectsStorage,
|
|
490
|
+
workItems: workItemsStorage
|
|
491
|
+
});
|
|
492
|
+
this.#keptCards = keptCards;
|
|
493
|
+
const boardChangeOrigin = globalThis.crypto.randomUUID();
|
|
494
|
+
workItemsStorage.onBoardChanged((scope) => {
|
|
495
|
+
touchFeed(eventBus, scope);
|
|
496
|
+
keptCards.changed(scope);
|
|
497
|
+
publishBoardChange(eventBus, boardChangeOrigin, scope);
|
|
498
|
+
});
|
|
499
|
+
factoryProjectsStorage.onDeleted((project) => {
|
|
500
|
+
const scope = {
|
|
501
|
+
orgId: project.orgId,
|
|
502
|
+
factoryProjectId: project.id
|
|
503
|
+
};
|
|
504
|
+
keptCards.changed(scope);
|
|
505
|
+
publishBoardChange(eventBus, boardChangeOrigin, scope);
|
|
506
|
+
});
|
|
507
|
+
this.#unsubscribeBoardChanges = subscribeBoardChanges(eventBus, boardChangeOrigin, (scope) => keptCards.changed(scope)).then((unsubscribe) => {
|
|
508
|
+
keptCards.trustAnnouncements();
|
|
509
|
+
return unsubscribe;
|
|
510
|
+
}, (error) => {
|
|
511
|
+
console.warn(`[factory] subscribing to board changes failed; background sweeps read every board from the database: ${error instanceof Error ? error.message : error}`);
|
|
512
|
+
});
|
|
476
513
|
const filesystemStorage = storage.registerDomain(new FilesystemStorage());
|
|
477
514
|
const sourceControlStorage = storage.registerDomain(new SourceControlStorage());
|
|
515
|
+
this.#unsubscribeLinkedRepositoryChanges = shareLinkedRepositoryChanges(eventBus, sourceControlStorage);
|
|
478
516
|
const channelIdentityStorage = storage.registerDomain(new ChannelIdentityStorage());
|
|
479
517
|
const skillOverridesStorage = storage.registerDomain(new SkillOverridesStorage());
|
|
480
518
|
const domains = {
|
|
@@ -1108,6 +1146,7 @@ var MastraFactory = class {
|
|
|
1108
1146
|
gitBranch: ""
|
|
1109
1147
|
},
|
|
1110
1148
|
storage: storage.getMastraStorage(),
|
|
1149
|
+
...this.#config.scorers ? { scorers: this.#config.scorers } : {},
|
|
1111
1150
|
disableScoreStorage: this.#config.disableScoreStorage ?? true,
|
|
1112
1151
|
...mastraStorageBackend ? { storageBackend: mastraStorageBackend } : {},
|
|
1113
1152
|
knowledge: this.#config.knowledge ?? false,
|
|
@@ -1335,6 +1374,7 @@ var MastraFactory = class {
|
|
|
1335
1374
|
cache: this.#projectBoards
|
|
1336
1375
|
} } : {},
|
|
1337
1376
|
factoryTransitionService: transitionService,
|
|
1377
|
+
runSlots: () => this.#dispatcher?.runSlots(),
|
|
1338
1378
|
onFactoryRuntime: ({ transitionService: runtimeTransitionService, startCoordinator, prepareBinding }) => {
|
|
1339
1379
|
this.#startCoordinator = startCoordinator;
|
|
1340
1380
|
this.#dispatcher ??= new FactoryDecisionDispatcher({
|
|
@@ -1496,11 +1536,14 @@ var MastraFactory = class {
|
|
|
1496
1536
|
threadId: session.thread.getId(),
|
|
1497
1537
|
outcome,
|
|
1498
1538
|
since
|
|
1499
|
-
}), {
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1539
|
+
}), {
|
|
1540
|
+
onApprovalRequested: (request) => notifyApprovalRequested({
|
|
1541
|
+
sessionId: session.identity.getId(),
|
|
1542
|
+
threadId: session.thread.getId(),
|
|
1543
|
+
...request
|
|
1544
|
+
}),
|
|
1545
|
+
answersItself: (toolCallId) => this.#dispatcher?.autoApproves(toolCallId) ?? false
|
|
1546
|
+
});
|
|
1504
1547
|
observeSessionThreadStamp(session);
|
|
1505
1548
|
});
|
|
1506
1549
|
prepared.base.controller.onSessionCreated((session) => hydrateSessionMemorySettings(session, { sourceControl: { sessions: sourceControlSessions } }), { blocking: true });
|
|
@@ -1552,6 +1595,7 @@ var MastraFactory = class {
|
|
|
1552
1595
|
integrations: integrationRegistrations,
|
|
1553
1596
|
configVersion,
|
|
1554
1597
|
boardRegistry: this.#projectBoards ?? this.#boards,
|
|
1598
|
+
...this.#keptCards ? { keptCards: this.#keptCards } : {},
|
|
1555
1599
|
factoryReady,
|
|
1556
1600
|
domains,
|
|
1557
1601
|
...this.#environmentBuilds ? { onRepositoryPush: this.#environmentBuilds.onRepositoryPush } : {},
|
|
@@ -1575,7 +1619,8 @@ var MastraFactory = class {
|
|
|
1575
1619
|
await this.#environmentBuilds?.probeSchedules();
|
|
1576
1620
|
this.#sessionResourceMigration?.then((movedRunBindings) => movedRunBindings ? this.#factoryProcessor?.reconcileAllBoundThreads() : void 0).catch((error) => console.warn(`[factory] reconciling bound threads after the session resource migration failed: ${error instanceof Error ? error.message : error}`));
|
|
1577
1621
|
this.#dispatcher?.start();
|
|
1578
|
-
if (this.#prepareStartedAt !== void 0) logTiming(`boot ${Math.round(performance.now() - this.#prepareStartedAt)}ms`);
|
|
1622
|
+
if (bootDiagnosticsEnabled && this.#prepareStartedAt !== void 0) logTiming(`boot ${Math.round(performance.now() - this.#prepareStartedAt)}ms`);
|
|
1623
|
+
if (process.env.MASTRA_FACTORY_DEV === "true") logIntegrationSummary(this.#integrations);
|
|
1579
1624
|
}
|
|
1580
1625
|
/** Stop Factory-owned background work and channel transports before the host process shuts down. */
|
|
1581
1626
|
async shutdown() {
|
|
@@ -1587,7 +1632,13 @@ var MastraFactory = class {
|
|
|
1587
1632
|
this.#unsubscribeDispatchWakes = void 0;
|
|
1588
1633
|
const unsubscribeSandboxEnvChanges = this.#unsubscribeSandboxEnvChanges;
|
|
1589
1634
|
this.#unsubscribeSandboxEnvChanges = void 0;
|
|
1635
|
+
const unsubscribeBoardChanges = this.#unsubscribeBoardChanges;
|
|
1636
|
+
this.#unsubscribeBoardChanges = void 0;
|
|
1637
|
+
await unsubscribeBoardChanges?.then((unsubscribe) => unsubscribe?.()).catch(() => void 0);
|
|
1590
1638
|
await unsubscribeSandboxEnvChanges?.then((unsubscribe) => unsubscribe?.()).catch(() => void 0);
|
|
1639
|
+
const unsubscribeLinkedRepositoryChanges = this.#unsubscribeLinkedRepositoryChanges;
|
|
1640
|
+
this.#unsubscribeLinkedRepositoryChanges = void 0;
|
|
1641
|
+
await unsubscribeLinkedRepositoryChanges?.then((unsubscribe) => unsubscribe()).catch(() => void 0);
|
|
1591
1642
|
await unsubscribeDispatchWakes?.then((unsubscribe) => unsubscribe?.()).catch((error) => console.warn(`[factory] unsubscribing from dispatcher wakes failed: ${error instanceof Error ? error.message : error}`));
|
|
1592
1643
|
const backfill = this.#workItemSplitBackfill;
|
|
1593
1644
|
backfill?.controller.abort();
|