@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,27 @@
|
|
|
1
|
+
import { taskIdSchema } from "./schema/id.mjs";
|
|
2
|
+
import { repositorySlugSchema } from "./schema/repository.mjs";
|
|
3
|
+
import { taskSchema } from "./schema/task.mjs";
|
|
4
|
+
import { receiptSchema } from "./schema/receipt.mjs";
|
|
5
|
+
import { findingSchema } from "./schema/finding.mjs";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
//#region src/approval-contracts.ts
|
|
8
|
+
/** Validates the stable human reason attached to an approval decision. */
|
|
9
|
+
const approvalRequestSchema = z.strictObject({ reason: z.string().trim().min(1).max(2e3).optional().describe("Reason for the decision; required for rejection. Retain unchanged for retries.") });
|
|
10
|
+
/** Validates one authorized approval proposal and its immutable decision state. */
|
|
11
|
+
const approvalViewSchema = z.object({
|
|
12
|
+
task: taskSchema.describe("Task requiring or carrying a human decision."),
|
|
13
|
+
repositories: z.array(repositorySlugSchema).readonly().describe("Configured repository names for this Task."),
|
|
14
|
+
finding: findingSchema.nullable().describe("Finding that prompted the Task, when available."),
|
|
15
|
+
decision: receiptSchema.nullable().describe("Immutable decision receipt, or null before a decision.")
|
|
16
|
+
});
|
|
17
|
+
/** Validates a filtered, cursor-paginated page of approval proposals. */
|
|
18
|
+
const approvalPageSchema = z.object({
|
|
19
|
+
actor: z.string().describe("Authenticated actor used for decision attribution."),
|
|
20
|
+
items: z.array(approvalViewSchema).readonly().describe("Authorized approvals in the requested order."),
|
|
21
|
+
totalCount: z.number().int().nonnegative().optional().describe("Number of authorized approvals matching all filters, before pagination."),
|
|
22
|
+
nextCursor: taskIdSchema.nullable().describe("Continue this filtered listing after this Task ID.")
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { approvalPageSchema, approvalRequestSchema, approvalViewSchema };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=approval-contracts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-contracts.mjs","names":[],"sources":["../src/approval-contracts.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { taskIdSchema, type TaskId } from \"./schema/id\";\nimport { taskSchema } from \"./schema/task\";\nimport { receiptSchema } from \"./schema/receipt\";\nimport { findingSchema } from \"./schema/finding\";\nimport { repositorySlugSchema, type RepositorySlug } from \"./schema/repository\";\n\n/** Workspace owner and optional individually authenticated actor at the approval boundary. */\nexport interface ApiPrincipal {\n /** Workspace identity used for existing conversation ownership. */\n readonly id: string;\n /** Individually authenticated, provider-qualified actor; absent for anonymous/workload access. */\n readonly actor?: string;\n}\n\n/** Validates the stable human reason attached to an approval decision. */\nexport const approvalRequestSchema = z.strictObject({\n reason: z\n .string()\n .trim()\n .min(1)\n .max(2000)\n .optional()\n .describe(\"Reason for the decision; required for rejection. Retain unchanged for retries.\"),\n});\n/** Validates one authorized approval proposal and its immutable decision state. */\nexport const approvalViewSchema = z.object({\n task: taskSchema.describe(\"Task requiring or carrying a human decision.\"),\n repositories: z\n .array(repositorySlugSchema)\n .readonly()\n .describe(\"Configured repository names for this Task.\"),\n finding: findingSchema.nullable().describe(\"Finding that prompted the Task, when available.\"),\n decision: receiptSchema\n .nullable()\n .describe(\"Immutable decision receipt, or null before a decision.\"),\n});\n/** Validates a filtered, cursor-paginated page of approval proposals. */\nexport const approvalPageSchema = z.object({\n actor: z.string().describe(\"Authenticated actor used for decision attribution.\"),\n items: z\n .array(approvalViewSchema)\n .readonly()\n .describe(\"Authorized approvals in the requested order.\"),\n totalCount: z\n .number()\n .int()\n .nonnegative()\n .optional()\n .describe(\"Number of authorized approvals matching all filters, before pagination.\"),\n nextCursor: taskIdSchema\n .nullable()\n .describe(\"Continue this filtered listing after this Task ID.\"),\n});\n/** Authorized Task proposal with repository, finding, and decision context. */\nexport type ApprovalView = z.infer<typeof approvalViewSchema>;\n/** Filtered, cursor-paginated approval proposals for one authorized actor. */\nexport type ApprovalPage = z.infer<typeof approvalPageSchema>;\n/** Filters, ordering, and cursor controls for approval discovery. */\nexport interface ApprovalListOptions {\n readonly repository?: RepositorySlug;\n readonly status?: \"pending\" | \"decided\" | \"all\";\n readonly query?: string;\n readonly sort?: \"created\" | \"priority\" | \"decided\";\n readonly limit?: number;\n readonly cursor?: TaskId;\n}\n"],"mappings":";;;;;;;;AAgBA,MAAa,wBAAwB,EAAE,aAAa,EAClD,QAAQ,EACL,OAAO,CAAC,CACR,KAAK,CAAC,CACN,IAAI,CAAC,CAAC,CACN,IAAI,GAAI,CAAC,CACT,SAAS,CAAC,CACV,SAAS,gFAAgF,EAC9F,CAAC;;AAED,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,WAAW,SAAS,8CAA8C;CACxE,cAAc,EACX,MAAM,oBAAoB,CAAC,CAC3B,SAAS,CAAC,CACV,SAAS,4CAA4C;CACxD,SAAS,cAAc,SAAS,CAAC,CAAC,SAAS,iDAAiD;CAC5F,UAAU,cACP,SAAS,CAAC,CACV,SAAS,wDAAwD;AACtE,CAAC;;AAED,MAAa,qBAAqB,EAAE,OAAO;CACzC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,oDAAoD;CAC/E,OAAO,EACJ,MAAM,kBAAkB,CAAC,CACzB,SAAS,CAAC,CACV,SAAS,8CAA8C;CAC1D,YAAY,EACT,OAAO,CAAC,CACR,IAAI,CAAC,CACL,YAAY,CAAC,CACb,SAAS,CAAC,CACV,SAAS,yEAAyE;CACrF,YAAY,aACT,SAAS,CAAC,CACV,SAAS,oDAAoD;AAClE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/approval.d.ts
|
|
3
|
+
/** Validates an open priority label used to match admission policy subjects. */
|
|
4
|
+
declare const approvalPrioritySchema: z.ZodString;
|
|
5
|
+
/**
|
|
6
|
+
* One approval rule. Every listed field must match for the rule to apply;
|
|
7
|
+
* absent fields match anything. Rules are evaluated first-match.
|
|
8
|
+
*/
|
|
9
|
+
declare const approvalRuleSchema: z.ZodReadonly<z.ZodObject<{
|
|
10
|
+
source: z.ZodOptional<z.ZodString>;
|
|
11
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
12
|
+
priority: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
13
|
+
require: z.ZodBoolean;
|
|
14
|
+
}, z.core.$strict>>;
|
|
15
|
+
/** Validates an ordered, first-match set of Task approval rules. */
|
|
16
|
+
declare const approvalPolicySchema: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
17
|
+
source: z.ZodOptional<z.ZodString>;
|
|
18
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
19
|
+
priority: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
20
|
+
require: z.ZodBoolean;
|
|
21
|
+
}, z.core.$strict>>>>;
|
|
22
|
+
/** One first-match condition that decides whether admitted work requires approval. */
|
|
23
|
+
type ApprovalRule = z.infer<typeof approvalRuleSchema>;
|
|
24
|
+
/** Ordered admission policy that stamps a Task's approval requirement once. */
|
|
25
|
+
type ApprovalPolicy = z.infer<typeof approvalPolicySchema>;
|
|
26
|
+
/** Open priority label compared exactly by approval policy. */
|
|
27
|
+
type ApprovalPriority = z.infer<typeof approvalPrioritySchema>;
|
|
28
|
+
/** Neutral framework default when an application does not select an approval policy. */
|
|
29
|
+
declare const allowByDefaultApprovalPolicy: readonly Readonly<{
|
|
30
|
+
require: boolean;
|
|
31
|
+
source?: string | undefined;
|
|
32
|
+
kind?: string | undefined;
|
|
33
|
+
priority?: readonly string[] | undefined;
|
|
34
|
+
}>[];
|
|
35
|
+
/** Immutable intake attributes evaluated against an approval policy. */
|
|
36
|
+
interface ApprovalSubject {
|
|
37
|
+
source?: string;
|
|
38
|
+
kind: string;
|
|
39
|
+
priority?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Decide at task-creation time whether a task needs approval. Pure: the answer
|
|
43
|
+
* is stamped on the task and never re-evaluated, so a later policy change
|
|
44
|
+
* cannot silently release work a human was expecting to see.
|
|
45
|
+
*/
|
|
46
|
+
declare function requiresApproval(policy: ApprovalPolicy, subject: ApprovalSubject): boolean;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ApprovalPolicy, ApprovalPriority, ApprovalRule, ApprovalSubject, allowByDefaultApprovalPolicy, approvalPolicySchema, approvalPrioritySchema, approvalRuleSchema, requiresApproval };
|
|
49
|
+
//# sourceMappingURL=approval.d.mts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { vocabularySchema } from "./schema/common.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/approval.ts
|
|
4
|
+
/** Validates an open priority label used to match admission policy subjects. */
|
|
5
|
+
const approvalPrioritySchema = z.string().min(1).max(64).describe("Priority label compared exactly, e.g. P0, P1, urgent, or a custom domain value.");
|
|
6
|
+
/**
|
|
7
|
+
* One approval rule. Every listed field must match for the rule to apply;
|
|
8
|
+
* absent fields match anything. Rules are evaluated first-match.
|
|
9
|
+
*/
|
|
10
|
+
const approvalRuleSchema = z.strictObject({
|
|
11
|
+
source: vocabularySchema.optional().describe("Signal source, e.g. security_scan or github_issue."),
|
|
12
|
+
kind: vocabularySchema.optional().describe("Task kind, e.g. code_change."),
|
|
13
|
+
priority: z.array(approvalPrioritySchema).min(1).readonly().optional().describe("Finding priorities the rule applies to."),
|
|
14
|
+
require: z.boolean().describe("Whether matching tasks wait for a human before dispatch.")
|
|
15
|
+
}).readonly();
|
|
16
|
+
/** Validates an ordered, first-match set of Task approval rules. */
|
|
17
|
+
const approvalPolicySchema = z.array(approvalRuleSchema).readonly().describe("First-match rules deciding which tasks need a human before they run.");
|
|
18
|
+
/** Neutral framework default when an application does not select an approval policy. */
|
|
19
|
+
const allowByDefaultApprovalPolicy = approvalPolicySchema.parse([{ require: false }]);
|
|
20
|
+
/**
|
|
21
|
+
* Decide at task-creation time whether a task needs approval. Pure: the answer
|
|
22
|
+
* is stamped on the task and never re-evaluated, so a later policy change
|
|
23
|
+
* cannot silently release work a human was expecting to see.
|
|
24
|
+
*/
|
|
25
|
+
function requiresApproval(policy, subject) {
|
|
26
|
+
for (const rule of policy) {
|
|
27
|
+
if (rule.source !== void 0 && rule.source !== subject.source) continue;
|
|
28
|
+
if (rule.kind !== void 0 && rule.kind !== subject.kind) continue;
|
|
29
|
+
if (rule.priority !== void 0) {
|
|
30
|
+
if (subject.priority === void 0 || !rule.priority.includes(subject.priority)) continue;
|
|
31
|
+
}
|
|
32
|
+
return rule.require;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { allowByDefaultApprovalPolicy, approvalPolicySchema, approvalPrioritySchema, approvalRuleSchema, requiresApproval };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=approval.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval.mjs","names":[],"sources":["../src/approval.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { vocabularySchema } from \"./schema/common\";\n\n/** Validates an open priority label used to match admission policy subjects. */\nexport const approvalPrioritySchema = z\n .string()\n .min(1)\n .max(64)\n .describe(\"Priority label compared exactly, e.g. P0, P1, urgent, or a custom domain value.\");\n\n/**\n * One approval rule. Every listed field must match for the rule to apply;\n * absent fields match anything. Rules are evaluated first-match.\n */\nexport const approvalRuleSchema = z\n .strictObject({\n source: vocabularySchema\n .optional()\n .describe(\"Signal source, e.g. security_scan or github_issue.\"),\n kind: vocabularySchema.optional().describe(\"Task kind, e.g. code_change.\"),\n priority: z\n .array(approvalPrioritySchema)\n .min(1)\n .readonly()\n .optional()\n .describe(\"Finding priorities the rule applies to.\"),\n require: z.boolean().describe(\"Whether matching tasks wait for a human before dispatch.\"),\n })\n .readonly();\n\n/** Validates an ordered, first-match set of Task approval rules. */\nexport const approvalPolicySchema = z\n .array(approvalRuleSchema)\n .readonly()\n .describe(\"First-match rules deciding which tasks need a human before they run.\");\n\n/** One first-match condition that decides whether admitted work requires approval. */\nexport type ApprovalRule = z.infer<typeof approvalRuleSchema>;\n/** Ordered admission policy that stamps a Task's approval requirement once. */\nexport type ApprovalPolicy = z.infer<typeof approvalPolicySchema>;\n/** Open priority label compared exactly by approval policy. */\nexport type ApprovalPriority = z.infer<typeof approvalPrioritySchema>;\n\n/** Neutral framework default when an application does not select an approval policy. */\nexport const allowByDefaultApprovalPolicy = approvalPolicySchema.parse([{ require: false }]);\n\n/** Immutable intake attributes evaluated against an approval policy. */\nexport interface ApprovalSubject {\n source?: string;\n kind: string;\n priority?: string;\n}\n\n/**\n * Decide at task-creation time whether a task needs approval. Pure: the answer\n * is stamped on the task and never re-evaluated, so a later policy change\n * cannot silently release work a human was expecting to see.\n */\nexport function requiresApproval(policy: ApprovalPolicy, subject: ApprovalSubject): boolean {\n for (const rule of policy) {\n if (rule.source !== undefined && rule.source !== subject.source) continue;\n if (rule.kind !== undefined && rule.kind !== subject.kind) continue;\n if (rule.priority !== undefined) {\n if (subject.priority === undefined || !rule.priority.includes(subject.priority)) continue;\n }\n return rule.require;\n }\n return false;\n}\n"],"mappings":";;;;AAIA,MAAa,yBAAyB,EACnC,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,SAAS,iFAAiF;;;;;AAM7F,MAAa,qBAAqB,EAC/B,aAAa;CACZ,QAAQ,iBACL,SAAS,CAAC,CACV,SAAS,oDAAoD;CAChE,MAAM,iBAAiB,SAAS,CAAC,CAAC,SAAS,8BAA8B;CACzE,UAAU,EACP,MAAM,sBAAsB,CAAC,CAC7B,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,yCAAyC;CACrD,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,0DAA0D;AAC1F,CAAC,CAAC,CACD,SAAS;;AAGZ,MAAa,uBAAuB,EACjC,MAAM,kBAAkB,CAAC,CACzB,SAAS,CAAC,CACV,SAAS,sEAAsE;;AAUlF,MAAa,+BAA+B,qBAAqB,MAAM,CAAC,EAAE,SAAS,MAAM,CAAC,CAAC;;;;;;AAc3F,SAAgB,iBAAiB,QAAwB,SAAmC;CAC1F,KAAK,MAAM,QAAQ,QAAQ;EACzB,IAAI,KAAK,WAAW,KAAA,KAAa,KAAK,WAAW,QAAQ,QAAQ;EACjE,IAAI,KAAK,SAAS,KAAA,KAAa,KAAK,SAAS,QAAQ,MAAM;EAC3D,IAAI,KAAK,aAAa,KAAA,GAChB;OAAA,QAAQ,aAAa,KAAA,KAAa,CAAC,KAAK,SAAS,SAAS,QAAQ,QAAQ,GAAG;EAAA;EAEnF,OAAO,KAAK;CACd;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TaskId } from "../schema/id.mjs";
|
|
2
|
+
import { TaskAttemptRef } from "../schema/execution.mjs";
|
|
3
|
+
import { BlobClient } from "./index.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/blob/artifacts.d.ts
|
|
6
|
+
declare const artifactRefSchema: z.core.$ZodBranded<z.ZodString, "ArtifactRef", "out">;
|
|
7
|
+
/** A content-addressed reference that binds an artifact to its owning Task attempt and kind. */
|
|
8
|
+
type ArtifactRef = z.infer<typeof artifactRefSchema>;
|
|
9
|
+
/** Valid syntax grants neither read authority nor proof that an artifact exists. */
|
|
10
|
+
declare function parseArtifactRef(value: unknown): ArtifactRef;
|
|
11
|
+
/** Artifact kinds accepted by the Task-bound content-addressed store. */
|
|
12
|
+
type ArtifactKind = "patch" | "report" | "log";
|
|
13
|
+
/** Task attempt, kind, and encoded body used to derive or persist an artifact. */
|
|
14
|
+
interface ArtifactInput extends TaskAttemptRef {
|
|
15
|
+
kind: ArtifactKind;
|
|
16
|
+
/** Binary artifacts use base64. */
|
|
17
|
+
body: string;
|
|
18
|
+
}
|
|
19
|
+
/** Artifact reference and authorized owning Task used for one verified read. */
|
|
20
|
+
interface ReadArtifactInput {
|
|
21
|
+
ref: ArtifactRef;
|
|
22
|
+
taskId: TaskId;
|
|
23
|
+
}
|
|
24
|
+
/** Persists and retrieves content-addressed artifacts within a Task authorization boundary. */
|
|
25
|
+
interface ArtifactStore {
|
|
26
|
+
/** Content-addressed and therefore idempotent; returns the durable reference. */
|
|
27
|
+
put(artifact: ArtifactInput): Promise<ArtifactRef>;
|
|
28
|
+
/** Reads require the owning Task and re-verify the content digest. */
|
|
29
|
+
read(input: ReadArtifactInput): Promise<string>;
|
|
30
|
+
}
|
|
31
|
+
/** Derive a validated, content-addressed reference for an artifact without writing it. */
|
|
32
|
+
declare function artifactReference(artifact: ArtifactInput): ArtifactRef;
|
|
33
|
+
/** Create a Task-bound artifact store that verifies ownership and content digests on reads. */
|
|
34
|
+
declare function createArtifactStore(client: BlobClient): ArtifactStore;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ArtifactInput, ArtifactKind, ArtifactRef, ArtifactStore, ReadArtifactInput, artifactReference, createArtifactStore, parseArtifactRef };
|
|
37
|
+
//# sourceMappingURL=artifacts.d.mts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/blob/artifacts.ts
|
|
4
|
+
const artifactRefPattern = /^factory-artifacts\/(task_[a-z0-9]{6,64})\/([1-9]\d{0,8})\/(patch|report|log)\/([0-9a-f]{64})$/u;
|
|
5
|
+
const artifactRefSchema = z.string().regex(artifactRefPattern, "Unrecognized artifact reference").brand();
|
|
6
|
+
/** Valid syntax grants neither read authority nor proof that an artifact exists. */
|
|
7
|
+
function parseArtifactRef(value) {
|
|
8
|
+
return artifactRefSchema.parse(value);
|
|
9
|
+
}
|
|
10
|
+
const sha256 = (body) => createHash("sha256").update(body).digest("hex");
|
|
11
|
+
/** Derive a validated, content-addressed reference for an artifact without writing it. */
|
|
12
|
+
function artifactReference(artifact) {
|
|
13
|
+
const ref = `factory-artifacts/${artifact.taskId}/${artifact.attempt}/${artifact.kind}/${sha256(artifact.body)}`;
|
|
14
|
+
if (!artifactRefPattern.test(ref)) throw new Error("Artifact reference requires a valid Task ID, attempt, and kind");
|
|
15
|
+
return parseArtifactRef(ref);
|
|
16
|
+
}
|
|
17
|
+
/** Create a Task-bound artifact store that verifies ownership and content digests on reads. */
|
|
18
|
+
function createArtifactStore(client) {
|
|
19
|
+
return {
|
|
20
|
+
async put(artifact) {
|
|
21
|
+
const ref = artifactReference(artifact);
|
|
22
|
+
await client.write({
|
|
23
|
+
pathname: ref,
|
|
24
|
+
body: artifact.body,
|
|
25
|
+
overwrite: true
|
|
26
|
+
});
|
|
27
|
+
return ref;
|
|
28
|
+
},
|
|
29
|
+
async read({ ref, taskId: authorizedTaskId }) {
|
|
30
|
+
const parsed = parseArtifactRef(ref);
|
|
31
|
+
const match = artifactRefPattern.exec(parsed);
|
|
32
|
+
if (!match) throw new Error("Unrecognized artifact reference");
|
|
33
|
+
const [, taskId, , , digest] = match;
|
|
34
|
+
if (taskId !== authorizedTaskId) throw new Error(`Artifact belongs to ${taskId}, not to the authorized Task ${authorizedTaskId}`);
|
|
35
|
+
const stored = await client.read({ pathname: parsed });
|
|
36
|
+
if (!stored) throw new Error(`Artifact ${ref} is unavailable`);
|
|
37
|
+
if (sha256(stored.body) !== digest) throw new Error(`Artifact ${ref} content does not match its digest`);
|
|
38
|
+
return stored.body;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { artifactReference, createArtifactStore, parseArtifactRef };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=artifacts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.mjs","names":[],"sources":["../../src/blob/artifacts.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport type { BlobClient } from \"./index\";\nimport type { TaskAttemptRef } from \"../schema/execution\";\nimport type { TaskId } from \"../schema/id\";\nimport { z } from \"zod\";\n\nconst artifactRefPattern =\n /^factory-artifacts\\/(task_[a-z0-9]{6,64})\\/([1-9]\\d{0,8})\\/(patch|report|log)\\/([0-9a-f]{64})$/u;\nconst artifactRefSchema = z\n .string()\n .regex(artifactRefPattern, \"Unrecognized artifact reference\")\n .brand<\"ArtifactRef\">();\n\n/** A content-addressed reference that binds an artifact to its owning Task attempt and kind. */\nexport type ArtifactRef = z.infer<typeof artifactRefSchema>;\n\n/** Valid syntax grants neither read authority nor proof that an artifact exists. */\nexport function parseArtifactRef(value: unknown): ArtifactRef {\n return artifactRefSchema.parse(value);\n}\n\n/** Artifact kinds accepted by the Task-bound content-addressed store. */\nexport type ArtifactKind = \"patch\" | \"report\" | \"log\";\n\n/** Task attempt, kind, and encoded body used to derive or persist an artifact. */\nexport interface ArtifactInput extends TaskAttemptRef {\n kind: ArtifactKind;\n /** Binary artifacts use base64. */\n body: string;\n}\n\n/** Artifact reference and authorized owning Task used for one verified read. */\nexport interface ReadArtifactInput {\n ref: ArtifactRef;\n taskId: TaskId;\n}\n\n/** Persists and retrieves content-addressed artifacts within a Task authorization boundary. */\nexport interface ArtifactStore {\n /** Content-addressed and therefore idempotent; returns the durable reference. */\n put(artifact: ArtifactInput): Promise<ArtifactRef>;\n /** Reads require the owning Task and re-verify the content digest. */\n read(input: ReadArtifactInput): Promise<string>;\n}\n\nconst sha256 = (body: string) => createHash(\"sha256\").update(body).digest(\"hex\");\n\n/** Derive a validated, content-addressed reference for an artifact without writing it. */\nexport function artifactReference(artifact: ArtifactInput): ArtifactRef {\n const ref = `factory-artifacts/${artifact.taskId}/${artifact.attempt}/${artifact.kind}/${sha256(artifact.body)}`;\n if (!artifactRefPattern.test(ref)) {\n throw new Error(\"Artifact reference requires a valid Task ID, attempt, and kind\");\n }\n return parseArtifactRef(ref);\n}\n\n/** Create a Task-bound artifact store that verifies ownership and content digests on reads. */\nexport function createArtifactStore(client: BlobClient): ArtifactStore {\n return {\n async put(artifact) {\n const ref = artifactReference(artifact);\n // Same path implies same content, so overwriting is safe and retryable.\n await client.write({ pathname: ref, body: artifact.body, overwrite: true });\n return ref;\n },\n async read({ ref, taskId: authorizedTaskId }) {\n const parsed = parseArtifactRef(ref);\n const match = artifactRefPattern.exec(parsed);\n if (!match) throw new Error(\"Unrecognized artifact reference\");\n const [, taskId, , , digest] = match;\n if (taskId !== authorizedTaskId) {\n throw new Error(\n `Artifact belongs to ${taskId}, not to the authorized Task ${authorizedTaskId}`,\n );\n }\n const stored = await client.read({ pathname: parsed });\n if (!stored) throw new Error(`Artifact ${ref} is unavailable`);\n if (sha256(stored.body) !== digest) {\n throw new Error(`Artifact ${ref} content does not match its digest`);\n }\n return stored.body;\n },\n };\n}\n"],"mappings":";;;AAMA,MAAM,qBACJ;AACF,MAAM,oBAAoB,EACvB,OAAO,CAAC,CACR,MAAM,oBAAoB,iCAAiC,CAAC,CAC5D,MAAqB;;AAMxB,SAAgB,iBAAiB,OAA6B;CAC5D,OAAO,kBAAkB,MAAM,KAAK;AACtC;AA0BA,MAAM,UAAU,SAAiB,WAAW,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK;;AAG/E,SAAgB,kBAAkB,UAAsC;CACtE,MAAM,MAAM,qBAAqB,SAAS,OAAO,GAAG,SAAS,QAAQ,GAAG,SAAS,KAAK,GAAG,OAAO,SAAS,IAAI;CAC7G,IAAI,CAAC,mBAAmB,KAAK,GAAG,GAC9B,MAAM,IAAI,MAAM,gEAAgE;CAElF,OAAO,iBAAiB,GAAG;AAC7B;;AAGA,SAAgB,oBAAoB,QAAmC;CACrE,OAAO;EACL,MAAM,IAAI,UAAU;GAClB,MAAM,MAAM,kBAAkB,QAAQ;GAEtC,MAAM,OAAO,MAAM;IAAE,UAAU;IAAK,MAAM,SAAS;IAAM,WAAW;GAAK,CAAC;GAC1E,OAAO;EACT;EACA,MAAM,KAAK,EAAE,KAAK,QAAQ,oBAAoB;GAC5C,MAAM,SAAS,iBAAiB,GAAG;GACnC,MAAM,QAAQ,mBAAmB,KAAK,MAAM;GAC5C,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,iCAAiC;GAC7D,MAAM,GAAG,YAAY,UAAU;GAC/B,IAAI,WAAW,kBACb,MAAM,IAAI,MACR,uBAAuB,OAAO,+BAA+B,kBAC/D;GAEF,MAAM,SAAS,MAAM,OAAO,KAAK,EAAE,UAAU,OAAO,CAAC;GACrD,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,YAAY,IAAI,gBAAgB;GAC7D,IAAI,OAAO,OAAO,IAAI,MAAM,QAC1B,MAAM,IAAI,MAAM,YAAY,IAAI,mCAAmC;GAErE,OAAO,OAAO;EAChB;CACF;AACF"}
|
package/dist/blob/index.d.mts
CHANGED
|
@@ -1,33 +1,105 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MillisecondClock } from "../schema/common.mjs";
|
|
2
|
+
import { StoreDriver } from "../store/driver.mjs";
|
|
3
|
+
import { ArtifactInput, ArtifactKind, ArtifactRef, ArtifactStore, ReadArtifactInput, artifactReference, createArtifactStore, parseArtifactRef } from "./artifacts.mjs";
|
|
2
4
|
//#region src/blob/index.d.ts
|
|
5
|
+
/** Blob content paired with the ETag required for compare-and-swap persistence. */
|
|
3
6
|
interface BlobObject {
|
|
7
|
+
/** Complete UTF-8 body returned by an uncached read. */
|
|
4
8
|
body: string;
|
|
9
|
+
/** Current object ETag used to fence a later conditional write. */
|
|
5
10
|
etag: string;
|
|
6
11
|
}
|
|
12
|
+
/** Exact blob pathname requested from storage. */
|
|
13
|
+
interface ReadBlobInput {
|
|
14
|
+
/** Exact namespaced object path; the client must not apply a second namespace. */
|
|
15
|
+
pathname: string;
|
|
16
|
+
}
|
|
17
|
+
/** Blob body and conditional-write policy used for one storage write. */
|
|
18
|
+
interface WriteBlobInput extends ReadBlobInput {
|
|
19
|
+
/** Complete replacement body to persist. */
|
|
20
|
+
body: string;
|
|
21
|
+
/** Whether an existing path may be replaced; `false` means create-if-absent. */
|
|
22
|
+
overwrite: boolean;
|
|
23
|
+
/** Optional ETag that must still match atomically when overwriting. */
|
|
24
|
+
ifMatch?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Path prefix used to list matching blobs. */
|
|
27
|
+
interface ListBlobPathsInput {
|
|
28
|
+
/** Path prefix whose complete matching object names are requested. */
|
|
29
|
+
prefix: string;
|
|
30
|
+
}
|
|
7
31
|
/** The narrow blob operations the driver needs; injectable for tests. */
|
|
8
32
|
interface BlobClient {
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Returns the latest content rather than a cached copy, or `null` when absent.
|
|
35
|
+
*
|
|
36
|
+
* @param input - Exact object path to read.
|
|
37
|
+
* @returns Current body and ETag, or `null` when the path does not exist.
|
|
38
|
+
*/
|
|
39
|
+
read(input: ReadBlobInput): Promise<BlobObject | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Persists one complete object and enforces its create or ETag precondition atomically.
|
|
42
|
+
*
|
|
43
|
+
* @param input - Exact path, body, overwrite policy, and optional ETag fence.
|
|
44
|
+
* @returns After the object write is durable at the provider boundary.
|
|
45
|
+
*/
|
|
46
|
+
write(input: WriteBlobInput): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Lists every object path matching the prefix, following all provider pages.
|
|
49
|
+
*
|
|
50
|
+
* @param input - Namespace prefix to enumerate.
|
|
51
|
+
* @returns Matching exact paths; callers do not depend on their order.
|
|
52
|
+
*/
|
|
53
|
+
listPaths(input: ListBlobPathsInput): Promise<readonly string[]>;
|
|
14
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Default private Vercel Blob client used by the durable Factory store driver.
|
|
57
|
+
* Reads explicitly bypass the CDN cache, and writes resolve only after the SDK accepts them.
|
|
58
|
+
*/
|
|
15
59
|
declare const vercelBlobClient: BlobClient;
|
|
60
|
+
/** Bounds retries and exponential backoff for transient Blob operations. */
|
|
61
|
+
interface BlobRetryOptions {
|
|
62
|
+
/** Positive integer attempts for one read or write, including the first. Default 3. */
|
|
63
|
+
attempts?: number;
|
|
64
|
+
/** Finite non-negative backoff base in milliseconds; doubles each retry. Default 250. */
|
|
65
|
+
baseDelayMs?: number;
|
|
66
|
+
/** Finite non-negative elapsed-time ceiling in milliseconds. Default 5000. */
|
|
67
|
+
maxTotalMs?: number;
|
|
68
|
+
}
|
|
69
|
+
/** Configures the Blob client, namespace, read concurrency, and transient retries. */
|
|
16
70
|
interface BlobDriverOptions {
|
|
71
|
+
/** Blob transport used for reads, conditional writes, and listings; defaults to Vercel Blob. */
|
|
17
72
|
client?: BlobClient;
|
|
18
73
|
/** Path prefix inside the blob store; defaults to "factory". */
|
|
19
74
|
prefix?: string;
|
|
20
75
|
/** Maximum Blob downloads in flight while listing a collection. Default 32. */
|
|
21
76
|
readConcurrency?: number;
|
|
77
|
+
/** Bounds retry of transient (5xx/429/network) Blob failures on reads and writes. */
|
|
78
|
+
retry?: BlobRetryOptions;
|
|
79
|
+
/** Millisecond clock used to bound total retry time. */
|
|
80
|
+
now?: MillisecondClock;
|
|
22
81
|
}
|
|
23
82
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* overwriting the winner.
|
|
83
|
+
* Creates a durable Vercel Blob driver with atomic compare-and-swap updates.
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* Inserts are create-if-absent. Updates bypass Blob's CDN cache and use the current ETag, so a
|
|
87
|
+
* writer that loses a race receives `VersionConflictError` instead of overwriting the winner.
|
|
88
|
+
* Reads and writes retry only 5xx, 429, and network failures within the configured attempt and
|
|
89
|
+
* elapsed-time bounds; exhaustion surfaces as `TransientStoreError`. If a transient write may
|
|
90
|
+
* have landed before its response was lost, the retry reads the record back and treats only the
|
|
91
|
+
* exact intended value and version as success. A different value remains a real conflict.
|
|
92
|
+
*
|
|
93
|
+
* Collection listing downloads records under the shared `readConcurrency` bound, coalesces
|
|
94
|
+
* concurrent lists of the same collection, and rejects malformed persisted values. Listing the
|
|
95
|
+
* provider's paths itself is not retried by this driver. The caller owns credentials and any
|
|
96
|
+
* injected client's lifecycle.
|
|
97
|
+
*
|
|
98
|
+
* @param options - Optional Blob transport, namespace, read limit, retry policy, and retry clock.
|
|
99
|
+
* @returns A `blob` driver suitable for `createStores`.
|
|
100
|
+
* @throws When concurrency or retry bounds are invalid.
|
|
29
101
|
*/
|
|
30
102
|
declare function createBlobDriver(options?: BlobDriverOptions): StoreDriver;
|
|
31
103
|
//#endregion
|
|
32
|
-
export { BlobClient, BlobDriverOptions, BlobObject, createBlobDriver, vercelBlobClient };
|
|
104
|
+
export { type ArtifactInput, type ArtifactKind, type ArtifactRef, type ArtifactStore, BlobClient, BlobDriverOptions, BlobObject, BlobRetryOptions, ListBlobPathsInput, type ReadArtifactInput, ReadBlobInput, WriteBlobInput, artifactReference, createArtifactStore, createBlobDriver, parseArtifactRef, vercelBlobClient };
|
|
33
105
|
//# sourceMappingURL=index.d.mts.map
|