@vercel/factory 0.0.14 → 0.0.16
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/CHANGELOG.md +356 -0
- package/README.md +96 -2
- package/dist/agent-routes.d.mts +113 -0
- package/dist/agent-routes.mjs +91 -0
- package/dist/agent-routes.mjs.map +1 -0
- package/dist/api-contracts.d.mts +1768 -0
- package/dist/api-contracts.mjs +119 -0
- package/dist/api-contracts.mjs.map +1 -0
- package/dist/api-images.d.mts +30 -0
- package/dist/api-images.mjs +28 -0
- package/dist/api-images.mjs.map +1 -0
- package/dist/api-task-graph.mjs +57 -0
- package/dist/api-task-graph.mjs.map +1 -0
- package/dist/api.d.mts +111 -216
- package/dist/api.mjs +1063 -99
- package/dist/api.mjs.map +1 -1
- package/dist/approval-access.d.mts +39 -0
- package/dist/approval-access.mjs +62 -0
- package/dist/approval-access.mjs.map +1 -0
- package/dist/approval-contracts.d.mts +698 -0
- package/dist/approval-contracts.mjs +27 -0
- package/dist/approval-contracts.mjs.map +1 -0
- package/dist/approval.d.mts +49 -0
- package/dist/approval.mjs +39 -0
- package/dist/approval.mjs.map +1 -0
- package/dist/blob/artifacts.d.mts +37 -0
- package/dist/blob/artifacts.mjs +45 -0
- package/dist/blob/artifacts.mjs.map +1 -0
- package/dist/blob/index.d.mts +84 -12
- package/dist/blob/index.mjs +179 -45
- package/dist/blob/index.mjs.map +1 -1
- package/dist/budget.d.mts +115 -0
- package/dist/budget.mjs +147 -0
- package/dist/budget.mjs.map +1 -0
- package/dist/budgets.d.mts +4 -0
- package/dist/budgets.mjs +4 -0
- package/dist/build-factory.d.mts +7 -4
- package/dist/build-factory.mjs +2 -1
- package/dist/build-factory.mjs.map +1 -1
- package/dist/change-verification/brief.d.mts +9 -0
- package/dist/change-verification/brief.mjs +13 -0
- package/dist/change-verification/brief.mjs.map +1 -0
- package/dist/change-verification/dispatch.d.mts +37 -0
- package/dist/change-verification/dispatch.mjs +83 -0
- package/dist/change-verification/dispatch.mjs.map +1 -0
- package/dist/change-verification/eve-tool.d.mts +61 -0
- package/dist/change-verification/eve-tool.mjs +89 -0
- package/dist/change-verification/eve-tool.mjs.map +1 -0
- package/dist/change-verification/result.mjs +130 -0
- package/dist/change-verification/result.mjs.map +1 -0
- package/dist/changes/eve-record-change.d.mts +56 -0
- package/dist/changes/eve-record-change.mjs +131 -0
- package/dist/changes/eve-record-change.mjs.map +1 -0
- package/dist/changes/presentation.d.mts +14 -0
- package/dist/changes.d.mts +24 -0
- package/dist/changes.mjs +29 -0
- package/dist/changes.mjs.map +1 -0
- package/dist/client-events.d.mts +25 -0
- package/dist/client-events.mjs +45 -0
- package/dist/client-events.mjs.map +1 -0
- package/dist/client-stream.d.mts +28 -0
- package/dist/client-stream.mjs +210 -0
- package/dist/client-stream.mjs.map +1 -0
- package/dist/client-transcript.d.mts +41 -0
- package/dist/client-transcript.mjs +233 -0
- package/dist/client-transcript.mjs.map +1 -0
- package/dist/client.d.mts +343 -0
- package/dist/client.mjs +366 -0
- package/dist/client.mjs.map +1 -0
- package/dist/code-review/contracts.d.mts +27 -0
- package/dist/code-review/eve-post-review.d.mts +70 -0
- package/dist/code-review/eve-post-review.mjs +195 -0
- package/dist/code-review/eve-post-review.mjs.map +1 -0
- package/dist/code-review/eve-review-comments.d.mts +75 -0
- package/dist/code-review/eve-review-comments.mjs +193 -0
- package/dist/code-review/eve-review-comments.mjs.map +1 -0
- package/dist/code-review/github-contracts.d.mts +10 -0
- package/dist/code-review/github-reporter.d.mts +46 -0
- package/dist/code-review/github-reporter.mjs +262 -0
- package/dist/code-review/github-reporter.mjs.map +1 -0
- package/dist/code-review/preparation.d.mts +34 -0
- package/dist/code-review/preparation.mjs +23 -0
- package/dist/code-review/preparation.mjs.map +1 -0
- package/dist/code-review/stall.d.mts +17 -0
- package/dist/code-review/stall.mjs +30 -0
- package/dist/code-review/stall.mjs.map +1 -0
- package/dist/code-review.d.mts +7 -0
- package/dist/code-review.mjs +5 -0
- package/dist/communication.d.mts +9 -0
- package/dist/communication.mjs +9 -0
- package/dist/connectors/github.d.mts +26 -0
- package/dist/connectors/github.mjs +55 -0
- package/dist/connectors/github.mjs.map +1 -0
- package/dist/connectors/index.d.mts +35 -3
- package/dist/connectors/index.mjs +3 -52
- package/dist/connectors/index.mjs.map +1 -1
- package/dist/connectors/outbox.d.mts +34 -0
- package/dist/connectors/outbox.mjs +50 -0
- package/dist/connectors/outbox.mjs.map +1 -0
- package/dist/connectors/slack-approval-blocks.mjs +136 -0
- package/dist/connectors/slack-approval-blocks.mjs.map +1 -0
- package/dist/connectors/slack-approvals.d.mts +29 -0
- package/dist/connectors/slack-approvals.mjs +346 -0
- package/dist/connectors/slack-approvals.mjs.map +1 -0
- package/dist/connectors/slack.d.mts +35 -52
- package/dist/connectors/slack.mjs +13 -85
- package/dist/connectors/slack.mjs.map +1 -1
- package/dist/deepsec/eve-tool.d.mts +110 -0
- package/dist/deepsec/eve-tool.mjs +166 -0
- package/dist/deepsec/eve-tool.mjs.map +1 -0
- package/dist/deepsec/finding.d.mts +84 -0
- package/dist/deepsec/finding.mjs +56 -0
- package/dist/deepsec/finding.mjs.map +1 -0
- package/dist/deepsec.d.mts +3 -0
- package/dist/delivery-metrics/metrics.d.mts +93 -0
- package/dist/delivery-metrics/metrics.mjs +200 -0
- package/dist/delivery-metrics/metrics.mjs.map +1 -0
- package/dist/delivery-metrics.d.mts +2 -0
- package/dist/delivery-metrics.mjs +2 -0
- package/dist/dispatch.d.mts +152 -0
- package/dist/dispatch.mjs +199 -0
- package/dist/dispatch.mjs.map +1 -0
- package/dist/errors.d.mts +15 -0
- package/dist/errors.mjs +38 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/eve/index.d.mts +209 -1277
- package/dist/eve/index.mjs +312 -1073
- package/dist/eve/index.mjs.map +1 -1
- package/dist/eve/invoke.d.mts +144 -0
- package/dist/eve/invoke.mjs +254 -0
- package/dist/eve/invoke.mjs.map +1 -0
- package/dist/eve/session-client.d.mts +186 -0
- package/dist/eve/session-client.mjs +245 -0
- package/dist/eve/session-client.mjs.map +1 -0
- package/dist/eve/task-execution.d.mts +380 -0
- package/dist/eve/task-execution.mjs +73 -0
- package/dist/eve/task-execution.mjs.map +1 -0
- package/dist/eve/task-session.d.mts +129 -0
- package/dist/eve/task-session.mjs +245 -0
- package/dist/eve/task-session.mjs.map +1 -0
- package/dist/eve/transcript.d.mts +37 -0
- package/dist/eve/transcript.mjs +69 -0
- package/dist/eve/transcript.mjs.map +1 -0
- package/dist/execution-public.d.mts +8 -0
- package/dist/execution-public.mjs +7 -0
- package/dist/execution.d.mts +183 -0
- package/dist/execution.mjs +223 -0
- package/dist/execution.mjs.map +1 -0
- package/dist/finding-remediation/admission.d.mts +53 -0
- package/dist/finding-remediation/admission.mjs +90 -0
- package/dist/finding-remediation/admission.mjs.map +1 -0
- package/dist/finding-remediation/brief.d.mts +14 -0
- package/dist/finding-remediation/brief.mjs +25 -0
- package/dist/finding-remediation/brief.mjs.map +1 -0
- package/dist/finding-remediation/eve-tool.d.mts +29 -0
- package/dist/finding-remediation/eve-tool.mjs +34 -0
- package/dist/finding-remediation/eve-tool.mjs.map +1 -0
- package/dist/findings/fingerprint.d.mts +14 -0
- package/dist/findings/fingerprint.mjs +28 -0
- package/dist/findings/fingerprint.mjs.map +1 -0
- package/dist/findings.d.mts +7 -0
- package/dist/findings.mjs +6 -0
- package/dist/github-app.d.mts +54 -0
- package/dist/github-app.mjs +121 -0
- package/dist/github-app.mjs.map +1 -0
- package/dist/github-publication.d.mts +199 -0
- package/dist/github-publication.mjs +442 -0
- package/dist/github-publication.mjs.map +1 -0
- package/dist/github-transfer.d.mts +81 -0
- package/dist/github-transfer.mjs +273 -0
- package/dist/github-transfer.mjs.map +1 -0
- package/dist/github.d.mts +446 -2
- package/dist/github.mjs +357 -56
- package/dist/github.mjs.map +1 -1
- package/dist/image-input.d.mts +51 -0
- package/dist/image-input.mjs +63 -0
- package/dist/image-input.mjs.map +1 -0
- package/dist/inbox-activity.d.mts +53 -0
- package/dist/inbox-activity.mjs +41 -0
- package/dist/inbox-activity.mjs.map +1 -0
- package/dist/index.d.mts +16 -484
- package/dist/index.mjs +15 -522
- package/dist/intake-contracts.d.mts +55 -0
- package/dist/intake-contracts.mjs +33 -0
- package/dist/intake-contracts.mjs.map +1 -0
- package/dist/integrations/deepsec.d.mts +5 -0
- package/dist/integrations/deepsec.mjs +3 -0
- package/dist/integrations/github.d.mts +11 -0
- package/dist/integrations/github.mjs +9 -0
- package/dist/integrations/slack.d.mts +5 -0
- package/dist/integrations/slack.mjs +5 -0
- package/dist/integrations/vercel.d.mts +5 -0
- package/dist/integrations/vercel.mjs +4 -0
- package/dist/merge-resolution/contracts.d.mts +17 -0
- package/dist/merge-resolution/contracts.mjs +19 -0
- package/dist/merge-resolution/contracts.mjs.map +1 -0
- package/dist/merge-resolution/eve-tools.d.mts +47 -0
- package/dist/merge-resolution/eve-tools.mjs +122 -0
- package/dist/merge-resolution/eve-tools.mjs.map +1 -0
- package/dist/model-settings.d.mts +41 -0
- package/dist/model-settings.mjs +35 -0
- package/dist/model-settings.mjs.map +1 -0
- package/dist/multi-repository-changes/coordination.d.mts +49 -0
- package/dist/multi-repository-changes/coordination.mjs +115 -0
- package/dist/multi-repository-changes/coordination.mjs.map +1 -0
- package/dist/planning/cancellation.mjs +82 -0
- package/dist/planning/cancellation.mjs.map +1 -0
- package/dist/planning/configuration.d.mts +23 -0
- package/dist/planning/configuration.mjs +56 -0
- package/dist/planning/configuration.mjs.map +1 -0
- package/dist/planning/contracts.d.mts +136 -0
- package/dist/planning/contracts.mjs +42 -0
- package/dist/planning/contracts.mjs.map +1 -0
- package/dist/planning/dependencies.mjs +44 -0
- package/dist/planning/dependencies.mjs.map +1 -0
- package/dist/planning/effects.mjs +122 -0
- package/dist/planning/effects.mjs.map +1 -0
- package/dist/planning/reconcile.mjs +279 -0
- package/dist/planning/reconcile.mjs.map +1 -0
- package/dist/planning/runtime.d.mts +27 -0
- package/dist/planning/runtime.mjs +25 -0
- package/dist/planning/runtime.mjs.map +1 -0
- package/dist/planning/state.mjs +92 -0
- package/dist/planning/state.mjs.map +1 -0
- package/dist/planning/turns.mjs +262 -0
- package/dist/planning/turns.mjs.map +1 -0
- package/dist/planning/validation.mjs +106 -0
- package/dist/planning/validation.mjs.map +1 -0
- package/dist/postgres/index.d.mts +48 -1
- package/dist/postgres/index.mjs +45 -3
- package/dist/postgres/index.mjs.map +1 -1
- package/dist/presets/software-development/approval.d.mts +14 -0
- package/dist/presets/software-development/approval.mjs +21 -0
- package/dist/presets/software-development/approval.mjs.map +1 -0
- package/dist/presets/software-development/deepsec-brief.d.mts +8 -0
- package/dist/presets/software-development/deepsec-brief.mjs +14 -0
- package/dist/presets/software-development/deepsec-brief.mjs.map +1 -0
- package/dist/presets/software-development/dispatch.d.mts +56 -0
- package/dist/presets/software-development/dispatch.mjs +67 -0
- package/dist/presets/software-development/dispatch.mjs.map +1 -0
- package/dist/presets/software-development/eve-delegation-policy.d.mts +7 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs +34 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs.map +1 -0
- package/dist/presets/software-development/eve.d.mts +18 -0
- package/dist/presets/software-development/eve.mjs +19 -0
- package/dist/presets/software-development/eve.mjs.map +1 -0
- package/dist/presets/software-development/finish-task-policy.d.mts +7 -0
- package/dist/presets/software-development/finish-task-policy.mjs +9 -0
- package/dist/presets/software-development/finish-task-policy.mjs.map +1 -0
- package/dist/presets/software-development/recovery.d.mts +32 -0
- package/dist/presets/software-development/recovery.mjs +120 -0
- package/dist/presets/software-development/recovery.mjs.map +1 -0
- package/dist/presets/software-development/task-communication.d.mts +24 -0
- package/dist/presets/software-development/task-communication.mjs +157 -0
- package/dist/presets/software-development/task-communication.mjs.map +1 -0
- package/dist/presets/software-development.d.mts +10 -0
- package/dist/presets/software-development.mjs +9 -0
- package/dist/pull-requests/contracts.d.mts +72 -0
- package/dist/pull-requests/eve-fetch.d.mts +57 -0
- package/dist/pull-requests/eve-fetch.mjs +151 -0
- package/dist/pull-requests/eve-fetch.mjs.map +1 -0
- package/dist/pull-requests/github-label-manager.d.mts +27 -0
- package/dist/pull-requests/github-label-manager.mjs +40 -0
- package/dist/pull-requests/github-label-manager.mjs.map +1 -0
- package/dist/pull-requests/github-publisher.d.mts +67 -0
- package/dist/pull-requests/github-publisher.mjs +405 -0
- package/dist/pull-requests/github-publisher.mjs.map +1 -0
- package/dist/pull-requests.d.mts +6 -0
- package/dist/pull-requests.mjs +4 -0
- package/dist/receipts.d.mts +4 -0
- package/dist/receipts.mjs +3 -0
- package/dist/repositories.d.mts +18 -0
- package/dist/repositories.mjs +33 -0
- package/dist/repositories.mjs.map +1 -0
- package/dist/sandbox/command.d.mts +18 -0
- package/dist/sandbox/execution-abort.d.mts +16 -0
- package/dist/sandbox/execution-abort.mjs +49 -0
- package/dist/sandbox/execution-abort.mjs.map +1 -0
- package/dist/sandbox/execution-environment.d.mts +25 -0
- package/dist/sandbox/execution-run-ledger.d.mts +115 -0
- package/dist/sandbox/execution-run-ledger.mjs +209 -0
- package/dist/sandbox/execution-run-ledger.mjs.map +1 -0
- package/dist/sandbox/execution.d.mts +54 -0
- package/dist/sandbox/execution.mjs +228 -0
- package/dist/sandbox/execution.mjs.map +1 -0
- package/dist/sandbox/harness-runner.d.mts +79 -0
- package/dist/sandbox/harness-runner.mjs +162 -0
- package/dist/sandbox/harness-runner.mjs.map +1 -0
- package/dist/sandbox/index.d.mts +10 -0
- package/dist/sandbox/index.mjs +7 -0
- package/dist/sandbox/task-environment.d.mts +50 -0
- package/dist/sandbox/task-environment.mjs +140 -0
- package/dist/sandbox/task-environment.mjs.map +1 -0
- package/dist/sandbox/workspace.d.mts +29 -0
- package/dist/sandbox/workspace.mjs +28 -0
- package/dist/sandbox/workspace.mjs.map +1 -0
- package/dist/schema/agent-route.d.mts +40 -0
- package/dist/schema/agent-route.mjs +33 -0
- package/dist/schema/agent-route.mjs.map +1 -0
- package/dist/schema/answer.d.mts +23 -0
- package/dist/schema/answer.mjs +21 -0
- package/dist/schema/answer.mjs.map +1 -0
- package/dist/schema/budget.d.mts +38 -0
- package/dist/schema/budget.mjs +30 -0
- package/dist/schema/budget.mjs.map +1 -0
- package/dist/schema/catalog.mjs +72 -0
- package/dist/schema/catalog.mjs.map +1 -0
- package/dist/schema/change.d.mts +117 -0
- package/dist/schema/change.mjs +68 -0
- package/dist/schema/change.mjs.map +1 -0
- package/dist/schema/common.d.mts +33 -0
- package/dist/{id-BLIkCVue.mjs → schema/common.mjs} +7 -16
- package/dist/schema/common.mjs.map +1 -0
- package/dist/schema/communication.d.mts +52 -0
- package/dist/{communication-Kd9nU5RP.mjs → schema/communication.mjs} +8 -3
- package/dist/schema/communication.mjs.map +1 -0
- package/dist/schema/execution.d.mts +101 -0
- package/dist/schema/execution.mjs +86 -0
- package/dist/schema/execution.mjs.map +1 -0
- package/dist/schema/factory-config.d.mts +122 -0
- package/dist/schema/factory-config.mjs +90 -0
- package/dist/schema/factory-config.mjs.map +1 -0
- package/dist/schema/finding.d.mts +125 -0
- package/dist/schema/finding.mjs +67 -0
- package/dist/schema/finding.mjs.map +1 -0
- package/dist/schema/id.d.mts +43 -0
- package/dist/schema/id.mjs +32 -0
- package/dist/schema/id.mjs.map +1 -0
- package/dist/schema/outbox.d.mts +240 -0
- package/dist/schema/outbox.mjs +53 -0
- package/dist/schema/outbox.mjs.map +1 -0
- package/dist/schema/question-route.mjs +16 -0
- package/dist/schema/question-route.mjs.map +1 -0
- package/dist/schema/receipt.d.mts +81 -0
- package/dist/schema/receipt.mjs +94 -0
- package/dist/schema/receipt.mjs.map +1 -0
- package/dist/schema/repository.d.mts +30 -0
- package/dist/schema/repository.mjs +29 -0
- package/dist/schema/repository.mjs.map +1 -0
- package/dist/schema/session.d.mts +136 -0
- package/dist/schema/session.mjs +54 -0
- package/dist/schema/session.mjs.map +1 -0
- package/dist/schema/signal.d.mts +105 -0
- package/dist/schema/signal.mjs +81 -0
- package/dist/schema/signal.mjs.map +1 -0
- package/dist/schema/slack-pr-notifications.d.mts +12 -0
- package/dist/schema/slack-pr-notifications.mjs +11 -0
- package/dist/schema/slack-pr-notifications.mjs.map +1 -0
- package/dist/schema/stored-session.mjs +10 -0
- package/dist/schema/stored-session.mjs.map +1 -0
- package/dist/schema/stored-task.mjs +20 -0
- package/dist/schema/stored-task.mjs.map +1 -0
- package/dist/schema/task-effect.d.mts +39 -0
- package/dist/schema/task-effect.mjs +29 -0
- package/dist/schema/task-effect.mjs.map +1 -0
- package/dist/schema/task-graph.d.mts +3173 -0
- package/dist/schema/task-graph.mjs +97 -0
- package/dist/schema/task-graph.mjs.map +1 -0
- package/dist/schema/task-message.d.mts +254 -0
- package/dist/schema/task-message.mjs +189 -0
- package/dist/schema/task-message.mjs.map +1 -0
- package/dist/schema/task.d.mts +273 -0
- package/dist/schema/task.mjs +200 -0
- package/dist/schema/task.mjs.map +1 -0
- package/dist/schema/transcript.d.mts +176 -0
- package/dist/schema/transcript.mjs +87 -0
- package/dist/schema/transcript.mjs.map +1 -0
- package/dist/schema/transitions.d.mts +50 -0
- package/dist/schema/transitions.mjs +303 -0
- package/dist/schema/transitions.mjs.map +1 -0
- package/dist/schema/work.d.mts +150 -0
- package/dist/schema/work.mjs +102 -0
- package/dist/schema/work.mjs.map +1 -0
- package/dist/session-previews.d.mts +76 -0
- package/dist/session-previews.mjs +55 -0
- package/dist/session-previews.mjs.map +1 -0
- package/dist/session-review.d.mts +120 -0
- package/dist/session-review.mjs +79 -0
- package/dist/session-review.mjs.map +1 -0
- package/dist/signal-triage.d.mts +20 -0
- package/dist/signal-triage.mjs +85 -0
- package/dist/signal-triage.mjs.map +1 -0
- package/dist/signals.d.mts +20 -0
- package/dist/signals.mjs +19 -0
- package/dist/signals.mjs.map +1 -0
- package/dist/stall.d.mts +41 -0
- package/dist/stall.mjs +83 -0
- package/dist/stall.mjs.map +1 -0
- package/dist/storage.d.mts +4 -0
- package/dist/storage.mjs +4 -0
- package/dist/store/driver.d.mts +65 -0
- package/dist/store/driver.mjs +42 -0
- package/dist/store/driver.mjs.map +1 -0
- package/dist/store/engine.d.mts +683 -0
- package/dist/store/engine.mjs +2309 -0
- package/dist/store/engine.mjs.map +1 -0
- package/dist/store/memory.d.mts +24 -0
- package/dist/store/memory.mjs +69 -0
- package/dist/store/memory.mjs.map +1 -0
- package/dist/store/slack-pr-notifications.d.mts +44 -0
- package/dist/store/slack-pr-notifications.mjs +121 -0
- package/dist/store/slack-pr-notifications.mjs.map +1 -0
- package/dist/store/task-effects.d.mts +38 -0
- package/dist/store/task-effects.mjs +118 -0
- package/dist/store/task-effects.mjs.map +1 -0
- package/dist/store/task-graphs.d.mts +60 -0
- package/dist/store/task-graphs.mjs +212 -0
- package/dist/store/task-graphs.mjs.map +1 -0
- package/dist/store/task-messages.d.mts +136 -0
- package/dist/store/task-messages.mjs +475 -0
- package/dist/store/task-messages.mjs.map +1 -0
- package/dist/store/task-work.d.mts +180 -0
- package/dist/store/task-work.mjs +137 -0
- package/dist/store/task-work.mjs.map +1 -0
- package/dist/store/work-notifications.d.mts +19 -0
- package/dist/store/work-notifications.mjs +48 -0
- package/dist/store/work-notifications.mjs.map +1 -0
- package/dist/sweep.d.mts +79 -0
- package/dist/sweep.mjs +171 -0
- package/dist/sweep.mjs.map +1 -0
- package/dist/task-communication.d.mts +35 -0
- package/dist/task-communication.mjs +47 -0
- package/dist/task-communication.mjs.map +1 -0
- package/dist/task-graph-view.d.mts +267 -0
- package/dist/task-graph-view.mjs +17 -0
- package/dist/task-graph-view.mjs.map +1 -0
- package/dist/task-message-processing.d.mts +60 -0
- package/dist/task-message-processing.mjs +200 -0
- package/dist/task-message-processing.mjs.map +1 -0
- package/dist/task-protocols.d.mts +80 -0
- package/dist/task-protocols.mjs +47 -0
- package/dist/task-protocols.mjs.map +1 -0
- package/dist/tasks.d.mts +17 -0
- package/dist/tasks.mjs +17 -0
- package/dist/vercel-git.d.mts +53 -0
- package/dist/vercel-git.mjs +344 -0
- package/dist/vercel-git.mjs.map +1 -0
- package/dist/vercel-github-api.d.mts +103 -0
- package/dist/vercel-github-api.mjs +363 -0
- package/dist/vercel-github-api.mjs.map +1 -0
- package/dist/vercel.d.mts +34 -2
- package/dist/vercel.mjs +49 -3
- package/dist/vercel.mjs.map +1 -1
- package/dist/work-triage/eve-tool.d.mts +29 -0
- package/dist/work-triage/eve-tool.mjs +32 -0
- package/dist/work-triage/eve-tool.mjs.map +1 -0
- package/dist/work-triage/find-existing-work.d.mts +32 -0
- package/dist/work-triage/find-existing-work.mjs +31 -0
- package/dist/work-triage/find-existing-work.mjs.map +1 -0
- package/dist/work-triage/github.d.mts +15 -0
- package/dist/work-triage/github.mjs +14 -0
- package/dist/work-triage/github.mjs.map +1 -0
- package/dist/work-triage.d.mts +4 -0
- package/dist/work-triage.mjs +3 -0
- package/dist/workflows.d.mts +146 -0
- package/dist/workflows.mjs +139 -0
- package/dist/workflows.mjs.map +1 -0
- package/dist/workspace-diff-assembly.d.mts +33 -0
- package/dist/workspace-diff-assembly.mjs +95 -0
- package/dist/workspace-diff-assembly.mjs.map +1 -0
- package/dist/workspace-diff.d.mts +90 -0
- package/dist/workspace-diff.mjs +61 -0
- package/dist/workspace-diff.mjs.map +1 -0
- package/dist/workspace-files-git.d.mts +15 -0
- package/dist/workspace-files-git.mjs +61 -0
- package/dist/workspace-files-git.mjs.map +1 -0
- package/dist/workspace-files.d.mts +107 -0
- package/dist/workspace-files.mjs +74 -0
- package/dist/workspace-files.mjs.map +1 -0
- package/dist/workspace-snapshot.d.mts +26 -0
- package/dist/workspace-snapshot.mjs +80 -0
- package/dist/workspace-snapshot.mjs.map +1 -0
- package/docs/getting-started.md +104 -0
- package/docs/index.md +100 -0
- package/docs/recipes/cancellation.md +215 -0
- package/docs/recipes/custom-workflow.md +153 -0
- package/docs/recipes/dependent-tasks.md +207 -0
- package/docs/recipes/eve-agent.md +277 -0
- package/docs/recipes/human-input.md +204 -0
- package/docs/recipes/persistence-recovery.md +268 -0
- package/docs/recipes/retry-recovery.md +241 -0
- package/docs/recipes/task-messaging.md +215 -0
- package/docs/recipes/typed-eve-result.md +161 -0
- package/docs/runtime-integration.md +137 -0
- package/package.json +142 -46
- package/dist/approval-JX2Px9IC.mjs +0 -132
- package/dist/approval-JX2Px9IC.mjs.map +0 -1
- package/dist/budget-DzSiIA4t.mjs +0 -42
- package/dist/budget-DzSiIA4t.mjs.map +0 -1
- package/dist/change-D2U6v7Ek.mjs +0 -554
- package/dist/change-D2U6v7Ek.mjs.map +0 -1
- package/dist/communication-Kd9nU5RP.mjs.map +0 -1
- package/dist/coordination-Cq08hb1l.mjs +0 -76
- package/dist/coordination-Cq08hb1l.mjs.map +0 -1
- package/dist/dispatch-BaZS3PT8.d.mts +0 -76
- package/dist/driver-BC0Mt5KG.d.mts +0 -34
- package/dist/driver-Bbd25rNM.mjs +0 -23
- package/dist/driver-Bbd25rNM.mjs.map +0 -1
- package/dist/engine-DFHU2Pe-.d.mts +0 -781
- package/dist/engine-WaUM2cGA.mjs +0 -1068
- package/dist/engine-WaUM2cGA.mjs.map +0 -1
- package/dist/factory-config-BoRXOw43.mjs +0 -50
- package/dist/factory-config-BoRXOw43.mjs.map +0 -1
- package/dist/factory-config-D2yU3G0c.d.mts +0 -58
- package/dist/github-C5HNBN6p.d.mts +0 -279
- package/dist/id-BLIkCVue.mjs.map +0 -1
- package/dist/index-Bw6hggoH.d.mts +0 -40
- package/dist/index.mjs.map +0 -1
- package/dist/task-CcOyOJ3k.mjs +0 -154
- package/dist/task-CcOyOJ3k.mjs.map +0 -1
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const defaultRetryDelayMs = (attempt) => Math.min(6e4 * 2 ** Math.max(0, attempt - 1), 36e5);
|
|
4
|
-
const credentialPatterns = [
|
|
5
|
-
/github_pat_[A-Za-z0-9_]+/gu,
|
|
6
|
-
/gh[psoru]_[A-Za-z0-9_]+/gu,
|
|
7
|
-
/xox[baprs]-[A-Za-z0-9-]+/gu,
|
|
8
|
-
/(?:Basic|Bearer) [A-Za-z0-9+/_=.:-]+/gu
|
|
9
|
-
];
|
|
10
|
-
function errorMessage(error) {
|
|
11
|
-
let message = error instanceof Error ? error.message : "Unknown communication delivery error";
|
|
12
|
-
for (const pattern of credentialPatterns) message = message.replace(pattern, (match) => {
|
|
13
|
-
return `${match.startsWith("Basic ") ? "Basic " : match.startsWith("Bearer ") ? "Bearer " : ""}[REDACTED]`;
|
|
14
|
-
});
|
|
15
|
-
return message;
|
|
16
|
-
}
|
|
17
|
-
async function deliverOne(stores, router, id, options) {
|
|
18
|
-
const claimed = await stores.outbox.claim(id, options.leaseMs);
|
|
19
|
-
if (claimed === null) return "skipped";
|
|
20
|
-
try {
|
|
21
|
-
await router.deliver(claimed.event);
|
|
22
|
-
return await stores.outbox.complete(claimed.id, claimed.attempt) === null ? "skipped" : "delivered";
|
|
23
|
-
} catch (error) {
|
|
24
|
-
const delay = (options.retryDelayMs ?? defaultRetryDelayMs)(claimed.attempt);
|
|
25
|
-
return await stores.outbox.retry(claimed.id, claimed.attempt, errorMessage(error), delay) === null ? "skipped" : "retried";
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
async function sweepCommunicationOutbox(stores, router, options = {}) {
|
|
29
|
-
const limit = options.limit ?? 100;
|
|
30
|
-
const messages = await stores.outbox.pending(limit);
|
|
31
|
-
const result = {
|
|
32
|
-
delivered: 0,
|
|
33
|
-
retried: 0,
|
|
34
|
-
skipped: 0
|
|
35
|
-
};
|
|
36
|
-
for (const message of messages) {
|
|
37
|
-
const outcome = await deliverOne(stores, router, message.id, options);
|
|
38
|
-
result[outcome] += 1;
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
function createOutboxCommunicationRouter(stores, router, options = {}) {
|
|
43
|
-
return Object.freeze({
|
|
44
|
-
channels: router.channels,
|
|
45
|
-
async deliver(event) {
|
|
46
|
-
const message = await stores.outbox.enqueue(event);
|
|
47
|
-
if (message.state === "delivered") return;
|
|
48
|
-
await deliverOne(stores, router, message.id, options);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
1
|
+
import { communicationEventSchema, communicationOutcomeSchema, communicationOutcomes } from "../schema/communication.mjs";
|
|
2
|
+
import { createOutboxCommunicationRouter, sweepCommunicationOutbox } from "./outbox.mjs";
|
|
53
3
|
//#region src/connectors/index.ts
|
|
4
|
+
/** Create a channel router that rejects duplicate registrations and unsupported destinations. */
|
|
54
5
|
function createCommunicationRouter(adapters) {
|
|
55
6
|
const byChannel = /* @__PURE__ */ new Map();
|
|
56
7
|
for (const adapter of adapters) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/connectors/
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/connectors/index.ts"],"sourcesContent":["import { communicationEventSchema, type CommunicationEvent } from \"../schema/communication\";\nimport type { ReplyTo } from \"../schema/common\";\nimport type { SignalSource } from \"../schema/signal\";\n\nexport {\n communicationEventSchema,\n communicationOutcomeSchema,\n communicationOutcomes,\n type CommunicationEvent,\n type CommunicationOutcome,\n} from \"../schema/communication\";\n\n/** An authenticated provider webhook envelope before connector-specific normalization. */\nexport interface WebhookEvent {\n deliveryId: string;\n event: string;\n payload: unknown;\n}\n\n/** Connector-neutral signal data ready for admission into Factory. */\nexport interface NormalizedSignal<TSource extends SignalSource = SignalSource> {\n source: TSource;\n deliveryId: string;\n replyTo: ReplyTo;\n payload: unknown;\n}\n\n/** Converts a verified webhook into a Factory signal or deliberately ignores it. */\nexport type SignalNormalizer<TSignal extends NormalizedSignal = NormalizedSignal> = (\n event: WebhookEvent,\n) => TSignal | null;\n\n/** Delivers communication events for one provider channel. */\nexport interface CommunicationAdapter {\n readonly channel: string;\n deliver(event: CommunicationEvent): Promise<void>;\n}\n\n/** Routes validated communication events to adapters by reply channel. */\nexport interface CommunicationRouter {\n readonly channels: readonly string[];\n deliver(event: CommunicationEvent): Promise<void>;\n}\n\n/** Create a channel router that rejects duplicate registrations and unsupported destinations. */\nexport function createCommunicationRouter(\n adapters: readonly CommunicationAdapter[],\n): CommunicationRouter {\n const byChannel = new Map<string, CommunicationAdapter>();\n for (const adapter of adapters) {\n const channel = adapter.channel.trim();\n if (channel.length === 0) {\n throw new Error(\"Communication adapter channel is required.\");\n }\n if (byChannel.has(channel)) {\n throw new Error(`Communication adapter ${channel} is registered more than once.`);\n }\n byChannel.set(channel, adapter);\n }\n const channels = Object.freeze([...byChannel.keys()]);\n\n return Object.freeze({\n channels,\n async deliver(input: CommunicationEvent): Promise<void> {\n const event = communicationEventSchema.parse(input);\n const adapter = byChannel.get(event.replyTo.channel);\n if (adapter === undefined) {\n throw new Error(`No communication adapter is registered for ${event.replyTo.channel}.`);\n }\n await adapter.deliver(event);\n },\n });\n}\n\nexport {\n createOutboxCommunicationRouter,\n sweepCommunicationOutbox,\n type CommunicationOutboxStores,\n type CreateOutboxCommunicationRouterOptions,\n type OutboxDeliveryOptions,\n type OutboxSweepResult,\n type SweepCommunicationOutboxOptions,\n} from \"./outbox\";\n"],"mappings":";;;;AA6CA,SAAgB,0BACd,UACqB;CACrB,MAAM,4BAAY,IAAI,IAAkC;CACxD,KAAK,MAAM,WAAW,UAAU;EAC9B,MAAM,UAAU,QAAQ,QAAQ,KAAK;EACrC,IAAI,QAAQ,WAAW,GACrB,MAAM,IAAI,MAAM,4CAA4C;EAE9D,IAAI,UAAU,IAAI,OAAO,GACvB,MAAM,IAAI,MAAM,yBAAyB,QAAQ,+BAA+B;EAElF,UAAU,IAAI,SAAS,OAAO;CAChC;CACA,MAAM,WAAW,OAAO,OAAO,CAAC,GAAG,UAAU,KAAK,CAAC,CAAC;CAEpD,OAAO,OAAO,OAAO;EACnB;EACA,MAAM,QAAQ,OAA0C;GACtD,MAAM,QAAQ,yBAAyB,MAAM,KAAK;GAClD,MAAM,UAAU,UAAU,IAAI,MAAM,QAAQ,OAAO;GACnD,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,MAAM,8CAA8C,MAAM,QAAQ,QAAQ,EAAE;GAExF,MAAM,QAAQ,QAAQ,KAAK;EAC7B;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FactoryStores } from "../store/engine.mjs";
|
|
2
|
+
import { CommunicationRouter } from "./index.mjs";
|
|
3
|
+
//#region src/connectors/outbox.d.ts
|
|
4
|
+
/** Store capability required for durable communication delivery. */
|
|
5
|
+
type CommunicationOutboxStores = Pick<FactoryStores, "outbox">;
|
|
6
|
+
/** Counts delivered, rescheduled, and no-longer-claimable messages from an outbox sweep. */
|
|
7
|
+
interface OutboxSweepResult {
|
|
8
|
+
delivered: number;
|
|
9
|
+
retried: number;
|
|
10
|
+
skipped: number;
|
|
11
|
+
}
|
|
12
|
+
/** Configures outbox claim duration, batch size, and retry scheduling. */
|
|
13
|
+
interface OutboxDeliveryOptions {
|
|
14
|
+
readonly leaseMs?: number;
|
|
15
|
+
readonly limit?: number;
|
|
16
|
+
readonly retryDelayMs?: (attempt: number) => number;
|
|
17
|
+
}
|
|
18
|
+
/** Stores, router, and delivery bounds supplied to one outbox sweep. */
|
|
19
|
+
interface SweepCommunicationOutboxOptions extends OutboxDeliveryOptions {
|
|
20
|
+
readonly stores: CommunicationOutboxStores;
|
|
21
|
+
readonly router: CommunicationRouter;
|
|
22
|
+
}
|
|
23
|
+
/** Stores, router, and delivery bounds used to construct a durable router. */
|
|
24
|
+
interface CreateOutboxCommunicationRouterOptions extends OutboxDeliveryOptions {
|
|
25
|
+
readonly stores: CommunicationOutboxStores;
|
|
26
|
+
readonly router: CommunicationRouter;
|
|
27
|
+
}
|
|
28
|
+
/** Deliver one bounded batch of pending communication events with durable retry state. */
|
|
29
|
+
declare function sweepCommunicationOutbox(options: SweepCommunicationOutboxOptions): Promise<OutboxSweepResult>;
|
|
30
|
+
/** Wrap a communication router so every delivery is durably enqueued before it is attempted. */
|
|
31
|
+
declare function createOutboxCommunicationRouter(options: CreateOutboxCommunicationRouterOptions): CommunicationRouter;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { CommunicationOutboxStores, CreateOutboxCommunicationRouterOptions, OutboxDeliveryOptions, OutboxSweepResult, SweepCommunicationOutboxOptions, createOutboxCommunicationRouter, sweepCommunicationOutbox };
|
|
34
|
+
//# sourceMappingURL=outbox.d.mts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { redactedErrorMessage } from "../errors.mjs";
|
|
2
|
+
//#region src/connectors/outbox.ts
|
|
3
|
+
const defaultRetryDelayMs = (attempt) => Math.min(6e4 * 2 ** Math.max(0, attempt - 1), 36e5);
|
|
4
|
+
async function deliverOne(stores, router, id, options) {
|
|
5
|
+
const claimed = await stores.outbox.claim(id, options.leaseMs);
|
|
6
|
+
if (claimed === null) return "skipped";
|
|
7
|
+
try {
|
|
8
|
+
await router.deliver(claimed.event);
|
|
9
|
+
return await stores.outbox.complete(claimed.id, claimed.attempt) === null ? "skipped" : "delivered";
|
|
10
|
+
} catch (error) {
|
|
11
|
+
const delay = (options.retryDelayMs ?? defaultRetryDelayMs)(claimed.attempt);
|
|
12
|
+
return await stores.outbox.retry(claimed.id, {
|
|
13
|
+
attempt: claimed.attempt,
|
|
14
|
+
reason: redactedErrorMessage(error, [], "Unknown communication delivery error"),
|
|
15
|
+
delayMs: delay
|
|
16
|
+
}) === null ? "skipped" : "retried";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Deliver one bounded batch of pending communication events with durable retry state. */
|
|
20
|
+
async function sweepCommunicationOutbox(options) {
|
|
21
|
+
const { stores, router } = options;
|
|
22
|
+
const limit = options.limit ?? 100;
|
|
23
|
+
const messages = await stores.outbox.pending(limit);
|
|
24
|
+
const result = {
|
|
25
|
+
delivered: 0,
|
|
26
|
+
retried: 0,
|
|
27
|
+
skipped: 0
|
|
28
|
+
};
|
|
29
|
+
for (const message of messages) {
|
|
30
|
+
const outcome = await deliverOne(stores, router, message.id, options);
|
|
31
|
+
result[outcome] += 1;
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/** Wrap a communication router so every delivery is durably enqueued before it is attempted. */
|
|
36
|
+
function createOutboxCommunicationRouter(options) {
|
|
37
|
+
const { stores, router } = options;
|
|
38
|
+
return Object.freeze({
|
|
39
|
+
channels: router.channels,
|
|
40
|
+
async deliver(event) {
|
|
41
|
+
const message = await stores.outbox.enqueue(event);
|
|
42
|
+
if (message.state === "delivered") return;
|
|
43
|
+
await deliverOne(stores, router, message.id, options);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { createOutboxCommunicationRouter, sweepCommunicationOutbox };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=outbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox.mjs","names":[],"sources":["../../src/connectors/outbox.ts"],"sourcesContent":["import type { OutboxId } from \"../schema/id\";\nimport type { FactoryStores } from \"../store/engine\";\nimport { redactedErrorMessage } from \"../errors\";\nimport type { CommunicationEvent, CommunicationRouter } from \"./index\";\n\n/** Store capability required for durable communication delivery. */\nexport type CommunicationOutboxStores = Pick<FactoryStores, \"outbox\">;\n\n/** Counts delivered, rescheduled, and no-longer-claimable messages from an outbox sweep. */\nexport interface OutboxSweepResult {\n delivered: number;\n retried: number;\n skipped: number;\n}\n\n/** Configures outbox claim duration, batch size, and retry scheduling. */\nexport interface OutboxDeliveryOptions {\n readonly leaseMs?: number;\n readonly limit?: number;\n readonly retryDelayMs?: (attempt: number) => number;\n}\n\n/** Stores, router, and delivery bounds supplied to one outbox sweep. */\nexport interface SweepCommunicationOutboxOptions extends OutboxDeliveryOptions {\n readonly stores: CommunicationOutboxStores;\n readonly router: CommunicationRouter;\n}\n\n/** Stores, router, and delivery bounds used to construct a durable router. */\nexport interface CreateOutboxCommunicationRouterOptions extends OutboxDeliveryOptions {\n readonly stores: CommunicationOutboxStores;\n readonly router: CommunicationRouter;\n}\n\nconst defaultRetryDelayMs = (attempt: number) =>\n Math.min(60_000 * 2 ** Math.max(0, attempt - 1), 60 * 60_000);\n\nasync function deliverOne(\n stores: CommunicationOutboxStores,\n router: CommunicationRouter,\n id: OutboxId,\n options: OutboxDeliveryOptions,\n): Promise<\"delivered\" | \"retried\" | \"skipped\"> {\n const claimed = await stores.outbox.claim(id, options.leaseMs);\n if (claimed === null) return \"skipped\";\n try {\n await router.deliver(claimed.event);\n const completed = await stores.outbox.complete(claimed.id, claimed.attempt);\n return completed === null ? \"skipped\" : \"delivered\";\n } catch (error) {\n const delay = (options.retryDelayMs ?? defaultRetryDelayMs)(claimed.attempt);\n const retried = await stores.outbox.retry(claimed.id, {\n attempt: claimed.attempt,\n reason: redactedErrorMessage(error, [], \"Unknown communication delivery error\"),\n delayMs: delay,\n });\n return retried === null ? \"skipped\" : \"retried\";\n }\n}\n\n/** Deliver one bounded batch of pending communication events with durable retry state. */\nexport async function sweepCommunicationOutbox(\n options: SweepCommunicationOutboxOptions,\n): Promise<OutboxSweepResult> {\n const { stores, router } = options;\n const limit = options.limit ?? 100;\n const messages = await stores.outbox.pending(limit);\n const result: OutboxSweepResult = { delivered: 0, retried: 0, skipped: 0 };\n for (const message of messages) {\n const outcome = await deliverOne(stores, router, message.id, options);\n result[outcome] += 1;\n }\n return result;\n}\n\n/** Wrap a communication router so every delivery is durably enqueued before it is attempted. */\nexport function createOutboxCommunicationRouter(\n options: CreateOutboxCommunicationRouterOptions,\n): CommunicationRouter {\n const { stores, router } = options;\n return Object.freeze({\n channels: router.channels,\n async deliver(event: CommunicationEvent): Promise<void> {\n const message = await stores.outbox.enqueue(event);\n if (message.state === \"delivered\") return;\n await deliverOne(stores, router, message.id, options);\n },\n });\n}\n"],"mappings":";;AAkCA,MAAM,uBAAuB,YAC3B,KAAK,IAAI,MAAS,KAAK,KAAK,IAAI,GAA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
|
2
|
+
const slackApprovalPrefix = "factory_approval:";
|
|
3
|
+
const slackRejectionCallback = "factory_approval_reject";
|
|
4
|
+
const slackReasonBlock = "reason";
|
|
5
|
+
const slackReasonAction = "reason_text";
|
|
6
|
+
function escape(text) {
|
|
7
|
+
return text.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
8
|
+
}
|
|
9
|
+
function plain(text) {
|
|
10
|
+
return {
|
|
11
|
+
type: "plain_text",
|
|
12
|
+
text: text.slice(0, 2900)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function section(text) {
|
|
16
|
+
return {
|
|
17
|
+
type: "section",
|
|
18
|
+
text: {
|
|
19
|
+
type: "mrkdwn",
|
|
20
|
+
text: text.slice(0, 2900)
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function context(text) {
|
|
25
|
+
return {
|
|
26
|
+
type: "context",
|
|
27
|
+
elements: [{
|
|
28
|
+
type: "mrkdwn",
|
|
29
|
+
text: text.slice(0, 2900)
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function button(action, text, id, style) {
|
|
34
|
+
return {
|
|
35
|
+
type: "button",
|
|
36
|
+
action_id: `${slackApprovalPrefix}${action}`,
|
|
37
|
+
text: plain(text),
|
|
38
|
+
value: id,
|
|
39
|
+
...style ? { style } : {}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function actor(value) {
|
|
43
|
+
const user = /^slack:T[A-Z0-9]+:([UW][A-Z0-9]+)$/u.exec(value ?? "")?.[1];
|
|
44
|
+
return user ? `<@${user}>` : escape(value ?? "an operator");
|
|
45
|
+
}
|
|
46
|
+
function title(view) {
|
|
47
|
+
return view.finding?.title ?? `${view.task.kind.replaceAll("_", " ")} proposal`;
|
|
48
|
+
}
|
|
49
|
+
function slackApprovalMessage(view) {
|
|
50
|
+
const { task, finding, decision } = view;
|
|
51
|
+
const pending = task.approval === "required" && task.state === "queued";
|
|
52
|
+
const blocks = [
|
|
53
|
+
context([finding?.priority, ...view.repositories].filter(Boolean).map((text) => escape(text)).join(" · ")),
|
|
54
|
+
section(`*${escape(title(view))}*`),
|
|
55
|
+
section(escape(finding?.body ?? "Inspect the task and its origin before deciding."))
|
|
56
|
+
];
|
|
57
|
+
if (finding) blocks.push(section(`*Evidence · ${escape(finding.verification.level)}*\n${escape(finding.verification.summary)}`));
|
|
58
|
+
if (pending && !decision) {
|
|
59
|
+
blocks.push(context("This task requires operator approval before work can start."));
|
|
60
|
+
blocks.push({
|
|
61
|
+
type: "actions",
|
|
62
|
+
elements: [
|
|
63
|
+
button("approve", "Approve work", task.id, "primary"),
|
|
64
|
+
button("reject", "Reject…", task.id),
|
|
65
|
+
button("evidence", "View evidence", task.id)
|
|
66
|
+
]
|
|
67
|
+
});
|
|
68
|
+
blocks.push(context("Grants permission to start. Budget and dependency checks still apply."));
|
|
69
|
+
} else if (pending && decision) {
|
|
70
|
+
blocks.push(context(`Decision saved by ${actor(decision.decidedBy)}. Its task update still needs to finish.`));
|
|
71
|
+
blocks.push({
|
|
72
|
+
type: "actions",
|
|
73
|
+
elements: [button("retry", "Finish recorded decision", task.id, "primary"), button("evidence", "View evidence", task.id)]
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
const state = decision?.state === "approved" ? `Approved by ${actor(decision.decidedBy)} · ${task.state === "queued" ? "queued for execution" : escape(task.state.replaceAll("_", " "))}` : decision?.state === "rejected" ? `Rejected by ${actor(decision.decidedBy)} · task cancelled` : `Task ${escape(task.state.replaceAll("_", " "))}`;
|
|
77
|
+
blocks.push(context(state));
|
|
78
|
+
if (decision?.reason) blocks.push(section(escape(decision.reason)));
|
|
79
|
+
blocks.push({
|
|
80
|
+
type: "actions",
|
|
81
|
+
elements: [button("evidence", "View evidence", task.id), ...decision ? [button("decision", "View decision", task.id)] : []]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
text: escape(`${title(view)} · ${decision?.state ?? (pending ? "Awaiting approval" : task.state)}`),
|
|
86
|
+
blocks
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function slackApprovalModal(view, kind, metadata) {
|
|
90
|
+
const { finding, decision } = view;
|
|
91
|
+
const blocks = [section(`*${escape(title(view))}*`)];
|
|
92
|
+
if (kind === "reject") {
|
|
93
|
+
blocks.push(section("Factory will cancel this task. Your reason will be visible with the decision."));
|
|
94
|
+
blocks.push({
|
|
95
|
+
type: "input",
|
|
96
|
+
block_id: slackReasonBlock,
|
|
97
|
+
label: plain("Reason"),
|
|
98
|
+
element: {
|
|
99
|
+
type: "plain_text_input",
|
|
100
|
+
action_id: slackReasonAction,
|
|
101
|
+
multiline: true,
|
|
102
|
+
min_length: 1,
|
|
103
|
+
max_length: 2e3,
|
|
104
|
+
...decision?.state === "rejected" && decision.reason ? { initial_value: decision.reason } : {},
|
|
105
|
+
placeholder: plain("Why should this work not proceed?")
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
} else if (kind === "decision" && decision) {
|
|
109
|
+
blocks.push(section(`${decision.state === "approved" ? "Approved" : "Rejected"} by ${actor(decision.decidedBy)}`));
|
|
110
|
+
if (decision.reason) blocks.push(section(escape(decision.reason)));
|
|
111
|
+
blocks.push(context(`${escape(decision.recordedAt)} · ${escape(decision.receiptId)}`));
|
|
112
|
+
} else {
|
|
113
|
+
blocks.push(section(escape(finding?.body ?? "No finding is attached to this task.")));
|
|
114
|
+
if (finding) {
|
|
115
|
+
blocks.push(section(`*Evidence · ${escape(finding.verification.level)}*\n${escape(finding.verification.summary)}`));
|
|
116
|
+
if (finding.path) blocks.push(context(`Location: ${escape(finding.path)}${finding.line ? `:${finding.line}` : ""}`));
|
|
117
|
+
if (finding.verification.limitations) blocks.push(section(`*Limitations*\n${escape(finding.verification.limitations)}`));
|
|
118
|
+
}
|
|
119
|
+
blocks.push(context(`Task: ${escape(view.task.id)}`));
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
type: "modal",
|
|
123
|
+
title: plain(kind === "reject" ? "Reject proposed work" : kind === "decision" ? "Recorded decision" : "Proposal evidence"),
|
|
124
|
+
close: plain(kind === "reject" ? "Cancel" : "Done"),
|
|
125
|
+
blocks,
|
|
126
|
+
...kind === "reject" ? {
|
|
127
|
+
callback_id: slackRejectionCallback,
|
|
128
|
+
private_metadata: metadata,
|
|
129
|
+
submit: plain("Reject work")
|
|
130
|
+
} : {}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { slackApprovalMessage, slackApprovalModal, slackApprovalPrefix, slackReasonAction, slackReasonBlock, slackRejectionCallback };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=slack-approval-blocks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-approval-blocks.mjs","names":[],"sources":["../../src/connectors/slack-approval-blocks.ts"],"sourcesContent":["import type { ApprovalView } from \"../approval-contracts\";\n\nexport const slackApprovalPrefix = \"factory_approval:\";\nexport const slackRejectionCallback = \"factory_approval_reject\";\nexport const slackReasonBlock = \"reason\";\nexport const slackReasonAction = \"reason_text\";\n\nfunction escape(text: string) {\n return text.replaceAll(\"&\", \"&\").replaceAll(\"<\", \"<\").replaceAll(\">\", \">\");\n}\nfunction plain(text: string) {\n return { type: \"plain_text\", text: text.slice(0, 2900) };\n}\nfunction section(text: string) {\n return { type: \"section\", text: { type: \"mrkdwn\", text: text.slice(0, 2900) } };\n}\nfunction context(text: string) {\n return { type: \"context\", elements: [{ type: \"mrkdwn\", text: text.slice(0, 2900) }] };\n}\nfunction button(action: string, text: string, id: string, style?: \"primary\" | \"danger\") {\n return {\n type: \"button\",\n action_id: `${slackApprovalPrefix}${action}`,\n text: plain(text),\n value: id,\n ...(style ? { style } : {}),\n };\n}\nfunction actor(value: string | undefined) {\n const user = /^slack:T[A-Z0-9]+:([UW][A-Z0-9]+)$/u.exec(value ?? \"\")?.[1];\n return user ? `<@${user}>` : escape(value ?? \"an operator\");\n}\nfunction title(view: ApprovalView) {\n return view.finding?.title ?? `${view.task.kind.replaceAll(\"_\", \" \")} proposal`;\n}\n\nexport function slackApprovalMessage(view: ApprovalView) {\n const { task, finding, decision } = view;\n const pending = task.approval === \"required\" && task.state === \"queued\";\n const blocks: Record<string, unknown>[] = [\n context(\n [finding?.priority, ...view.repositories]\n .filter(Boolean)\n .map((text) => escape(text!))\n .join(\" · \"),\n ),\n section(`*${escape(title(view))}*`),\n section(escape(finding?.body ?? \"Inspect the task and its origin before deciding.\")),\n ];\n if (finding)\n blocks.push(\n section(\n `*Evidence · ${escape(finding.verification.level)}*\\n${escape(finding.verification.summary)}`,\n ),\n );\n if (pending && !decision) {\n blocks.push(context(\"This task requires operator approval before work can start.\"));\n blocks.push({\n type: \"actions\",\n elements: [\n button(\"approve\", \"Approve work\", task.id, \"primary\"),\n button(\"reject\", \"Reject…\", task.id),\n button(\"evidence\", \"View evidence\", task.id),\n ],\n });\n blocks.push(context(\"Grants permission to start. Budget and dependency checks still apply.\"));\n } else if (pending && decision) {\n blocks.push(\n context(\n `Decision saved by ${actor(decision.decidedBy)}. Its task update still needs to finish.`,\n ),\n );\n blocks.push({\n type: \"actions\",\n elements: [\n button(\"retry\", \"Finish recorded decision\", task.id, \"primary\"),\n button(\"evidence\", \"View evidence\", task.id),\n ],\n });\n } else {\n const state =\n decision?.state === \"approved\"\n ? `Approved by ${actor(decision.decidedBy)} · ${task.state === \"queued\" ? \"queued for execution\" : escape(task.state.replaceAll(\"_\", \" \"))}`\n : decision?.state === \"rejected\"\n ? `Rejected by ${actor(decision.decidedBy)} · task cancelled`\n : `Task ${escape(task.state.replaceAll(\"_\", \" \"))}`;\n blocks.push(context(state));\n if (decision?.reason) blocks.push(section(escape(decision.reason)));\n blocks.push({\n type: \"actions\",\n elements: [\n button(\"evidence\", \"View evidence\", task.id),\n ...(decision ? [button(\"decision\", \"View decision\", task.id)] : []),\n ],\n });\n }\n return {\n text: escape(\n `${title(view)} · ${decision?.state ?? (pending ? \"Awaiting approval\" : task.state)}`,\n ),\n blocks,\n };\n}\n\nexport function slackApprovalModal(\n view: ApprovalView,\n kind: \"reject\" | \"evidence\" | \"decision\",\n metadata: string,\n) {\n const { finding, decision } = view;\n const blocks: Record<string, unknown>[] = [section(`*${escape(title(view))}*`)];\n if (kind === \"reject\") {\n blocks.push(\n section(\"Factory will cancel this task. Your reason will be visible with the decision.\"),\n );\n blocks.push({\n type: \"input\",\n block_id: slackReasonBlock,\n label: plain(\"Reason\"),\n element: {\n type: \"plain_text_input\",\n action_id: slackReasonAction,\n multiline: true,\n min_length: 1,\n max_length: 2000,\n ...(decision?.state === \"rejected\" && decision.reason\n ? { initial_value: decision.reason }\n : {}),\n placeholder: plain(\"Why should this work not proceed?\"),\n },\n });\n } else if (kind === \"decision\" && decision) {\n blocks.push(\n section(\n `${decision.state === \"approved\" ? \"Approved\" : \"Rejected\"} by ${actor(decision.decidedBy)}`,\n ),\n );\n if (decision.reason) blocks.push(section(escape(decision.reason)));\n blocks.push(context(`${escape(decision.recordedAt)} · ${escape(decision.receiptId)}`));\n } else {\n blocks.push(section(escape(finding?.body ?? \"No finding is attached to this task.\")));\n if (finding) {\n blocks.push(\n section(\n `*Evidence · ${escape(finding.verification.level)}*\\n${escape(finding.verification.summary)}`,\n ),\n );\n if (finding.path)\n blocks.push(\n context(`Location: ${escape(finding.path)}${finding.line ? `:${finding.line}` : \"\"}`),\n );\n if (finding.verification.limitations)\n blocks.push(section(`*Limitations*\\n${escape(finding.verification.limitations)}`));\n }\n blocks.push(context(`Task: ${escape(view.task.id)}`));\n }\n return {\n type: \"modal\",\n title: plain(\n kind === \"reject\"\n ? \"Reject proposed work\"\n : kind === \"decision\"\n ? \"Recorded decision\"\n : \"Proposal evidence\",\n ),\n close: plain(kind === \"reject\" ? \"Cancel\" : \"Done\"),\n blocks,\n ...(kind === \"reject\"\n ? {\n callback_id: slackRejectionCallback,\n private_metadata: metadata,\n submit: plain(\"Reject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ACL,QAAQ,aAAa,OAAO,QAAQ,IAAI,IAAI,QAAQ,OAAO,IAAI,QAAQ,SAAS,IAAI,CACtF;GACF,IAAI,QAAQ,aAAa,aACvB,OAAO,KAAK,QAAQ,kBAAkB,OAAO,QAAQ,aAAa,WAAW,GAAG,CAAC;EACrF;EACA,OAAO,KAAK,QAAQ,SAAS,OAAO,KAAK,KAAK,EAAE,GAAG,CAAC;CACtD;CACA,OAAO;EACL,MAAM;EACN,OAAO,MACL,SAAS,WACL,yBACA,SAAS,aACP,sBACA,mBACR;EACA,OAAO,MAAM,SAAS,WAAW,WAAW,MAAM;EAClD;EACA,GAAI,SAAS,WACT;GACE,aAAa;GACb,kBAAkB;GAClB,QAAQ,MAAM,aAAa;EAC7B,IACA,CAAC;CACP;AACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Task } from "../schema/task.mjs";
|
|
2
|
+
import { CommunicationEvent } from "../schema/communication.mjs";
|
|
3
|
+
import { FactoryStores } from "../store/engine.mjs";
|
|
4
|
+
import { ApprovalAccessOptions, ApprovalAccessStores } from "../approval-access.mjs";
|
|
5
|
+
//#region src/connectors/slack-approvals.d.ts
|
|
6
|
+
/** Store capabilities required to present and decide Slack approvals. */
|
|
7
|
+
type SlackApprovalsStores = ApprovalAccessStores & Pick<FactoryStores, "outbox" | "receipts">;
|
|
8
|
+
/** Configures authenticated Slack presentation and handling for durable Task approvals. */
|
|
9
|
+
interface SlackApprovalsOptions extends Omit<ApprovalAccessOptions, "stores"> {
|
|
10
|
+
readonly stores: SlackApprovalsStores;
|
|
11
|
+
/** Explicit fallback destination for work with no Slack reply thread. */
|
|
12
|
+
approvalChannel?: string;
|
|
13
|
+
request(operation: string, body: unknown): Promise<unknown>;
|
|
14
|
+
/** Authenticate the original request and body before accepting any interaction. */
|
|
15
|
+
verify(request: Request, body: string): Promise<void>;
|
|
16
|
+
reportError?(error: unknown): void;
|
|
17
|
+
}
|
|
18
|
+
/** Slack approval projection, interaction handler, and reconciliation operations. */
|
|
19
|
+
interface SlackApprovals {
|
|
20
|
+
handle(request: Request, waitUntil: (task: Promise<unknown>) => void): Promise<Response | null>;
|
|
21
|
+
reconcile(tasks: readonly Task[]): Promise<number>;
|
|
22
|
+
deliver(event: CommunicationEvent): Promise<void>;
|
|
23
|
+
updatePresented(taskId: Task["id"]): Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
/** Slack is a projection of the same Task decision used by HTTP clients. */
|
|
26
|
+
declare function createSlackApprovals(options: SlackApprovalsOptions): SlackApprovals;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { SlackApprovals, SlackApprovalsOptions, SlackApprovalsStores, createSlackApprovals };
|
|
29
|
+
//# sourceMappingURL=slack-approvals.d.mts.map
|