@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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WorkItemBranchSource } from '../work-item-branch.js';
|
|
2
|
+
/** What a board filter reads of a card or of an issue not filed yet: where it came from and what that source says of it. */
|
|
3
|
+
export interface SourceFacts {
|
|
4
|
+
source: WorkItemBranchSource;
|
|
5
|
+
/** What the source says of the item: its labels, people, Linear project. */
|
|
6
|
+
metadata: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
/** The source filters a board view picked. An empty set picks everything. */
|
|
9
|
+
export interface SourceFilters {
|
|
10
|
+
source: ReadonlySet<string>;
|
|
11
|
+
linearProject: ReadonlySet<string>;
|
|
12
|
+
}
|
|
13
|
+
/** Picks every card that has a pull request, whatever it was filed from. */
|
|
14
|
+
export declare const PULL_REQUEST_SOURCE_FILTER = "pull-request";
|
|
15
|
+
/** The source a card is filtered under: its provider, whether it tracks an issue or a pull request. */
|
|
16
|
+
export declare function boardSource(source: WorkItemBranchSource): string;
|
|
17
|
+
/** The sources a view keeps; empty keeps all. A Linear project picked alone keeps Linear. */
|
|
18
|
+
export declare function pickedBoardSources(filters: SourceFilters): ReadonlySet<string>;
|
|
19
|
+
/** Whether the view's source and Linear project filters keep the item. */
|
|
20
|
+
export declare function matchesSourceFilters(item: SourceFacts & {
|
|
21
|
+
hasPullRequest: boolean;
|
|
22
|
+
}, filters: SourceFilters): boolean;
|
|
23
|
+
//# sourceMappingURL=card-source-filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-source-filters.d.ts","sourceRoot":"","sources":["../../src/work-items/card-source-filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,4HAA4H;AAC5H,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,6EAA6E;AAC7E,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AAIzD,uGAAuG;AACvG,wBAAgB,WAAW,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAGhE;AAED,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,CAG9E;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAYrH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/work-items/card-source-filters.ts
|
|
2
|
+
/** Picks every card that has a pull request, whatever it was filed from. */
|
|
3
|
+
const PULL_REQUEST_SOURCE_FILTER = "pull-request";
|
|
4
|
+
const LINEAR_ONLY = /* @__PURE__ */ new Set(["linear"]);
|
|
5
|
+
/** The source a card is filtered under: its provider, whether it tracks an issue or a pull request. */
|
|
6
|
+
function boardSource(source) {
|
|
7
|
+
if (source === "incidentio-follow-up") return "incidentio";
|
|
8
|
+
return source.split("-")[0] ?? source;
|
|
9
|
+
}
|
|
10
|
+
/** The sources a view keeps; empty keeps all. A Linear project picked alone keeps Linear. */
|
|
11
|
+
function pickedBoardSources(filters) {
|
|
12
|
+
if (filters.source.size > 0 || filters.linearProject.size === 0) return filters.source;
|
|
13
|
+
return LINEAR_ONLY;
|
|
14
|
+
}
|
|
15
|
+
/** Whether the view's source and Linear project filters keep the item. */
|
|
16
|
+
function matchesSourceFilters(item, filters) {
|
|
17
|
+
const sources = pickedBoardSources(filters);
|
|
18
|
+
if (sources.size > 0 && !sources.has(boardSource(item.source)) && !(sources.has("pull-request") && item.hasPullRequest)) return false;
|
|
19
|
+
if (item.source !== "linear-issue" || filters.linearProject.size === 0) return true;
|
|
20
|
+
const projectId = item.metadata.linearProjectId;
|
|
21
|
+
return typeof projectId === "string" && filters.linearProject.has(projectId);
|
|
22
|
+
}
|
|
23
|
+
export { PULL_REQUEST_SOURCE_FILTER, boardSource, matchesSourceFilters, pickedBoardSources };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=card-source-filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-source-filters.js","names":[],"sources":["../../src/work-items/card-source-filters.ts"],"sourcesContent":["import type { WorkItemBranchSource } from '../work-item-branch.js';\n\n/** What a board filter reads of a card or of an issue not filed yet: where it came from and what that source says of it. */\nexport interface SourceFacts {\n source: WorkItemBranchSource;\n /** What the source says of the item: its labels, people, Linear project. */\n metadata: Record<string, unknown>;\n}\n\n/** The source filters a board view picked. An empty set picks everything. */\nexport interface SourceFilters {\n source: ReadonlySet<string>;\n linearProject: ReadonlySet<string>;\n}\n\n/** Picks every card that has a pull request, whatever it was filed from. */\nexport const PULL_REQUEST_SOURCE_FILTER = 'pull-request';\n\nconst LINEAR_ONLY: ReadonlySet<string> = new Set(['linear']);\n\n/** The source a card is filtered under: its provider, whether it tracks an issue or a pull request. */\nexport function boardSource(source: WorkItemBranchSource): string {\n if (source === 'incidentio-follow-up') return 'incidentio';\n return source.split('-')[0] ?? source;\n}\n\n/** The sources a view keeps; empty keeps all. A Linear project picked alone keeps Linear. */\nexport function pickedBoardSources(filters: SourceFilters): ReadonlySet<string> {\n if (filters.source.size > 0 || filters.linearProject.size === 0) return filters.source;\n return LINEAR_ONLY;\n}\n\n/** Whether the view's source and Linear project filters keep the item. */\nexport function matchesSourceFilters(item: SourceFacts & { hasPullRequest: boolean }, filters: SourceFilters): boolean {\n const sources = pickedBoardSources(filters);\n if (\n sources.size > 0 &&\n !sources.has(boardSource(item.source)) &&\n !(sources.has(PULL_REQUEST_SOURCE_FILTER) && item.hasPullRequest)\n ) {\n return false;\n }\n if (item.source !== 'linear-issue' || filters.linearProject.size === 0) return true;\n const projectId = item.metadata.linearProjectId;\n return typeof projectId === 'string' && filters.linearProject.has(projectId);\n}\n"],"mappings":";;AAgBA,MAAa,6BAA6B;AAE1C,MAAM,8BAAmC,IAAI,IAAI,CAAC,QAAQ,CAAC;;AAG3D,SAAgB,YAAY,QAAsC;CAChE,IAAI,WAAW,wBAAwB,OAAO;CAC9C,OAAO,OAAO,MAAM,GAAG,CAAC,CAAC,MAAM;AACjC;;AAGA,SAAgB,mBAAmB,SAA6C;CAC9E,IAAI,QAAQ,OAAO,OAAO,KAAK,QAAQ,cAAc,SAAS,GAAG,OAAO,QAAQ;CAChF,OAAO;AACT;;AAGA,SAAgB,qBAAqB,MAAiD,SAAiC;CACrH,MAAM,UAAU,mBAAmB,OAAO;CAC1C,IACE,QAAQ,OAAO,KACf,CAAC,QAAQ,IAAI,YAAY,KAAK,MAAM,CAAC,KACrC,EAAE,QAAQ,IAAA,cAA8B,KAAK,KAAK,iBAElD,OAAO;CAET,IAAI,KAAK,WAAW,kBAAkB,QAAQ,cAAc,SAAS,GAAG,OAAO;CAC/E,MAAM,YAAY,KAAK,SAAS;CAChC,OAAO,OAAO,cAAc,YAAY,QAAQ,cAAc,IAAI,SAAS;AAC7E"}
|
|
@@ -10,12 +10,6 @@ import type { CreateWorkItemInput, Card, WorkItemsStorage } from '../storage/dom
|
|
|
10
10
|
/** Records one audit event for the caller; routes bind it to the request, tools to the session's person. */
|
|
11
11
|
export type FactoryAuditEmit = (input: EmitAuditInput) => Promise<void>;
|
|
12
12
|
type TransitionResult = Awaited<ReturnType<FactoryTransitionService['transition']>>;
|
|
13
|
-
/**
|
|
14
|
-
* Board metadata key holding the `#number` of a card filed without an issue
|
|
15
|
-
* behind it. Kept apart from `number`, which integrations read as the source
|
|
16
|
-
* issue's number.
|
|
17
|
-
*/
|
|
18
|
-
export declare const CARD_NUMBER_METADATA_KEY = "cardNumber";
|
|
19
13
|
export type CreateFactoryWorkItemResult =
|
|
20
14
|
/** A new card, entered into its board's first phase and audited. */
|
|
21
15
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-work-item.d.ts","sourceRoot":"","sources":["../../src/work-items/create-work-item.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACzG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"create-work-item.d.ts","sourceRoot":"","sources":["../../src/work-items/create-work-item.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,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AC;IACd,iGAAiG;IACjG,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,sFAAsF;IACtF,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,6EAA6E;IAC7E,MAAM,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;CACrE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,KAAK,EACL,KAAK,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,MAAM,GACP,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CA8JlE"}
|
|
@@ -4,6 +4,7 @@ import { INTAKE_ROUTE_METADATA_KEY, resolveIntakePlacement } from "../boards/int
|
|
|
4
4
|
import { cardRuleFacts } from "../boards/card-facts.js";
|
|
5
5
|
import { intakeTarget } from "../boards/semantics.js";
|
|
6
6
|
import { WorkItemUpdateConflictError } from "../storage/domains/work-items/base.js";
|
|
7
|
+
import { CARD_NUMBER_METADATA_KEY } from "./card-number.js";
|
|
7
8
|
// src/work-items/create-work-item.ts
|
|
8
9
|
/**
|
|
9
10
|
* Filing a work item, shared by the board's create route and the Factory tools
|
|
@@ -11,12 +12,6 @@ import { WorkItemUpdateConflictError } from "../storage/domains/work-items/base.
|
|
|
11
12
|
*/
|
|
12
13
|
/** Attempts at each step after the upsert before a card that keeps changing under its creator is left as is. */
|
|
13
14
|
const STEP_ATTEMPTS = 3;
|
|
14
|
-
/**
|
|
15
|
-
* Board metadata key holding the `#number` of a card filed without an issue
|
|
16
|
-
* behind it. Kept apart from `number`, which integrations read as the source
|
|
17
|
-
* issue's number.
|
|
18
|
-
*/
|
|
19
|
-
const CARD_NUMBER_METADATA_KEY = "cardNumber";
|
|
20
15
|
/** One past the highest number given to a manually filed card in the project. */
|
|
21
16
|
async function nextCardNumber(workItems, orgId, factoryProjectId) {
|
|
22
17
|
let highest = 0;
|
|
@@ -209,6 +204,6 @@ async function createFactoryWorkItem({ workItems, boards, transitionService, aud
|
|
|
209
204
|
item
|
|
210
205
|
};
|
|
211
206
|
}
|
|
212
|
-
export {
|
|
207
|
+
export { createFactoryWorkItem };
|
|
213
208
|
|
|
214
209
|
//# sourceMappingURL=create-work-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-work-item.js","names":[],"sources":["../../src/work-items/create-work-item.ts"],"sourcesContent":["/**\n * Filing a work item, shared by the board's create route and the Factory tools\n * so a card filed from a session goes through exactly what \"New card\" does.\n */\n\nimport { DEFAULT_BOARD_ID } from '../boards/default-board.js';\nimport { cardRuleFacts } from '../boards/index.js';\nimport type { BoardRegistry } from '../boards/index.js';\nimport { INTAKE_ROUTE_METADATA_KEY, resolveIntakePlacement } from '../boards/intake-routing.js';\nimport type { IntakeRoutesReader } from '../boards/intake-routing.js';\nimport { intakeTarget } from '../boards/semantics.js';\nimport type { FactoryTransitionRequest, FactoryTransitionService } from '../rules/transition-service.js';\nimport type { EmitAuditInput } from '../storage/domains/audit/domain.js';\nimport { WorkItemUpdateConflictError } from '../storage/domains/work-items/base.js';\nimport type { CreateWorkItemInput, Card, WorkItemsStorage } from '../storage/domains/work-items/base.js';\n\n/** Records one audit event for the caller; routes bind it to the request, tools to the session's person. */\nexport type FactoryAuditEmit = (input: EmitAuditInput) => Promise<void>;\n\ntype TransitionResult = Awaited<ReturnType<FactoryTransitionService['transition']>>;\n\n/** Attempts at each step after the upsert before a card that keeps changing under its creator is left as is. */\nconst STEP_ATTEMPTS = 3;\n\n/**\n * Board metadata key holding the `#number` of a card filed without an issue\n * behind it. Kept apart from `number`, which integrations read as the source\n * issue's number.\n */\nexport const CARD_NUMBER_METADATA_KEY = 'cardNumber';\n\n/** One past the highest number given to a manually filed card in the project. */\nasync function nextCardNumber(workItems: WorkItemsStorage, orgId: string, factoryProjectId: string): Promise<number> {\n let highest = 0;\n for (const card of await workItems.listShared({ orgId, factoryProjectId })) {\n const number = card.metadata?.[CARD_NUMBER_METADATA_KEY];\n if (typeof number === 'number' && number > highest) highest = number;\n }\n return highest + 1;\n}\n\nexport type CreateFactoryWorkItemResult =\n /** A new card, entered into its board's first phase and audited. */\n | { status: 'created'; item: Card }\n /** The source key matched an existing card, which was updated instead (the caller audits the patch). */\n | { status: 'reused'; item: Card }\n | {\n status: 'refused';\n code: 'invalid_board' | 'governed_transition_required' | 'factory_transitions_unavailable';\n message: string;\n }\n /** The first phase's entry rules (or the move to an intake route's phase) refused the card; it was removed again unless a concurrent create had already reused it. */\n | { status: 'rejected'; code: Extract<TransitionResult, { status: 'rejected' }>['code']; reason: string };\n\nexport interface CreateFactoryWorkItemArgs {\n workItems: WorkItemsStorage;\n boards: BoardRegistry;\n transitionService: Pick<FactoryTransitionService, 'transition'> | undefined;\n audit: FactoryAuditEmit;\n orgId: string;\n /** Who files the card; becomes its `created_by` and the human actor of its first phase entry. */\n userId: string;\n factoryProjectId: string;\n input: CreateWorkItemInput;\n /** The project's intake routes; they place a card filed without a board or stages. */\n intakeRoutes?: IntakeRoutesReader;\n /** Where a browser request came from; a session's tool call carries none. */\n origin?: Pick<FactoryTransitionRequest, 'actorProfile' | 'context'>;\n}\n\n/**\n * Upserts the card into its board's first phase, enters that phase as the\n * person (rolling the card back if its entry rules refuse it), then audits\n * `factory.work_item.created`. Throws `WorkItemRelationError` for a bad parent.\n */\nexport async function createFactoryWorkItem({\n workItems,\n boards,\n transitionService,\n audit,\n orgId,\n userId,\n factoryProjectId,\n input,\n intakeRoutes,\n origin,\n}: CreateFactoryWorkItemArgs): Promise<CreateFactoryWorkItemResult> {\n // A card filed without a board or stages goes where the project's intake routes say; one\n // that names either went where the person chose.\n const placement =\n intakeRoutes && input.board === undefined && input.stages === undefined\n ? resolveIntakePlacement(\n await intakeRoutes.listIntakeRoutes({ orgId, factoryProjectId }),\n cardRuleFacts({\n title: input.title,\n metadata: input.metadata ?? null,\n externalSource: input.externalSource ?? null,\n }),\n boards,\n )\n : undefined;\n // No route took it: Work, else the project's first board (a project with only an app's boards).\n const boardId = placement?.board ?? input.board ?? intakeTarget(boards)?.board ?? DEFAULT_BOARD_ID;\n const board = boards.get(boardId);\n if (!board) return { status: 'refused', code: 'invalid_board', message: `Board '${boardId}' is not installed.` };\n const initialStages = input.stages ?? [board.initialPhase];\n if (initialStages.length !== 1 || initialStages[0] !== board.initialPhase) {\n return {\n status: 'refused',\n code: 'governed_transition_required',\n message: `New work items must enter through the '${board.initialPhase}' phase of board '${boardId}'.`,\n };\n }\n\n await workItems.ensureReady();\n // A card with no issue behind it has no number of its own, so it gets the project's next one.\n const metadata = input.externalSource\n ? input.metadata\n : {\n ...input.metadata,\n [CARD_NUMBER_METADATA_KEY]: await nextCardNumber(workItems, orgId, factoryProjectId),\n };\n const result = await workItems.upsert({\n orgId,\n userId,\n factoryProjectId,\n input: {\n ...input,\n ...(metadata ? { metadata } : {}),\n board: boardId,\n stages: initialStages,\n },\n reuseMode: 'non-stage',\n });\n // A reused card keeps its own placement, so only a card this call created records the route.\n if (!result.created) return { status: 'reused', item: result.item };\n\n const id = result.item.id;\n // A concurrent create for the same source can reuse this card at any step below. That caller\n // has already returned it as `reused`, so a step that loses the revision race is retried at the\n // current revision, and the card is never rolled back once anyone else has touched it. A reuse\n // that only refreshes source facts keeps the revision but moves `updatedAt`, so the rollback\n // deletes only while both still match this call's last write.\n let revision: number | undefined = result.item.revision;\n let updatedAt = result.item.updatedAt;\n let contended = false;\n const reread = async () => {\n contended = true;\n revision = (await workItems.getForProject(orgId, factoryProjectId, id))?.revision;\n };\n const rollBack = async () => {\n if (contended || revision === undefined) return;\n await workItems.delete({ orgId, id, expectedRevision: revision, expectedUpdatedAt: updatedAt });\n };\n const notFound = { status: 'rejected', code: 'invalid_transition', reason: 'Work item not found.' } as const;\n\n if (placement) {\n for (let attempt = 1; revision !== undefined; attempt++) {\n try {\n const stamped = await workItems.update({\n orgId,\n id,\n userId,\n patch: { metadata: { [INTAKE_ROUTE_METADATA_KEY]: placement.routeId } },\n expectedRevision: revision,\n });\n revision = stamped?.item.revision;\n if (stamped) updatedAt = stamped.item.updatedAt;\n break;\n } catch (error) {\n const stale = error instanceof WorkItemUpdateConflictError && error.reason === 'revision';\n if (!stale || attempt >= STEP_ATTEMPTS) throw error;\n await reread();\n }\n }\n if (revision === undefined) return notFound;\n }\n if (!transitionService) {\n await rollBack();\n return {\n status: 'refused',\n code: 'factory_transitions_unavailable',\n message: 'Factory stage transitions are not available right now.',\n };\n }\n const transition = async (\n request: Omit<FactoryTransitionRequest, 'expectedRevision'>,\n ): Promise<TransitionResult | undefined> => {\n for (let attempt = 1; revision !== undefined; attempt++) {\n const transitioned = await transitionService.transition({ ...request, expectedRevision: revision });\n // The result carries no timestamp, so `updatedAt` stays at the last write this call saw; the\n // commit has moved the card past it, so a later rollback keeps the card instead of guessing.\n if (transitioned.status === 'accepted') revision = transitioned.revision;\n if (transitioned.status !== 'rejected' || transitioned.code !== 'stale' || attempt >= STEP_ATTEMPTS) {\n return transitioned;\n }\n await reread();\n }\n return undefined;\n };\n\n const entered = await transition({\n orgId,\n factoryProjectId,\n workItemId: id,\n board: boardId,\n stage: board.initialPhase,\n actor: { type: 'human', id: userId },\n ...origin,\n ingress: { type: 'human', identity: `work-item:${id}:initial-entry` },\n cause: 'work_item_created',\n initialEntry: true,\n });\n if (!entered) return notFound;\n if (entered.status === 'rejected') {\n await rollBack();\n return { status: 'rejected', code: entered.code, reason: entered.reason };\n }\n if (placement && placement.phase !== board.initialPhase) {\n const moved = await transition({\n orgId,\n factoryProjectId,\n workItemId: id,\n board: boardId,\n stage: placement.phase,\n // The route moves the card, not the person: a run it starts still needs their consent.\n actor: { type: 'system', id: 'factory-intake-route' },\n ingress: { type: 'rule', identity: `work-item:${id}:intake-route` },\n cause: 'work_item_created',\n });\n if (!moved) return notFound;\n if (moved.status === 'rejected') {\n await rollBack();\n return { status: 'rejected', code: moved.code, reason: moved.reason };\n }\n }\n const item = (await workItems.getForProject(orgId, factoryProjectId, id)) ?? result.item;\n await audit({\n action: 'factory.work_item.created',\n factoryProjectId,\n targets: [{ type: 'work_item', id: item.id, name: item.title }],\n metadata: { externalSource: item.externalSource, stages: item.stages },\n });\n return { status: 'created', item };\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAM,gBAAgB;;;;;;AAOtB,MAAa,2BAA2B;;AAGxC,eAAe,eAAe,WAA6B,OAAe,kBAA2C;CACnH,IAAI,UAAU;CACd,KAAK,MAAM,QAAQ,MAAM,UAAU,WAAW;EAAE;EAAO;CAAiB,CAAC,GAAG;EAC1E,MAAM,SAAS,KAAK,WAAW;EAC/B,IAAI,OAAO,WAAW,YAAY,SAAS,SAAS,UAAU;CAChE;CACA,OAAO,UAAU;AACnB;;;;;;AAoCA,eAAsB,sBAAsB,EAC1C,WACA,QACA,mBACA,OACA,OACA,QACA,kBACA,OACA,cACA,UACkE;CAGlE,MAAM,YACJ,gBAAgB,MAAM,UAAU,KAAA,KAAa,MAAM,WAAW,KAAA,IAC1D,uBACE,MAAM,aAAa,iBAAiB;EAAE;EAAO;CAAiB,CAAC,GAC/D,cAAc;EACZ,OAAO,MAAM;EACb,UAAU,MAAM,YAAY;EAC5B,gBAAgB,MAAM,kBAAkB;CAC1C,CAAC,GACD,MACF,IACA,KAAA;CAEN,MAAM,UAAU,WAAW,SAAS,MAAM,SAAS,aAAa,MAAM,CAAC,EAAE,SAAA;CACzE,MAAM,QAAQ,OAAO,IAAI,OAAO;CAChC,IAAI,CAAC,OAAO,OAAO;EAAE,QAAQ;EAAW,MAAM;EAAiB,SAAS,UAAU,QAAQ;CAAqB;CAC/G,MAAM,gBAAgB,MAAM,UAAU,CAAC,MAAM,YAAY;CACzD,IAAI,cAAc,WAAW,KAAK,cAAc,OAAO,MAAM,cAC3D,OAAO;EACL,QAAQ;EACR,MAAM;EACN,SAAS,0CAA0C,MAAM,aAAa,o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c,OAAO,kBAAkB,EAAE,KAAM,OAAO;CACpF,MAAM,MAAM;EACV,QAAQ;EACR;EACA,SAAS,CAAC;GAAE,MAAM;GAAa,IAAI,KAAK;GAAI,MAAM,KAAK;EAAM,CAAC;EAC9D,UAAU;GAAE,gBAAgB,KAAK;GAAgB,QAAQ,KAAK;EAAO;CACvE,CAAC;CACD,OAAO;EAAE,QAAQ;EAAW;CAAK;AACnC"}
|
|
1
|
+
{"version":3,"file":"create-work-item.js","names":[],"sources":["../../src/work-items/create-work-item.ts"],"sourcesContent":["/**\n * Filing a work item, shared by the board's create route and the Factory tools\n * so a card filed from a session goes through exactly what \"New card\" does.\n */\n\nimport { DEFAULT_BOARD_ID } from '../boards/default-board.js';\nimport { cardRuleFacts } from '../boards/index.js';\nimport type { BoardRegistry } from '../boards/index.js';\nimport { INTAKE_ROUTE_METADATA_KEY, resolveIntakePlacement } from '../boards/intake-routing.js';\nimport type { IntakeRoutesReader } from '../boards/intake-routing.js';\nimport { intakeTarget } from '../boards/semantics.js';\nimport type { FactoryTransitionRequest, FactoryTransitionService } from '../rules/transition-service.js';\nimport type { EmitAuditInput } from '../storage/domains/audit/domain.js';\nimport { WorkItemUpdateConflictError } from '../storage/domains/work-items/base.js';\nimport type { CreateWorkItemInput, Card, WorkItemsStorage } from '../storage/domains/work-items/base.js';\nimport { CARD_NUMBER_METADATA_KEY } from './card-number.js';\n\n/** Records one audit event for the caller; routes bind it to the request, tools to the session's person. */\nexport type FactoryAuditEmit = (input: EmitAuditInput) => Promise<void>;\n\ntype TransitionResult = Awaited<ReturnType<FactoryTransitionService['transition']>>;\n\n/** Attempts at each step after the upsert before a card that keeps changing under its creator is left as is. */\nconst STEP_ATTEMPTS = 3;\n\n/** One past the highest number given to a manually filed card in the project. */\nasync function nextCardNumber(workItems: WorkItemsStorage, orgId: string, factoryProjectId: string): Promise<number> {\n let highest = 0;\n for (const card of await workItems.listShared({ orgId, factoryProjectId })) {\n const number = card.metadata?.[CARD_NUMBER_METADATA_KEY];\n if (typeof number === 'number' && number > highest) highest = number;\n }\n return highest + 1;\n}\n\nexport type CreateFactoryWorkItemResult =\n /** A new card, entered into its board's first phase and audited. */\n | { status: 'created'; item: Card }\n /** The source key matched an existing card, which was updated instead (the caller audits the patch). */\n | { status: 'reused'; item: Card }\n | {\n status: 'refused';\n code: 'invalid_board' | 'governed_transition_required' | 'factory_transitions_unavailable';\n message: string;\n }\n /** The first phase's entry rules (or the move to an intake route's phase) refused the card; it was removed again unless a concurrent create had already reused it. */\n | { status: 'rejected'; code: Extract<TransitionResult, { status: 'rejected' }>['code']; reason: string };\n\nexport interface CreateFactoryWorkItemArgs {\n workItems: WorkItemsStorage;\n boards: BoardRegistry;\n transitionService: Pick<FactoryTransitionService, 'transition'> | undefined;\n audit: FactoryAuditEmit;\n orgId: string;\n /** Who files the card; becomes its `created_by` and the human actor of its first phase entry. */\n userId: string;\n factoryProjectId: string;\n input: CreateWorkItemInput;\n /** The project's intake routes; they place a card filed without a board or stages. */\n intakeRoutes?: IntakeRoutesReader;\n /** Where a browser request came from; a session's tool call carries none. */\n origin?: Pick<FactoryTransitionRequest, 'actorProfile' | 'context'>;\n}\n\n/**\n * Upserts the card into its board's first phase, enters that phase as the\n * person (rolling the card back if its entry rules refuse it), then audits\n * `factory.work_item.created`. Throws `WorkItemRelationError` for a bad parent.\n */\nexport async function createFactoryWorkItem({\n workItems,\n boards,\n transitionService,\n audit,\n orgId,\n userId,\n factoryProjectId,\n input,\n intakeRoutes,\n origin,\n}: CreateFactoryWorkItemArgs): Promise<CreateFactoryWorkItemResult> {\n // A card filed without a board or stages goes where the project's intake routes say; one\n // that names either went where the person chose.\n const placement =\n intakeRoutes && input.board === undefined && input.stages === undefined\n ? resolveIntakePlacement(\n await intakeRoutes.listIntakeRoutes({ orgId, factoryProjectId }),\n cardRuleFacts({\n title: input.title,\n metadata: input.metadata ?? null,\n externalSource: input.externalSource ?? null,\n }),\n boards,\n )\n : undefined;\n // No route took it: Work, else the project's first board (a project with only an app's boards).\n const boardId = placement?.board ?? input.board ?? intakeTarget(boards)?.board ?? DEFAULT_BOARD_ID;\n const board = boards.get(boardId);\n if (!board) return { status: 'refused', code: 'invalid_board', message: `Board '${boardId}' is not installed.` };\n const initialStages = input.stages ?? [board.initialPhase];\n if (initialStages.length !== 1 || initialStages[0] !== board.initialPhase) {\n return {\n status: 'refused',\n code: 'governed_transition_required',\n message: `New work items must enter through the '${board.initialPhase}' phase of board '${boardId}'.`,\n };\n }\n\n await workItems.ensureReady();\n // A card with no issue behind it has no number of its own, so it gets the project's next one.\n const metadata = input.externalSource\n ? input.metadata\n : {\n ...input.metadata,\n [CARD_NUMBER_METADATA_KEY]: await nextCardNumber(workItems, orgId, factoryProjectId),\n };\n const result = await workItems.upsert({\n orgId,\n userId,\n factoryProjectId,\n input: {\n ...input,\n ...(metadata ? { metadata } : {}),\n board: boardId,\n stages: initialStages,\n },\n reuseMode: 'non-stage',\n });\n // A reused card keeps its own placement, so only a card this call created records the route.\n if (!result.created) return { status: 'reused', item: result.item };\n\n const id = result.item.id;\n // A concurrent create for the same source can reuse this card at any step below. That caller\n // has already returned it as `reused`, so a step that loses the revision race is retried at the\n // current revision, and the card is never rolled back once anyone else has touched it. A reuse\n // that only refreshes source facts keeps the revision but moves `updatedAt`, so the rollback\n // deletes only while both still match this call's last write.\n let revision: number | undefined = result.item.revision;\n let updatedAt = result.item.updatedAt;\n let contended = false;\n const reread = async () => {\n contended = true;\n revision = (await workItems.getForProject(orgId, factoryProjectId, id))?.revision;\n };\n const rollBack = async () => {\n if (contended || revision === undefined) return;\n await workItems.delete({ orgId, id, expectedRevision: revision, expectedUpdatedAt: updatedAt });\n };\n const notFound = { status: 'rejected', code: 'invalid_transition', reason: 'Work item not found.' } as const;\n\n if (placement) {\n for (let attempt = 1; revision !== undefined; attempt++) {\n try {\n const stamped = await workItems.update({\n orgId,\n id,\n userId,\n patch: { metadata: { [INTAKE_ROUTE_METADATA_KEY]: placement.routeId } },\n expectedRevision: revision,\n });\n revision = stamped?.item.revision;\n if (stamped) updatedAt = stamped.item.updatedAt;\n break;\n } catch (error) {\n const stale = error instanceof WorkItemUpdateConflictError && error.reason === 'revision';\n if (!stale || attempt >= STEP_ATTEMPTS) throw error;\n await reread();\n }\n }\n if (revision === undefined) return notFound;\n }\n if (!transitionService) {\n await rollBack();\n return {\n status: 'refused',\n code: 'factory_transitions_unavailable',\n message: 'Factory stage transitions are not available right now.',\n };\n }\n const transition = async (\n request: Omit<FactoryTransitionRequest, 'expectedRevision'>,\n ): Promise<TransitionResult | undefined> => {\n for (let attempt = 1; revision !== undefined; attempt++) {\n const transitioned = await transitionService.transition({ ...request, expectedRevision: revision });\n // The result carries no timestamp, so `updatedAt` stays at the last write this call saw; the\n // commit has moved the card past it, so a later rollback keeps the card instead of guessing.\n if (transitioned.status === 'accepted') revision = transitioned.revision;\n if (transitioned.status !== 'rejected' || transitioned.code !== 'stale' || attempt >= STEP_ATTEMPTS) {\n return transitioned;\n }\n await reread();\n }\n return undefined;\n };\n\n const entered = await transition({\n orgId,\n factoryProjectId,\n workItemId: id,\n board: boardId,\n stage: board.initialPhase,\n actor: { type: 'human', id: userId },\n ...origin,\n ingress: { type: 'human', identity: `work-item:${id}:initial-entry` },\n cause: 'work_item_created',\n initialEntry: true,\n });\n if (!entered) return notFound;\n if (entered.status === 'rejected') {\n await rollBack();\n return { status: 'rejected', code: entered.code, reason: entered.reason };\n }\n if (placement && placement.phase !== board.initialPhase) {\n const moved = await transition({\n orgId,\n factoryProjectId,\n workItemId: id,\n board: boardId,\n stage: placement.phase,\n // The route moves the card, not the person: a run it starts still needs their consent.\n actor: { type: 'system', id: 'factory-intake-route' },\n ingress: { type: 'rule', identity: `work-item:${id}:intake-route` },\n cause: 'work_item_created',\n });\n if (!moved) return notFound;\n if (moved.status === 'rejected') {\n await rollBack();\n return { status: 'rejected', code: moved.code, reason: moved.reason };\n }\n }\n const item = (await workItems.getForProject(orgId, factoryProjectId, id)) ?? result.item;\n await audit({\n action: 'factory.work_item.created',\n factoryProjectId,\n targets: [{ type: 'work_item', id: item.id, name: item.title }],\n metadata: { externalSource: item.externalSource, stages: item.stages },\n });\n return { status: 'created', item };\n}\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAM,gBAAgB;;AAGtB,eAAe,eAAe,WAA6B,OAAe,kBAA2C;CACnH,IAAI,UAAU;CACd,KAAK,MAAM,QAAQ,MAAM,UAAU,WAAW;EAAE;EAAO;CAAiB,CAAC,GAAG;EAC1E,MAAM,SAAS,KAAK,WAAW;EAC/B,IAAI,OAAO,WAAW,YAAY,SAAS,SAAS,UAAU;CAChE;CACA,OAAO,UAAU;AACnB;;;;;;AAoCA,eAAsB,sBAAsB,EAC1C,WACA,QACA,mBACA,OACA,OACA,QACA,kBACA,OACA,cACA,UACkE;CAGlE,MAAM,YACJ,gBAAgB,MAAM,UAAU,KAAA,KAAa,MAAM,WAAW,KAAA,IAC1D,uBACE,MAAM,aAAa,iBAAiB;EAAE;EAAO;CAAiB,CAAC,GAC/D,cAAc;EACZ,OAAO,MAAM;EACb,UAAU,MAAM,YAAY;EAC5B,gBAAgB,MAAM,kBAAkB;CAC1C,CAAC,GACD,MACF,IACA,KAAA;CAEN,MAAM,UAAU,WAAW,SAAS,MAAM,SAAS,aAAa,MAAM,CAAC,EAAE,SAAA;CACzE,MAAM,QAAQ,OAAO,IAAI,OAAO;CAChC,IAAI,CAAC,OAAO,OAAO;EAAE,QAAQ;EAAW,MAAM;EAAiB,SAAS,UAAU,QAAQ;CAAqB;CAC/G,MAAM,gBAAgB,MAAM,UAAU,CAAC,MAAM,YAAY;CACzD,IAAI,cAAc,WAAW,KAAK,cAAc,OAAO,MAAM,cAC3D,OAAO;EACL,QAAQ;EACR,MAAM;EACN,SAAS,0CAA0C,MAAM,aAAa,oBAAoB,QAAQ;CACpG;CAGF,MAAM,UAAU,YAAY;CAE5B,MAAM,WAAW,MAAM,iBACnB,MAAM,WACN;EACE,GAAG,MAAM;GACR,2BAA2B,MAAM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MAAM,KAAK;EAAM,CAAC;EAC9D,UAAU;GAAE,gBAAgB,KAAK;GAAgB,QAAQ,KAAK;EAAO;CACvE,CAAC;CACD,OAAO;EAAE,QAAQ;EAAW;CAAK;AACnC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Card } from '../storage/domains/work-items/base.js';
|
|
2
|
+
/** Reads the cards related to one of the list's cards, in list order. */
|
|
3
|
+
export declare function relatedCardsIn(list: readonly Card[]): (card: Card) => Card[];
|
|
4
|
+
//# sourceMappingURL=list-related-cards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-related-cards.d.ts","sourceRoot":"","sources":["../../src/work-items/list-related-cards.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAgBlE,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,CAO5E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isPullRequestCard } from "../boards/semantics.js";
|
|
2
|
+
import { workItemBranchSource } from "../work-item-branch.js";
|
|
3
|
+
import { relatedCardIndex } from "./related-cards.js";
|
|
4
|
+
// src/work-items/list-related-cards.ts
|
|
5
|
+
const CARD_PULL_REQUESTS = {
|
|
6
|
+
isPullRequest: (card) => isPullRequestCard({ source: workItemBranchSource(card.externalSource) }),
|
|
7
|
+
headBranch: (card) => {
|
|
8
|
+
const branch = card.workItem.metadata?.headBranch;
|
|
9
|
+
return typeof branch === "string" ? branch : void 0;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const relatedByList = /* @__PURE__ */ new WeakMap();
|
|
13
|
+
/** Reads the cards related to one of the list's cards, in list order. */
|
|
14
|
+
function relatedCardsIn(list) {
|
|
15
|
+
let relatedTo = relatedByList.get(list);
|
|
16
|
+
if (!relatedTo) {
|
|
17
|
+
relatedTo = relatedCardIndex(list, CARD_PULL_REQUESTS);
|
|
18
|
+
relatedByList.set(list, relatedTo);
|
|
19
|
+
}
|
|
20
|
+
return relatedTo;
|
|
21
|
+
}
|
|
22
|
+
export { relatedCardsIn };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=list-related-cards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-related-cards.js","names":[],"sources":["../../src/work-items/list-related-cards.ts"],"sourcesContent":["import { isPullRequestCard } from '../boards/semantics.js';\nimport type { Card } from '../storage/domains/work-items/base.js';\nimport { workItemBranchSource } from '../work-item-branch.js';\nimport { relatedCardIndex } from './related-cards.js';\nimport type { PullRequestFacts } from './related-cards.js';\n\nconst CARD_PULL_REQUESTS: PullRequestFacts<Card> = {\n isPullRequest: card => isPullRequestCard({ source: workItemBranchSource(card.externalSource) }),\n headBranch: card => {\n const branch = card.workItem.metadata?.headBranch;\n return typeof branch === 'string' ? branch : undefined;\n },\n};\n\n// One index per list version: `listShared` returns the same array until a card changes.\nconst relatedByList = new WeakMap<readonly Card[], (card: Card) => Card[]>();\n\n/** Reads the cards related to one of the list's cards, in list order. */\nexport function relatedCardsIn(list: readonly Card[]): (card: Card) => Card[] {\n let relatedTo = relatedByList.get(list);\n if (!relatedTo) {\n relatedTo = relatedCardIndex(list, CARD_PULL_REQUESTS);\n relatedByList.set(list, relatedTo);\n }\n return relatedTo;\n}\n"],"mappings":";;;;AAMA,MAAM,qBAA6C;CACjD,gBAAe,SAAQ,kBAAkB,EAAE,QAAQ,qBAAqB,KAAK,cAAc,EAAE,CAAC;CAC9F,aAAY,SAAQ;EAClB,MAAM,SAAS,KAAK,SAAS,UAAU;EACvC,OAAO,OAAO,WAAW,WAAW,SAAS,KAAA;CAC/C;AACF;AAGA,MAAM,gCAAgB,IAAI,QAAiD;;AAG3E,SAAgB,eAAe,MAA+C;CAC5E,IAAI,YAAY,cAAc,IAAI,IAAI;CACtC,IAAI,CAAC,WAAW;EACd,YAAY,iBAAiB,MAAM,kBAAkB;EACrD,cAAc,IAAI,MAAM,SAAS;CACnC;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The words of a typed search, lowercased. */
|
|
2
|
+
export declare function searchWords(query: string): string[];
|
|
3
|
+
/** Whether every word is somewhere in `text`, which the caller has lowercased. */
|
|
4
|
+
export declare function hasEveryWord(text: string, words: readonly string[]): boolean;
|
|
5
|
+
//# sourceMappingURL=search-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-words.d.ts","sourceRoot":"","sources":["../../src/work-items/search-words.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAEnD;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE5E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/work-items/search-words.ts
|
|
2
|
+
/** The words of a typed search, lowercased. */
|
|
3
|
+
function searchWords(query) {
|
|
4
|
+
return query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
5
|
+
}
|
|
6
|
+
/** Whether every word is somewhere in `text`, which the caller has lowercased. */
|
|
7
|
+
function hasEveryWord(text, words) {
|
|
8
|
+
return words.every((word) => text.includes(word));
|
|
9
|
+
}
|
|
10
|
+
export { hasEveryWord, searchWords };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=search-words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-words.js","names":[],"sources":["../../src/work-items/search-words.ts"],"sourcesContent":["/** The words of a typed search, lowercased. */\nexport function searchWords(query: string): string[] {\n return query.toLowerCase().split(/\\s+/).filter(Boolean);\n}\n\n/** Whether every word is somewhere in `text`, which the caller has lowercased. */\nexport function hasEveryWord(text: string, words: readonly string[]): boolean {\n return words.every(word => text.includes(word));\n}\n"],"mappings":";;AACA,SAAgB,YAAY,OAAyB;CACnD,OAAO,MAAM,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;AACxD;;AAGA,SAAgB,aAAa,MAAc,OAAmC;CAC5E,OAAO,MAAM,OAAM,SAAQ,KAAK,SAAS,IAAI,CAAC;AAChD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkItemSourceRow } from '../storage/domains/work-items/work-item-schema.js';
|
|
2
|
+
/** A source row's external id without the type/workspace scope storage prefixes it with. */
|
|
3
|
+
export declare function sourceExternalId(source: Pick<WorkItemSourceRow, 'sourceType' | 'workspaceId' | 'externalId'>): string;
|
|
4
|
+
//# sourceMappingURL=source-external-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-external-id.d.ts","sourceRoot":"","sources":["../../src/work-items/source-external-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAE3F,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC,GAAG,MAAM,CAGrH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/work-items/source-external-id.ts
|
|
2
|
+
/** A source row's external id without the type/workspace scope storage prefixes it with. */
|
|
3
|
+
function sourceExternalId(source) {
|
|
4
|
+
const prefix = `${source.sourceType}:${source.workspaceId ? `${source.workspaceId}:` : ""}`;
|
|
5
|
+
return source.externalId.startsWith(prefix) ? source.externalId.slice(prefix.length) : source.externalId;
|
|
6
|
+
}
|
|
7
|
+
export { sourceExternalId };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=source-external-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-external-id.js","names":[],"sources":["../../src/work-items/source-external-id.ts"],"sourcesContent":["import type { WorkItemSourceRow } from '../storage/domains/work-items/work-item-schema.js';\n\n/** A source row's external id without the type/workspace scope storage prefixes it with. */\nexport function sourceExternalId(source: Pick<WorkItemSourceRow, 'sourceType' | 'workspaceId' | 'externalId'>): string {\n const prefix = `${source.sourceType}:${source.workspaceId ? `${source.workspaceId}:` : ''}`;\n return source.externalId.startsWith(prefix) ? source.externalId.slice(prefix.length) : source.externalId;\n}\n"],"mappings":";;AAGA,SAAgB,iBAAiB,QAAsF;CACrH,MAAM,SAAS,GAAG,OAAO,WAAW,GAAG,OAAO,cAAc,GAAG,OAAO,YAAY,KAAK;CACvF,OAAO,OAAO,WAAW,WAAW,MAAM,IAAI,OAAO,WAAW,MAAM,OAAO,MAAM,IAAI,OAAO;AAChG"}
|
package/dist/workspace.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,mCAAmC,CAAC;AAKtG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAoB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EACV,cAAc,EAEd,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAG1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAmC9E,OAAO,KAAK,EAAE,qBAAqB,EAA4C,MAAM,8BAA8B,CAAC;AAQpH,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjG,OAAO,K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,OAAO,GAAE,6BAAkC,aA2uC/D,uBAAuB,2MACzC"}
|
package/dist/workspace.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getFactoryAuthUserFromContext, getFactoryAuthUserId } from "./auth.js";
|
|
2
2
|
import "./boards/define-board.js";
|
|
3
3
|
import { redactCredentials } from "./environment/build.js";
|
|
4
|
-
import { groupedRepositoryAccess } from "./environment/repository-access.js";
|
|
4
|
+
import { groupRepositoryIds, groupedRepositoryAccess } from "./environment/repository-access.js";
|
|
5
5
|
import { getGithubPat } from "./integrations/github/pat.js";
|
|
6
6
|
import { DEFAULT_COMMAND_TIMEOUT_MS, SetupCommandError, checkoutSessionBranch, materializeRepo, runSetupCommand, runTeardownCommand, syncEnvironmentRepository } from "./integrations/github/sandbox.js";
|
|
7
7
|
import { registerGithubPatKind, registerGithubRefreshTarget, registerGithubTokenInjector, registerGithubTokenInjectorResolver } from "./integrations/github/token-refresh.js";
|
|
@@ -455,6 +455,7 @@ function createWorkspaceFactory(options = {}) {
|
|
|
455
455
|
const eagerSandboxStart = options.sandboxStart === "eager";
|
|
456
456
|
const workspaceRegistry = options.workspaceRegistry ?? new FactoryWorkspaceRegistry();
|
|
457
457
|
const githubTokenInjectors = /* @__PURE__ */ new Map();
|
|
458
|
+
const githubGroupTokens = /* @__PURE__ */ new Map();
|
|
458
459
|
const githubTokenReconciliations = /* @__PURE__ */ new Map();
|
|
459
460
|
const constructedWorkspaces = /* @__PURE__ */ new Map();
|
|
460
461
|
const skillCacheState = /* @__PURE__ */ new Map();
|
|
@@ -514,6 +515,23 @@ function createWorkspaceFactory(options = {}) {
|
|
|
514
515
|
const environment = resolvedEnvironment?.repos.some((repo) => repo.projectRepositoryId === projectRepository.id) ? resolvedEnvironment : void 0;
|
|
515
516
|
const tokenRepositoryIds = environment ? [repository.id, ...environment.repos.map((repo) => repo.repositoryId).filter((id) => id !== repository.id)] : [repository.id];
|
|
516
517
|
const repositoryAccess = groupedRepositoryAccess(sourceControl.versionControl, session.orgId, tokenRepositoryIds);
|
|
518
|
+
const tokenGroups = groupRepositoryIds(tokenRepositoryIds);
|
|
519
|
+
const groupTokenEnvName = (index) => index === 0 ? "GH_TOKEN" : `GH_TOKEN_${index + 1}`;
|
|
520
|
+
const tokenEnvNameFor = (repositoryId) => groupTokenEnvName(Math.max(0, tokenGroups.findIndex((group) => group.includes(repositoryId))));
|
|
521
|
+
const repositorySlug = (repositoryId) => repositoryId === repository.id ? repoFullName : environment?.repos.find((repo) => repo.repositoryId === repositoryId)?.slug ?? repositoryId;
|
|
522
|
+
const withGithubTokens = (env, token, pat) => ({
|
|
523
|
+
...Object.fromEntries(Object.entries(env).filter(([name]) => !/^GH_TOKEN_\d+$/.test(name))),
|
|
524
|
+
GH_TOKEN: token,
|
|
525
|
+
...pat ? {} : githubGroupTokens.get(workspaceId)?.env ?? {}
|
|
526
|
+
});
|
|
527
|
+
const installGithubTokens = (target, token, pat, required) => {
|
|
528
|
+
if (!target.setEnv) {
|
|
529
|
+
if (required) throw new Error("The active sandbox provider does not support runtime GitHub token refresh.");
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
target.setEnv((env) => withGithubTokens(env, token, pat));
|
|
533
|
+
setSessionEnvironmentNote(session.sessionId, pat ? null : githubGroupTokens.get(workspaceId)?.note ?? null);
|
|
534
|
+
};
|
|
517
535
|
if (githubProvider) registerGithubRefreshTarget(requestContext, {
|
|
518
536
|
orgId: session.orgId,
|
|
519
537
|
repositoryId: repository.id,
|
|
@@ -569,11 +587,7 @@ function createWorkspaceFactory(options = {}) {
|
|
|
569
587
|
const existingRegistration = githubTokenInjectors.get(workspaceId);
|
|
570
588
|
if (existingRegistration) {
|
|
571
589
|
existingRegistration.inject = (freshToken, pat = false) => {
|
|
572
|
-
|
|
573
|
-
target.setEnv((env) => ({
|
|
574
|
-
...env,
|
|
575
|
-
GH_TOKEN: freshToken
|
|
576
|
-
}));
|
|
590
|
+
installGithubTokens(target, freshToken, pat, true);
|
|
577
591
|
existingRegistration.ghToken = freshToken;
|
|
578
592
|
existingRegistration.patInstalled = pat;
|
|
579
593
|
existingRegistration.tokenIssuedAt = Date.now();
|
|
@@ -589,17 +603,10 @@ function createWorkspaceFactory(options = {}) {
|
|
|
589
603
|
const patKind = await resolveGithubPatKind();
|
|
590
604
|
const ghCliPat = await getGithubPat(() => githubProvider.integrationStorage, session.orgId, patKind);
|
|
591
605
|
const ghCliToken = ghCliPat ?? await getRepositoryToken();
|
|
592
|
-
target
|
|
593
|
-
...env,
|
|
594
|
-
GH_TOKEN: ghCliToken
|
|
595
|
-
}));
|
|
606
|
+
installGithubTokens(target, ghCliToken, ghCliPat !== null, false);
|
|
596
607
|
const tokenRegistration = {
|
|
597
608
|
inject: (freshToken, pat = false) => {
|
|
598
|
-
|
|
599
|
-
target.setEnv((env) => ({
|
|
600
|
-
...env,
|
|
601
|
-
GH_TOKEN: freshToken
|
|
602
|
-
}));
|
|
609
|
+
installGithubTokens(target, freshToken, pat, true);
|
|
603
610
|
tokenRegistration.ghToken = freshToken;
|
|
604
611
|
tokenRegistration.patInstalled = pat;
|
|
605
612
|
tokenRegistration.tokenIssuedAt = Date.now();
|
|
@@ -764,36 +771,73 @@ function createWorkspaceFactory(options = {}) {
|
|
|
764
771
|
const configDir = DEFAULT_CONFIG_DIR;
|
|
765
772
|
const getRepositoryAccess = () => repositoryAccess(repository.id);
|
|
766
773
|
let tokenScopeWarned = false;
|
|
774
|
+
const mintGroupToken = async (group) => {
|
|
775
|
+
let reason = "provider mints per-repository tokens only";
|
|
776
|
+
if (group.length > 1 && sourceControl.versionControl.getRepositoriesAccess) try {
|
|
777
|
+
const wide = await sourceControl.versionControl.getRepositoriesAccess({
|
|
778
|
+
orgId: session.orgId,
|
|
779
|
+
repositoryIds: group
|
|
780
|
+
});
|
|
781
|
+
if (wide?.authorization?.token) return {
|
|
782
|
+
token: wide.authorization.token,
|
|
783
|
+
covered: group
|
|
784
|
+
};
|
|
785
|
+
reason = "provider cannot mint one token for this repository set";
|
|
786
|
+
} catch (error) {
|
|
787
|
+
reason = `provider failed to mint one token for this repository set (${error instanceof Error ? error.name : "error"})`;
|
|
788
|
+
}
|
|
789
|
+
const token = (await sourceControl.versionControl.getRepositoryAccess({
|
|
790
|
+
orgId: session.orgId,
|
|
791
|
+
repositoryId: group[0]
|
|
792
|
+
})).authorization?.token;
|
|
793
|
+
return {
|
|
794
|
+
token,
|
|
795
|
+
covered: token ? [group[0]] : [],
|
|
796
|
+
...group.length > 1 ? { reason } : {}
|
|
797
|
+
};
|
|
798
|
+
};
|
|
767
799
|
const getRepositoryToken = async () => {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
if (sourceControl.versionControl.getRepositoriesAccess) try {
|
|
772
|
-
wide = await sourceControl.versionControl.getRepositoriesAccess({
|
|
773
|
-
orgId: session.orgId,
|
|
774
|
-
repositoryIds: tokenRepositoryIds
|
|
775
|
-
});
|
|
776
|
-
reason = "provider cannot mint one token for this repository set";
|
|
800
|
+
const minted = await Promise.all(tokenGroups.map(async (group, index) => {
|
|
801
|
+
try {
|
|
802
|
+
return await mintGroupToken(group);
|
|
777
803
|
} catch (error) {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
}
|
|
784
|
-
if (!tokenScopeWarned) {
|
|
785
|
-
tokenScopeWarned = true;
|
|
786
|
-
console.warn("[Mastra Factory] GH_TOKEN covers the session repository only", {
|
|
787
|
-
sessionId: session.sessionId,
|
|
788
|
-
repositories: environment?.repos.map((repo) => repo.slug) ?? [repoFullName],
|
|
789
|
-
reason
|
|
790
|
-
});
|
|
804
|
+
if (index === 0) throw error;
|
|
805
|
+
return {
|
|
806
|
+
covered: [],
|
|
807
|
+
reason: `mint failed (${error instanceof Error ? error.name : "error"})`
|
|
808
|
+
};
|
|
791
809
|
}
|
|
792
|
-
|
|
810
|
+
}));
|
|
811
|
+
const primary = minted[0]?.token;
|
|
812
|
+
if (!primary) throw new Error("Repository access did not include a bearer token for the Factory session");
|
|
813
|
+
const groupEnv = Object.fromEntries(minted.slice(1).flatMap((group, index) => group.token ? [[groupTokenEnvName(index + 1), group.token]] : []));
|
|
814
|
+
const covered = new Set(minted.flatMap((group) => group.covered));
|
|
815
|
+
const uncovered = tokenRepositoryIds.filter((id) => !covered.has(id));
|
|
816
|
+
if (uncovered.length && !tokenScopeWarned) {
|
|
817
|
+
tokenScopeWarned = true;
|
|
818
|
+
console.warn("[Mastra Factory] Sandbox GitHub tokens do not cover every environment repository", {
|
|
819
|
+
sessionId: session.sessionId,
|
|
820
|
+
uncovered: uncovered.map(repositorySlug),
|
|
821
|
+
reason: minted.flatMap((group) => group.reason ? [group.reason] : []).join("; ")
|
|
822
|
+
});
|
|
793
823
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
824
|
+
githubGroupTokens.set(workspaceId, {
|
|
825
|
+
env: groupEnv,
|
|
826
|
+
note: githubTokenNote(minted, uncovered)
|
|
827
|
+
});
|
|
828
|
+
return primary;
|
|
829
|
+
};
|
|
830
|
+
const githubTokenNote = (minted, uncovered) => {
|
|
831
|
+
if (minted.length === 1) return uncovered.length ? `GH_TOKEN covers ${repoFullName} only; use the source_control_* tools for other repositories.` : null;
|
|
832
|
+
const lines = minted.flatMap((group, index) => {
|
|
833
|
+
if (!group.token || !group.covered.length) return [];
|
|
834
|
+
const name = groupTokenEnvName(index);
|
|
835
|
+
const slugs = group.covered.map(repositorySlug).join(", ");
|
|
836
|
+
return [index === 0 ? `GH_TOKEN covers ${slugs}.` : `${name} covers ${slugs}; run gh for these as \`GH_TOKEN=$${name} gh ...\`.`];
|
|
837
|
+
});
|
|
838
|
+
lines.push("git in each checkout already authenticates with the token that covers it.");
|
|
839
|
+
if (uncovered.length) lines.push(`No sandbox token covers ${uncovered.map(repositorySlug).join(", ")}; use the source_control_* tools for them.`);
|
|
840
|
+
return lines.join(" ");
|
|
797
841
|
};
|
|
798
842
|
const resolveGithubPatKind = async () => {
|
|
799
843
|
if (!workItems) return "default";
|
|
@@ -871,6 +915,7 @@ function createWorkspaceFactory(options = {}) {
|
|
|
871
915
|
} catch {}
|
|
872
916
|
if (evicted && githubTokenInjectors.get(workspaceId) === registered) {
|
|
873
917
|
githubTokenInjectors.delete(workspaceId);
|
|
918
|
+
githubGroupTokens.delete(workspaceId);
|
|
874
919
|
constructedWorkspaces.delete(workspaceId);
|
|
875
920
|
skillCacheState.delete(workspaceId);
|
|
876
921
|
}
|
|
@@ -940,11 +985,9 @@ function createWorkspaceFactory(options = {}) {
|
|
|
940
985
|
if (!token) throw new Error("Repository access did not include a bearer token for the Factory session");
|
|
941
986
|
if (githubProvider) {
|
|
942
987
|
const setupPatKind = await resolveGithubPatKind();
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
GH_TOKEN: setupGhToken
|
|
947
|
-
}));
|
|
988
|
+
const setupPat = await getGithubPat(() => githubProvider.integrationStorage, session.orgId, setupPatKind);
|
|
989
|
+
const setupGhToken = setupPat ?? (tokenGroups.length > 1 ? await getRepositoryToken() : token);
|
|
990
|
+
installGithubTokens(target, setupGhToken, setupPat !== null, false);
|
|
948
991
|
}
|
|
949
992
|
await materializeRepo({
|
|
950
993
|
row: {
|
|
@@ -1094,7 +1137,8 @@ function createWorkspaceFactory(options = {}) {
|
|
|
1094
1137
|
token,
|
|
1095
1138
|
repoFullName: repo.slug,
|
|
1096
1139
|
cloneUrl: access.cloneUrl,
|
|
1097
|
-
authUsername: access.authorization?.username
|
|
1140
|
+
authUsername: access.authorization?.username,
|
|
1141
|
+
tokenEnvName: tokenEnvNameFor(repo.repositoryId)
|
|
1098
1142
|
}))).branch;
|
|
1099
1143
|
secondary.synced = true;
|
|
1100
1144
|
} catch (error) {
|
|
@@ -1212,6 +1256,7 @@ function createWorkspaceFactory(options = {}) {
|
|
|
1212
1256
|
skillOverrideStates.delete(workspaceId);
|
|
1213
1257
|
if (!await workspaceRegistry.register(session.sessionId, workspaceId, workspaceGeneration, async () => {
|
|
1214
1258
|
githubTokenInjectors.delete(workspaceId);
|
|
1259
|
+
githubGroupTokens.delete(workspaceId);
|
|
1215
1260
|
constructedWorkspaces.delete(workspaceId);
|
|
1216
1261
|
skillCacheState.delete(workspaceId);
|
|
1217
1262
|
skillReviewChecks.delete(workspaceId);
|