@mastra/factory 0.24.0-alpha.1 → 0.24.0-alpha.10
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 +106 -4
- package/dist/auth.d.ts +14 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +45 -9
- package/dist/auth.js.map +1 -1
- package/dist/boards/review.d.ts.map +1 -1
- package/dist/boards/review.js +21 -1
- package/dist/boards/review.js.map +1 -1
- package/dist/boards/work-transition-policy.d.ts.map +1 -1
- package/dist/boards/work-transition-policy.js +12 -1
- package/dist/boards/work-transition-policy.js.map +1 -1
- package/dist/boards/work.d.ts +14 -0
- package/dist/boards/work.d.ts.map +1 -1
- package/dist/boards/work.js +70 -7
- package/dist/boards/work.js.map +1 -1
- package/dist/capabilities/version-control.d.ts +26 -0
- package/dist/capabilities/version-control.d.ts.map +1 -1
- package/dist/factory.d.ts +8 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +354 -27
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +1 -1
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/github/default-rules.d.ts.map +1 -1
- package/dist/integrations/github/default-rules.js +1 -16
- package/dist/integrations/github/default-rules.js.map +1 -1
- package/dist/integrations/github/integration.d.ts.map +1 -1
- package/dist/integrations/github/integration.js +37 -1
- package/dist/integrations/github/integration.js.map +1 -1
- package/dist/integrations/github/routes.d.ts +1 -1
- package/dist/integrations/github/routes.d.ts.map +1 -1
- package/dist/integrations/github/routes.js +19 -11
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +26 -22
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/github/sandbox-release.d.ts +15 -3
- package/dist/integrations/github/sandbox-release.d.ts.map +1 -1
- package/dist/integrations/github/sandbox-release.js +20 -3
- package/dist/integrations/github/sandbox-release.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +2 -3
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +78 -7
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/github/session-subscriptions.d.ts.map +1 -1
- package/dist/integrations/github/session-subscriptions.js +1 -2
- package/dist/integrations/github/session-subscriptions.js.map +1 -1
- package/dist/integrations/github/subscriptions.d.ts +7 -4
- package/dist/integrations/github/subscriptions.d.ts.map +1 -1
- package/dist/integrations/github/subscriptions.js +5 -5
- package/dist/integrations/github/subscriptions.js.map +1 -1
- package/dist/integrations/github/webhook.d.ts +4 -2
- package/dist/integrations/github/webhook.d.ts.map +1 -1
- package/dist/integrations/github/webhook.js +59 -36
- package/dist/integrations/github/webhook.js.map +1 -1
- package/dist/integrations/gitlab/api.d.ts +16 -1
- package/dist/integrations/gitlab/api.d.ts.map +1 -1
- package/dist/integrations/gitlab/api.js +9 -0
- package/dist/integrations/gitlab/api.js.map +1 -1
- package/dist/integrations/gitlab/routes.d.ts.map +1 -1
- package/dist/integrations/gitlab/routes.js +10 -6
- package/dist/integrations/gitlab/routes.js.map +1 -1
- package/dist/integrations/gitlab/rules.d.ts.map +1 -1
- package/dist/integrations/gitlab/rules.js +28 -21
- package/dist/integrations/gitlab/rules.js.map +1 -1
- package/dist/integrations/gitlab/session-subscriptions.d.ts.map +1 -1
- package/dist/integrations/gitlab/session-subscriptions.js +1 -2
- package/dist/integrations/gitlab/session-subscriptions.js.map +1 -1
- package/dist/integrations/gitlab/subscriptions.d.ts +7 -4
- package/dist/integrations/gitlab/subscriptions.d.ts.map +1 -1
- package/dist/integrations/gitlab/subscriptions.js +5 -5
- package/dist/integrations/gitlab/subscriptions.js.map +1 -1
- package/dist/integrations/gitlab/version-control.d.ts.map +1 -1
- package/dist/integrations/gitlab/version-control.js +37 -3
- package/dist/integrations/gitlab/version-control.js.map +1 -1
- package/dist/integrations/incidentio/intake.d.ts +1 -1
- package/dist/integrations/incidentio/intake.d.ts.map +1 -1
- package/dist/integrations/incidentio/intake.js.map +1 -1
- package/dist/integrations/linear/agent-tools.d.ts.map +1 -1
- package/dist/integrations/linear/agent-tools.js.map +1 -1
- package/dist/integrations/platform/connect/routes.d.ts +1 -1
- package/dist/integrations/platform/connect/routes.d.ts.map +1 -1
- package/dist/integrations/platform/connect/routes.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +27 -1
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/incidentio/integration.d.ts +1 -1
- package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -1
- package/dist/integrations/platform/incidentio/integration.js.map +1 -1
- package/dist/integrations/platform/jira/integration.d.ts +1 -1
- package/dist/integrations/platform/jira/integration.d.ts.map +1 -1
- package/dist/integrations/platform/jira/integration.js.map +1 -1
- package/dist/integrations/platform/linear/event-worker.d.ts +1 -1
- package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/linear/event-worker.js.map +1 -1
- package/dist/integrations/slack/integration.d.ts.map +1 -1
- package/dist/integrations/slack/integration.js +33 -6
- package/dist/integrations/slack/integration.js.map +1 -1
- package/dist/integrations/slack/slack.d.ts +16 -5
- package/dist/integrations/slack/slack.d.ts.map +1 -1
- package/dist/integrations/slack/slack.js +137 -64
- package/dist/integrations/slack/slack.js.map +1 -1
- package/dist/integrations/subscription-session.d.ts +14 -0
- package/dist/integrations/subscription-session.d.ts.map +1 -1
- package/dist/integrations/subscription-session.js +30 -16
- package/dist/integrations/subscription-session.js.map +1 -1
- package/dist/mcp/disconnect.d.ts +10 -0
- package/dist/mcp/disconnect.d.ts.map +1 -0
- package/dist/mcp/disconnect.js +44 -0
- package/dist/mcp/disconnect.js.map +1 -0
- package/dist/mcp/routes.d.ts +46 -0
- package/dist/mcp/routes.d.ts.map +1 -0
- package/dist/mcp/routes.js +243 -0
- package/dist/mcp/routes.js.map +1 -0
- package/dist/provider-display-name.d.ts +2 -0
- package/dist/provider-display-name.d.ts.map +1 -0
- package/dist/provider-display-name.js +16 -0
- package/dist/provider-display-name.js.map +1 -0
- package/dist/review-verdict.d.ts +11 -0
- package/dist/review-verdict.d.ts.map +1 -1
- package/dist/review-verdict.js +16 -1
- package/dist/review-verdict.js.map +1 -1
- package/dist/routes/attention-activity.d.ts.map +1 -1
- package/dist/routes/attention-activity.js +5 -2
- package/dist/routes/attention-activity.js.map +1 -1
- package/dist/routes/attention-providers.d.ts +0 -1
- package/dist/routes/attention-providers.d.ts.map +1 -1
- package/dist/routes/attention-providers.js +5 -6
- package/dist/routes/attention-providers.js.map +1 -1
- package/dist/routes/config.d.ts +44 -5
- package/dist/routes/config.d.ts.map +1 -1
- package/dist/routes/config.js +181 -58
- package/dist/routes/config.js.map +1 -1
- package/dist/routes/contracts.d.ts +4 -0
- package/dist/routes/contracts.d.ts.map +1 -1
- package/dist/routes/contracts.js +3 -1
- package/dist/routes/contracts.js.map +1 -1
- package/dist/routes/custom-provider-source.d.ts +8 -0
- package/dist/routes/custom-provider-source.d.ts.map +1 -1
- package/dist/routes/custom-provider-source.js +22 -1
- package/dist/routes/custom-provider-source.js.map +1 -1
- package/dist/routes/oauth.js +1 -1
- package/dist/routes/oauth.js.map +1 -1
- package/dist/routes/projects.d.ts +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +1 -1
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/provider-credentials.d.ts +7 -2
- package/dist/routes/provider-credentials.d.ts.map +1 -1
- package/dist/routes/provider-credentials.js +30 -8
- package/dist/routes/provider-credentials.js.map +1 -1
- package/dist/routes/skills.d.ts +2 -4
- package/dist/routes/skills.d.ts.map +1 -1
- package/dist/routes/skills.js +19 -65
- package/dist/routes/skills.js.map +1 -1
- package/dist/routes/source-control-sessions.d.ts +9 -1
- package/dist/routes/source-control-sessions.d.ts.map +1 -1
- package/dist/routes/source-control-sessions.js +131 -7
- package/dist/routes/source-control-sessions.js.map +1 -1
- package/dist/routes/surface.d.ts +3 -2
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +7 -3
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +60 -120
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/binding-context.js +7 -7
- package/dist/rules/binding-context.js.map +1 -1
- package/dist/rules/dispatch-errors.d.ts.map +1 -1
- package/dist/rules/dispatch-errors.js +12 -0
- package/dist/rules/dispatch-errors.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +8 -1
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +117 -12
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/processor.d.ts.map +1 -1
- package/dist/rules/processor.js +2 -1
- package/dist/rules/processor.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts +4 -0
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +36 -4
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/tools.d.ts.map +1 -1
- package/dist/rules/tools.js +82 -3
- package/dist/rules/tools.js.map +1 -1
- package/dist/rules/transition-service.d.ts +17 -0
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +25 -0
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +2 -4
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +1 -4
- package/dist/rules/types.js.map +1 -1
- package/dist/sandbox/local-factory-sandbox.d.ts.map +1 -1
- package/dist/sandbox/local-factory-sandbox.js +1 -0
- package/dist/sandbox/local-factory-sandbox.js.map +1 -1
- package/dist/sandbox/session-retirement.d.ts +27 -3
- package/dist/sandbox/session-retirement.d.ts.map +1 -1
- package/dist/sandbox/session-retirement.js +158 -20
- package/dist/sandbox/session-retirement.js.map +1 -1
- package/dist/secret-encryption.d.ts.map +1 -1
- package/dist/secret-encryption.js +65 -25
- package/dist/secret-encryption.js.map +1 -1
- package/dist/session/channel-reply-processor.d.ts +36 -0
- package/dist/session/channel-reply-processor.d.ts.map +1 -0
- package/dist/session/channel-reply-processor.js +46 -0
- package/dist/session/channel-reply-processor.js.map +1 -0
- package/dist/session/channel-session-link-processor.d.ts +39 -0
- package/dist/session/channel-session-link-processor.d.ts.map +1 -0
- package/dist/session/channel-session-link-processor.js +100 -0
- package/dist/session/channel-session-link-processor.js.map +1 -0
- package/dist/session/credential-policy.d.ts +1 -1
- package/dist/session/credential-policy.d.ts.map +1 -1
- package/dist/session/credential-policy.js +7 -6
- package/dist/session/credential-policy.js.map +1 -1
- package/dist/session/default-model-hydration.d.ts +1 -0
- package/dist/session/default-model-hydration.d.ts.map +1 -1
- package/dist/session/default-model-hydration.js +3 -2
- package/dist/session/default-model-hydration.js.map +1 -1
- package/dist/session/environment-state-processor.js +1 -1
- package/dist/session/environment-state-processor.js.map +1 -1
- package/dist/session/factory-session.d.ts +19 -1
- package/dist/session/factory-session.d.ts.map +1 -1
- package/dist/session/factory-session.js +5 -2
- package/dist/session/factory-session.js.map +1 -1
- package/dist/session/filesystem-capture.d.ts +3 -3
- package/dist/session/filesystem-capture.d.ts.map +1 -1
- package/dist/session/filesystem-capture.js +16 -17
- package/dist/session/filesystem-capture.js.map +1 -1
- package/dist/session/first-exec-capture.d.ts +1 -1
- package/dist/session/first-exec-capture.d.ts.map +1 -1
- package/dist/session/first-exec-capture.js +1 -1
- package/dist/session/first-exec-capture.js.map +1 -1
- package/dist/session/first-message-capture.d.ts +1 -1
- package/dist/session/first-message-capture.d.ts.map +1 -1
- package/dist/session/first-message-capture.js +1 -1
- package/dist/session/first-message-capture.js.map +1 -1
- package/dist/session/live-sessions.d.ts +1 -1
- package/dist/session/live-sessions.js +1 -1
- package/dist/session/live-sessions.js.map +1 -1
- package/dist/session/memory-settings-hydration.d.ts +1 -1
- package/dist/session/memory-settings-hydration.d.ts.map +1 -1
- package/dist/session/memory-settings-hydration.js +1 -1
- package/dist/session/memory-settings-hydration.js.map +1 -1
- package/dist/session/reply-credential-processor.d.ts +15 -0
- package/dist/session/reply-credential-processor.d.ts.map +1 -0
- package/dist/session/reply-credential-processor.js +38 -0
- package/dist/session/reply-credential-processor.js.map +1 -0
- package/dist/session/resource-migration.d.ts +87 -0
- package/dist/session/resource-migration.d.ts.map +1 -0
- package/dist/session/resource-migration.js +163 -0
- package/dist/session/resource-migration.js.map +1 -0
- package/dist/session/run-audit.d.ts +24 -0
- package/dist/session/run-audit.d.ts.map +1 -1
- package/dist/session/run-audit.js +93 -7
- package/dist/session/run-audit.js.map +1 -1
- package/dist/session/session-threads.d.ts +49 -0
- package/dist/session/session-threads.d.ts.map +1 -0
- package/dist/session/session-threads.js +70 -0
- package/dist/session/session-threads.js.map +1 -0
- package/dist/session/source-control-tools.d.ts +19 -1
- package/dist/session/source-control-tools.d.ts.map +1 -1
- package/dist/session/source-control-tools.js +78 -11
- package/dist/session/source-control-tools.js.map +1 -1
- package/dist/session/thinking-default.d.ts.map +1 -1
- package/dist/session/thinking-default.js +3 -4
- package/dist/session/thinking-default.js.map +1 -1
- package/dist/session/thread-session-stamp.d.ts +21 -0
- package/dist/session/thread-session-stamp.d.ts.map +1 -0
- package/dist/session/thread-session-stamp.js +20 -0
- package/dist/session/thread-session-stamp.js.map +1 -0
- package/dist/session/thread-title-mirror.d.ts +1 -1
- package/dist/session/thread-title-mirror.d.ts.map +1 -1
- package/dist/session/thread-title-mirror.js +1 -1
- package/dist/session/thread-title-mirror.js.map +1 -1
- package/dist/session/work-item-repository.d.ts +1 -1
- package/dist/session/work-item-repository.d.ts.map +1 -1
- package/dist/session/work-item-repository.js.map +1 -1
- package/dist/skills/service.d.ts +6 -8
- package/dist/skills/service.d.ts.map +1 -1
- package/dist/skills/service.js +3 -3
- package/dist/skills/service.js.map +1 -1
- package/dist/storage/domains/audit/agent-audit.d.ts.map +1 -1
- package/dist/storage/domains/audit/agent-audit.js +2 -2
- package/dist/storage/domains/audit/agent-audit.js.map +1 -1
- package/dist/storage/domains/audit/domain.js +1 -1
- package/dist/storage/domains/filesystem/base.d.ts +4 -0
- package/dist/storage/domains/filesystem/base.d.ts.map +1 -1
- package/dist/storage/domains/filesystem/base.js +5 -0
- package/dist/storage/domains/filesystem/base.js.map +1 -1
- package/dist/storage/domains/integrations/base.d.ts +8 -0
- package/dist/storage/domains/integrations/base.d.ts.map +1 -1
- package/dist/storage/domains/integrations/base.js +7 -0
- package/dist/storage/domains/integrations/base.js.map +1 -1
- package/dist/storage/domains/projects/base.d.ts +6 -0
- package/dist/storage/domains/projects/base.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.js +12 -0
- package/dist/storage/domains/projects/base.js.map +1 -1
- package/dist/storage/domains/source-control/base.d.ts +28 -0
- package/dist/storage/domains/source-control/base.d.ts.map +1 -1
- package/dist/storage/domains/source-control/base.js +48 -0
- package/dist/storage/domains/source-control/base.js.map +1 -1
- package/dist/storage/domains/source-control/inmemory.d.ts +8 -0
- package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/source-control/inmemory.js +13 -1
- package/dist/storage/domains/source-control/inmemory.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +79 -7
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +172 -30
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/timing.d.ts +23 -0
- package/dist/timing.d.ts.map +1 -1
- package/dist/timing.js +85 -6
- package/dist/timing.js.map +1 -1
- package/dist/tools/annotations.d.ts +7 -0
- package/dist/tools/annotations.d.ts.map +1 -0
- package/dist/tools/annotations.js +102 -0
- package/dist/tools/annotations.js.map +1 -0
- package/dist/tools/approval-tools.d.ts +15 -0
- package/dist/tools/approval-tools.d.ts.map +1 -0
- package/dist/tools/approval-tools.js +79 -0
- package/dist/tools/approval-tools.js.map +1 -0
- package/dist/tools/deliver.d.ts +71 -0
- package/dist/tools/deliver.d.ts.map +1 -0
- package/dist/tools/deliver.js +129 -0
- package/dist/tools/deliver.js.map +1 -0
- package/dist/tools/index.d.ts +30 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +36 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/messaging-tools.d.ts +28 -0
- package/dist/tools/messaging-tools.d.ts.map +1 -0
- package/dist/tools/messaging-tools.js +396 -0
- package/dist/tools/messaging-tools.js.map +1 -0
- package/dist/tools/permissions.d.ts +31 -0
- package/dist/tools/permissions.d.ts.map +1 -0
- package/dist/tools/permissions.js +48 -0
- package/dist/tools/permissions.js.map +1 -0
- package/dist/tools/read-tools.d.ts +30 -0
- package/dist/tools/read-tools.d.ts.map +1 -0
- package/dist/tools/read-tools.js +293 -0
- package/dist/tools/read-tools.js.map +1 -0
- package/dist/tools/reports.d.ts +174 -0
- package/dist/tools/reports.d.ts.map +1 -0
- package/dist/tools/reports.js +380 -0
- package/dist/tools/reports.js.map +1 -0
- package/dist/tools/run-watch.d.ts +46 -0
- package/dist/tools/run-watch.d.ts.map +1 -0
- package/dist/tools/run-watch.js +102 -0
- package/dist/tools/run-watch.js.map +1 -0
- package/dist/tools/scope.d.ts +54 -0
- package/dist/tools/scope.d.ts.map +1 -0
- package/dist/tools/scope.js +87 -0
- package/dist/tools/scope.js.map +1 -0
- package/dist/tools/session-tools.d.ts +43 -0
- package/dist/tools/session-tools.d.ts.map +1 -0
- package/dist/tools/session-tools.js +410 -0
- package/dist/tools/session-tools.js.map +1 -0
- package/dist/tools/sessions-state-processor.d.ts +41 -0
- package/dist/tools/sessions-state-processor.d.ts.map +1 -0
- package/dist/tools/sessions-state-processor.js +190 -0
- package/dist/tools/sessions-state-processor.js.map +1 -0
- package/dist/tools/side-sessions.d.ts +53 -0
- package/dist/tools/side-sessions.d.ts.map +1 -0
- package/dist/tools/side-sessions.js +83 -0
- package/dist/tools/side-sessions.js.map +1 -0
- package/dist/tools/work-item-tools.d.ts +28 -0
- package/dist/tools/work-item-tools.d.ts.map +1 -0
- package/dist/tools/work-item-tools.js +342 -0
- package/dist/tools/work-item-tools.js.map +1 -0
- package/dist/work-items/create-work-item.d.ts +55 -0
- package/dist/work-items/create-work-item.d.ts.map +1 -0
- package/dist/work-items/create-work-item.js +101 -0
- package/dist/work-items/create-work-item.js.map +1 -0
- package/dist/work-items/decision-actions.d.ts +42 -0
- package/dist/work-items/decision-actions.d.ts.map +1 -0
- package/dist/work-items/decision-actions.js +70 -0
- package/dist/work-items/decision-actions.js.map +1 -0
- package/dist/workspace.d.ts +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +15 -7
- package/dist/workspace.js.map +1 -1
- package/factory-skills/factory-gitlab-rereview/SKILL.md +1 -1
- package/factory-skills/factory-gitlab-review/SKILL.md +1 -1
- package/factory-skills/factory-plan/SKILL.md +4 -4
- package/factory-skills/factory-rereview/SKILL.md +3 -1
- package/factory-skills/factory-review/SKILL.md +3 -1
- package/factory-skills/factory-self-review/SKILL.md +46 -0
- package/package.json +13 -13
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { decisionRetryable, overtakenDecisionIds } from "../rules/decision-applicability.js";
|
|
2
|
+
import { factoryDecisionType } from "../routes/attention-providers.js";
|
|
3
|
+
import "../routes/attention.js";
|
|
4
|
+
//#region src/work-items/decision-actions.ts
|
|
5
|
+
const notRetryable = (message) => ({
|
|
6
|
+
ok: false,
|
|
7
|
+
code: "decision_not_retryable",
|
|
8
|
+
message
|
|
9
|
+
});
|
|
10
|
+
/** Re-queue a failed run, unless its failure can't be fixed by retrying or the card has left the run's phase. */
|
|
11
|
+
async function retryFactoryDecision({ workItems, boards, orgId, factoryProjectId, decisionId }) {
|
|
12
|
+
await workItems.ensureReady();
|
|
13
|
+
const current = await workItems.getDeferredDecision(orgId, factoryProjectId, decisionId);
|
|
14
|
+
if (!current || !decisionRetryable(current, false)) return notRetryable("The decision is not a retryable failure, no longer exists, or belongs to another Factory.");
|
|
15
|
+
if ((await overtakenDecisionIds(workItems, boards, {
|
|
16
|
+
orgId,
|
|
17
|
+
factoryProjectId
|
|
18
|
+
}, [current])).size > 0) return notRetryable("The work item has moved on from the phase this run was decided for; it cannot be retried.");
|
|
19
|
+
const decision = await workItems.retryDeferredDecision(orgId, factoryProjectId, decisionId, /* @__PURE__ */ new Date());
|
|
20
|
+
if (!decision) return notRetryable("The decision is not a retryable failure, no longer exists, or belongs to another Factory.");
|
|
21
|
+
return {
|
|
22
|
+
ok: true,
|
|
23
|
+
decision
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Release (approve) or drop (dismiss) a parked proposal as `userId`, audited as
|
|
28
|
+
* consent. Approval arms the item's autonomy inside the same storage
|
|
29
|
+
* transaction (see approveDeferredDecision), so follow-up runs no longer wait.
|
|
30
|
+
*/
|
|
31
|
+
async function resolveFactoryProposal({ workItems, audit, orgId, factoryProjectId, userId, decisionId, action }) {
|
|
32
|
+
await workItems.ensureReady();
|
|
33
|
+
const now = /* @__PURE__ */ new Date();
|
|
34
|
+
const decision = action === "approve" ? await workItems.approveDeferredDecision(orgId, factoryProjectId, decisionId, now, userId) : await workItems.dismissDeferredDecision(orgId, factoryProjectId, decisionId, now);
|
|
35
|
+
if (!decision) return {
|
|
36
|
+
ok: false,
|
|
37
|
+
code: "decision_not_proposed",
|
|
38
|
+
message: "The decision is not an open proposal, no longer exists, or belongs to another Factory."
|
|
39
|
+
};
|
|
40
|
+
await audit({
|
|
41
|
+
action: action === "approve" ? "factory.run.approved" : "factory.run.dismissed",
|
|
42
|
+
factoryProjectId,
|
|
43
|
+
targets: decision.workItemId ? [{
|
|
44
|
+
type: "work_item",
|
|
45
|
+
id: decision.workItemId
|
|
46
|
+
}] : [{
|
|
47
|
+
type: "rule_decision",
|
|
48
|
+
id: decision.id
|
|
49
|
+
}],
|
|
50
|
+
metadata: {
|
|
51
|
+
decisionId: decision.id,
|
|
52
|
+
effect: factoryDecisionType(decision)
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
ok: true,
|
|
57
|
+
decision
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** Drop a parked proposal; the same as dismissing it through {@link resolveFactoryProposal}. */
|
|
61
|
+
function dismissFactoryDecision(args) {
|
|
62
|
+
return resolveFactoryProposal({
|
|
63
|
+
...args,
|
|
64
|
+
action: "dismiss"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { dismissFactoryDecision, resolveFactoryProposal, retryFactoryDecision };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=decision-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-actions.js","names":[],"sources":["../../src/work-items/decision-actions.ts"],"sourcesContent":["/**\n * Retrying, approving and dismissing Factory decisions, shared by the board's\n * routes and the Factory tools so both refuse and audit the same way.\n */\n\nimport type { BoardRegistry } from '../boards/index.js';\nimport { factoryDecisionType } from '../routes/attention.js';\nimport { decisionRetryable, overtakenDecisionIds } from '../rules/decision-applicability.js';\nimport type { FactoryDeferredDecisionRecord, WorkItemsStorage } from '../storage/domains/work-items/base.js';\nimport type { FactoryAuditEmit } from './create-work-item.js';\n\nexport type FactoryDecisionActionResult =\n | { ok: true; decision: FactoryDeferredDecisionRecord }\n | { ok: false; code: 'decision_not_retryable' | 'decision_not_proposed'; message: string };\n\ninterface DecisionActionArgs {\n workItems: WorkItemsStorage;\n orgId: string;\n factoryProjectId: string;\n decisionId: string;\n}\n\nconst notRetryable = (message: string): FactoryDecisionActionResult => ({\n ok: false,\n code: 'decision_not_retryable',\n message,\n});\n\n/** Re-queue a failed run, unless its failure can't be fixed by retrying or the card has left the run's phase. */\nexport async function retryFactoryDecision({\n workItems,\n boards,\n orgId,\n factoryProjectId,\n decisionId,\n}: DecisionActionArgs & { boards: BoardRegistry }): Promise<FactoryDecisionActionResult> {\n await workItems.ensureReady();\n const current = await workItems.getDeferredDecision(orgId, factoryProjectId, decisionId);\n if (!current || !decisionRetryable(current, false)) {\n return notRetryable('The decision is not a retryable failure, no longer exists, or belongs to another Factory.');\n }\n // A run decided for a phase the card has left would seat the old role on it.\n if ((await overtakenDecisionIds(workItems, boards, { orgId, factoryProjectId }, [current])).size > 0) {\n return notRetryable('The work item has moved on from the phase this run was decided for; it cannot be retried.');\n }\n const decision = await workItems.retryDeferredDecision(orgId, factoryProjectId, decisionId, new Date());\n if (!decision) {\n return notRetryable('The decision is not a retryable failure, no longer exists, or belongs to another Factory.');\n }\n return { ok: true, decision };\n}\n\n/**\n * Release (approve) or drop (dismiss) a parked proposal as `userId`, audited as\n * consent. Approval arms the item's autonomy inside the same storage\n * transaction (see approveDeferredDecision), so follow-up runs no longer wait.\n */\nexport async function resolveFactoryProposal({\n workItems,\n audit,\n orgId,\n factoryProjectId,\n userId,\n decisionId,\n action,\n}: DecisionActionArgs & {\n audit: FactoryAuditEmit;\n userId: string;\n action: 'approve' | 'dismiss';\n}): Promise<FactoryDecisionActionResult> {\n await workItems.ensureReady();\n const now = new Date();\n const decision =\n action === 'approve'\n ? await workItems.approveDeferredDecision(orgId, factoryProjectId, decisionId, now, userId)\n : await workItems.dismissDeferredDecision(orgId, factoryProjectId, decisionId, now);\n if (!decision) {\n return {\n ok: false,\n code: 'decision_not_proposed',\n message: 'The decision is not an open proposal, no longer exists, or belongs to another Factory.',\n };\n }\n await audit({\n action: action === 'approve' ? 'factory.run.approved' : 'factory.run.dismissed',\n factoryProjectId,\n targets: decision.workItemId\n ? [{ type: 'work_item', id: decision.workItemId }]\n : [{ type: 'rule_decision', id: decision.id }],\n metadata: { decisionId: decision.id, effect: factoryDecisionType(decision) },\n });\n return { ok: true, decision };\n}\n\n/** Drop a parked proposal; the same as dismissing it through {@link resolveFactoryProposal}. */\nexport function dismissFactoryDecision(\n args: DecisionActionArgs & { audit: FactoryAuditEmit; userId: string },\n): Promise<FactoryDecisionActionResult> {\n return resolveFactoryProposal({ ...args, action: 'dismiss' });\n}\n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SAAgB,uBACd,MACsC;CACtC,OAAO,uBAAuB;EAAE,GAAG;EAAM,QAAQ;CAAU,CAAC;AAC9D"}
|
package/dist/workspace.d.ts
CHANGED
|
@@ -126,6 +126,6 @@ export declare function environmentSandboxContext(environment: SessionEnvironmen
|
|
|
126
126
|
}) => Promise<RepositoryAccess>;
|
|
127
127
|
resolveHead?: FactorySandboxContext['resolveHead'];
|
|
128
128
|
}): Omit<FactorySandboxContext, 'sessionId'>;
|
|
129
|
-
export declare function createWorkspaceFactory(options?: CreateWorkspaceFactoryOptions): (
|
|
129
|
+
export declare function createWorkspaceFactory(options?: CreateWorkspaceFactoryOptions): (context: DynamicWorkspaceContext) => Promise<Workspace<import("@mastra/core/workspace").WorkspaceFilesystem | undefined, WorkspaceSandbox | undefined, undefined> | Workspace<SandboxFilesystem, WorkspaceSandbox, undefined> | undefined>;
|
|
130
130
|
export {};
|
|
131
131
|
//# sourceMappingURL=workspace.d.ts.map
|
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;AAItG,OAAO,EAAoB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EACV,cAAc,EAEd,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AA6B9E,OAAO,KAAK,EAAE,qBAAqB,EAA4C,MAAM,8BAA8B,CAAC;AAQpH,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE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,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,kGAAkG;AAClG,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,8EAA8E;IAC9E,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAuBD;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,IAAI,CAAC,0BAA0B,EAAE,qBAAqB,GAAG,cAAc,CAAC,EACjF,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAqD7B;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAClG,WAAW,CAAC,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;CACpD,GACA,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAe1C;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,6BAAkC,IAy9BxE,SAAS,uBAAuB,2MACzC"}
|
package/dist/workspace.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { timedPhase } from "./timing.js";
|
|
1
|
+
import { instrumentMethods, timed, timedPhase } from "./timing.js";
|
|
2
2
|
import { getFactoryAuthUserFromContext, getFactoryAuthUserId } from "./auth.js";
|
|
3
3
|
import { mergeRequestNumberFromBranch, pullRequestNumberFromBranch } from "./work-item-branch.js";
|
|
4
4
|
import { redactCredentials } from "./environment/build.js";
|
|
@@ -44,6 +44,7 @@ const FACTORY_SKILL_NAMES = /* @__PURE__ */ new Set([
|
|
|
44
44
|
"factory-plan",
|
|
45
45
|
"factory-rereview",
|
|
46
46
|
"factory-review",
|
|
47
|
+
"factory-self-review",
|
|
47
48
|
"factory-triage"
|
|
48
49
|
]);
|
|
49
50
|
/** Review skills only sessions with an active review run binding may discover or load. */
|
|
@@ -51,7 +52,8 @@ const REVIEW_ONLY_FACTORY_SKILLS = /* @__PURE__ */ new Set([
|
|
|
51
52
|
"factory-gitlab-rereview",
|
|
52
53
|
"factory-gitlab-review",
|
|
53
54
|
"factory-rereview",
|
|
54
|
-
"factory-review"
|
|
55
|
+
"factory-review",
|
|
56
|
+
"factory-self-review"
|
|
55
57
|
]);
|
|
56
58
|
/**
|
|
57
59
|
* Skill caches rescanned outside the workspace resolver. The resolver records
|
|
@@ -359,9 +361,9 @@ function createWorkspaceFactory(options = {}) {
|
|
|
359
361
|
const skillCacheReviewState = /* @__PURE__ */ new Map();
|
|
360
362
|
const skillCacheRefreshes = /* @__PURE__ */ new Map();
|
|
361
363
|
const skillReviewChecks = /* @__PURE__ */ new Map();
|
|
362
|
-
|
|
364
|
+
const resolve = async ({ requestContext, mastra, skillExtension }) => {
|
|
363
365
|
const ctx = requestContext.get("controller");
|
|
364
|
-
const resolvedSession = ctx?.
|
|
366
|
+
const resolvedSession = ctx?.sessionId ? await resolveSourceControlSession(sourceControls, ctx.sessionId) : null;
|
|
365
367
|
const session = resolvedSession?.session ?? null;
|
|
366
368
|
const sourceControl = resolvedSession?.provider;
|
|
367
369
|
if (!session || !sourceControl) return;
|
|
@@ -475,7 +477,7 @@ function createWorkspaceFactory(options = {}) {
|
|
|
475
477
|
await finishStart();
|
|
476
478
|
};
|
|
477
479
|
const constructSessionEntry = () => getSessionSandbox(session.id, repoFullName, () => {
|
|
478
|
-
const sandbox = factorySandbox.create({
|
|
480
|
+
const sandbox = instrumentMethods(factorySandbox.create({
|
|
479
481
|
sessionId: session.id,
|
|
480
482
|
sandboxId: session.sandboxId ?? void 0,
|
|
481
483
|
repoFullName,
|
|
@@ -489,7 +491,12 @@ function createWorkspaceFactory(options = {}) {
|
|
|
489
491
|
repositoryId: repository.id
|
|
490
492
|
})
|
|
491
493
|
}
|
|
492
|
-
}, sandboxSettings)
|
|
494
|
+
}, sandboxSettings), `sandbox(${session.id})`, [
|
|
495
|
+
"start",
|
|
496
|
+
"stop",
|
|
497
|
+
"executeCommand",
|
|
498
|
+
"reconnect"
|
|
499
|
+
]);
|
|
493
500
|
sandbox.setOnStart((previous) => async (args) => {
|
|
494
501
|
await timedPhase(`workspace.onStart(${args.outcome})`, async () => {
|
|
495
502
|
await setupHook(args);
|
|
@@ -525,7 +532,7 @@ function createWorkspaceFactory(options = {}) {
|
|
|
525
532
|
sessionId: session.sessionId
|
|
526
533
|
});
|
|
527
534
|
if (!binding || !ctx?.threadId) return binding;
|
|
528
|
-
return binding.threadId === ctx.threadId && binding.
|
|
535
|
+
return binding.threadId === ctx.threadId && binding.sessionId === ctx.sessionId ? binding : null;
|
|
529
536
|
};
|
|
530
537
|
const isReviewSession = async () => {
|
|
531
538
|
if (!workItems) return false;
|
|
@@ -978,6 +985,7 @@ function createWorkspaceFactory(options = {}) {
|
|
|
978
985
|
fireEagerStart();
|
|
979
986
|
return workspace;
|
|
980
987
|
};
|
|
988
|
+
return (context) => timed("workspace.resolve", () => resolve(context));
|
|
981
989
|
}
|
|
982
990
|
//#endregion
|
|
983
991
|
export { BUNDLED_FACTORY_SKILLS_PATH, FACTORY_SKILL_NAMES, FactorySkillSource, FactoryWorkspaceRegistry, REVIEW_ONLY_FACTORY_SKILLS, createWorkspaceFactory, environmentSandboxContext, rescanFactorySkills, resolveLocalFactorySkillsPath, resolveProjectEnvironment };
|