@vercel/factory 0.0.14 → 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 +306 -0
- 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 +68 -216
- package/dist/api.mjs +872 -97
- 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 +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 +41 -6
- package/dist/blob/index.mjs +158 -40
- 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 -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 +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 -1271
- package/dist/eve/index.mjs +233 -1065
- 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 +239 -40
- 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 -484
- package/dist/index.mjs +14 -522
- 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-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 +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 -44
- 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,80 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/workspace-snapshot.ts
|
|
3
|
+
/** Validates the bounded committed-tree snapshot captured inside an execution workspace. */
|
|
4
|
+
const workspaceSnapshotSchema = z.object({
|
|
5
|
+
truncated: z.boolean(),
|
|
6
|
+
files: z.array(z.object({
|
|
7
|
+
path: z.string(),
|
|
8
|
+
oldMode: z.string().nullable(),
|
|
9
|
+
newMode: z.string().nullable(),
|
|
10
|
+
oldSha: z.string().nullable(),
|
|
11
|
+
newSha: z.string().nullable(),
|
|
12
|
+
content: z.string().max(2e5).nullable(),
|
|
13
|
+
binary: z.boolean(),
|
|
14
|
+
omitted: z.boolean()
|
|
15
|
+
})).max(200).readonly()
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Captures a bounded committed-tree snapshot using only sandbox Node.js built-ins without
|
|
19
|
+
* writing the checkout or Git index.
|
|
20
|
+
*/
|
|
21
|
+
const workspaceSnapshotScript = String.raw`
|
|
22
|
+
const fs = require('node:fs');
|
|
23
|
+
const path = require('node:path');
|
|
24
|
+
const { execFileSync } = require('node:child_process');
|
|
25
|
+
const input = JSON.parse(fs.readFileSync(process.argv[1], 'utf8'));
|
|
26
|
+
const root = input.root;
|
|
27
|
+
const started = Date.now();
|
|
28
|
+
const runGit = (args, encoding) => execFileSync('git', ['--no-optional-locks', '-c', 'core.fsmonitor=false', ...args], { cwd: root, timeout: 10000, maxBuffer: 16000000, encoding, env: { ...process.env, GIT_OPTIONAL_LOCKS: '0' } });
|
|
29
|
+
const git = (args) => runGit(args, 'utf8');
|
|
30
|
+
const safe = (p) => p && !path.isAbsolute(p) && !p.split('/').some((v) => v === '..' || v === '.' || v.toLowerCase() === '.git' || !v);
|
|
31
|
+
function tree(ref) {
|
|
32
|
+
const entries = new Map();
|
|
33
|
+
for (const line of git(['ls-tree', '-rz', '-r', '--long', '--full-tree', ref]).split('\0').filter(Boolean)) {
|
|
34
|
+
const match = /^(\d+) (\w+) ([a-f0-9]+)\s+(-|\d+)\t([\s\S]+)$/u.exec(line);
|
|
35
|
+
if (!match || !safe(match[5])) throw new Error('Invalid repository tree');
|
|
36
|
+
entries.set(match[5], { mode: match[1], type: match[2], sha: match[3], size: match[4] === '-' ? null : Number(match[4]) });
|
|
37
|
+
}
|
|
38
|
+
return entries;
|
|
39
|
+
}
|
|
40
|
+
function entryBytes(entry) {
|
|
41
|
+
if (!entry) return Buffer.alloc(0);
|
|
42
|
+
if (entry.type !== 'blob' || entry.size === null || entry.size > 200000) return null;
|
|
43
|
+
return runGit(['cat-file', 'blob', entry.sha], null);
|
|
44
|
+
}
|
|
45
|
+
function text(data) {
|
|
46
|
+
if (data === null) return { content: null, binary: false };
|
|
47
|
+
if (data.includes(0)) return { content: null, binary: true };
|
|
48
|
+
try { return { content: new TextDecoder('utf-8', { fatal: true }).decode(data), binary: false }; }
|
|
49
|
+
catch { return { content: null, binary: true }; }
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
if (fs.realpathSync(root) !== root || !fs.lstatSync(path.join(root, '.git')).isDirectory()) throw new Error('Workspace checkout unavailable');
|
|
53
|
+
if (!/^[a-f0-9]{40,64}$/u.test(input.headSha) || git(['rev-parse', '--verify', input.headSha + '^{commit}']).trim() !== input.headSha) throw new Error('Invalid branch head');
|
|
54
|
+
const base = new Map(input.tree.map((file) => [file.path, file]));
|
|
55
|
+
const head = tree(input.headSha);
|
|
56
|
+
const paths = [...new Set([...base.keys(), ...head.keys()])].sort();
|
|
57
|
+
const files = [];
|
|
58
|
+
let truncated = false, bytes = 0;
|
|
59
|
+
for (const p of paths) {
|
|
60
|
+
if (!safe(p)) throw new Error('Invalid repository path');
|
|
61
|
+
if (Date.now() - started > 15000 || files.length >= 200) { truncated = true; break; }
|
|
62
|
+
const before = base.get(p);
|
|
63
|
+
const after = head.get(p);
|
|
64
|
+
if (before && after && before.sha === after.sha && before.mode === after.mode) continue;
|
|
65
|
+
const decoded = text(entryBytes(after));
|
|
66
|
+
if (decoded.content !== null) bytes += Buffer.byteLength(decoded.content);
|
|
67
|
+
const omitted = Boolean(after && decoded.content === null && !decoded.binary) || bytes > 2000000 || before?.mode === '160000' || after?.mode === '160000';
|
|
68
|
+
files.push({ path: p, oldMode: before?.mode ?? null, newMode: after?.mode ?? null, oldSha: before?.sha ?? null, newSha: after?.sha ?? null, content: omitted ? null : decoded.content, binary: decoded.binary, omitted });
|
|
69
|
+
if (bytes > 2000000) truncated = true;
|
|
70
|
+
}
|
|
71
|
+
process.stdout.write(JSON.stringify({ files, truncated }));
|
|
72
|
+
} catch (error) {
|
|
73
|
+
process.stderr.write('Workspace inspection failed\n');
|
|
74
|
+
process.exitCode = 1;
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
//#endregion
|
|
78
|
+
export { workspaceSnapshotSchema, workspaceSnapshotScript };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=workspace-snapshot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-snapshot.mjs","names":[],"sources":["../src/workspace-snapshot.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/** Validates the bounded committed-tree snapshot captured inside an execution workspace. */\nexport const workspaceSnapshotSchema = z.object({\n truncated: z.boolean(),\n files: z\n .array(\n z.object({\n path: z.string(),\n oldMode: z.string().nullable(),\n newMode: z.string().nullable(),\n oldSha: z.string().nullable(),\n newSha: z.string().nullable(),\n content: z.string().max(200_000).nullable(),\n binary: z.boolean(),\n omitted: z.boolean(),\n }),\n )\n .max(200)\n .readonly(),\n});\n\n/** A bounded committed-tree snapshot captured inside an execution workspace. */\nexport type WorkspaceSnapshot = z.infer<typeof workspaceSnapshotSchema>;\n\n/**\n * Captures a bounded committed-tree snapshot using only sandbox Node.js built-ins without\n * writing the checkout or Git index.\n */\nexport const workspaceSnapshotScript = String.raw`\nconst fs = require('node:fs');\nconst path = require('node:path');\nconst { execFileSync } = require('node:child_process');\nconst input = JSON.parse(fs.readFileSync(process.argv[1], 'utf8'));\nconst root = input.root;\nconst started = Date.now();\nconst runGit = (args, encoding) => execFileSync('git', ['--no-optional-locks', '-c', 'core.fsmonitor=false', ...args], { cwd: root, timeout: 10000, maxBuffer: 16000000, encoding, env: { ...process.env, GIT_OPTIONAL_LOCKS: '0' } });\nconst git = (args) => runGit(args, 'utf8');\nconst safe = (p) => p && !path.isAbsolute(p) && !p.split('/').some((v) => v === '..' || v === '.' || v.toLowerCase() === '.git' || !v);\nfunction tree(ref) {\n const entries = new Map();\n for (const line of git(['ls-tree', '-rz', '-r', '--long', '--full-tree', ref]).split('\\0').filter(Boolean)) {\n const match = /^(\\d+) (\\w+) ([a-f0-9]+)\\s+(-|\\d+)\\t([\\s\\S]+)$/u.exec(line);\n if (!match || !safe(match[5])) throw new Error('Invalid repository tree');\n entries.set(match[5], { mode: match[1], type: match[2], sha: match[3], size: match[4] === '-' ? null : Number(match[4]) });\n }\n return entries;\n}\nfunction entryBytes(entry) {\n if (!entry) return Buffer.alloc(0);\n if (entry.type !== 'blob' || entry.size === null || entry.size > 200000) return null;\n return runGit(['cat-file', 'blob', entry.sha], null);\n}\nfunction text(data) {\n if (data === null) return { content: null, binary: false };\n if (data.includes(0)) return { content: null, binary: true };\n try { return { content: new TextDecoder('utf-8', { fatal: true }).decode(data), binary: false }; }\n catch { return { content: null, binary: true }; }\n}\ntry {\n if (fs.realpathSync(root) !== root || !fs.lstatSync(path.join(root, '.git')).isDirectory()) throw new Error('Workspace checkout unavailable');\n if (!/^[a-f0-9]{40,64}$/u.test(input.headSha) || git(['rev-parse', '--verify', input.headSha + '^{commit}']).trim() !== input.headSha) throw new Error('Invalid branch head');\n const base = new Map(input.tree.map((file) => [file.path, file]));\n const head = tree(input.headSha);\n const paths = [...new Set([...base.keys(), ...head.keys()])].sort();\n const files = [];\n let truncated = false, bytes = 0;\n for (const p of paths) {\n if (!safe(p)) throw new Error('Invalid repository path');\n if (Date.now() - started > 15000 || files.length >= 200) { truncated = true; break; }\n const before = base.get(p);\n const after = head.get(p);\n if (before && after && before.sha === after.sha && before.mode === after.mode) continue;\n const decoded = text(entryBytes(after));\n if (decoded.content !== null) bytes += Buffer.byteLength(decoded.content);\n const omitted = Boolean(after && decoded.content === null && !decoded.binary) || bytes > 2000000 || before?.mode === '160000' || after?.mode === '160000';\n files.push({ path: p, oldMode: before?.mode ?? null, newMode: after?.mode ?? null, oldSha: before?.sha ?? null, newSha: after?.sha ?? null, content: omitted ? null : decoded.content, binary: decoded.binary, omitted });\n if (bytes > 2000000) truncated = true;\n }\n process.stdout.write(JSON.stringify({ files, truncated }));\n} catch (error) {\n process.stderr.write('Workspace inspection failed\\n');\n process.exitCode = 1;\n}\n`;\n"],"mappings":";;;AAGA,MAAa,0BAA0B,EAAE,OAAO;CAC9C,WAAW,EAAE,QAAQ;CACrB,OAAO,EACJ,MACC,EAAE,OAAO;EACP,MAAM,EAAE,OAAO;EACf,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;EAC7B,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;EAC7B,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;EAC5B,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;EAC5B,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,GAAO,CAAC,CAAC,SAAS;EAC1C,QAAQ,EAAE,QAAQ;EAClB,SAAS,EAAE,QAAQ;CACrB,CAAC,CACH,CAAC,CACA,IAAI,GAAG,CAAC,CACR,SAAS;AACd,CAAC;;;;;AASD,MAAa,0BAA0B,OAAO,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,95 +1,180 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/factory",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Schema, state machines, and kernel primitives for Agent Factory.",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
5
8
|
"type": "module",
|
|
6
9
|
"sideEffects": false,
|
|
7
10
|
"main": "./dist/index.mjs",
|
|
8
11
|
"types": "./dist/index.d.mts",
|
|
9
12
|
"exports": {
|
|
10
|
-
"./api": {
|
|
11
|
-
"types": "./dist/api.d.mts",
|
|
12
|
-
"import": "./dist/api.mjs"
|
|
13
|
-
},
|
|
14
13
|
".": {
|
|
15
14
|
"types": "./dist/index.d.mts",
|
|
16
15
|
"import": "./dist/index.mjs",
|
|
17
16
|
"default": "./dist/index.mjs"
|
|
18
17
|
},
|
|
18
|
+
"./tasks": {
|
|
19
|
+
"types": "./dist/tasks.d.mts",
|
|
20
|
+
"import": "./dist/tasks.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./workflows": {
|
|
23
|
+
"types": "./dist/workflows.d.mts",
|
|
24
|
+
"import": "./dist/workflows.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./execution": {
|
|
27
|
+
"types": "./dist/execution-public.d.mts",
|
|
28
|
+
"import": "./dist/execution-public.mjs"
|
|
29
|
+
},
|
|
30
|
+
"./planning": {
|
|
31
|
+
"types": "./dist/planning/runtime.d.mts",
|
|
32
|
+
"import": "./dist/planning/runtime.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./budgets": {
|
|
35
|
+
"types": "./dist/budgets.d.mts",
|
|
36
|
+
"import": "./dist/budgets.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./signals": {
|
|
39
|
+
"types": "./dist/signals.d.mts",
|
|
40
|
+
"import": "./dist/signals.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./receipts": {
|
|
43
|
+
"types": "./dist/receipts.d.mts",
|
|
44
|
+
"import": "./dist/receipts.mjs"
|
|
45
|
+
},
|
|
46
|
+
"./storage": {
|
|
47
|
+
"types": "./dist/storage.d.mts",
|
|
48
|
+
"import": "./dist/storage.mjs"
|
|
49
|
+
},
|
|
50
|
+
"./storage/blob": {
|
|
51
|
+
"types": "./dist/blob/index.d.mts",
|
|
52
|
+
"import": "./dist/blob/index.mjs"
|
|
53
|
+
},
|
|
54
|
+
"./storage/postgres": {
|
|
55
|
+
"types": "./dist/postgres/index.d.mts",
|
|
56
|
+
"import": "./dist/postgres/index.mjs"
|
|
57
|
+
},
|
|
58
|
+
"./communication": {
|
|
59
|
+
"types": "./dist/communication.d.mts",
|
|
60
|
+
"import": "./dist/communication.mjs"
|
|
61
|
+
},
|
|
62
|
+
"./integrations/deepsec": {
|
|
63
|
+
"types": "./dist/integrations/deepsec.d.mts",
|
|
64
|
+
"import": "./dist/integrations/deepsec.mjs"
|
|
65
|
+
},
|
|
66
|
+
"./integrations/github": {
|
|
67
|
+
"types": "./dist/integrations/github.d.mts",
|
|
68
|
+
"import": "./dist/integrations/github.mjs"
|
|
69
|
+
},
|
|
70
|
+
"./integrations/slack": {
|
|
71
|
+
"types": "./dist/integrations/slack.d.mts",
|
|
72
|
+
"import": "./dist/integrations/slack.mjs"
|
|
73
|
+
},
|
|
74
|
+
"./integrations/vercel": {
|
|
75
|
+
"types": "./dist/integrations/vercel.d.mts",
|
|
76
|
+
"import": "./dist/integrations/vercel.mjs"
|
|
77
|
+
},
|
|
78
|
+
"./client": {
|
|
79
|
+
"types": "./dist/client.d.mts",
|
|
80
|
+
"import": "./dist/client.mjs"
|
|
81
|
+
},
|
|
82
|
+
"./api": {
|
|
83
|
+
"types": "./dist/api.d.mts",
|
|
84
|
+
"import": "./dist/api.mjs"
|
|
85
|
+
},
|
|
19
86
|
"./next": {
|
|
20
87
|
"types": "./dist/build-factory.d.mts",
|
|
21
88
|
"import": "./dist/build-factory.mjs",
|
|
22
89
|
"default": "./dist/build-factory.mjs"
|
|
23
90
|
},
|
|
24
|
-
"./
|
|
25
|
-
"types": "./dist/
|
|
26
|
-
"import": "./dist/
|
|
91
|
+
"./changes": {
|
|
92
|
+
"types": "./dist/changes.d.mts",
|
|
93
|
+
"import": "./dist/changes.mjs"
|
|
27
94
|
},
|
|
28
|
-
"./
|
|
29
|
-
"types": "./dist/
|
|
30
|
-
"import": "./dist/
|
|
95
|
+
"./findings": {
|
|
96
|
+
"types": "./dist/findings.d.mts",
|
|
97
|
+
"import": "./dist/findings.mjs"
|
|
98
|
+
},
|
|
99
|
+
"./code-review": {
|
|
100
|
+
"types": "./dist/code-review.d.mts",
|
|
101
|
+
"import": "./dist/code-review.mjs"
|
|
31
102
|
},
|
|
32
|
-
"./
|
|
33
|
-
"types": "./dist/
|
|
34
|
-
"import": "./dist/
|
|
103
|
+
"./pull-requests": {
|
|
104
|
+
"types": "./dist/pull-requests.d.mts",
|
|
105
|
+
"import": "./dist/pull-requests.mjs"
|
|
35
106
|
},
|
|
36
|
-
"./
|
|
37
|
-
"types": "./dist/
|
|
38
|
-
"import": "./dist/
|
|
107
|
+
"./work-triage": {
|
|
108
|
+
"types": "./dist/work-triage.d.mts",
|
|
109
|
+
"import": "./dist/work-triage.mjs"
|
|
39
110
|
},
|
|
40
|
-
"./
|
|
41
|
-
"types": "./dist/
|
|
42
|
-
"import": "./dist/
|
|
111
|
+
"./delivery-metrics": {
|
|
112
|
+
"types": "./dist/delivery-metrics.d.mts",
|
|
113
|
+
"import": "./dist/delivery-metrics.mjs"
|
|
43
114
|
},
|
|
44
|
-
"./
|
|
45
|
-
"types": "./dist/
|
|
46
|
-
"import": "./dist/
|
|
115
|
+
"./presets/software-development": {
|
|
116
|
+
"types": "./dist/presets/software-development.d.mts",
|
|
117
|
+
"import": "./dist/presets/software-development.mjs",
|
|
118
|
+
"default": "./dist/presets/software-development.mjs"
|
|
47
119
|
},
|
|
48
|
-
"./
|
|
49
|
-
"types": "./dist/
|
|
50
|
-
"import": "./dist/
|
|
120
|
+
"./sandbox": {
|
|
121
|
+
"types": "./dist/sandbox/index.d.mts",
|
|
122
|
+
"import": "./dist/sandbox/index.mjs"
|
|
51
123
|
},
|
|
52
124
|
"./package.json": "./package.json"
|
|
53
125
|
},
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
126
|
+
"dependencies": {
|
|
127
|
+
"diff": "8.0.2"
|
|
128
|
+
},
|
|
129
|
+
"devDependencies": {
|
|
130
|
+
"@ai-sdk/harness": "1.0.108",
|
|
131
|
+
"@ai-sdk/harness-claude-code": "1.0.112",
|
|
132
|
+
"@ai-sdk/sandbox-vercel": "1.0.108",
|
|
133
|
+
"@electric-sql/pglite": "^0.5.7",
|
|
134
|
+
"@types/node": "24.x",
|
|
135
|
+
"@vercel/blob": "^2.8.0",
|
|
136
|
+
"@vercel/sandbox": "2.10.0-beta.0",
|
|
137
|
+
"drizzle-orm": "^0.45.2",
|
|
138
|
+
"eve": "^0.46.1",
|
|
139
|
+
"tsdown": "^0.22.14",
|
|
140
|
+
"typescript": "5.9.3",
|
|
141
|
+
"vitest": "4.1.9",
|
|
142
|
+
"zod": "4.4.3"
|
|
59
143
|
},
|
|
60
144
|
"peerDependencies": {
|
|
145
|
+
"@ai-sdk/harness": "^1.0.0",
|
|
146
|
+
"@ai-sdk/sandbox-vercel": "^1.0.0",
|
|
61
147
|
"@vercel/blob": "^2.6.0",
|
|
148
|
+
"@vercel/sandbox": ">=2.10.0-beta.0 <4",
|
|
62
149
|
"drizzle-orm": "^0.45.0",
|
|
63
150
|
"eve": "^0.46.0",
|
|
64
151
|
"zod": "^4.4.3"
|
|
65
152
|
},
|
|
66
153
|
"peerDependenciesMeta": {
|
|
154
|
+
"@ai-sdk/harness": {
|
|
155
|
+
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"@ai-sdk/sandbox-vercel": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
67
160
|
"@vercel/blob": {
|
|
68
161
|
"optional": true
|
|
69
162
|
},
|
|
70
|
-
"
|
|
163
|
+
"@vercel/sandbox": {
|
|
71
164
|
"optional": true
|
|
72
165
|
},
|
|
73
|
-
"
|
|
166
|
+
"drizzle-orm": {
|
|
74
167
|
"optional": true
|
|
75
168
|
}
|
|
76
169
|
},
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"@types/node": "24.x",
|
|
80
|
-
"@vercel/blob": "^2.8.0",
|
|
81
|
-
"drizzle-orm": "^0.45.2",
|
|
82
|
-
"eve": "^0.46.1",
|
|
83
|
-
"tsdown": "^0.22.14",
|
|
84
|
-
"typescript": "5.9.3",
|
|
85
|
-
"vitest": "4.1.9",
|
|
86
|
-
"zod": "4.4.3"
|
|
170
|
+
"engines": {
|
|
171
|
+
"node": ">=24"
|
|
87
172
|
},
|
|
88
173
|
"scripts": {
|
|
89
174
|
"build": "tsdown",
|
|
90
175
|
"clean": "rm -rf dist",
|
|
91
176
|
"dead-exports": "knip --directory ../.. --workspace @vercel/factory --exports",
|
|
92
|
-
"lint": "
|
|
177
|
+
"lint": "oxlint --config ../../.oxlintrc.json --max-warnings 0 .",
|
|
93
178
|
"lint:logs": "node ../../scripts/check-structured-logging.mjs src",
|
|
94
179
|
"test": "vitest run",
|
|
95
180
|
"typecheck": "tsc"
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { h as vocabularySchema } from "./id-BLIkCVue.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { createHash } from "node:crypto";
|
|
4
|
-
//#region src/schema/finding.ts
|
|
5
|
-
const findingPrioritySchema = z.enum([
|
|
6
|
-
"P0",
|
|
7
|
-
"P1",
|
|
8
|
-
"P2",
|
|
9
|
-
"P3"
|
|
10
|
-
]).describe("Urgency of a finding: P0 is drop-everything, P3 is nice-to-have.");
|
|
11
|
-
const findingCategorySchema = z.enum([
|
|
12
|
-
"security",
|
|
13
|
-
"correctness",
|
|
14
|
-
"reliability",
|
|
15
|
-
"performance",
|
|
16
|
-
"compatibility",
|
|
17
|
-
"accessibility",
|
|
18
|
-
"documentation",
|
|
19
|
-
"maintainability",
|
|
20
|
-
"testing",
|
|
21
|
-
"usability"
|
|
22
|
-
]);
|
|
23
|
-
const findingVerificationLevelSchema = z.enum([
|
|
24
|
-
"unverified",
|
|
25
|
-
"supported",
|
|
26
|
-
"confirmed"
|
|
27
|
-
]).describe("How sure the reporter is: unverified = suspected from reading; supported = evidence points to it; confirmed = demonstrated.");
|
|
28
|
-
const findingVerificationMethodSchema = z.enum([
|
|
29
|
-
"code_inspection",
|
|
30
|
-
"static_analysis",
|
|
31
|
-
"manual_reproduction",
|
|
32
|
-
"unit_test",
|
|
33
|
-
"integration_test",
|
|
34
|
-
"e2e_test",
|
|
35
|
-
"runtime_observation",
|
|
36
|
-
"documentation"
|
|
37
|
-
]);
|
|
38
|
-
/**
|
|
39
|
-
* What was done to check the finding. Forces a reporter to distinguish "I
|
|
40
|
-
* think this is a problem" from "I demonstrated it", which is the axis a human
|
|
41
|
-
* approving fixes cares about most.
|
|
42
|
-
*/
|
|
43
|
-
const findingVerificationSchema = z.strictObject({
|
|
44
|
-
level: findingVerificationLevelSchema,
|
|
45
|
-
method: findingVerificationMethodSchema,
|
|
46
|
-
summary: z.string().min(1).max(2e3).describe("What was checked and what it showed."),
|
|
47
|
-
limitations: z.string().min(1).max(2e3).optional().describe("What could not be checked.")
|
|
48
|
-
});
|
|
49
|
-
/** A single problem found in a repository, as a scanner or agent reports it. */
|
|
50
|
-
const findingSchema = z.strictObject({
|
|
51
|
-
title: z.string().min(1).max(200),
|
|
52
|
-
body: z.string().min(1).max(8e3).describe("The problem, its impact, and how to fix it. Markdown."),
|
|
53
|
-
path: z.string().min(1).max(500).optional().describe("Repository-relative file path."),
|
|
54
|
-
line: z.number().int().min(1).optional(),
|
|
55
|
-
endLine: z.number().int().min(1).optional(),
|
|
56
|
-
priority: findingPrioritySchema,
|
|
57
|
-
category: findingCategorySchema,
|
|
58
|
-
verification: findingVerificationSchema,
|
|
59
|
-
tool: z.string().min(1).max(100).optional().describe("Scanner that produced it, e.g. deepsec."),
|
|
60
|
-
ruleId: z.string().min(1).max(200).optional().describe("Scanner rule or check id, when there is one.")
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Stable identity of a finding across scans, used as the signal's delivery id
|
|
64
|
-
* so re-reporting is a no-op instead of a second task. A scanner finding is
|
|
65
|
-
* the same problem when the same tool reports the same rule on the same file;
|
|
66
|
-
* its title is model-written prose and changes between runs, so it is left
|
|
67
|
-
* out. Without a rule id the title is all there is, normalised.
|
|
68
|
-
*/
|
|
69
|
-
function findingFingerprint(repositoryId, finding) {
|
|
70
|
-
const parts = finding.tool !== void 0 && finding.ruleId !== void 0 && finding.path !== void 0 ? [
|
|
71
|
-
repositoryId,
|
|
72
|
-
finding.tool,
|
|
73
|
-
finding.ruleId,
|
|
74
|
-
finding.path
|
|
75
|
-
] : [
|
|
76
|
-
repositoryId,
|
|
77
|
-
finding.tool ?? "",
|
|
78
|
-
finding.ruleId ?? "",
|
|
79
|
-
finding.path ?? "",
|
|
80
|
-
finding.title.trim().toLowerCase().replaceAll(/\s+/gu, " ")
|
|
81
|
-
];
|
|
82
|
-
return createHash("sha256").update(parts.join(" ")).digest("hex").slice(0, 32);
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/approval.ts
|
|
86
|
-
/**
|
|
87
|
-
* One approval rule. Every listed field must match for the rule to apply;
|
|
88
|
-
* absent fields match anything. Rules are evaluated first-match.
|
|
89
|
-
*/
|
|
90
|
-
const approvalRuleSchema = z.strictObject({
|
|
91
|
-
source: vocabularySchema.optional().describe("Signal source, e.g. security_scan or github_issue."),
|
|
92
|
-
kind: vocabularySchema.optional().describe("Task kind, e.g. code_change."),
|
|
93
|
-
priority: z.array(findingPrioritySchema).min(1).optional().describe("Finding priorities the rule applies to."),
|
|
94
|
-
require: z.boolean().describe("Whether matching tasks wait for a human before dispatch.")
|
|
95
|
-
});
|
|
96
|
-
const approvalPolicySchema = z.array(approvalRuleSchema).describe("First-match rules deciding which tasks need a human before they run.");
|
|
97
|
-
/**
|
|
98
|
-
* The default: fixes for security findings wait for a human; everything else
|
|
99
|
-
* runs as it always has. Handoffs between agents (verification) never wait,
|
|
100
|
-
* because a human already approved the work they continue.
|
|
101
|
-
*/
|
|
102
|
-
const defaultApprovalPolicy = [
|
|
103
|
-
{
|
|
104
|
-
kind: "verification",
|
|
105
|
-
require: false
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
source: "security_scan",
|
|
109
|
-
require: true
|
|
110
|
-
},
|
|
111
|
-
{ require: false }
|
|
112
|
-
];
|
|
113
|
-
/**
|
|
114
|
-
* Decide at task-creation time whether a task needs approval. Pure: the answer
|
|
115
|
-
* is stamped on the task and never re-evaluated, so a later policy change
|
|
116
|
-
* cannot silently release work a human was expecting to see.
|
|
117
|
-
*/
|
|
118
|
-
function requiresApproval(policy, subject) {
|
|
119
|
-
for (const rule of policy) {
|
|
120
|
-
if (rule.source !== void 0 && rule.source !== subject.source) continue;
|
|
121
|
-
if (rule.kind !== void 0 && rule.kind !== subject.kind) continue;
|
|
122
|
-
if (rule.priority !== void 0) {
|
|
123
|
-
if (subject.priority === void 0 || !rule.priority.includes(subject.priority)) continue;
|
|
124
|
-
}
|
|
125
|
-
return rule.require;
|
|
126
|
-
}
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
export { findingCategorySchema as a, findingSchema as c, findingVerificationSchema as d, requiresApproval as i, findingVerificationLevelSchema as l, approvalRuleSchema as n, findingFingerprint as o, defaultApprovalPolicy as r, findingPrioritySchema as s, approvalPolicySchema as t, findingVerificationMethodSchema as u };
|
|
131
|
-
|
|
132
|
-
//# sourceMappingURL=approval-JX2Px9IC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"approval-JX2Px9IC.mjs","names":[],"sources":["../src/schema/finding.ts","../src/approval.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { z } from \"zod\";\n\nexport const findingPrioritySchema = z\n .enum([\"P0\", \"P1\", \"P2\", \"P3\"])\n .describe(\"Urgency of a finding: P0 is drop-everything, P3 is nice-to-have.\");\n\nexport const findingCategorySchema = z.enum([\n \"security\",\n \"correctness\",\n \"reliability\",\n \"performance\",\n \"compatibility\",\n \"accessibility\",\n \"documentation\",\n \"maintainability\",\n \"testing\",\n \"usability\",\n]);\n\nexport const findingVerificationLevelSchema = z\n .enum([\"unverified\", \"supported\", \"confirmed\"])\n .describe(\n \"How sure the reporter is: unverified = suspected from reading; supported = evidence points to it; confirmed = demonstrated.\",\n );\n\nexport const findingVerificationMethodSchema = z.enum([\n \"code_inspection\",\n \"static_analysis\",\n \"manual_reproduction\",\n \"unit_test\",\n \"integration_test\",\n \"e2e_test\",\n \"runtime_observation\",\n \"documentation\",\n]);\n\n/**\n * What was done to check the finding. Forces a reporter to distinguish \"I\n * think this is a problem\" from \"I demonstrated it\", which is the axis a human\n * approving fixes cares about most.\n */\nexport const findingVerificationSchema = z.strictObject({\n level: findingVerificationLevelSchema,\n method: findingVerificationMethodSchema,\n summary: z.string().min(1).max(2000).describe(\"What was checked and what it showed.\"),\n limitations: z.string().min(1).max(2000).optional().describe(\"What could not be checked.\"),\n});\n\n/** A single problem found in a repository, as a scanner or agent reports it. */\nexport const findingSchema = z.strictObject({\n title: z.string().min(1).max(200),\n body: z.string().min(1).max(8000).describe(\"The problem, its impact, and how to fix it. Markdown.\"),\n path: z.string().min(1).max(500).optional().describe(\"Repository-relative file path.\"),\n line: z.number().int().min(1).optional(),\n endLine: z.number().int().min(1).optional(),\n priority: findingPrioritySchema,\n category: findingCategorySchema,\n verification: findingVerificationSchema,\n tool: z.string().min(1).max(100).optional().describe(\"Scanner that produced it, e.g. deepsec.\"),\n ruleId: z.string().min(1).max(200).optional().describe(\"Scanner rule or check id, when there is one.\"),\n});\n\nexport type FindingPriority = z.infer<typeof findingPrioritySchema>;\nexport type FindingCategory = z.infer<typeof findingCategorySchema>;\nexport type FindingVerification = z.infer<typeof findingVerificationSchema>;\nexport type Finding = z.infer<typeof findingSchema>;\n\n/**\n * Stable identity of a finding across scans, used as the signal's delivery id\n * so re-reporting is a no-op instead of a second task. A scanner finding is\n * the same problem when the same tool reports the same rule on the same file;\n * its title is model-written prose and changes between runs, so it is left\n * out. Without a rule id the title is all there is, normalised.\n */\nexport function findingFingerprint(repositoryId: string, finding: Finding): string {\n const parts =\n finding.tool !== undefined && finding.ruleId !== undefined && finding.path !== undefined\n ? [repositoryId, finding.tool, finding.ruleId, finding.path]\n : [\n repositoryId,\n finding.tool ?? \"\",\n finding.ruleId ?? \"\",\n finding.path ?? \"\",\n finding.title.trim().toLowerCase().replaceAll(/\\s+/gu, \" \"),\n ];\n return createHash(\"sha256\").update(parts.join(\" \")).digest(\"hex\").slice(0, 32);\n}\n","import { z } from \"zod\";\nimport { vocabularySchema } from \"./schema/common\";\nimport { findingPrioritySchema, type FindingPriority } from \"./schema/finding\";\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.strictObject({\n source: vocabularySchema.optional().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(findingPrioritySchema)\n .min(1)\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\nexport const approvalPolicySchema = z\n .array(approvalRuleSchema)\n .describe(\"First-match rules deciding which tasks need a human before they run.\");\n\nexport type ApprovalRule = z.infer<typeof approvalRuleSchema>;\nexport type ApprovalPolicy = z.infer<typeof approvalPolicySchema>;\n\n/**\n * The default: fixes for security findings wait for a human; everything else\n * runs as it always has. Handoffs between agents (verification) never wait,\n * because a human already approved the work they continue.\n */\nexport const defaultApprovalPolicy: ApprovalPolicy = [\n { kind: \"verification\", require: false },\n { source: \"security_scan\", require: true },\n { require: false },\n];\n\nexport interface ApprovalSubject {\n source?: string;\n kind: string;\n priority?: FindingPriority;\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":";;;;AAGA,MAAa,wBAAwB,EAClC,KAAK;CAAC;CAAM;CAAM;CAAM;AAAI,CAAC,CAAC,CAC9B,SAAS,kEAAkE;AAE9E,MAAa,wBAAwB,EAAE,KAAK;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,iCAAiC,EAC3C,KAAK;CAAC;CAAc;CAAa;AAAW,CAAC,CAAC,CAC9C,SACC,6HACF;AAEF,MAAa,kCAAkC,EAAE,KAAK;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;AAOD,MAAa,4BAA4B,EAAE,aAAa;CACtD,OAAO;CACP,QAAQ;CACR,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS,sCAAsC;CACpF,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,4BAA4B;AAC3F,CAAC;;AAGD,MAAa,gBAAgB,EAAE,aAAa;CAC1C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAChC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS,uDAAuD;CAClG,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,gCAAgC;CACrF,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CACvC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;CAC1C,UAAU;CACV,UAAU;CACV,cAAc;CACd,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,yCAAyC;CAC9F,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,8CAA8C;AACvG,CAAC;;;;;;;;AAcD,SAAgB,mBAAmB,cAAsB,SAA0B;CACjF,MAAM,QACJ,QAAQ,SAAS,KAAA,KAAa,QAAQ,WAAW,KAAA,KAAa,QAAQ,SAAS,KAAA,IAC3E;EAAC;EAAc,QAAQ;EAAM,QAAQ;EAAQ,QAAQ;CAAI,IACzD;EACE;EACA,QAAQ,QAAQ;EAChB,QAAQ,UAAU;EAClB,QAAQ,QAAQ;EAChB,QAAQ,MAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,WAAW,SAAS,GAAG;CAC5D;CACN,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;AAC/E;;;;;;;AC/EA,MAAa,qBAAqB,EAAE,aAAa;CAC/C,QAAQ,iBAAiB,SAAS,CAAC,CAAC,SAAS,oDAAoD;CACjG,MAAM,iBAAiB,SAAS,CAAC,CAAC,SAAS,8BAA8B;CACzE,UAAU,EACP,MAAM,qBAAqB,CAAC,CAC5B,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,yCAAyC;CACrD,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,0DAA0D;AAC1F,CAAC;AAED,MAAa,uBAAuB,EACjC,MAAM,kBAAkB,CAAC,CACzB,SAAS,sEAAsE;;;;;;AAUlF,MAAa,wBAAwC;CACnD;EAAE,MAAM;EAAgB,SAAS;CAAM;CACvC;EAAE,QAAQ;EAAiB,SAAS;CAAK;CACzC,EAAE,SAAS,MAAM;AACnB;;;;;;AAaA,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"}
|
package/dist/budget-DzSiIA4t.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { d as isoDateTimeSchema, m as usdSchema, o as repositoryIdSchema, p as schemaVersionSchema, r as factoryIdSchema } from "./id-BLIkCVue.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
//#region src/schema/repository.ts
|
|
4
|
-
const repositorySlugSchema = z.string().regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\/[a-z0-9._-]+$/).describe("owner/name, lowercase, e.g. acme/web.");
|
|
5
|
-
const repositorySchema = z.strictObject({
|
|
6
|
-
schemaVersion: schemaVersionSchema,
|
|
7
|
-
id: repositoryIdSchema,
|
|
8
|
-
slug: repositorySlugSchema,
|
|
9
|
-
defaultBranch: z.string().min(1).describe("Branch changes land on, usually main."),
|
|
10
|
-
enabled: z.boolean().describe("Whether the factory may work on this repository."),
|
|
11
|
-
dependsOn: z.array(repositorySlugSchema).describe("Slugs of repositories this one consumes, for multi-repo work ordering."),
|
|
12
|
-
devbox: z.strictObject({
|
|
13
|
-
projectId: z.string().min(1),
|
|
14
|
-
teamId: z.string().min(1),
|
|
15
|
-
snapshot: z.string().min(1).optional().describe("Prebuilt snapshot to boot from.")
|
|
16
|
-
}).optional().describe("Devbox execution config. Absent when this repository never uses devboxes."),
|
|
17
|
-
connectedAt: isoDateTimeSchema
|
|
18
|
-
});
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/schema/budget.ts
|
|
21
|
-
const budgetMonthSchema = z.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/);
|
|
22
|
-
const budgetLimitsSchema = z.strictObject({
|
|
23
|
-
totalUsd: usdSchema,
|
|
24
|
-
investigationUsd: usdSchema,
|
|
25
|
-
perTaskReservationUsd: usdSchema,
|
|
26
|
-
warningPercent: z.number().int().min(1).max(100),
|
|
27
|
-
perRepositoryUsd: z.record(repositorySlugSchema, usdSchema).optional()
|
|
28
|
-
});
|
|
29
|
-
const budgetSchema = z.strictObject({
|
|
30
|
-
schemaVersion: schemaVersionSchema,
|
|
31
|
-
factoryId: factoryIdSchema,
|
|
32
|
-
month: budgetMonthSchema,
|
|
33
|
-
limits: budgetLimitsSchema,
|
|
34
|
-
notices: z.strictObject({
|
|
35
|
-
warningAt: isoDateTimeSchema.optional(),
|
|
36
|
-
exhaustedAt: isoDateTimeSchema.optional()
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
//#endregion
|
|
40
|
-
export { repositorySlugSchema as a, repositorySchema as i, budgetMonthSchema as n, budgetSchema as r, budgetLimitsSchema as t };
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=budget-DzSiIA4t.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"budget-DzSiIA4t.mjs","names":[],"sources":["../src/schema/repository.ts","../src/schema/budget.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, schemaVersionSchema } from \"./common\";\nimport { repositoryIdSchema } from \"./id\";\n\nexport const repositorySlugSchema = z\n .string()\n .regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\\/[a-z0-9._-]+$/)\n .describe(\"owner/name, lowercase, e.g. acme/web.\");\n\nexport const repositorySchema = z.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 .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 .optional()\n .describe(\"Devbox execution config. Absent when this repository never uses devboxes.\"),\n connectedAt: isoDateTimeSchema,\n});\n\nexport type RepositorySlug = z.infer<typeof repositorySlugSchema>;\nexport type Repository = z.infer<typeof repositorySchema>;\n","import { z } from \"zod\";\nimport { isoDateTimeSchema, schemaVersionSchema, usdSchema } from \"./common\";\nimport { factoryIdSchema } from \"./id\";\nimport { repositorySlugSchema } from \"./repository\";\n\nexport const budgetMonthSchema = z.string().regex(/^\\d{4}-(0[1-9]|1[0-2])$/);\n\nexport const budgetLimitsSchema = z.strictObject({\n totalUsd: usdSchema,\n investigationUsd: usdSchema,\n perTaskReservationUsd: usdSchema,\n warningPercent: z.number().int().min(1).max(100),\n perRepositoryUsd: z.record(repositorySlugSchema, usdSchema).optional(),\n});\n\nexport const budgetSchema = z.strictObject({\n schemaVersion: schemaVersionSchema,\n factoryId: factoryIdSchema,\n month: budgetMonthSchema,\n limits: budgetLimitsSchema,\n notices: z.strictObject({\n warningAt: isoDateTimeSchema.optional(),\n exhaustedAt: isoDateTimeSchema.optional(),\n }),\n});\n\nexport type BudgetLimits = z.infer<typeof budgetLimitsSchema>;\nexport type Budget = z.infer<typeof budgetSchema>;\n"],"mappings":";;;AAIA,MAAa,uBAAuB,EACjC,OAAO,CAAC,CACR,MAAM,+CAA+C,CAAC,CACtD,SAAS,uCAAuC;AAEnD,MAAa,mBAAmB,EAAE,aAAa;CAC7C,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,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,2EAA2E;CACvF,aAAa;AACf,CAAC;;;ACtBD,MAAa,oBAAoB,EAAE,OAAO,CAAC,CAAC,MAAM,yBAAyB;AAE3E,MAAa,qBAAqB,EAAE,aAAa;CAC/C,UAAU;CACV,kBAAkB;CAClB,uBAAuB;CACvB,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAC/C,kBAAkB,EAAE,OAAO,sBAAsB,SAAS,CAAC,CAAC,SAAS;AACvE,CAAC;AAED,MAAa,eAAe,EAAE,aAAa;CACzC,eAAe;CACf,WAAW;CACX,OAAO;CACP,QAAQ;CACR,SAAS,EAAE,aAAa;EACtB,WAAW,kBAAkB,SAAS;EACtC,aAAa,kBAAkB,SAAS;CAC1C,CAAC;AACH,CAAC"}
|