@vercel/factory 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +307 -1
- package/dist/agent-routes.d.mts +69 -0
- package/dist/agent-routes.mjs +64 -0
- package/dist/agent-routes.mjs.map +1 -0
- package/dist/api-contracts.d.mts +1749 -0
- package/dist/api-contracts.mjs +118 -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 +77 -0
- package/dist/api.mjs +1087 -0
- package/dist/api.mjs.map +1 -0
- 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 +692 -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 +44 -8
- package/dist/blob/index.mjs +159 -35
- package/dist/blob/index.mjs.map +1 -1
- package/dist/budget.d.mts +108 -0
- package/dist/budget.mjs +141 -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 +6 -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 +24 -0
- package/dist/change-verification/dispatch.mjs +45 -0
- package/dist/change-verification/dispatch.mjs.map +1 -0
- package/dist/change-verification/eve-tool.d.mts +60 -0
- package/dist/change-verification/eve-tool.mjs +101 -0
- package/dist/change-verification/eve-tool.mjs.map +1 -0
- package/dist/changes/eve-record-change.d.mts +56 -0
- package/dist/changes/eve-record-change.mjs +97 -0
- package/dist/changes/eve-record-change.mjs.map +1 -0
- package/dist/changes/presentation.d.mts +14 -0
- package/dist/changes.d.mts +23 -0
- package/dist/changes.mjs +29 -0
- package/dist/changes.mjs.map +1 -0
- package/dist/client-events.d.mts +18 -0
- package/dist/client-events.mjs +41 -0
- package/dist/client-events.mjs.map +1 -0
- package/dist/client-stream.d.mts +28 -0
- package/dist/client-stream.mjs +204 -0
- package/dist/client-stream.mjs.map +1 -0
- package/dist/client-transcript.d.mts +41 -0
- package/dist/client-transcript.mjs +229 -0
- package/dist/client-transcript.mjs.map +1 -0
- package/dist/client.d.mts +234 -0
- package/dist/client.mjs +258 -0
- package/dist/client.mjs.map +1 -0
- package/dist/code-review/contracts.d.mts +26 -0
- package/dist/code-review/eve-post-review.d.mts +70 -0
- package/dist/code-review/eve-post-review.mjs +183 -0
- package/dist/code-review/eve-post-review.mjs.map +1 -0
- package/dist/code-review/eve-review-comments.d.mts +64 -0
- package/dist/code-review/eve-review-comments.mjs +159 -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 +44 -0
- package/dist/code-review/github-reporter.mjs +260 -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 +6 -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 -2
- package/dist/connectors/index.mjs +4 -26
- 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 -41
- package/dist/connectors/slack.mjs +13 -69
- package/dist/connectors/slack.mjs.map +1 -1
- package/dist/deepsec/eve-tool.d.mts +110 -0
- package/dist/deepsec/eve-tool.mjs +164 -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 +81 -0
- package/dist/dispatch.mjs +140 -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 +143 -1561
- package/dist/eve/index.mjs +244 -1063
- package/dist/eve/index.mjs.map +1 -1
- package/dist/eve/invoke.d.mts +144 -0
- package/dist/eve/invoke.mjs +241 -0
- package/dist/eve/invoke.mjs.map +1 -0
- package/dist/eve/session-client.d.mts +68 -0
- package/dist/eve/session-client.mjs +131 -0
- package/dist/eve/session-client.mjs.map +1 -0
- package/dist/eve/task-execution.mjs +18 -0
- package/dist/eve/task-execution.mjs.map +1 -0
- package/dist/eve/task-session.d.mts +87 -0
- package/dist/eve/task-session.mjs +203 -0
- package/dist/eve/task-session.mjs.map +1 -0
- package/dist/eve/transcript.d.mts +37 -0
- package/dist/eve/transcript.mjs +65 -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 +75 -0
- package/dist/execution.mjs +153 -0
- package/dist/execution.mjs.map +1 -0
- package/dist/finding-remediation/admission.d.mts +51 -0
- package/dist/finding-remediation/admission.mjs +87 -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 +6 -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 +198 -0
- package/dist/github-publication.mjs +429 -0
- package/dist/github-publication.mjs.map +1 -0
- package/dist/github-transfer.d.mts +72 -0
- package/dist/github-transfer.mjs +125 -0
- package/dist/github-transfer.mjs.map +1 -0
- package/dist/github.d.mts +406 -2
- package/dist/github.mjs +250 -37
- 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/index.d.mts +14 -314
- package/dist/index.mjs +14 -1124
- package/dist/intake-contracts.d.mts +56 -0
- package/dist/intake-contracts.mjs +33 -0
- package/dist/intake-contracts.mjs.map +1 -0
- package/dist/integrations/deepsec.d.mts +4 -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 +3 -0
- package/dist/integrations/slack.mjs +3 -0
- package/dist/integrations/vercel.d.mts +3 -0
- package/dist/integrations/vercel.mjs +3 -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 +46 -0
- package/dist/merge-resolution/eve-tools.mjs +117 -0
- package/dist/merge-resolution/eve-tools.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 +273 -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 +7 -1
- package/dist/postgres/index.mjs +7 -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 +53 -0
- package/dist/presets/software-development/dispatch.mjs +66 -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 +23 -0
- package/dist/presets/software-development/task-communication.mjs +120 -0
- package/dist/presets/software-development/task-communication.mjs.map +1 -0
- package/dist/presets/software-development.d.mts +9 -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 +53 -0
- package/dist/pull-requests/github-publisher.mjs +345 -0
- package/dist/pull-requests/github-publisher.mjs.map +1 -0
- package/dist/pull-requests.d.mts +5 -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 +9 -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 +22 -0
- package/dist/schema/agent-route.mjs +15 -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-DwCihQr4.mjs → schema/common.mjs} +7 -14
- package/dist/schema/common.mjs.map +1 -0
- package/dist/schema/communication.d.mts +52 -0
- package/dist/schema/communication.mjs +35 -0
- 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 +95 -0
- package/dist/schema/factory-config.mjs +60 -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 +26 -0
- package/dist/schema/repository.mjs +25 -0
- package/dist/schema/repository.mjs.map +1 -0
- package/dist/schema/session.d.mts +135 -0
- package/dist/schema/session.mjs +53 -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/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 +3134 -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 +272 -0
- package/dist/schema/task.mjs +199 -0
- package/dist/schema/task.mjs.map +1 -0
- package/dist/schema/transcript.d.mts +170 -0
- package/dist/schema/transcript.mjs +86 -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 +101 -0
- package/dist/schema/work.mjs +102 -0
- package/dist/schema/work.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 +19 -0
- package/dist/signals.mjs +19 -0
- package/dist/signals.mjs.map +1 -0
- package/dist/stall.d.mts +38 -0
- package/dist/stall.mjs +79 -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 +485 -0
- package/dist/store/engine.mjs +2175 -0
- package/dist/store/engine.mjs.map +1 -0
- package/dist/store/memory.d.mts +7 -0
- package/dist/store/memory.mjs +52 -0
- package/dist/store/memory.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 +65 -0
- package/dist/store/task-work.mjs +134 -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 +57 -0
- package/dist/sweep.mjs +143 -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 +264 -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 +21 -0
- package/dist/vercel-git.mjs +112 -0
- package/dist/vercel-git.mjs.map +1 -0
- package/dist/vercel.d.mts +33 -2
- package/dist/vercel.mjs +48 -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 +3 -0
- package/dist/work-triage.mjs +3 -0
- package/dist/workflows.d.mts +48 -0
- package/dist/workflows.mjs +86 -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-snapshot.d.mts +26 -0
- package/dist/workspace-snapshot.mjs +80 -0
- package/dist/workspace-snapshot.mjs.map +1 -0
- package/package.json +129 -40
- package/dist/approval-CwhTP1XB.mjs +0 -269
- package/dist/approval-CwhTP1XB.mjs.map +0 -1
- package/dist/change-CzEAoFVE.mjs +0 -620
- package/dist/change-CzEAoFVE.mjs.map +0 -1
- package/dist/dispatch-B77cuPxh.d.mts +0 -713
- package/dist/driver-BJutB0PE.d.mts +0 -34
- package/dist/driver-Bbd25rNM.mjs +0 -23
- package/dist/driver-Bbd25rNM.mjs.map +0 -1
- package/dist/factory-config-BJcjsPKl.mjs +0 -86
- package/dist/factory-config-BJcjsPKl.mjs.map +0 -1
- package/dist/factory-config-D2yU3G0c.d.mts +0 -58
- package/dist/github-DXsxboUL.d.mts +0 -271
- package/dist/id-DwCihQr4.mjs.map +0 -1
- package/dist/index-Cy4jfXh5.d.mts +0 -67
- package/dist/index.mjs.map +0 -1
- package/dist/signal-CHVEmzvI.d.mts +0 -59
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/id.ts
|
|
3
|
+
function idSchema(prefix) {
|
|
4
|
+
const pattern = new RegExp(`^${prefix}_[a-z0-9]{6,64}$`);
|
|
5
|
+
return z.string().regex(pattern, `Expected ${prefix}_ followed by 6 to 64 lowercase letters or digits`);
|
|
6
|
+
}
|
|
7
|
+
/** Validates a stable Factory identifier. */
|
|
8
|
+
const factoryIdSchema = idSchema("fac");
|
|
9
|
+
/** Validates a stable repository identifier. */
|
|
10
|
+
const repositoryIdSchema = idSchema("repo");
|
|
11
|
+
/** Validates a stable inbound Signal identifier. */
|
|
12
|
+
const signalIdSchema = idSchema("sig");
|
|
13
|
+
/** Validates a stable Task identifier. */
|
|
14
|
+
const taskIdSchema = idSchema("task");
|
|
15
|
+
/** Validates a stable Change identifier. */
|
|
16
|
+
const changeIdSchema = idSchema("chg");
|
|
17
|
+
/** Validates a stable immutable Receipt identifier. */
|
|
18
|
+
const receiptIdSchema = idSchema("rcpt");
|
|
19
|
+
/** Validates a stable communication outbox identifier. */
|
|
20
|
+
const outboxIdSchema = idSchema("out");
|
|
21
|
+
/** Validates a stable immutable answer-event identifier. */
|
|
22
|
+
const answerIdSchema = idSchema("ans");
|
|
23
|
+
/** Validates a nonempty repository scope expressed as repository identifiers. */
|
|
24
|
+
const repositoryIdsSchema = z.tuple([repositoryIdSchema], repositoryIdSchema).readonly();
|
|
25
|
+
/** Constructs a validated nonempty repository scope from typed identifiers. */
|
|
26
|
+
function repositoryScope(first, ...rest) {
|
|
27
|
+
return repositoryIdsSchema.parse([first, ...rest]);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { answerIdSchema, changeIdSchema, factoryIdSchema, outboxIdSchema, receiptIdSchema, repositoryIdSchema, repositoryIdsSchema, repositoryScope, signalIdSchema, taskIdSchema };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=id.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.mjs","names":[],"sources":["../../src/schema/id.ts"],"sourcesContent":["import { z } from \"zod\";\n\nfunction idSchema<const Prefix extends string>(prefix: Prefix) {\n const pattern = new RegExp(`^${prefix}_[a-z0-9]{6,64}$`);\n return z\n .string()\n .regex(\n pattern,\n `Expected ${prefix}_ followed by 6 to 64 lowercase letters or digits`,\n ) as z.ZodType<`${Prefix}_${string}`, string>;\n}\n\n/** Validates a stable Factory identifier. */\nexport const factoryIdSchema = idSchema(\"fac\");\n/** Validates a stable repository identifier. */\nexport const repositoryIdSchema = idSchema(\"repo\");\n/** Validates a stable inbound Signal identifier. */\nexport const signalIdSchema = idSchema(\"sig\");\n/** Validates a stable Task identifier. */\nexport const taskIdSchema = idSchema(\"task\");\n/** Validates a stable Change identifier. */\nexport const changeIdSchema = idSchema(\"chg\");\n/** Validates a stable immutable Receipt identifier. */\nexport const receiptIdSchema = idSchema(\"rcpt\");\n/** Validates a stable communication outbox identifier. */\nexport const outboxIdSchema = idSchema(\"out\");\n/** Validates a stable immutable answer-event identifier. */\nexport const answerIdSchema = idSchema(\"ans\");\n\n/** Validates a nonempty repository scope expressed as repository identifiers. */\nexport const repositoryIdsSchema = z.tuple([repositoryIdSchema], repositoryIdSchema).readonly();\n\n/** Constructs a validated nonempty repository scope from typed identifiers. */\nexport function repositoryScope(\n first: RepositoryId,\n ...rest: readonly RepositoryId[]\n): RepositoryIds {\n return repositoryIdsSchema.parse([first, ...rest]);\n}\n\n/** Stable identifier for one configured Factory. */\nexport type FactoryId = z.infer<typeof factoryIdSchema>;\n/** Stable identifier for one configured repository. */\nexport type RepositoryId = z.infer<typeof repositoryIdSchema>;\n/** Nonempty ordered repository scope attached to one Task or event. */\nexport type RepositoryIds = z.infer<typeof repositoryIdsSchema>;\n/** Stable identifier for one normalized inbound Signal. */\nexport type SignalId = z.infer<typeof signalIdSchema>;\n/** Stable identifier for one durable unit of workflow work. */\nexport type TaskId = z.infer<typeof taskIdSchema>;\n/** Stable identifier for one human-visible pull-request Change. */\nexport type ChangeId = z.infer<typeof changeIdSchema>;\n/** Stable identifier for one immutable audit Receipt. */\nexport type ReceiptId = z.infer<typeof receiptIdSchema>;\n/** Stable identifier for one communication outbox event. */\nexport type OutboxId = z.infer<typeof outboxIdSchema>;\n/** Stable identifier for one immutable authenticated answer event. */\nexport type AnswerId = z.infer<typeof answerIdSchema>;\n"],"mappings":";;AAEA,SAAS,SAAsC,QAAgB;CAC7D,MAAM,UAAU,IAAI,OAAO,IAAI,OAAO,iBAAiB;CACvD,OAAO,EACJ,OAAO,CAAC,CACR,MACC,SACA,YAAY,OAAO,kDACrB;AACJ;;AAGA,MAAa,kBAAkB,SAAS,KAAK;;AAE7C,MAAa,qBAAqB,SAAS,MAAM;;AAEjD,MAAa,iBAAiB,SAAS,KAAK;;AAE5C,MAAa,eAAe,SAAS,MAAM;;AAE3C,MAAa,iBAAiB,SAAS,KAAK;;AAE5C,MAAa,kBAAkB,SAAS,MAAM;;AAE9C,MAAa,iBAAiB,SAAS,KAAK;;AAE5C,MAAa,iBAAiB,SAAS,KAAK;;AAG5C,MAAa,sBAAsB,EAAE,MAAM,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,CAAC,SAAS;;AAG9F,SAAgB,gBACd,OACA,GAAG,MACY;CACf,OAAO,oBAAoB,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;AACnD"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/outbox.d.ts
|
|
3
|
+
/** Validates the durable delivery state of an outbox message. */
|
|
4
|
+
declare const outboxStateSchema: z.ZodEnum<{
|
|
5
|
+
pending: "pending";
|
|
6
|
+
delivering: "delivering";
|
|
7
|
+
delivered: "delivered";
|
|
8
|
+
}>;
|
|
9
|
+
/** Validates one retryable connector delivery retained in the communication outbox. */
|
|
10
|
+
declare const outboxMessageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
|
|
11
|
+
state: z.ZodLiteral<"pending">;
|
|
12
|
+
leaseUntil: z.ZodOptional<z.ZodNever>;
|
|
13
|
+
deliveredAt: z.ZodOptional<z.ZodNever>;
|
|
14
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
15
|
+
id: z.ZodType<`out_${string}`, string, z.core.$ZodTypeInternals<`out_${string}`, string>>;
|
|
16
|
+
event: z.ZodObject<{
|
|
17
|
+
eventId: z.ZodString;
|
|
18
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
19
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
20
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
21
|
+
replyTo: z.ZodObject<{
|
|
22
|
+
channel: z.ZodString;
|
|
23
|
+
address: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
outcome: z.ZodEnum<{
|
|
26
|
+
message: "message";
|
|
27
|
+
succeeded: "succeeded";
|
|
28
|
+
failed: "failed";
|
|
29
|
+
needs_human: "needs_human";
|
|
30
|
+
cancelled: "cancelled";
|
|
31
|
+
accepted: "accepted";
|
|
32
|
+
question: "question";
|
|
33
|
+
rolled_back: "rolled_back";
|
|
34
|
+
started: "started";
|
|
35
|
+
digest: "digest";
|
|
36
|
+
budget_warning: "budget_warning";
|
|
37
|
+
budget_exhausted: "budget_exhausted";
|
|
38
|
+
}>;
|
|
39
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
attempt: z.ZodNumber;
|
|
42
|
+
availableAt: z.ZodISODateTime;
|
|
43
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
44
|
+
createdAt: z.ZodISODateTime;
|
|
45
|
+
updatedAt: z.ZodISODateTime;
|
|
46
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
47
|
+
state: z.ZodLiteral<"delivering">;
|
|
48
|
+
leaseUntil: z.ZodISODateTime;
|
|
49
|
+
deliveredAt: z.ZodOptional<z.ZodNever>;
|
|
50
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
51
|
+
id: z.ZodType<`out_${string}`, string, z.core.$ZodTypeInternals<`out_${string}`, string>>;
|
|
52
|
+
event: z.ZodObject<{
|
|
53
|
+
eventId: z.ZodString;
|
|
54
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
55
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
56
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
57
|
+
replyTo: z.ZodObject<{
|
|
58
|
+
channel: z.ZodString;
|
|
59
|
+
address: z.ZodString;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
outcome: z.ZodEnum<{
|
|
62
|
+
message: "message";
|
|
63
|
+
succeeded: "succeeded";
|
|
64
|
+
failed: "failed";
|
|
65
|
+
needs_human: "needs_human";
|
|
66
|
+
cancelled: "cancelled";
|
|
67
|
+
accepted: "accepted";
|
|
68
|
+
question: "question";
|
|
69
|
+
rolled_back: "rolled_back";
|
|
70
|
+
started: "started";
|
|
71
|
+
digest: "digest";
|
|
72
|
+
budget_warning: "budget_warning";
|
|
73
|
+
budget_exhausted: "budget_exhausted";
|
|
74
|
+
}>;
|
|
75
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
attempt: z.ZodNumber;
|
|
78
|
+
availableAt: z.ZodISODateTime;
|
|
79
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
80
|
+
createdAt: z.ZodISODateTime;
|
|
81
|
+
updatedAt: z.ZodISODateTime;
|
|
82
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
83
|
+
state: z.ZodLiteral<"delivered">;
|
|
84
|
+
leaseUntil: z.ZodOptional<z.ZodNever>;
|
|
85
|
+
deliveredAt: z.ZodISODateTime;
|
|
86
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
87
|
+
id: z.ZodType<`out_${string}`, string, z.core.$ZodTypeInternals<`out_${string}`, string>>;
|
|
88
|
+
event: z.ZodObject<{
|
|
89
|
+
eventId: z.ZodString;
|
|
90
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
91
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
92
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
93
|
+
replyTo: z.ZodObject<{
|
|
94
|
+
channel: z.ZodString;
|
|
95
|
+
address: z.ZodString;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
outcome: z.ZodEnum<{
|
|
98
|
+
message: "message";
|
|
99
|
+
succeeded: "succeeded";
|
|
100
|
+
failed: "failed";
|
|
101
|
+
needs_human: "needs_human";
|
|
102
|
+
cancelled: "cancelled";
|
|
103
|
+
accepted: "accepted";
|
|
104
|
+
question: "question";
|
|
105
|
+
rolled_back: "rolled_back";
|
|
106
|
+
started: "started";
|
|
107
|
+
digest: "digest";
|
|
108
|
+
budget_warning: "budget_warning";
|
|
109
|
+
budget_exhausted: "budget_exhausted";
|
|
110
|
+
}>;
|
|
111
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
attempt: z.ZodNumber;
|
|
114
|
+
availableAt: z.ZodISODateTime;
|
|
115
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
116
|
+
createdAt: z.ZodISODateTime;
|
|
117
|
+
updatedAt: z.ZodISODateTime;
|
|
118
|
+
}, z.core.$strict>>], "state">;
|
|
119
|
+
/** Retryable connector delivery with lease and attempt metadata. */
|
|
120
|
+
type OutboxMessage = z.infer<typeof outboxMessageSchema>;
|
|
121
|
+
/** Validates one fixed shard containing the active communication delivery backlog. */
|
|
122
|
+
declare const outboxQueueSchema: z.ZodReadonly<z.ZodObject<{
|
|
123
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
messages: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
|
|
126
|
+
state: z.ZodLiteral<"pending">;
|
|
127
|
+
leaseUntil: z.ZodOptional<z.ZodNever>;
|
|
128
|
+
deliveredAt: z.ZodOptional<z.ZodNever>;
|
|
129
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
130
|
+
id: z.ZodType<`out_${string}`, string, z.core.$ZodTypeInternals<`out_${string}`, string>>;
|
|
131
|
+
event: z.ZodObject<{
|
|
132
|
+
eventId: z.ZodString;
|
|
133
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
134
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
135
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
136
|
+
replyTo: z.ZodObject<{
|
|
137
|
+
channel: z.ZodString;
|
|
138
|
+
address: z.ZodString;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
outcome: z.ZodEnum<{
|
|
141
|
+
message: "message";
|
|
142
|
+
succeeded: "succeeded";
|
|
143
|
+
failed: "failed";
|
|
144
|
+
needs_human: "needs_human";
|
|
145
|
+
cancelled: "cancelled";
|
|
146
|
+
accepted: "accepted";
|
|
147
|
+
question: "question";
|
|
148
|
+
rolled_back: "rolled_back";
|
|
149
|
+
started: "started";
|
|
150
|
+
digest: "digest";
|
|
151
|
+
budget_warning: "budget_warning";
|
|
152
|
+
budget_exhausted: "budget_exhausted";
|
|
153
|
+
}>;
|
|
154
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
attempt: z.ZodNumber;
|
|
157
|
+
availableAt: z.ZodISODateTime;
|
|
158
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
159
|
+
createdAt: z.ZodISODateTime;
|
|
160
|
+
updatedAt: z.ZodISODateTime;
|
|
161
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
162
|
+
state: z.ZodLiteral<"delivering">;
|
|
163
|
+
leaseUntil: z.ZodISODateTime;
|
|
164
|
+
deliveredAt: z.ZodOptional<z.ZodNever>;
|
|
165
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
166
|
+
id: z.ZodType<`out_${string}`, string, z.core.$ZodTypeInternals<`out_${string}`, string>>;
|
|
167
|
+
event: z.ZodObject<{
|
|
168
|
+
eventId: z.ZodString;
|
|
169
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
170
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
171
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
172
|
+
replyTo: z.ZodObject<{
|
|
173
|
+
channel: z.ZodString;
|
|
174
|
+
address: z.ZodString;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
outcome: z.ZodEnum<{
|
|
177
|
+
message: "message";
|
|
178
|
+
succeeded: "succeeded";
|
|
179
|
+
failed: "failed";
|
|
180
|
+
needs_human: "needs_human";
|
|
181
|
+
cancelled: "cancelled";
|
|
182
|
+
accepted: "accepted";
|
|
183
|
+
question: "question";
|
|
184
|
+
rolled_back: "rolled_back";
|
|
185
|
+
started: "started";
|
|
186
|
+
digest: "digest";
|
|
187
|
+
budget_warning: "budget_warning";
|
|
188
|
+
budget_exhausted: "budget_exhausted";
|
|
189
|
+
}>;
|
|
190
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
attempt: z.ZodNumber;
|
|
193
|
+
availableAt: z.ZodISODateTime;
|
|
194
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
195
|
+
createdAt: z.ZodISODateTime;
|
|
196
|
+
updatedAt: z.ZodISODateTime;
|
|
197
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
198
|
+
state: z.ZodLiteral<"delivered">;
|
|
199
|
+
leaseUntil: z.ZodOptional<z.ZodNever>;
|
|
200
|
+
deliveredAt: z.ZodISODateTime;
|
|
201
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
202
|
+
id: z.ZodType<`out_${string}`, string, z.core.$ZodTypeInternals<`out_${string}`, string>>;
|
|
203
|
+
event: z.ZodObject<{
|
|
204
|
+
eventId: z.ZodString;
|
|
205
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
206
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
207
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
208
|
+
replyTo: z.ZodObject<{
|
|
209
|
+
channel: z.ZodString;
|
|
210
|
+
address: z.ZodString;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
outcome: z.ZodEnum<{
|
|
213
|
+
message: "message";
|
|
214
|
+
succeeded: "succeeded";
|
|
215
|
+
failed: "failed";
|
|
216
|
+
needs_human: "needs_human";
|
|
217
|
+
cancelled: "cancelled";
|
|
218
|
+
accepted: "accepted";
|
|
219
|
+
question: "question";
|
|
220
|
+
rolled_back: "rolled_back";
|
|
221
|
+
started: "started";
|
|
222
|
+
digest: "digest";
|
|
223
|
+
budget_warning: "budget_warning";
|
|
224
|
+
budget_exhausted: "budget_exhausted";
|
|
225
|
+
}>;
|
|
226
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
attempt: z.ZodNumber;
|
|
229
|
+
availableAt: z.ZodISODateTime;
|
|
230
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
231
|
+
createdAt: z.ZodISODateTime;
|
|
232
|
+
updatedAt: z.ZodISODateTime;
|
|
233
|
+
}, z.core.$strict>>], "state">>>;
|
|
234
|
+
updatedAt: z.ZodISODateTime;
|
|
235
|
+
}, z.core.$strict>>;
|
|
236
|
+
/** Fixed communication-outbox shard containing only active deliveries. */
|
|
237
|
+
type OutboxQueue = z.infer<typeof outboxQueueSchema>;
|
|
238
|
+
//#endregion
|
|
239
|
+
export { OutboxMessage, OutboxQueue, outboxMessageSchema, outboxQueueSchema, outboxStateSchema };
|
|
240
|
+
//# sourceMappingURL=outbox.d.mts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { outboxIdSchema } from "./id.mjs";
|
|
2
|
+
import { isoDateTimeSchema, schemaVersionSchema } from "./common.mjs";
|
|
3
|
+
import { communicationEventSchema } from "./communication.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/schema/outbox.ts
|
|
6
|
+
/** Validates the durable delivery state of an outbox message. */
|
|
7
|
+
const outboxStateSchema = z.enum([
|
|
8
|
+
"pending",
|
|
9
|
+
"delivering",
|
|
10
|
+
"delivered"
|
|
11
|
+
]).describe("Durable connector delivery state.");
|
|
12
|
+
const outboxMessageFields = {
|
|
13
|
+
schemaVersion: schemaVersionSchema,
|
|
14
|
+
id: outboxIdSchema,
|
|
15
|
+
event: communicationEventSchema.describe("Immutable provider-neutral delivery payload."),
|
|
16
|
+
attempt: z.number().int().nonnegative(),
|
|
17
|
+
availableAt: isoDateTimeSchema,
|
|
18
|
+
lastError: z.string().min(1).max(2e3).optional(),
|
|
19
|
+
createdAt: isoDateTimeSchema,
|
|
20
|
+
updatedAt: isoDateTimeSchema
|
|
21
|
+
};
|
|
22
|
+
/** Validates one retryable connector delivery retained in the communication outbox. */
|
|
23
|
+
const outboxMessageSchema = z.discriminatedUnion("state", [
|
|
24
|
+
z.strictObject({
|
|
25
|
+
...outboxMessageFields,
|
|
26
|
+
state: z.literal("pending"),
|
|
27
|
+
leaseUntil: z.never().optional(),
|
|
28
|
+
deliveredAt: z.never().optional()
|
|
29
|
+
}).readonly(),
|
|
30
|
+
z.strictObject({
|
|
31
|
+
...outboxMessageFields,
|
|
32
|
+
state: z.literal("delivering"),
|
|
33
|
+
leaseUntil: isoDateTimeSchema,
|
|
34
|
+
deliveredAt: z.never().optional()
|
|
35
|
+
}).readonly(),
|
|
36
|
+
z.strictObject({
|
|
37
|
+
...outboxMessageFields,
|
|
38
|
+
state: z.literal("delivered"),
|
|
39
|
+
leaseUntil: z.never().optional(),
|
|
40
|
+
deliveredAt: isoDateTimeSchema
|
|
41
|
+
}).readonly()
|
|
42
|
+
]);
|
|
43
|
+
/** Validates one fixed shard containing the active communication delivery backlog. */
|
|
44
|
+
const outboxQueueSchema = z.strictObject({
|
|
45
|
+
schemaVersion: schemaVersionSchema,
|
|
46
|
+
id: z.string().regex(/^communication-[0-9a-f]$/u),
|
|
47
|
+
messages: z.array(outboxMessageSchema).readonly(),
|
|
48
|
+
updatedAt: isoDateTimeSchema
|
|
49
|
+
}).readonly();
|
|
50
|
+
//#endregion
|
|
51
|
+
export { outboxMessageSchema, outboxQueueSchema, outboxStateSchema };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=outbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox.mjs","names":[],"sources":["../../src/schema/outbox.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { communicationEventSchema } from \"./communication\";\nimport { isoDateTimeSchema, schemaVersionSchema } from \"./common\";\nimport { outboxIdSchema } from \"./id\";\n\n/** Validates the durable delivery state of an outbox message. */\nexport const outboxStateSchema = z\n .enum([\"pending\", \"delivering\", \"delivered\"])\n .describe(\"Durable connector delivery state.\");\n\nconst outboxMessageFields = {\n schemaVersion: schemaVersionSchema,\n id: outboxIdSchema,\n event: communicationEventSchema.describe(\"Immutable provider-neutral delivery payload.\"),\n attempt: z.number().int().nonnegative(),\n availableAt: isoDateTimeSchema,\n lastError: z.string().min(1).max(2000).optional(),\n createdAt: isoDateTimeSchema,\n updatedAt: isoDateTimeSchema,\n} as const;\n\n/** Validates one retryable connector delivery retained in the communication outbox. */\nexport const outboxMessageSchema = z.discriminatedUnion(\"state\", [\n z\n .strictObject({\n ...outboxMessageFields,\n state: z.literal(\"pending\"),\n leaseUntil: z.never().optional(),\n deliveredAt: z.never().optional(),\n })\n .readonly(),\n z\n .strictObject({\n ...outboxMessageFields,\n state: z.literal(\"delivering\"),\n leaseUntil: isoDateTimeSchema,\n deliveredAt: z.never().optional(),\n })\n .readonly(),\n z\n .strictObject({\n ...outboxMessageFields,\n state: z.literal(\"delivered\"),\n leaseUntil: z.never().optional(),\n deliveredAt: isoDateTimeSchema,\n })\n .readonly(),\n]);\n\n/** Retryable connector delivery with lease and attempt metadata. */\nexport type OutboxMessage = z.infer<typeof outboxMessageSchema>;\n\n/** Validates one fixed shard containing the active communication delivery backlog. */\nexport const outboxQueueSchema = z\n .strictObject({\n schemaVersion: schemaVersionSchema,\n id: z.string().regex(/^communication-[0-9a-f]$/u),\n messages: z.array(outboxMessageSchema).readonly(),\n updatedAt: isoDateTimeSchema,\n })\n .readonly();\n\n/** Fixed communication-outbox shard containing only active deliveries. */\nexport type OutboxQueue = z.infer<typeof outboxQueueSchema>;\n"],"mappings":";;;;;;AAMA,MAAa,oBAAoB,EAC9B,KAAK;CAAC;CAAW;CAAc;AAAW,CAAC,CAAC,CAC5C,SAAS,mCAAmC;AAE/C,MAAM,sBAAsB;CAC1B,eAAe;CACf,IAAI;CACJ,OAAO,yBAAyB,SAAS,8CAA8C;CACvF,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY;CACtC,aAAa;CACb,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS;CAChD,WAAW;CACX,WAAW;AACb;;AAGA,MAAa,sBAAsB,EAAE,mBAAmB,SAAS;CAC/D,EACG,aAAa;EACZ,GAAG;EACH,OAAO,EAAE,QAAQ,SAAS;EAC1B,YAAY,EAAE,MAAM,CAAC,CAAC,SAAS;EAC/B,aAAa,EAAE,MAAM,CAAC,CAAC,SAAS;CAClC,CAAC,CAAC,CACD,SAAS;CACZ,EACG,aAAa;EACZ,GAAG;EACH,OAAO,EAAE,QAAQ,YAAY;EAC7B,YAAY;EACZ,aAAa,EAAE,MAAM,CAAC,CAAC,SAAS;CAClC,CAAC,CAAC,CACD,SAAS;CACZ,EACG,aAAa;EACZ,GAAG;EACH,OAAO,EAAE,QAAQ,WAAW;EAC5B,YAAY,EAAE,MAAM,CAAC,CAAC,SAAS;EAC/B,aAAa;CACf,CAAC,CAAC,CACD,SAAS;AACd,CAAC;;AAMD,MAAa,oBAAoB,EAC9B,aAAa;CACZ,eAAe;CACf,IAAI,EAAE,OAAO,CAAC,CAAC,MAAM,2BAA2B;CAChD,UAAU,EAAE,MAAM,mBAAmB,CAAC,CAAC,SAAS;CAChD,WAAW;AACb,CAAC,CAAC,CACD,SAAS"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { taskIdSchema } from "./id.mjs";
|
|
2
|
+
import { isoDateTimeSchema, replyToSchema, schemaVersionSchema } from "./common.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/schema/question-route.ts
|
|
5
|
+
/** Validates the directly addressed index of open questions for one reply destination. */
|
|
6
|
+
const questionRouteSchema = z.strictObject({
|
|
7
|
+
schemaVersion: schemaVersionSchema,
|
|
8
|
+
id: z.string().regex(/^qroute_[a-z0-9]{6,64}$/u),
|
|
9
|
+
replyTo: replyToSchema,
|
|
10
|
+
questionTaskIds: z.array(taskIdSchema),
|
|
11
|
+
updatedAt: isoDateTimeSchema
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { questionRouteSchema };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=question-route.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question-route.mjs","names":[],"sources":["../../src/schema/question-route.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, replyToSchema, schemaVersionSchema } from \"./common\";\nimport { taskIdSchema } from \"./id\";\n\n/** Validates the directly addressed index of open questions for one reply destination. */\nexport const questionRouteSchema = z.strictObject({\n schemaVersion: schemaVersionSchema,\n id: z.string().regex(/^qroute_[a-z0-9]{6,64}$/u),\n replyTo: replyToSchema,\n questionTaskIds: z.array(taskIdSchema),\n updatedAt: isoDateTimeSchema,\n});\n"],"mappings":";;;;;AAKA,MAAa,sBAAsB,EAAE,aAAa;CAChD,eAAe;CACf,IAAI,EAAE,OAAO,CAAC,CAAC,MAAM,0BAA0B;CAC/C,SAAS;CACT,iBAAiB,EAAE,MAAM,YAAY;CACrC,WAAW;AACb,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/receipt.d.ts
|
|
3
|
+
/** States the engine writes on transitions. Any vocabulary value is valid. */
|
|
4
|
+
declare const standardReceiptStates: readonly ["approved", "rejected", "queued", "dispatched", "stalled", "succeeded", "failed", "needs_human", "cancelled", "settled", "verifying", "ready", "merged", "deployed", "rolled_out", "rolled_back"];
|
|
5
|
+
/** Phases the standard loop uses. Any vocabulary value is valid. */
|
|
6
|
+
declare const standardReceiptPhases: readonly ["approval", "budget", "dispatch", "retry", "implementation", "verification", "pull_request", "cleanup"];
|
|
7
|
+
/** Kinds the standard loop writes: the standard task kinds plus "change". */
|
|
8
|
+
declare const standardReceiptKinds: readonly ["coordination", "code_change", "verification", "investigation", "question", "change"];
|
|
9
|
+
/** Receipt states written by the supplied lifecycle and settlement loops. */
|
|
10
|
+
type StandardReceiptState = (typeof standardReceiptStates)[number];
|
|
11
|
+
/** Standard Receipt phases exported for correlated construction inputs. */
|
|
12
|
+
type StandardReceiptPhase = (typeof standardReceiptPhases)[number];
|
|
13
|
+
/** Standard Receipt kinds exported for correlated construction inputs. */
|
|
14
|
+
type StandardReceiptKind = (typeof standardReceiptKinds)[number];
|
|
15
|
+
/** Standard Receipt states with support for caller-defined audit events. */
|
|
16
|
+
type ReceiptState = StandardReceiptState | (string & Record<never, never>);
|
|
17
|
+
/** Standard Receipt phases with support for caller-defined workflow phases. */
|
|
18
|
+
type ReceiptPhase = StandardReceiptPhase | (string & Record<never, never>);
|
|
19
|
+
/** Standard Receipt kinds with support for caller-defined subject categories. */
|
|
20
|
+
type ReceiptKind = StandardReceiptKind | (string & Record<never, never>);
|
|
21
|
+
/** Validates the open audit-event vocabulary recorded as a Receipt state. */
|
|
22
|
+
declare const receiptStateSchema: z.ZodType<ReceiptState>;
|
|
23
|
+
/** Validates the optional workflow phase associated with a Receipt. */
|
|
24
|
+
declare const receiptPhaseSchema: z.ZodType<ReceiptPhase>;
|
|
25
|
+
/** Validates the Task, Change, or custom subject kind recorded by a Receipt. */
|
|
26
|
+
declare const receiptKindSchema: z.ZodType<ReceiptKind>;
|
|
27
|
+
/** Validates the measured dollar cost attached only to settlement Receipts. */
|
|
28
|
+
declare const costSchema: z.ZodObject<{
|
|
29
|
+
totalUsd: z.ZodNumber;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
/** Validates an immutable provider message reference recorded after communication delivery. */
|
|
32
|
+
declare const receiptDeliverySchema: z.ZodObject<{
|
|
33
|
+
replyTo: z.ZodObject<{
|
|
34
|
+
channel: z.ZodString;
|
|
35
|
+
address: z.ZodString;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
messageId: z.ZodString;
|
|
38
|
+
workspaceId: z.ZodString;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
/** Validates immutable audit evidence for a lifecycle, decision, or settlement event. */
|
|
41
|
+
declare const receiptSchema: z.ZodObject<{
|
|
42
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
43
|
+
receiptId: z.ZodType<`rcpt_${string}`, string, z.core.$ZodTypeInternals<`rcpt_${string}`, string>>;
|
|
44
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
45
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
46
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
47
|
+
kind: z.ZodType<ReceiptKind, unknown, z.core.$ZodTypeInternals<ReceiptKind, unknown>>;
|
|
48
|
+
state: z.ZodType<ReceiptState, unknown, z.core.$ZodTypeInternals<ReceiptState, unknown>>;
|
|
49
|
+
phase: z.ZodOptional<z.ZodType<ReceiptPhase, unknown, z.core.$ZodTypeInternals<ReceiptPhase, unknown>>>;
|
|
50
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
51
|
+
attempt: z.ZodNumber;
|
|
52
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
totalUsd: z.ZodNumber;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
decidedBy: z.ZodOptional<z.ZodString>;
|
|
56
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
provider: z.ZodString;
|
|
58
|
+
sessionId: z.ZodString;
|
|
59
|
+
environmentId: z.ZodOptional<z.ZodString>;
|
|
60
|
+
harness: z.ZodOptional<z.ZodString>;
|
|
61
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
delivery: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
replyTo: z.ZodObject<{
|
|
65
|
+
channel: z.ZodString;
|
|
66
|
+
address: z.ZodString;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
messageId: z.ZodString;
|
|
69
|
+
workspaceId: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
recordedAt: z.ZodISODateTime;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
/** Measured dollar cost carried by a settlement Receipt. */
|
|
74
|
+
type Cost = z.infer<typeof costSchema>;
|
|
75
|
+
/** Immutable provider message reference carried by a communication Receipt. */
|
|
76
|
+
type ReceiptDelivery = z.infer<typeof receiptDeliverySchema>;
|
|
77
|
+
/** Immutable audit evidence for a Factory lifecycle or settlement event. */
|
|
78
|
+
type Receipt = z.infer<typeof receiptSchema>;
|
|
79
|
+
//#endregion
|
|
80
|
+
export { Cost, Receipt, ReceiptDelivery, ReceiptKind, ReceiptPhase, ReceiptState, StandardReceiptKind, StandardReceiptPhase, StandardReceiptState, costSchema, receiptDeliverySchema, receiptKindSchema, receiptPhaseSchema, receiptSchema, receiptStateSchema, standardReceiptKinds, standardReceiptPhases, standardReceiptStates };
|
|
81
|
+
//# sourceMappingURL=receipt.d.mts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { changeIdSchema, receiptIdSchema, repositoryIdsSchema, taskIdSchema } from "./id.mjs";
|
|
2
|
+
import { isoDateTimeSchema, replyToSchema, schemaVersionSchema, usdSchema, vocabularySchema } from "./common.mjs";
|
|
3
|
+
import { executionReferenceSchema, standardTaskKinds } from "./task.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/schema/receipt.ts
|
|
6
|
+
/** States the engine writes on transitions. Any vocabulary value is valid. */
|
|
7
|
+
const standardReceiptStates = [
|
|
8
|
+
"approved",
|
|
9
|
+
"rejected",
|
|
10
|
+
"queued",
|
|
11
|
+
"dispatched",
|
|
12
|
+
"stalled",
|
|
13
|
+
"succeeded",
|
|
14
|
+
"failed",
|
|
15
|
+
"needs_human",
|
|
16
|
+
"cancelled",
|
|
17
|
+
"settled",
|
|
18
|
+
"verifying",
|
|
19
|
+
"ready",
|
|
20
|
+
"merged",
|
|
21
|
+
"deployed",
|
|
22
|
+
"rolled_out",
|
|
23
|
+
"rolled_back"
|
|
24
|
+
];
|
|
25
|
+
/** Phases the standard loop uses. Any vocabulary value is valid. */
|
|
26
|
+
const standardReceiptPhases = [
|
|
27
|
+
"approval",
|
|
28
|
+
"budget",
|
|
29
|
+
"dispatch",
|
|
30
|
+
"retry",
|
|
31
|
+
"implementation",
|
|
32
|
+
"verification",
|
|
33
|
+
"pull_request",
|
|
34
|
+
"cleanup"
|
|
35
|
+
];
|
|
36
|
+
/** Kinds the standard loop writes: the standard task kinds plus "change". */
|
|
37
|
+
const standardReceiptKinds = [...standardTaskKinds, "change"];
|
|
38
|
+
/** Validates the open audit-event vocabulary recorded as a Receipt state. */
|
|
39
|
+
const receiptStateSchema = vocabularySchema.describe("What happened, e.g. dispatched, settled, merged, or a custom event name.");
|
|
40
|
+
/** Validates the optional workflow phase associated with a Receipt. */
|
|
41
|
+
const receiptPhaseSchema = vocabularySchema.describe("Where in the process it happened, e.g. dispatch or verification.");
|
|
42
|
+
/** Validates the Task, Change, or custom subject kind recorded by a Receipt. */
|
|
43
|
+
const receiptKindSchema = vocabularySchema.describe("What the receipt is about: a task kind, change, or a custom kind.");
|
|
44
|
+
/** Validates the measured dollar cost attached only to settlement Receipts. */
|
|
45
|
+
const costSchema = z.strictObject({ totalUsd: usdSchema });
|
|
46
|
+
/** Validates an immutable provider message reference recorded after communication delivery. */
|
|
47
|
+
const receiptDeliverySchema = z.strictObject({
|
|
48
|
+
replyTo: replyToSchema.describe("Destination of the external message."),
|
|
49
|
+
messageId: z.string().min(1).describe("Provider message identifier used for subsequent updates."),
|
|
50
|
+
workspaceId: z.string().min(1).describe("Provider workspace in which this message was posted.")
|
|
51
|
+
});
|
|
52
|
+
/** Validates immutable audit evidence for a lifecycle, decision, or settlement event. */
|
|
53
|
+
const receiptSchema = z.strictObject({
|
|
54
|
+
schemaVersion: schemaVersionSchema,
|
|
55
|
+
receiptId: receiptIdSchema,
|
|
56
|
+
repositoryIds: repositoryIdsSchema.describe("Repositories the recorded event concerns."),
|
|
57
|
+
taskId: taskIdSchema.optional(),
|
|
58
|
+
changeId: changeIdSchema.optional(),
|
|
59
|
+
kind: receiptKindSchema,
|
|
60
|
+
state: receiptStateSchema,
|
|
61
|
+
phase: receiptPhaseSchema.optional(),
|
|
62
|
+
reason: z.string().min(1).max(2e3).optional().describe("Why it happened. Scrubbed and truncated; never secrets."),
|
|
63
|
+
attempt: z.number().int().min(1).describe("Attempt the event belongs to."),
|
|
64
|
+
cost: costSchema.optional().describe("Measured cost. Settled receipts only."),
|
|
65
|
+
decidedBy: z.string().min(1).optional().describe("Human who made the decision. Change and approval receipts only."),
|
|
66
|
+
execution: executionReferenceSchema.optional().describe("Provider execution retained for inspection of this attempt."),
|
|
67
|
+
delivery: receiptDeliverySchema.optional().describe("Immutable provider message reference for a communication receipt."),
|
|
68
|
+
recordedAt: isoDateTimeSchema
|
|
69
|
+
}).superRefine((receipt, ctx) => {
|
|
70
|
+
if (receipt.delivery !== void 0 && receipt.phase !== "communication") ctx.addIssue({
|
|
71
|
+
code: "custom",
|
|
72
|
+
path: ["delivery"],
|
|
73
|
+
message: "delivery is only valid on communication receipts"
|
|
74
|
+
});
|
|
75
|
+
if (receipt.state === "settled" && receipt.cost === void 0) ctx.addIssue({
|
|
76
|
+
code: "custom",
|
|
77
|
+
path: ["cost"],
|
|
78
|
+
message: "settled receipts require cost"
|
|
79
|
+
});
|
|
80
|
+
if (receipt.state !== "settled" && receipt.cost !== void 0) ctx.addIssue({
|
|
81
|
+
code: "custom",
|
|
82
|
+
path: ["cost"],
|
|
83
|
+
message: "cost is only valid on settled receipts"
|
|
84
|
+
});
|
|
85
|
+
if (receipt.decidedBy !== void 0 && receipt.kind !== "change" && receipt.state !== "approved" && receipt.state !== "rejected") ctx.addIssue({
|
|
86
|
+
code: "custom",
|
|
87
|
+
path: ["decidedBy"],
|
|
88
|
+
message: "decidedBy is only valid on change and approval receipts"
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { costSchema, receiptDeliverySchema, receiptKindSchema, receiptPhaseSchema, receiptSchema, receiptStateSchema, standardReceiptKinds, standardReceiptPhases, standardReceiptStates };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=receipt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipt.mjs","names":[],"sources":["../../src/schema/receipt.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n isoDateTimeSchema,\n replyToSchema,\n schemaVersionSchema,\n usdSchema,\n vocabularySchema,\n} from \"./common\";\nimport { changeIdSchema, receiptIdSchema, repositoryIdsSchema, taskIdSchema } from \"./id\";\nimport { executionReferenceSchema, standardTaskKinds } from \"./task\";\n\n/** States the engine writes on transitions. Any vocabulary value is valid. */\nexport const standardReceiptStates = [\n \"approved\",\n \"rejected\",\n \"queued\",\n \"dispatched\",\n \"stalled\",\n \"succeeded\",\n \"failed\",\n \"needs_human\",\n \"cancelled\",\n \"settled\",\n \"verifying\",\n \"ready\",\n \"merged\",\n \"deployed\",\n \"rolled_out\",\n \"rolled_back\",\n] as const;\n\n/** Phases the standard loop uses. Any vocabulary value is valid. */\nexport const standardReceiptPhases = [\n \"approval\",\n \"budget\",\n \"dispatch\",\n \"retry\",\n \"implementation\",\n \"verification\",\n \"pull_request\",\n \"cleanup\",\n] as const;\n\n/** Kinds the standard loop writes: the standard task kinds plus \"change\". */\nexport const standardReceiptKinds = [...standardTaskKinds, \"change\"] as const;\n\n/** Receipt states written by the supplied lifecycle and settlement loops. */\nexport type StandardReceiptState = (typeof standardReceiptStates)[number];\n/** Standard Receipt phases exported for correlated construction inputs. */\nexport type StandardReceiptPhase = (typeof standardReceiptPhases)[number];\n/** Standard Receipt kinds exported for correlated construction inputs. */\nexport type StandardReceiptKind = (typeof standardReceiptKinds)[number];\n/** Standard Receipt states with support for caller-defined audit events. */\nexport type ReceiptState = StandardReceiptState | (string & Record<never, never>);\n/** Standard Receipt phases with support for caller-defined workflow phases. */\nexport type ReceiptPhase = StandardReceiptPhase | (string & Record<never, never>);\n/** Standard Receipt kinds with support for caller-defined subject categories. */\nexport type ReceiptKind = StandardReceiptKind | (string & Record<never, never>);\n\n/** Validates the open audit-event vocabulary recorded as a Receipt state. */\nexport const receiptStateSchema = vocabularySchema.describe(\n \"What happened, e.g. dispatched, settled, merged, or a custom event name.\",\n) as z.ZodType<ReceiptState>;\n\n/** Validates the optional workflow phase associated with a Receipt. */\nexport const receiptPhaseSchema = vocabularySchema.describe(\n \"Where in the process it happened, e.g. dispatch or verification.\",\n) as z.ZodType<ReceiptPhase>;\n\n/** Validates the Task, Change, or custom subject kind recorded by a Receipt. */\nexport const receiptKindSchema = vocabularySchema.describe(\n \"What the receipt is about: a task kind, change, or a custom kind.\",\n) as z.ZodType<ReceiptKind>;\n\n/** Validates the measured dollar cost attached only to settlement Receipts. */\nexport const costSchema = z.strictObject({\n totalUsd: usdSchema,\n});\n\n/** Validates an immutable provider message reference recorded after communication delivery. */\nexport const receiptDeliverySchema = z.strictObject({\n replyTo: replyToSchema.describe(\"Destination of the external message.\"),\n messageId: z.string().min(1).describe(\"Provider message identifier used for subsequent updates.\"),\n workspaceId: z.string().min(1).describe(\"Provider workspace in which this message was posted.\"),\n});\n\n/** Validates immutable audit evidence for a lifecycle, decision, or settlement event. */\nexport const receiptSchema = z\n .strictObject({\n schemaVersion: schemaVersionSchema,\n receiptId: receiptIdSchema,\n repositoryIds: repositoryIdsSchema.describe(\"Repositories the recorded event concerns.\"),\n taskId: taskIdSchema.optional(),\n changeId: changeIdSchema.optional(),\n kind: receiptKindSchema,\n state: receiptStateSchema,\n phase: receiptPhaseSchema.optional(),\n reason: z\n .string()\n .min(1)\n .max(2000)\n .optional()\n .describe(\"Why it happened. Scrubbed and truncated; never secrets.\"),\n attempt: z.number().int().min(1).describe(\"Attempt the event belongs to.\"),\n cost: costSchema.optional().describe(\"Measured cost. Settled receipts only.\"),\n decidedBy: z\n .string()\n .min(1)\n .optional()\n .describe(\"Human who made the decision. Change and approval receipts only.\"),\n execution: executionReferenceSchema\n .optional()\n .describe(\"Provider execution retained for inspection of this attempt.\"),\n delivery: receiptDeliverySchema\n .optional()\n .describe(\"Immutable provider message reference for a communication receipt.\"),\n recordedAt: isoDateTimeSchema,\n })\n .superRefine((receipt, ctx) => {\n if (receipt.delivery !== undefined && receipt.phase !== \"communication\") {\n ctx.addIssue({\n code: \"custom\",\n path: [\"delivery\"],\n message: \"delivery is only valid on communication receipts\",\n });\n }\n if (receipt.state === \"settled\" && receipt.cost === undefined) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"cost\"],\n message: \"settled receipts require cost\",\n });\n }\n if (receipt.state !== \"settled\" && receipt.cost !== undefined) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"cost\"],\n message: \"cost is only valid on settled receipts\",\n });\n }\n if (\n receipt.decidedBy !== undefined &&\n receipt.kind !== \"change\" &&\n receipt.state !== \"approved\" &&\n receipt.state !== \"rejected\"\n ) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"decidedBy\"],\n message: \"decidedBy is only valid on change and approval receipts\",\n });\n }\n });\n\n/** Measured dollar cost carried by a settlement Receipt. */\nexport type Cost = z.infer<typeof costSchema>;\n/** Immutable provider message reference carried by a communication Receipt. */\nexport type ReceiptDelivery = z.infer<typeof receiptDeliverySchema>;\n/** Immutable audit evidence for a Factory lifecycle or settlement event. */\nexport type Receipt = z.infer<typeof receiptSchema>;\n"],"mappings":";;;;;;AAYA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAa,uBAAuB,CAAC,GAAG,mBAAmB,QAAQ;;AAgBnE,MAAa,qBAAqB,iBAAiB,SACjD,0EACF;;AAGA,MAAa,qBAAqB,iBAAiB,SACjD,kEACF;;AAGA,MAAa,oBAAoB,iBAAiB,SAChD,mEACF;;AAGA,MAAa,aAAa,EAAE,aAAa,EACvC,UAAU,UACZ,CAAC;;AAGD,MAAa,wBAAwB,EAAE,aAAa;CAClD,SAAS,cAAc,SAAS,sCAAsC;CACtE,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,0DAA0D;CAChG,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,sDAAsD;AAChG,CAAC;;AAGD,MAAa,gBAAgB,EAC1B,aAAa;CACZ,eAAe;CACf,WAAW;CACX,eAAe,oBAAoB,SAAS,2CAA2C;CACvF,QAAQ,aAAa,SAAS;CAC9B,UAAU,eAAe,SAAS;CAClC,MAAM;CACN,OAAO;CACP,OAAO,mBAAmB,SAAS;CACnC,QAAQ,EACL,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAI,CAAC,CACT,SAAS,CAAC,CACV,SAAS,yDAAyD;CACrE,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,+BAA+B;CACzE,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,uCAAuC;CAC5E,WAAW,EACR,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,iEAAiE;CAC7E,WAAW,yBACR,SAAS,CAAC,CACV,SAAS,6DAA6D;CACzE,UAAU,sBACP,SAAS,CAAC,CACV,SAAS,mEAAmE;CAC/E,YAAY;AACd,CAAC,CAAC,CACD,aAAa,SAAS,QAAQ;CAC7B,IAAI,QAAQ,aAAa,KAAA,KAAa,QAAQ,UAAU,iBACtD,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,UAAU;EACjB,SAAS;CACX,CAAC;CAEH,IAAI,QAAQ,UAAU,aAAa,QAAQ,SAAS,KAAA,GAClD,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,MAAM;EACb,SAAS;CACX,CAAC;CAEH,IAAI,QAAQ,UAAU,aAAa,QAAQ,SAAS,KAAA,GAClD,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,MAAM;EACb,SAAS;CACX,CAAC;CAEH,IACE,QAAQ,cAAc,KAAA,KACtB,QAAQ,SAAS,YACjB,QAAQ,UAAU,cAClB,QAAQ,UAAU,YAElB,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,WAAW;EAClB,SAAS;CACX,CAAC;AAEL,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/repository.d.ts
|
|
3
|
+
/** Canonical lowercase `owner/name` repository slug. */
|
|
4
|
+
type RepositorySlug = `${string}/${string}`;
|
|
5
|
+
/** Validates the canonical lowercase `owner/name` form used for repository scope. */
|
|
6
|
+
declare const repositorySlugSchema: z.ZodType<RepositorySlug, string>;
|
|
7
|
+
/** Validates the persisted identity and enabled state of a configured repository. */
|
|
8
|
+
declare const repositorySchema: z.ZodReadonly<z.ZodObject<{
|
|
9
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
10
|
+
id: z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>;
|
|
11
|
+
slug: z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
|
|
12
|
+
defaultBranch: z.ZodString;
|
|
13
|
+
enabled: z.ZodBoolean;
|
|
14
|
+
dependsOn: z.ZodReadonly<z.ZodArray<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>>>;
|
|
15
|
+
devbox: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
16
|
+
projectId: z.ZodString;
|
|
17
|
+
teamId: z.ZodString;
|
|
18
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strict>>>;
|
|
20
|
+
connectedAt: z.ZodISODateTime;
|
|
21
|
+
}, z.core.$strict>>;
|
|
22
|
+
/** Persisted identity and status of a repository admitted by Factory configuration. */
|
|
23
|
+
type Repository = z.infer<typeof repositorySchema>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Repository, RepositorySlug, repositorySchema, repositorySlugSchema };
|
|
26
|
+
//# sourceMappingURL=repository.d.mts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { repositoryIdSchema } from "./id.mjs";
|
|
2
|
+
import { isoDateTimeSchema, schemaVersionSchema } from "./common.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/schema/repository.ts
|
|
5
|
+
/** Validates the canonical lowercase `owner/name` form used for repository scope. */
|
|
6
|
+
const repositorySlugSchema = z.string().regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\/(?!\.{1,2}$|\.git$)[a-z0-9._-]+$/u, "Expected a canonical lowercase owner/name repository slug").describe("owner/name, lowercase, e.g. acme/web. Repository names cannot be '.', '..', or '.git'.");
|
|
7
|
+
/** Validates the persisted identity and enabled state of a configured repository. */
|
|
8
|
+
const repositorySchema = z.strictObject({
|
|
9
|
+
schemaVersion: schemaVersionSchema,
|
|
10
|
+
id: repositoryIdSchema,
|
|
11
|
+
slug: repositorySlugSchema,
|
|
12
|
+
defaultBranch: z.string().min(1).describe("Branch changes land on, usually main."),
|
|
13
|
+
enabled: z.boolean().describe("Whether the factory may work on this repository."),
|
|
14
|
+
dependsOn: z.array(repositorySlugSchema).readonly().describe("Slugs of repositories this one consumes, for multi-repo work ordering."),
|
|
15
|
+
devbox: z.strictObject({
|
|
16
|
+
projectId: z.string().min(1),
|
|
17
|
+
teamId: z.string().min(1),
|
|
18
|
+
snapshot: z.string().min(1).optional().describe("Prebuilt snapshot to boot from.")
|
|
19
|
+
}).readonly().optional().describe("Devbox execution config. Absent when this repository never uses devboxes."),
|
|
20
|
+
connectedAt: isoDateTimeSchema
|
|
21
|
+
}).readonly();
|
|
22
|
+
//#endregion
|
|
23
|
+
export { repositorySchema, repositorySlugSchema };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=repository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.mjs","names":[],"sources":["../../src/schema/repository.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, schemaVersionSchema } from \"./common\";\nimport { repositoryIdSchema } from \"./id\";\n\n/** Canonical lowercase `owner/name` repository slug. */\nexport type RepositorySlug = `${string}/${string}`;\n\n/** Validates the canonical lowercase `owner/name` form used for repository scope. */\nexport const repositorySlugSchema = z\n .string()\n .regex(\n /^[a-z0-9]([a-z0-9-]*[a-z0-9])?\\/(?!\\.{1,2}$|\\.git$)[a-z0-9._-]+$/u,\n \"Expected a canonical lowercase owner/name repository slug\",\n )\n .describe(\n \"owner/name, lowercase, e.g. acme/web. Repository names cannot be '.', '..', or '.git'.\",\n ) as z.ZodType<RepositorySlug, string>;\n\n/** Validates the persisted identity and enabled state of a configured repository. */\nexport const repositorySchema = z\n .strictObject({\n schemaVersion: schemaVersionSchema,\n id: repositoryIdSchema,\n slug: repositorySlugSchema,\n defaultBranch: z.string().min(1).describe(\"Branch changes land on, usually main.\"),\n enabled: z.boolean().describe(\"Whether the factory may work on this repository.\"),\n dependsOn: z\n .array(repositorySlugSchema)\n .readonly()\n .describe(\"Slugs of repositories this one consumes, for multi-repo work ordering.\"),\n devbox: z\n .strictObject({\n projectId: z.string().min(1),\n teamId: z.string().min(1),\n snapshot: z.string().min(1).optional().describe(\"Prebuilt snapshot to boot from.\"),\n })\n .readonly()\n .optional()\n .describe(\"Devbox execution config. Absent when this repository never uses devboxes.\"),\n connectedAt: isoDateTimeSchema,\n })\n .readonly();\n\n/** Persisted identity and status of a repository admitted by Factory configuration. */\nexport type Repository = z.infer<typeof repositorySchema>;\n"],"mappings":";;;;;AAQA,MAAa,uBAAuB,EACjC,OAAO,CAAC,CACR,MACC,qEACA,2DACF,CAAC,CACA,SACC,wFACF;;AAGF,MAAa,mBAAmB,EAC7B,aAAa;CACZ,eAAe;CACf,IAAI;CACJ,MAAM;CACN,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,uCAAuC;CACjF,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,kDAAkD;CAChF,WAAW,EACR,MAAM,oBAAoB,CAAC,CAC3B,SAAS,CAAC,CACV,SAAS,wEAAwE;CACpF,QAAQ,EACL,aAAa;EACZ,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EAC3B,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EACxB,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;CACnF,CAAC,CAAC,CACD,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,2EAA2E;CACvF,aAAa;AACf,CAAC,CAAC,CACD,SAAS"}
|