@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
|
@@ -0,0 +1,683 @@
|
|
|
1
|
+
import { Signal, SignalOutcome, SignalSource, SignalTriage } from "../schema/signal.mjs";
|
|
2
|
+
import { AnswerId, ChangeId, FactoryId, OutboxId, ReceiptId, RepositoryId, RepositoryIds, SignalId, TaskId } from "../schema/id.mjs";
|
|
3
|
+
import { Repository } from "../schema/repository.mjs";
|
|
4
|
+
import { ExecutionReference, Task, TaskOrigin, TaskQuestion, TaskState } from "../schema/task.mjs";
|
|
5
|
+
import { WorkflowRegistry } from "../workflows.mjs";
|
|
6
|
+
import { TaskMessageProtocols } from "../schema/task-message.mjs";
|
|
7
|
+
import { WorkNotifications } from "./work-notifications.mjs";
|
|
8
|
+
import { IsoDateTimeClock, ReplyTo } from "../schema/common.mjs";
|
|
9
|
+
import { StoreDriver } from "./driver.mjs";
|
|
10
|
+
import { TaskMessageAuthorize, TaskMessageStore } from "./task-messages.mjs";
|
|
11
|
+
import { TaskGraphStore } from "./task-graphs.mjs";
|
|
12
|
+
import { TaskEffectStore } from "./task-effects.mjs";
|
|
13
|
+
import { TaskWorkStore } from "./task-work.mjs";
|
|
14
|
+
import { ImageAttachment, ImageId, imageUploadSchema } from "../image-input.mjs";
|
|
15
|
+
import { AnswerEvent } from "../schema/answer.mjs";
|
|
16
|
+
import { AgentSession, AgentSessionId } from "../schema/session.mjs";
|
|
17
|
+
import { CommunicationEvent } from "../schema/communication.mjs";
|
|
18
|
+
import { Budget, BudgetMonth } from "../schema/budget.mjs";
|
|
19
|
+
import { Change, ChangeInState, ChangeLevel, ChangeState } from "../schema/change.mjs";
|
|
20
|
+
import { OutboxMessage } from "../schema/outbox.mjs";
|
|
21
|
+
import { TranscriptSnapshot } from "../schema/transcript.mjs";
|
|
22
|
+
import { Cost, Receipt, ReceiptDelivery, ReceiptKind, ReceiptPhase, ReceiptState, StandardReceiptKind, StandardReceiptPhase, StandardReceiptState } from "../schema/receipt.mjs";
|
|
23
|
+
import { z } from "zod";
|
|
24
|
+
//#region src/store/engine.d.ts
|
|
25
|
+
declare const storedImageSchema: z.ZodObject<{
|
|
26
|
+
id: z.ZodType<`img_${string}`, string, z.core.$ZodTypeInternals<`img_${string}`, string>>;
|
|
27
|
+
filename: z.ZodString;
|
|
28
|
+
mediaType: z.ZodEnum<{
|
|
29
|
+
"image/png": "image/png";
|
|
30
|
+
"image/jpeg": "image/jpeg";
|
|
31
|
+
"image/webp": "image/webp";
|
|
32
|
+
}>;
|
|
33
|
+
size: z.ZodNumber;
|
|
34
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
35
|
+
owner: z.ZodString;
|
|
36
|
+
base64: z.ZodString;
|
|
37
|
+
createdAt: z.ZodISODateTime;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
type StoredImage = z.infer<typeof storedImageSchema>;
|
|
40
|
+
/** Error raised when uploaded image bytes, ownership, or attachment metadata is invalid. */
|
|
41
|
+
declare class ImageInputError extends Error {}
|
|
42
|
+
/** An approval decision that does not apply to the task's current approval or state. */
|
|
43
|
+
declare class ApprovalError extends Error {
|
|
44
|
+
readonly taskId: TaskId;
|
|
45
|
+
readonly reason: string;
|
|
46
|
+
constructor(taskId: TaskId, reason: string);
|
|
47
|
+
}
|
|
48
|
+
/** A settlement that does not apply to the task's current state. */
|
|
49
|
+
declare class SettlementError extends Error {
|
|
50
|
+
readonly taskId: TaskId;
|
|
51
|
+
readonly reason: string;
|
|
52
|
+
constructor(taskId: TaskId, reason: string);
|
|
53
|
+
}
|
|
54
|
+
/** Error raised when a Task is not authorized to create or update a requested Change. */
|
|
55
|
+
declare class ChangeAssociationError extends Error {
|
|
56
|
+
readonly taskId: TaskId;
|
|
57
|
+
readonly repositoryId: RepositoryId;
|
|
58
|
+
readonly reason: string;
|
|
59
|
+
constructor(taskId: TaskId, repositoryId: RepositoryId, reason: string);
|
|
60
|
+
}
|
|
61
|
+
/** Error raised when a stable outbox event ID is reused with different content. */
|
|
62
|
+
declare class OutboxEventConflictError extends Error {
|
|
63
|
+
constructor(eventId: string);
|
|
64
|
+
}
|
|
65
|
+
/** Error raised when a QuestionTask already has a different immutable answer event. */
|
|
66
|
+
declare class AnswerEventConflictError extends Error {
|
|
67
|
+
constructor(questionTaskId: TaskId);
|
|
68
|
+
}
|
|
69
|
+
/** Normalized, authenticated input required to persist one inbound Signal. */
|
|
70
|
+
interface CreateSignalInput {
|
|
71
|
+
repositoryId: RepositoryId;
|
|
72
|
+
source: SignalSource;
|
|
73
|
+
deliveryId: string;
|
|
74
|
+
replyTo: ReplyTo;
|
|
75
|
+
payload: unknown;
|
|
76
|
+
}
|
|
77
|
+
/** Outcome and optional human-readable context for one Signal decision. */
|
|
78
|
+
interface DecideSignalInput {
|
|
79
|
+
readonly outcome: SignalOutcome;
|
|
80
|
+
readonly detail?: string;
|
|
81
|
+
readonly reason?: string;
|
|
82
|
+
}
|
|
83
|
+
interface CreateTaskInputBase {
|
|
84
|
+
/** Repository authorization scope; children must remain within their parent's scope. */
|
|
85
|
+
repositoryIds: RepositoryIds;
|
|
86
|
+
/** Descriptive work vocabulary; routing comes only from `work.route`. */
|
|
87
|
+
kind: Task["kind"];
|
|
88
|
+
/** Destination for lifecycle communication produced by this Task. */
|
|
89
|
+
replyTo: ReplyTo;
|
|
90
|
+
/** Same key under the same parent creates one Task and returns its current snapshot on retries. */
|
|
91
|
+
dedupeKey?: string;
|
|
92
|
+
/** Optional application-owned grouping label. */
|
|
93
|
+
area?: string;
|
|
94
|
+
/** Optional associated software Change. */
|
|
95
|
+
changeId?: ChangeId;
|
|
96
|
+
/** Stamp the task as needing a human decision before dispatch. */
|
|
97
|
+
approval?: "required";
|
|
98
|
+
/** Required explicit versioned workflow contract. */
|
|
99
|
+
work: Task["work"];
|
|
100
|
+
/** Graph prerequisites that must succeed before this Task can run. */
|
|
101
|
+
dependencies?: readonly TaskId[];
|
|
102
|
+
}
|
|
103
|
+
/** Provenance required when admitting a root Task with no parent to inherit from. */
|
|
104
|
+
type RootTaskOrigin = {
|
|
105
|
+
/** Durable inbound Signal that caused the root work. */
|
|
106
|
+
signalId: SignalId;
|
|
107
|
+
/** Authenticated operator additionally associated with the work. */
|
|
108
|
+
operator?: string;
|
|
109
|
+
} | {
|
|
110
|
+
/** Optional inbound Signal additionally associated with operator-created work. */
|
|
111
|
+
signalId?: SignalId;
|
|
112
|
+
/** Authenticated operator that caused the root work. */
|
|
113
|
+
operator: string;
|
|
114
|
+
};
|
|
115
|
+
/** Explicit work, graph placement, provenance, and policy input for Task admission. */
|
|
116
|
+
type CreateTaskInput = CreateTaskInputBase & ({
|
|
117
|
+
origin: RootTaskOrigin;
|
|
118
|
+
parentTaskId?: never;
|
|
119
|
+
parentTaskAttempt?: never;
|
|
120
|
+
question?: TaskQuestion;
|
|
121
|
+
} | ({
|
|
122
|
+
origin: TaskOrigin;
|
|
123
|
+
parentTaskId: TaskId;
|
|
124
|
+
} & ({
|
|
125
|
+
question?: undefined;
|
|
126
|
+
parentTaskAttempt?: never;
|
|
127
|
+
} | {
|
|
128
|
+
question: TaskQuestion;
|
|
129
|
+
parentTaskAttempt?: number;
|
|
130
|
+
})));
|
|
131
|
+
/** Authenticated operator and optional rationale for an immutable approval decision. */
|
|
132
|
+
interface ApprovalDecision {
|
|
133
|
+
/** Authenticated operator making the decision. */
|
|
134
|
+
by: string;
|
|
135
|
+
reason?: string;
|
|
136
|
+
}
|
|
137
|
+
/** Authenticated operator and required rationale for denying a Task approval. */
|
|
138
|
+
interface RejectionDecision {
|
|
139
|
+
/** Authenticated operator making the decision. */
|
|
140
|
+
by: string;
|
|
141
|
+
/** Human-readable reason retained on the immutable rejection receipt. */
|
|
142
|
+
reason: string;
|
|
143
|
+
}
|
|
144
|
+
/** Authenticated answer submitted for one open QuestionTask. */
|
|
145
|
+
interface AnswerQuestionInput {
|
|
146
|
+
questionTaskId: TaskId;
|
|
147
|
+
answer: string;
|
|
148
|
+
answeredBy: string;
|
|
149
|
+
}
|
|
150
|
+
/** Persisted answer and affected question/parent Tasks after answering a question. */
|
|
151
|
+
interface AnswerQuestionResult {
|
|
152
|
+
readonly answerEvent: AnswerEvent;
|
|
153
|
+
readonly questionTask: Task;
|
|
154
|
+
readonly parentTask: Task | null;
|
|
155
|
+
}
|
|
156
|
+
/** Exclusive binding of a Factory interaction to a Task or provider execution. */
|
|
157
|
+
type AgentSessionBinding = {
|
|
158
|
+
taskId: TaskId;
|
|
159
|
+
execution?: never;
|
|
160
|
+
} | {
|
|
161
|
+
execution: ExecutionReference;
|
|
162
|
+
taskId?: never;
|
|
163
|
+
};
|
|
164
|
+
/** Continuation Task, prompt context, and optional images cached on one Agent Session. */
|
|
165
|
+
interface CacheContinuationContextInput {
|
|
166
|
+
readonly taskId: TaskId;
|
|
167
|
+
readonly context: string;
|
|
168
|
+
readonly attachments?: readonly ImageAttachment[];
|
|
169
|
+
}
|
|
170
|
+
/** Lifecycle-transition fields that may be changed without bypassing settlement or usage APIs. */
|
|
171
|
+
type TaskPatch = Partial<Pick<Task, "changeId" | "reportRef" | "reservedUsd" | "reservedAt" | "question">>;
|
|
172
|
+
/** One completed model step's usage, as eve's step.completed event carries it. */
|
|
173
|
+
declare const stepUsageSchema: z.ZodObject<{
|
|
174
|
+
turnId: z.ZodString;
|
|
175
|
+
stepIndex: z.ZodNumber;
|
|
176
|
+
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
}, z.core.$strict>;
|
|
182
|
+
/** Measured usage for one completed provider turn step, used for idempotent accounting. */
|
|
183
|
+
type StepUsage = z.infer<typeof stepUsageSchema>;
|
|
184
|
+
/** Attempt and provider execution that must still own a Task usage observation. */
|
|
185
|
+
interface TaskExecutionFence {
|
|
186
|
+
/** Current positive attempt that emitted the observation. */
|
|
187
|
+
readonly attempt: number;
|
|
188
|
+
/** Exact provider execution that emitted the observation. */
|
|
189
|
+
readonly execution: ExecutionReference;
|
|
190
|
+
}
|
|
191
|
+
/** Error raised when a Task operation loses its exact-attempt concurrency fence. */
|
|
192
|
+
declare class TaskAttemptConflictError extends Error {
|
|
193
|
+
readonly taskId: TaskId;
|
|
194
|
+
readonly actualAttempt: number;
|
|
195
|
+
readonly expectedAttempt: number;
|
|
196
|
+
constructor(taskId: TaskId, actualAttempt: number, expectedAttempt: number);
|
|
197
|
+
}
|
|
198
|
+
/** Provider execution and optional attempt fence recorded on one running Task. */
|
|
199
|
+
interface RecordTaskExecutionInput {
|
|
200
|
+
/** Provider handle to persist for later inspection, cancellation, and callback fencing. */
|
|
201
|
+
readonly execution: ExecutionReference;
|
|
202
|
+
/** Current running attempt required at the write; identical replay is then a no-op while running. */
|
|
203
|
+
readonly expectAttempt?: number;
|
|
204
|
+
}
|
|
205
|
+
/** One measured usage step and optional exact-execution fence for a Task. */
|
|
206
|
+
interface RecordTaskUsageInput {
|
|
207
|
+
/** Monotonic step observation to aggregate once per provider turn. */
|
|
208
|
+
readonly step: StepUsage;
|
|
209
|
+
/** Optional current-attempt and execution guard for provider-originated observations. */
|
|
210
|
+
readonly fence?: TaskExecutionFence;
|
|
211
|
+
}
|
|
212
|
+
interface TaskTransitionContext {
|
|
213
|
+
patch?: TaskPatch;
|
|
214
|
+
reason?: string;
|
|
215
|
+
/** Classifies the transition receipt for lifecycle communication. */
|
|
216
|
+
phase?: ReceiptPhase;
|
|
217
|
+
/**
|
|
218
|
+
* Refuse unless the task is in this state at write time. Closes
|
|
219
|
+
* check-then-act races where the transition would also be legal from the
|
|
220
|
+
* state a concurrent writer moved the task into.
|
|
221
|
+
*/
|
|
222
|
+
expectFrom?: TaskState;
|
|
223
|
+
/** Refuse late events from a previous execution attempt. */
|
|
224
|
+
expectAttempt?: number;
|
|
225
|
+
/** Refuse completion from a provider execution that has been replaced. */
|
|
226
|
+
expectExecution?: ExecutionReference;
|
|
227
|
+
/** Refuse cleanup or answers for a question that no longer blocks this task. */
|
|
228
|
+
expectQuestionTaskId?: TaskId;
|
|
229
|
+
}
|
|
230
|
+
/** Destination-correlated data and concurrency fences for one Task transition. */
|
|
231
|
+
type TaskTransitionOptions<To extends TaskState = TaskState> = To extends "needs_human" ? TaskTransitionContext & {
|
|
232
|
+
/** Actionable description required whenever a Task enters needs_human. */
|
|
233
|
+
needsHumanAction: string;
|
|
234
|
+
/** Open child question required when the Task is not itself a QuestionTask. */
|
|
235
|
+
questionTaskId?: TaskId;
|
|
236
|
+
output?: never;
|
|
237
|
+
reuseRecordedOutput?: never;
|
|
238
|
+
} : To extends "succeeded" ? TaskTransitionContext & ({
|
|
239
|
+
/** Candidate output validated against the Task's exact workflow. */
|
|
240
|
+
output: unknown;
|
|
241
|
+
reuseRecordedOutput?: never;
|
|
242
|
+
} | {
|
|
243
|
+
output?: never;
|
|
244
|
+
/** Explicitly finish with output already persisted by the work store. */
|
|
245
|
+
reuseRecordedOutput: true;
|
|
246
|
+
}) & {
|
|
247
|
+
needsHumanAction?: never;
|
|
248
|
+
questionTaskId?: never;
|
|
249
|
+
} : TaskTransitionContext & {
|
|
250
|
+
output?: never;
|
|
251
|
+
reuseRecordedOutput?: never;
|
|
252
|
+
needsHumanAction?: never;
|
|
253
|
+
questionTaskId?: never;
|
|
254
|
+
};
|
|
255
|
+
/** Argument tuple requiring destination-specific data only for constrained transitions. */
|
|
256
|
+
type TaskTransitionArguments<To extends TaskState> = To extends "needs_human" | "succeeded" ? [options: TaskTransitionOptions<To>] : [options?: TaskTransitionOptions<To>];
|
|
257
|
+
/** Pull-request identity, ownership, and initial trust evidence used to create a Change. */
|
|
258
|
+
interface CreateChangeInput {
|
|
259
|
+
repositoryId: RepositoryId;
|
|
260
|
+
taskId?: TaskId;
|
|
261
|
+
groupId?: TaskId;
|
|
262
|
+
prNumber: number;
|
|
263
|
+
prUrl: string;
|
|
264
|
+
author: string;
|
|
265
|
+
risk: ChangeLevel;
|
|
266
|
+
confidence: ChangeLevel;
|
|
267
|
+
evidence: Change["evidence"];
|
|
268
|
+
}
|
|
269
|
+
/** Verification and merge fields that may accompany a legal Change transition. */
|
|
270
|
+
type ChangePatch = Partial<Pick<Change, "confidence" | "evidence" | "decidedBy" | "mergeSha">>;
|
|
271
|
+
/** Trust evidence update fenced to the complete observed Change snapshot. */
|
|
272
|
+
interface UpdateChangeEvidenceInput {
|
|
273
|
+
evidence: Change["evidence"];
|
|
274
|
+
confidence: ChangeLevel;
|
|
275
|
+
expected: Change;
|
|
276
|
+
}
|
|
277
|
+
interface ChangeTransitionContext {
|
|
278
|
+
patch?: ChangePatch;
|
|
279
|
+
reason?: string;
|
|
280
|
+
}
|
|
281
|
+
/** Destination-correlated patch and audit reason accompanying a Change transition. */
|
|
282
|
+
type ChangeTransitionOptions<To extends ChangeState = ChangeState> = To extends "merged" ? Omit<ChangeTransitionContext, "patch"> & {
|
|
283
|
+
/** The merge actor must be recorded when a Change first enters its merged lifecycle. */
|
|
284
|
+
patch: ChangePatch & {
|
|
285
|
+
decidedBy: string;
|
|
286
|
+
};
|
|
287
|
+
} : ChangeTransitionContext;
|
|
288
|
+
/** Argument tuple requiring merge attribution for the transition into merged. */
|
|
289
|
+
type ChangeTransitionArguments<To extends ChangeState> = To extends "merged" ? [options: ChangeTransitionOptions<To>] : [options?: ChangeTransitionOptions<To>];
|
|
290
|
+
/** Factory, month, and configured limits used to create or refresh a monthly Budget. */
|
|
291
|
+
interface EnsureBudgetInput {
|
|
292
|
+
factoryId: FactoryId;
|
|
293
|
+
month: BudgetMonth;
|
|
294
|
+
limits: Budget["limits"];
|
|
295
|
+
}
|
|
296
|
+
/** Monthly Budget returned with whether this call durably stamped a notice. */
|
|
297
|
+
interface BudgetNoticeStampResult {
|
|
298
|
+
readonly budget: Budget;
|
|
299
|
+
readonly stamped: boolean;
|
|
300
|
+
}
|
|
301
|
+
/** Measured cost and optional audit reason used to settle one terminal Task. */
|
|
302
|
+
interface SettleTaskInput {
|
|
303
|
+
/** Final measured Task cost, normalized to micro-dollar precision. */
|
|
304
|
+
readonly cost: Cost;
|
|
305
|
+
/** Optional audit context retained on the immutable settlement receipt. */
|
|
306
|
+
readonly reason?: string;
|
|
307
|
+
}
|
|
308
|
+
/** Delivery attempt, failure reason, and retry delay for one outbox message. */
|
|
309
|
+
interface RetryOutboxMessageInput {
|
|
310
|
+
readonly attempt: number;
|
|
311
|
+
readonly reason: string;
|
|
312
|
+
readonly delayMs: number;
|
|
313
|
+
}
|
|
314
|
+
interface AppendReceiptInputBase<State extends ReceiptState, Kind extends ReceiptKind> {
|
|
315
|
+
repositoryIds: RepositoryIds;
|
|
316
|
+
taskId?: TaskId;
|
|
317
|
+
changeId?: ChangeId;
|
|
318
|
+
kind: Kind;
|
|
319
|
+
state: State;
|
|
320
|
+
reason?: string;
|
|
321
|
+
attempt?: number;
|
|
322
|
+
execution?: ExecutionReference;
|
|
323
|
+
/** Same key twice appends one receipt and returns the existing one. */
|
|
324
|
+
dedupeKey?: string;
|
|
325
|
+
}
|
|
326
|
+
type AppendReceiptCost<State extends ReceiptState> = State extends "settled" ? {
|
|
327
|
+
cost: Cost;
|
|
328
|
+
} : {
|
|
329
|
+
cost?: never;
|
|
330
|
+
};
|
|
331
|
+
type AppendReceiptDelivery<Phase extends ReceiptPhase | undefined> = Phase extends "communication" ? {
|
|
332
|
+
phase: Phase;
|
|
333
|
+
delivery?: ReceiptDelivery;
|
|
334
|
+
} : {
|
|
335
|
+
phase?: Phase;
|
|
336
|
+
delivery?: never;
|
|
337
|
+
};
|
|
338
|
+
type AppendReceiptDecision<Kind extends ReceiptKind, State extends ReceiptState> = Kind extends "change" ? {
|
|
339
|
+
decidedBy?: string;
|
|
340
|
+
} : State extends "approved" | "rejected" ? {
|
|
341
|
+
decidedBy?: string;
|
|
342
|
+
} : {
|
|
343
|
+
decidedBy?: never;
|
|
344
|
+
};
|
|
345
|
+
type AppendReceiptCallInput<State extends ReceiptState, Kind extends ReceiptKind, Phase extends ReceiptPhase | undefined> = AppendReceiptInputBase<State, Kind> & AppendReceiptCost<State> & AppendReceiptDelivery<Phase> & AppendReceiptDecision<Kind, State>;
|
|
346
|
+
/** Subject, event, cost, and deduplication input for appending immutable audit evidence. */
|
|
347
|
+
type AppendReceiptInput<State extends ReceiptState = StandardReceiptState, Kind extends ReceiptKind = StandardReceiptKind, Phase extends ReceiptPhase | undefined = StandardReceiptPhase | "communication" | "workflow" | undefined> = State extends ReceiptState ? Kind extends ReceiptKind ? Phase extends ReceiptPhase | undefined ? AppendReceiptInputBase<State, Kind> & AppendReceiptCost<State> & AppendReceiptDelivery<Phase> & AppendReceiptDecision<Kind, State> : never : never : never;
|
|
348
|
+
/** Error raised when an idempotent session operation conflicts with its original intent. */
|
|
349
|
+
declare class SessionConflictError extends Error {}
|
|
350
|
+
/** Validating engine API for all canonical Factory state and auxiliary persistence. */
|
|
351
|
+
interface FactoryStores {
|
|
352
|
+
/** Name supplied by the configured persistence driver for diagnostics and health reporting. */
|
|
353
|
+
driverName: string;
|
|
354
|
+
/** Trusted workflow records bound to the same persistence backend as every validating store. */
|
|
355
|
+
workflowRecords: Pick<StoreDriver, "get" | "insert" | "update">;
|
|
356
|
+
/** Durable, task-scoped external-effect references and reconciliation stamps. */
|
|
357
|
+
taskEffects: TaskEffectStore;
|
|
358
|
+
/** Trusted workflow capabilities; application transports must authenticate and authorize callers. */
|
|
359
|
+
graphs: TaskGraphStore;
|
|
360
|
+
/** Validated, authorized Task-message operations; omitted protocols remain unavailable. */
|
|
361
|
+
messages: TaskMessageStore;
|
|
362
|
+
/** Workflow completion, message waiting, graph recovery, and usage aggregation operations. */
|
|
363
|
+
work: TaskWorkStore;
|
|
364
|
+
/** Materialized transcript snapshots keyed by exact provider execution. */
|
|
365
|
+
transcripts: {
|
|
366
|
+
get(execution: ExecutionReference): Promise<TranscriptSnapshot | null>;
|
|
367
|
+
/** Persist only forward progress; safe to repeat from response-boundary hooks. */
|
|
368
|
+
put(execution: ExecutionReference, snapshot: TranscriptSnapshot): Promise<TranscriptSnapshot>;
|
|
369
|
+
};
|
|
370
|
+
/** Owner-scoped image persistence and attachment validation. */
|
|
371
|
+
images: {
|
|
372
|
+
put(owner: string, input: z.infer<typeof imageUploadSchema>): Promise<ImageAttachment>;
|
|
373
|
+
get(owner: string, id: ImageId): Promise<StoredImage | null>;
|
|
374
|
+
validate(owner: string, attachments: readonly ImageAttachment[]): Promise<readonly ImageAttachment[]>;
|
|
375
|
+
};
|
|
376
|
+
/** Durable operator-session admission, binding, continuation, and notification operations. */
|
|
377
|
+
sessions: {
|
|
378
|
+
/** Looks up an admitted session without recomputing defaults on a repeated operation. */
|
|
379
|
+
getByOperation(owner: string, operationId: string): Promise<AgentSession | null>;
|
|
380
|
+
create(input: Omit<AgentSession, "schemaVersion" | "id" | "createdAt" | "execution" | "taskId" | "notifications" | "attached" | "continuations" | "external"> & {
|
|
381
|
+
operationId: string;
|
|
382
|
+
}): Promise<AgentSession>;
|
|
383
|
+
attachTask(input: {
|
|
384
|
+
owner: string;
|
|
385
|
+
taskId: TaskId;
|
|
386
|
+
agent: string;
|
|
387
|
+
message: string;
|
|
388
|
+
}): Promise<AgentSession>;
|
|
389
|
+
attachConversation(input: {
|
|
390
|
+
owner: string;
|
|
391
|
+
agent: string;
|
|
392
|
+
message: string;
|
|
393
|
+
execution: ExecutionReference;
|
|
394
|
+
external: NonNullable<AgentSession["external"]>;
|
|
395
|
+
createdAt?: string;
|
|
396
|
+
}): Promise<AgentSession>;
|
|
397
|
+
cacheContinuationContext(id: AgentSessionId, input: CacheContinuationContextInput): Promise<string>;
|
|
398
|
+
continue(id: AgentSessionId, input: {
|
|
399
|
+
operationId: string;
|
|
400
|
+
parentTaskId: TaskId;
|
|
401
|
+
agent: string;
|
|
402
|
+
message: string;
|
|
403
|
+
attachments?: readonly ImageAttachment[];
|
|
404
|
+
}): Promise<AgentSession>;
|
|
405
|
+
get(id: AgentSessionId): Promise<AgentSession | null>;
|
|
406
|
+
list(): Promise<readonly AgentSession[]>;
|
|
407
|
+
/** Compact session snapshots from fixed shards for discovery; large cached continuation context is omitted. */
|
|
408
|
+
summaries(): Promise<readonly AgentSession[]>;
|
|
409
|
+
bind(id: AgentSessionId, reference: AgentSessionBinding): Promise<AgentSession>;
|
|
410
|
+
notify(event: CommunicationEvent): Promise<void>;
|
|
411
|
+
};
|
|
412
|
+
/** Configured repository snapshots used for admission and routing. */
|
|
413
|
+
repositories: {
|
|
414
|
+
/** Atomically replaces model overrides when their observed revision still matches. */
|
|
415
|
+
setModelDefaults(id: RepositoryId, input: {
|
|
416
|
+
expectedRevision: number;
|
|
417
|
+
agents: Readonly<Record<string, string>>;
|
|
418
|
+
}): Promise<Repository>;
|
|
419
|
+
put(repository: Repository): Promise<Repository>;
|
|
420
|
+
get(id: RepositoryId): Promise<Repository | null>;
|
|
421
|
+
list(): Promise<readonly Repository[]>;
|
|
422
|
+
};
|
|
423
|
+
/** External intake records and their explicit triage lifecycle. */
|
|
424
|
+
signals: {
|
|
425
|
+
create(input: CreateSignalInput): Promise<Signal>;
|
|
426
|
+
get(id: SignalId): Promise<Signal | null>;
|
|
427
|
+
/** Read a deterministic source/delivery record without scanning the Signal collection. */
|
|
428
|
+
getByDelivery(input: Pick<CreateSignalInput, "source" | "deliveryId">): Promise<Signal | null>;
|
|
429
|
+
beginTriage(id: SignalId, options: {
|
|
430
|
+
expectedAttempt: number;
|
|
431
|
+
by: string;
|
|
432
|
+
}): Promise<Signal>;
|
|
433
|
+
updateTriage(id: SignalId, attempt: number, observation: Pick<SignalTriage, "state" | "failure" | "sessionId">): Promise<Signal>;
|
|
434
|
+
decide(id: SignalId, input: DecideSignalInput): Promise<Signal>;
|
|
435
|
+
list(): Promise<readonly Signal[]>;
|
|
436
|
+
};
|
|
437
|
+
/** Canonical Task lifecycle operations. */
|
|
438
|
+
tasks: {
|
|
439
|
+
/** Pins an application's model choice once, fencing the current attempt. */
|
|
440
|
+
pinModel(id: TaskId, input: {
|
|
441
|
+
attempt: number;
|
|
442
|
+
model: string;
|
|
443
|
+
}): Promise<Task>;
|
|
444
|
+
/**
|
|
445
|
+
* Validates and durably admits a queued Task into its canonical graph.
|
|
446
|
+
*
|
|
447
|
+
* @remarks
|
|
448
|
+
* Admission writes the immutable graph node before the mutable Task snapshot. A failure after
|
|
449
|
+
* graph admission can therefore leave a repairable missing snapshot; call
|
|
450
|
+
* `stores.work.recover(rootTaskId)` with the known root to restore it. The method returns only
|
|
451
|
+
* after both admission and the canonical Task snapshot are durable.
|
|
452
|
+
*
|
|
453
|
+
* A `dedupeKey` derives a stable ID within the parent scope. An identical retry returns the
|
|
454
|
+
* Task's current mutable snapshot, while changed immutable admission data is refused. Without
|
|
455
|
+
* a key, every call creates a new Task.
|
|
456
|
+
*
|
|
457
|
+
* @param input - Explicit workflow work, scope, provenance, graph placement, and policy.
|
|
458
|
+
* @returns The newly admitted Task, or the current snapshot selected by `dedupeKey`.
|
|
459
|
+
* @throws When workflow input is invalid or its exact version is unregistered, parent or
|
|
460
|
+
* dependency constraints fail, or a dedupe key conflicts with an earlier admission.
|
|
461
|
+
*/
|
|
462
|
+
create(input: CreateTaskInput): Promise<Task>;
|
|
463
|
+
/**
|
|
464
|
+
* Returns the validated current Task snapshot without repairing a missing admitted snapshot.
|
|
465
|
+
*
|
|
466
|
+
* @param id - Exact Task ID to read.
|
|
467
|
+
* @returns Current Task state, or `null` when its canonical snapshot is absent.
|
|
468
|
+
*/
|
|
469
|
+
get(id: TaskId): Promise<Task | null>;
|
|
470
|
+
findOpenQuestions(replyTo: ReplyTo): Promise<readonly Task[]>;
|
|
471
|
+
/**
|
|
472
|
+
* Performs one legal lifecycle transition with optional attempt, source-state, execution, and
|
|
473
|
+
* question fences.
|
|
474
|
+
*
|
|
475
|
+
* @remarks
|
|
476
|
+
* Lifecycle evidence is appended before the final Task-state write. A successful completion
|
|
477
|
+
* first persists its validated `workResult`, then its receipt, then the terminal state. The
|
|
478
|
+
* promise resolves only after the final Task snapshot is durable, but a rejected call may have
|
|
479
|
+
* persisted prepared output or its idempotent receipt before a later write failed. Reread
|
|
480
|
+
* canonical Task state before retrying, and retain the same fences so a late callback cannot
|
|
481
|
+
* advance a replacement attempt or execution. Transitions that re-enter `queued`, and
|
|
482
|
+
* `verifying` to `running`, increment the attempt and clear attempt-owned execution state.
|
|
483
|
+
*
|
|
484
|
+
* @param id - Exact Task to advance.
|
|
485
|
+
* @param to - Legal destination state.
|
|
486
|
+
* @param args - Destination data and optional concurrency fences.
|
|
487
|
+
* @returns The durably updated Task snapshot.
|
|
488
|
+
* @throws `InvalidTransitionError` for an illegal or stale source state,
|
|
489
|
+
* `TaskAttemptConflictError` for a replaced attempt, or a persistence conflict when a
|
|
490
|
+
* concurrent writer wins.
|
|
491
|
+
*/
|
|
492
|
+
transition<To extends TaskState>(id: TaskId, to: To, ...args: TaskTransitionArguments<NoInfer<To>>): Promise<Task>;
|
|
493
|
+
/** Remove a receipt after its CommunicationEvent is durable in the outbox. */
|
|
494
|
+
acknowledgeCommunication(id: TaskId, receiptId: ReceiptId): Promise<Task>;
|
|
495
|
+
answerQuestion(input: AnswerQuestionInput): Promise<AnswerQuestionResult>;
|
|
496
|
+
/** Grant a required approval. The task stays queued; dispatch may now take it. */
|
|
497
|
+
approve(id: TaskId, decision: ApprovalDecision): Promise<Task>;
|
|
498
|
+
/** Immutable human decision, addressed directly by Task ID. */
|
|
499
|
+
approvalReceipt(id: TaskId): Promise<Receipt | null>;
|
|
500
|
+
/** Deny a required approval. The task is cancelled with the reason. */
|
|
501
|
+
reject(id: TaskId, decision: RejectionDecision): Promise<Task>;
|
|
502
|
+
/**
|
|
503
|
+
* Record the provider's handle on the running attempt's execution, so the
|
|
504
|
+
* reconciler can inspect or cancel it.
|
|
505
|
+
*
|
|
506
|
+
* @remarks
|
|
507
|
+
* The returned Task contains the durably recorded handle. Supply `expectAttempt` for launch
|
|
508
|
+
* callbacks: while that attempt remains running, replaying the same handle is a no-op, while a
|
|
509
|
+
* different handle or replaced attempt is refused. Terminal Tasks reject every binding call.
|
|
510
|
+
* The engine retries bounded transient driver failures, but surfaces compare-and-swap
|
|
511
|
+
* conflicts; callers should reread and reconcile rather than start an unkeyed replacement
|
|
512
|
+
* execution.
|
|
513
|
+
*
|
|
514
|
+
* @param id - Exact running Task to bind.
|
|
515
|
+
* @param input - Provider reference and recommended attempt fence.
|
|
516
|
+
* @returns The Task containing the durable execution reference.
|
|
517
|
+
* @throws When the Task is not running, the attempt or existing execution differs, or bounded
|
|
518
|
+
* persistence retries are exhausted.
|
|
519
|
+
*/
|
|
520
|
+
recordExecution(id: TaskId, input: RecordTaskExecutionInput): Promise<Task>;
|
|
521
|
+
/**
|
|
522
|
+
* Adds one provider step's measured usage without settling the Task.
|
|
523
|
+
*
|
|
524
|
+
* @remarks
|
|
525
|
+
* Step indexes advance monotonically per `turnId`; replaying the recorded index or an earlier
|
|
526
|
+
* one returns the current Task without charging it again. Use an execution fence for provider
|
|
527
|
+
* callbacks. Version races are retried, transient storage failures are retried within bounded
|
|
528
|
+
* limits, and new usage after settlement is refused so measured cost cannot silently diverge
|
|
529
|
+
* from the immutable settlement receipt.
|
|
530
|
+
*
|
|
531
|
+
* @param id - Exact Task to charge.
|
|
532
|
+
* @param input - Validated step observation and optional execution fence.
|
|
533
|
+
* @returns The Task after aggregation, or unchanged when the step was already covered.
|
|
534
|
+
*/
|
|
535
|
+
recordUsage(id: TaskId, input: RecordTaskUsageInput): Promise<Task>;
|
|
536
|
+
/**
|
|
537
|
+
* Records measured cost on a terminal Task using receipt-first persistence.
|
|
538
|
+
*
|
|
539
|
+
* @remarks
|
|
540
|
+
* Cost is normalized to micro-dollar precision. The immutable receipt is written before the
|
|
541
|
+
* Task snapshot, so retrying after an interrupted snapshot write adopts the receipt's original
|
|
542
|
+
* cost. Once settled, every replay returns the unchanged Task even if a different cost is
|
|
543
|
+
* supplied; callers must treat the first settlement as authoritative.
|
|
544
|
+
*
|
|
545
|
+
* @param id - Exact terminal Task to settle.
|
|
546
|
+
* @param input - Final measured cost and optional audit reason.
|
|
547
|
+
* @returns The Task with its authoritative `settledUsd` value.
|
|
548
|
+
* @throws `SettlementError` when the Task is not terminal.
|
|
549
|
+
*/
|
|
550
|
+
settle(id: TaskId, input: SettleTaskInput): Promise<Task>;
|
|
551
|
+
/**
|
|
552
|
+
* Stamp a QuestionTask and the parent it currently blocks after Slack delivery.
|
|
553
|
+
* An attempt guard rejects confirmations from an earlier question episode.
|
|
554
|
+
* Retrying repairs either stamp independently; persistence errors propagate.
|
|
555
|
+
*/
|
|
556
|
+
recordNeedsHumanDelivery(id: TaskId, options?: {
|
|
557
|
+
at?: string;
|
|
558
|
+
attempt?: number;
|
|
559
|
+
}): Promise<Task>;
|
|
560
|
+
/** Tasks addressed to one connector or operator conversation without a collection scan. */
|
|
561
|
+
forReplyTo(replyTo: ReplyTo): Promise<readonly Task[]>;
|
|
562
|
+
list(): Promise<readonly Task[]>;
|
|
563
|
+
};
|
|
564
|
+
/** Canonical software Change admission and lifecycle operations. */
|
|
565
|
+
changes: {
|
|
566
|
+
create(input: CreateChangeInput): Promise<Change>;
|
|
567
|
+
get(id: ChangeId): Promise<Change | null>;
|
|
568
|
+
/** Save evidence without inventing a lifecycle transition; reject a changed snapshot. */
|
|
569
|
+
updateEvidence(id: ChangeId, input: UpdateChangeEvidenceInput): Promise<Change>;
|
|
570
|
+
transition<To extends ChangeState>(id: ChangeId, to: To, ...args: ChangeTransitionArguments<NoInfer<To>>): Promise<ChangeInState<To>>;
|
|
571
|
+
list(): Promise<readonly Change[]>;
|
|
572
|
+
};
|
|
573
|
+
/** Immutable audit evidence appended by engine and application policy. */
|
|
574
|
+
receipts: {
|
|
575
|
+
append<const State extends ReceiptState, const Kind extends ReceiptKind, const Phase extends ReceiptPhase | undefined = undefined>(input: AppendReceiptCallInput<State, Kind, Phase> & {
|
|
576
|
+
state: State;
|
|
577
|
+
kind: Kind;
|
|
578
|
+
phase?: Phase;
|
|
579
|
+
}): Promise<Receipt>;
|
|
580
|
+
get(id: ReceiptId): Promise<Receipt | null>;
|
|
581
|
+
list(): Promise<readonly Receipt[]>;
|
|
582
|
+
};
|
|
583
|
+
/** Monthly budget snapshots, limits, and once-only notification stamps. */
|
|
584
|
+
budgets: {
|
|
585
|
+
/**
|
|
586
|
+
* Insert-once per month; refreshes limits when configuration changed and
|
|
587
|
+
* preserves notices. Safe under concurrent sweeps.
|
|
588
|
+
*/
|
|
589
|
+
ensure(input: EnsureBudgetInput): Promise<Budget>;
|
|
590
|
+
get(month: BudgetMonth): Promise<Budget | null>;
|
|
591
|
+
/**
|
|
592
|
+
* Write-once notice stamp. `stamped` is false when the notice was already
|
|
593
|
+
* set or a concurrent stamp won, so callers notify at most once.
|
|
594
|
+
*/
|
|
595
|
+
stampNotice(month: BudgetMonth, notice: "warning" | "exhausted"): Promise<BudgetNoticeStampResult>;
|
|
596
|
+
};
|
|
597
|
+
/** Immutable authenticated answers addressed by deterministic event ID. */
|
|
598
|
+
answers: {
|
|
599
|
+
get(id: AnswerId): Promise<AnswerEvent | null>;
|
|
600
|
+
};
|
|
601
|
+
/** Durable communication delivery queue with attempt-fenced leases. */
|
|
602
|
+
outbox: {
|
|
603
|
+
enqueue(event: CommunicationEvent): Promise<OutboxMessage>;
|
|
604
|
+
get(id: OutboxId): Promise<OutboxMessage | null>;
|
|
605
|
+
claim(id: OutboxId, leaseMs?: number): Promise<OutboxMessage | null>;
|
|
606
|
+
retry(id: OutboxId, input: RetryOutboxMessageInput): Promise<OutboxMessage | null>;
|
|
607
|
+
complete(id: OutboxId, attempt: number): Promise<OutboxMessage | null>;
|
|
608
|
+
pending(limit?: number): Promise<readonly OutboxMessage[]>;
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
/** Persistence, workflow, messaging, clock, and wakeup configuration for the Factory engine. */
|
|
612
|
+
interface CreateStoresOptions {
|
|
613
|
+
/** Persistence implementation. The engine owns validation and lifecycle policy above it. */
|
|
614
|
+
driver: StoreDriver;
|
|
615
|
+
/**
|
|
616
|
+
* Optional post-commit wakeup transport. Delivery failure is reported through its `onError`
|
|
617
|
+
* callback and never rolls back the canonical write.
|
|
618
|
+
*/
|
|
619
|
+
workNotifications?: WorkNotifications;
|
|
620
|
+
/** ISO timestamp source used for engine-owned records. Defaults to the current wall clock. */
|
|
621
|
+
now?: IsoDateTimeClock;
|
|
622
|
+
/**
|
|
623
|
+
* Every workflow version that stored Tasks may reference. Omission registers only the generic
|
|
624
|
+
* `task@1` workflow. A supplied registry replaces that default, so include `defaultTaskWorkflow`
|
|
625
|
+
* when Factory tools or human-question flows may create generic work.
|
|
626
|
+
*/
|
|
627
|
+
workflows?: WorkflowRegistry;
|
|
628
|
+
/**
|
|
629
|
+
* Versioned Task-message protocols and deny-by-default authorization. Omit when the runtime
|
|
630
|
+
* does not use Task messages.
|
|
631
|
+
*/
|
|
632
|
+
messages?: {
|
|
633
|
+
/** Exact protocol versions accepted by this runtime. */
|
|
634
|
+
protocols: TaskMessageProtocols;
|
|
635
|
+
/** Trusted application policy applied to every message operation. */
|
|
636
|
+
authorize: TaskMessageAuthorize;
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Creates the validating Factory store engine over a deliberately policy-free driver.
|
|
641
|
+
*
|
|
642
|
+
* @remarks
|
|
643
|
+
* The returned stores validate entities on read and write, enforce legal transitions and
|
|
644
|
+
* compare-and-swap fences, and emit immutable receipts. Construct one configured instance per
|
|
645
|
+
* runtime and share it with launchers, hooks, and tools. A custom workflow must be registered on
|
|
646
|
+
* every process that may read its Tasks; omission is a configuration error rather than permission
|
|
647
|
+
* to select a newer workflow version. Supplying `workflows` replaces the default registry, so
|
|
648
|
+
* include `defaultTaskWorkflow` when generic `task@1` work, Factory tools, or human questions may
|
|
649
|
+
* be created.
|
|
650
|
+
*
|
|
651
|
+
* Wakeups run after their source write commits. Notification failure therefore cannot roll the
|
|
652
|
+
* mutation back; reconciliation must be able to rediscover canonical state.
|
|
653
|
+
*
|
|
654
|
+
* @param options - Persistence and exact workflow/message configuration for this runtime.
|
|
655
|
+
* @returns The complete set of validating Factory stores backed by `options.driver`.
|
|
656
|
+
* @see The version-matched `docs/getting-started.md` shipped with the package.
|
|
657
|
+
*
|
|
658
|
+
* @example
|
|
659
|
+
* ```ts
|
|
660
|
+
* import { createInMemoryDriver, createStores } from "@vercel/factory/storage";
|
|
661
|
+
* import {
|
|
662
|
+
* defaultTaskWorkflow,
|
|
663
|
+
* defineWorkflow,
|
|
664
|
+
* defineWorkflows,
|
|
665
|
+
* } from "@vercel/factory/workflows";
|
|
666
|
+
* import { z } from "zod";
|
|
667
|
+
*
|
|
668
|
+
* const greeting = defineWorkflow({
|
|
669
|
+
* id: "greeting",
|
|
670
|
+
* version: 1,
|
|
671
|
+
* input: z.object({ name: z.string() }),
|
|
672
|
+
* output: z.object({ message: z.string() }),
|
|
673
|
+
* });
|
|
674
|
+
* const stores = createStores({
|
|
675
|
+
* driver: createInMemoryDriver(),
|
|
676
|
+
* workflows: defineWorkflows([defaultTaskWorkflow, greeting]),
|
|
677
|
+
* });
|
|
678
|
+
* ```
|
|
679
|
+
*/
|
|
680
|
+
declare function createStores(options: CreateStoresOptions): FactoryStores;
|
|
681
|
+
//#endregion
|
|
682
|
+
export { AgentSessionBinding, AnswerEventConflictError, AnswerQuestionInput, AnswerQuestionResult, AppendReceiptInput, ApprovalDecision, ApprovalError, BudgetNoticeStampResult, CacheContinuationContextInput, ChangeAssociationError, ChangePatch, ChangeTransitionArguments, ChangeTransitionOptions, CreateChangeInput, CreateSignalInput, CreateStoresOptions, CreateTaskInput, DecideSignalInput, EnsureBudgetInput, FactoryStores, ImageInputError, OutboxEventConflictError, RecordTaskExecutionInput, RecordTaskUsageInput, RejectionDecision, RetryOutboxMessageInput, RootTaskOrigin, SessionConflictError, SettleTaskInput, SettlementError, StepUsage, TaskAttemptConflictError, TaskExecutionFence, TaskPatch, TaskTransitionArguments, TaskTransitionOptions, UpdateChangeEvidenceInput, createStores };
|
|
683
|
+
//# sourceMappingURL=engine.d.mts.map
|