@vercel/factory 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +307 -1
- package/dist/agent-routes.d.mts +69 -0
- package/dist/agent-routes.mjs +64 -0
- package/dist/agent-routes.mjs.map +1 -0
- package/dist/api-contracts.d.mts +1749 -0
- package/dist/api-contracts.mjs +118 -0
- package/dist/api-contracts.mjs.map +1 -0
- package/dist/api-images.d.mts +30 -0
- package/dist/api-images.mjs +28 -0
- package/dist/api-images.mjs.map +1 -0
- package/dist/api-task-graph.mjs +57 -0
- package/dist/api-task-graph.mjs.map +1 -0
- package/dist/api.d.mts +77 -0
- package/dist/api.mjs +1087 -0
- package/dist/api.mjs.map +1 -0
- package/dist/approval-access.d.mts +39 -0
- package/dist/approval-access.mjs +62 -0
- package/dist/approval-access.mjs.map +1 -0
- package/dist/approval-contracts.d.mts +692 -0
- package/dist/approval-contracts.mjs +27 -0
- package/dist/approval-contracts.mjs.map +1 -0
- package/dist/approval.d.mts +49 -0
- package/dist/approval.mjs +39 -0
- package/dist/approval.mjs.map +1 -0
- package/dist/blob/artifacts.d.mts +37 -0
- package/dist/blob/artifacts.mjs +45 -0
- package/dist/blob/artifacts.mjs.map +1 -0
- package/dist/blob/index.d.mts +44 -8
- package/dist/blob/index.mjs +159 -35
- package/dist/blob/index.mjs.map +1 -1
- package/dist/budget.d.mts +108 -0
- package/dist/budget.mjs +141 -0
- package/dist/budget.mjs.map +1 -0
- package/dist/budgets.d.mts +4 -0
- package/dist/budgets.mjs +4 -0
- package/dist/build-factory.d.mts +6 -4
- package/dist/build-factory.mjs +2 -1
- package/dist/build-factory.mjs.map +1 -1
- package/dist/change-verification/brief.d.mts +9 -0
- package/dist/change-verification/brief.mjs +13 -0
- package/dist/change-verification/brief.mjs.map +1 -0
- package/dist/change-verification/dispatch.d.mts +24 -0
- package/dist/change-verification/dispatch.mjs +45 -0
- package/dist/change-verification/dispatch.mjs.map +1 -0
- package/dist/change-verification/eve-tool.d.mts +60 -0
- package/dist/change-verification/eve-tool.mjs +101 -0
- package/dist/change-verification/eve-tool.mjs.map +1 -0
- package/dist/changes/eve-record-change.d.mts +56 -0
- package/dist/changes/eve-record-change.mjs +97 -0
- package/dist/changes/eve-record-change.mjs.map +1 -0
- package/dist/changes/presentation.d.mts +14 -0
- package/dist/changes.d.mts +23 -0
- package/dist/changes.mjs +29 -0
- package/dist/changes.mjs.map +1 -0
- package/dist/client-events.d.mts +18 -0
- package/dist/client-events.mjs +41 -0
- package/dist/client-events.mjs.map +1 -0
- package/dist/client-stream.d.mts +28 -0
- package/dist/client-stream.mjs +204 -0
- package/dist/client-stream.mjs.map +1 -0
- package/dist/client-transcript.d.mts +41 -0
- package/dist/client-transcript.mjs +229 -0
- package/dist/client-transcript.mjs.map +1 -0
- package/dist/client.d.mts +234 -0
- package/dist/client.mjs +258 -0
- package/dist/client.mjs.map +1 -0
- package/dist/code-review/contracts.d.mts +26 -0
- package/dist/code-review/eve-post-review.d.mts +70 -0
- package/dist/code-review/eve-post-review.mjs +183 -0
- package/dist/code-review/eve-post-review.mjs.map +1 -0
- package/dist/code-review/eve-review-comments.d.mts +64 -0
- package/dist/code-review/eve-review-comments.mjs +159 -0
- package/dist/code-review/eve-review-comments.mjs.map +1 -0
- package/dist/code-review/github-contracts.d.mts +10 -0
- package/dist/code-review/github-reporter.d.mts +44 -0
- package/dist/code-review/github-reporter.mjs +260 -0
- package/dist/code-review/github-reporter.mjs.map +1 -0
- package/dist/code-review/preparation.d.mts +34 -0
- package/dist/code-review/preparation.mjs +23 -0
- package/dist/code-review/preparation.mjs.map +1 -0
- package/dist/code-review/stall.d.mts +17 -0
- package/dist/code-review/stall.mjs +30 -0
- package/dist/code-review/stall.mjs.map +1 -0
- package/dist/code-review.d.mts +6 -0
- package/dist/code-review.mjs +5 -0
- package/dist/communication.d.mts +9 -0
- package/dist/communication.mjs +9 -0
- package/dist/connectors/github.d.mts +26 -0
- package/dist/connectors/github.mjs +55 -0
- package/dist/connectors/github.mjs.map +1 -0
- package/dist/connectors/index.d.mts +35 -2
- package/dist/connectors/index.mjs +4 -26
- package/dist/connectors/index.mjs.map +1 -1
- package/dist/connectors/outbox.d.mts +34 -0
- package/dist/connectors/outbox.mjs +50 -0
- package/dist/connectors/outbox.mjs.map +1 -0
- package/dist/connectors/slack-approval-blocks.mjs +136 -0
- package/dist/connectors/slack-approval-blocks.mjs.map +1 -0
- package/dist/connectors/slack-approvals.d.mts +29 -0
- package/dist/connectors/slack-approvals.mjs +346 -0
- package/dist/connectors/slack-approvals.mjs.map +1 -0
- package/dist/connectors/slack.d.mts +35 -41
- package/dist/connectors/slack.mjs +13 -69
- package/dist/connectors/slack.mjs.map +1 -1
- package/dist/deepsec/eve-tool.d.mts +110 -0
- package/dist/deepsec/eve-tool.mjs +164 -0
- package/dist/deepsec/eve-tool.mjs.map +1 -0
- package/dist/deepsec/finding.d.mts +84 -0
- package/dist/deepsec/finding.mjs +56 -0
- package/dist/deepsec/finding.mjs.map +1 -0
- package/dist/deepsec.d.mts +3 -0
- package/dist/delivery-metrics/metrics.d.mts +93 -0
- package/dist/delivery-metrics/metrics.mjs +200 -0
- package/dist/delivery-metrics/metrics.mjs.map +1 -0
- package/dist/delivery-metrics.d.mts +2 -0
- package/dist/delivery-metrics.mjs +2 -0
- package/dist/dispatch.d.mts +81 -0
- package/dist/dispatch.mjs +140 -0
- package/dist/dispatch.mjs.map +1 -0
- package/dist/errors.d.mts +15 -0
- package/dist/errors.mjs +38 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/eve/index.d.mts +143 -1561
- package/dist/eve/index.mjs +244 -1063
- package/dist/eve/index.mjs.map +1 -1
- package/dist/eve/invoke.d.mts +144 -0
- package/dist/eve/invoke.mjs +241 -0
- package/dist/eve/invoke.mjs.map +1 -0
- package/dist/eve/session-client.d.mts +68 -0
- package/dist/eve/session-client.mjs +131 -0
- package/dist/eve/session-client.mjs.map +1 -0
- package/dist/eve/task-execution.mjs +18 -0
- package/dist/eve/task-execution.mjs.map +1 -0
- package/dist/eve/task-session.d.mts +87 -0
- package/dist/eve/task-session.mjs +203 -0
- package/dist/eve/task-session.mjs.map +1 -0
- package/dist/eve/transcript.d.mts +37 -0
- package/dist/eve/transcript.mjs +65 -0
- package/dist/eve/transcript.mjs.map +1 -0
- package/dist/execution-public.d.mts +8 -0
- package/dist/execution-public.mjs +7 -0
- package/dist/execution.d.mts +75 -0
- package/dist/execution.mjs +153 -0
- package/dist/execution.mjs.map +1 -0
- package/dist/finding-remediation/admission.d.mts +51 -0
- package/dist/finding-remediation/admission.mjs +87 -0
- package/dist/finding-remediation/admission.mjs.map +1 -0
- package/dist/finding-remediation/brief.d.mts +14 -0
- package/dist/finding-remediation/brief.mjs +25 -0
- package/dist/finding-remediation/brief.mjs.map +1 -0
- package/dist/finding-remediation/eve-tool.d.mts +29 -0
- package/dist/finding-remediation/eve-tool.mjs +34 -0
- package/dist/finding-remediation/eve-tool.mjs.map +1 -0
- package/dist/findings/fingerprint.d.mts +14 -0
- package/dist/findings/fingerprint.mjs +28 -0
- package/dist/findings/fingerprint.mjs.map +1 -0
- package/dist/findings.d.mts +6 -0
- package/dist/findings.mjs +6 -0
- package/dist/github-app.d.mts +54 -0
- package/dist/github-app.mjs +121 -0
- package/dist/github-app.mjs.map +1 -0
- package/dist/github-publication.d.mts +198 -0
- package/dist/github-publication.mjs +429 -0
- package/dist/github-publication.mjs.map +1 -0
- package/dist/github-transfer.d.mts +72 -0
- package/dist/github-transfer.mjs +125 -0
- package/dist/github-transfer.mjs.map +1 -0
- package/dist/github.d.mts +406 -2
- package/dist/github.mjs +250 -37
- package/dist/github.mjs.map +1 -1
- package/dist/image-input.d.mts +51 -0
- package/dist/image-input.mjs +63 -0
- package/dist/image-input.mjs.map +1 -0
- package/dist/index.d.mts +14 -314
- package/dist/index.mjs +14 -1124
- package/dist/intake-contracts.d.mts +56 -0
- package/dist/intake-contracts.mjs +33 -0
- package/dist/intake-contracts.mjs.map +1 -0
- package/dist/integrations/deepsec.d.mts +4 -0
- package/dist/integrations/deepsec.mjs +3 -0
- package/dist/integrations/github.d.mts +11 -0
- package/dist/integrations/github.mjs +9 -0
- package/dist/integrations/slack.d.mts +3 -0
- package/dist/integrations/slack.mjs +3 -0
- package/dist/integrations/vercel.d.mts +3 -0
- package/dist/integrations/vercel.mjs +3 -0
- package/dist/merge-resolution/contracts.d.mts +17 -0
- package/dist/merge-resolution/contracts.mjs +19 -0
- package/dist/merge-resolution/contracts.mjs.map +1 -0
- package/dist/merge-resolution/eve-tools.d.mts +46 -0
- package/dist/merge-resolution/eve-tools.mjs +117 -0
- package/dist/merge-resolution/eve-tools.mjs.map +1 -0
- package/dist/multi-repository-changes/coordination.d.mts +49 -0
- package/dist/multi-repository-changes/coordination.mjs +115 -0
- package/dist/multi-repository-changes/coordination.mjs.map +1 -0
- package/dist/planning/cancellation.mjs +82 -0
- package/dist/planning/cancellation.mjs.map +1 -0
- package/dist/planning/configuration.d.mts +23 -0
- package/dist/planning/configuration.mjs +56 -0
- package/dist/planning/configuration.mjs.map +1 -0
- package/dist/planning/contracts.d.mts +136 -0
- package/dist/planning/contracts.mjs +42 -0
- package/dist/planning/contracts.mjs.map +1 -0
- package/dist/planning/dependencies.mjs +44 -0
- package/dist/planning/dependencies.mjs.map +1 -0
- package/dist/planning/effects.mjs +122 -0
- package/dist/planning/effects.mjs.map +1 -0
- package/dist/planning/reconcile.mjs +273 -0
- package/dist/planning/reconcile.mjs.map +1 -0
- package/dist/planning/runtime.d.mts +27 -0
- package/dist/planning/runtime.mjs +25 -0
- package/dist/planning/runtime.mjs.map +1 -0
- package/dist/planning/state.mjs +92 -0
- package/dist/planning/state.mjs.map +1 -0
- package/dist/planning/turns.mjs +262 -0
- package/dist/planning/turns.mjs.map +1 -0
- package/dist/planning/validation.mjs +106 -0
- package/dist/planning/validation.mjs.map +1 -0
- package/dist/postgres/index.d.mts +7 -1
- package/dist/postgres/index.mjs +7 -3
- package/dist/postgres/index.mjs.map +1 -1
- package/dist/presets/software-development/approval.d.mts +14 -0
- package/dist/presets/software-development/approval.mjs +21 -0
- package/dist/presets/software-development/approval.mjs.map +1 -0
- package/dist/presets/software-development/deepsec-brief.d.mts +8 -0
- package/dist/presets/software-development/deepsec-brief.mjs +14 -0
- package/dist/presets/software-development/deepsec-brief.mjs.map +1 -0
- package/dist/presets/software-development/dispatch.d.mts +53 -0
- package/dist/presets/software-development/dispatch.mjs +66 -0
- package/dist/presets/software-development/dispatch.mjs.map +1 -0
- package/dist/presets/software-development/eve-delegation-policy.d.mts +7 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs +34 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs.map +1 -0
- package/dist/presets/software-development/eve.d.mts +18 -0
- package/dist/presets/software-development/eve.mjs +19 -0
- package/dist/presets/software-development/eve.mjs.map +1 -0
- package/dist/presets/software-development/finish-task-policy.d.mts +7 -0
- package/dist/presets/software-development/finish-task-policy.mjs +9 -0
- package/dist/presets/software-development/finish-task-policy.mjs.map +1 -0
- package/dist/presets/software-development/recovery.d.mts +32 -0
- package/dist/presets/software-development/recovery.mjs +120 -0
- package/dist/presets/software-development/recovery.mjs.map +1 -0
- package/dist/presets/software-development/task-communication.d.mts +23 -0
- package/dist/presets/software-development/task-communication.mjs +120 -0
- package/dist/presets/software-development/task-communication.mjs.map +1 -0
- package/dist/presets/software-development.d.mts +9 -0
- package/dist/presets/software-development.mjs +9 -0
- package/dist/pull-requests/contracts.d.mts +72 -0
- package/dist/pull-requests/eve-fetch.d.mts +57 -0
- package/dist/pull-requests/eve-fetch.mjs +151 -0
- package/dist/pull-requests/eve-fetch.mjs.map +1 -0
- package/dist/pull-requests/github-label-manager.d.mts +27 -0
- package/dist/pull-requests/github-label-manager.mjs +40 -0
- package/dist/pull-requests/github-label-manager.mjs.map +1 -0
- package/dist/pull-requests/github-publisher.d.mts +53 -0
- package/dist/pull-requests/github-publisher.mjs +345 -0
- package/dist/pull-requests/github-publisher.mjs.map +1 -0
- package/dist/pull-requests.d.mts +5 -0
- package/dist/pull-requests.mjs +4 -0
- package/dist/receipts.d.mts +4 -0
- package/dist/receipts.mjs +3 -0
- package/dist/repositories.d.mts +18 -0
- package/dist/repositories.mjs +33 -0
- package/dist/repositories.mjs.map +1 -0
- package/dist/sandbox/command.d.mts +18 -0
- package/dist/sandbox/execution-abort.d.mts +16 -0
- package/dist/sandbox/execution-abort.mjs +49 -0
- package/dist/sandbox/execution-abort.mjs.map +1 -0
- package/dist/sandbox/execution-environment.d.mts +25 -0
- package/dist/sandbox/execution-run-ledger.d.mts +115 -0
- package/dist/sandbox/execution-run-ledger.mjs +209 -0
- package/dist/sandbox/execution-run-ledger.mjs.map +1 -0
- package/dist/sandbox/execution.d.mts +54 -0
- package/dist/sandbox/execution.mjs +228 -0
- package/dist/sandbox/execution.mjs.map +1 -0
- package/dist/sandbox/harness-runner.d.mts +79 -0
- package/dist/sandbox/harness-runner.mjs +162 -0
- package/dist/sandbox/harness-runner.mjs.map +1 -0
- package/dist/sandbox/index.d.mts +9 -0
- package/dist/sandbox/index.mjs +7 -0
- package/dist/sandbox/task-environment.d.mts +50 -0
- package/dist/sandbox/task-environment.mjs +140 -0
- package/dist/sandbox/task-environment.mjs.map +1 -0
- package/dist/sandbox/workspace.d.mts +29 -0
- package/dist/sandbox/workspace.mjs +28 -0
- package/dist/sandbox/workspace.mjs.map +1 -0
- package/dist/schema/agent-route.d.mts +22 -0
- package/dist/schema/agent-route.mjs +15 -0
- package/dist/schema/agent-route.mjs.map +1 -0
- package/dist/schema/answer.d.mts +23 -0
- package/dist/schema/answer.mjs +21 -0
- package/dist/schema/answer.mjs.map +1 -0
- package/dist/schema/budget.d.mts +38 -0
- package/dist/schema/budget.mjs +30 -0
- package/dist/schema/budget.mjs.map +1 -0
- package/dist/schema/catalog.mjs +72 -0
- package/dist/schema/catalog.mjs.map +1 -0
- package/dist/schema/change.d.mts +117 -0
- package/dist/schema/change.mjs +68 -0
- package/dist/schema/change.mjs.map +1 -0
- package/dist/schema/common.d.mts +33 -0
- package/dist/{id-DwCihQr4.mjs → schema/common.mjs} +7 -14
- package/dist/schema/common.mjs.map +1 -0
- package/dist/schema/communication.d.mts +52 -0
- package/dist/schema/communication.mjs +35 -0
- package/dist/schema/communication.mjs.map +1 -0
- package/dist/schema/execution.d.mts +101 -0
- package/dist/schema/execution.mjs +86 -0
- package/dist/schema/execution.mjs.map +1 -0
- package/dist/schema/factory-config.d.mts +95 -0
- package/dist/schema/factory-config.mjs +60 -0
- package/dist/schema/factory-config.mjs.map +1 -0
- package/dist/schema/finding.d.mts +125 -0
- package/dist/schema/finding.mjs +67 -0
- package/dist/schema/finding.mjs.map +1 -0
- package/dist/schema/id.d.mts +43 -0
- package/dist/schema/id.mjs +32 -0
- package/dist/schema/id.mjs.map +1 -0
- package/dist/schema/outbox.d.mts +240 -0
- package/dist/schema/outbox.mjs +53 -0
- package/dist/schema/outbox.mjs.map +1 -0
- package/dist/schema/question-route.mjs +16 -0
- package/dist/schema/question-route.mjs.map +1 -0
- package/dist/schema/receipt.d.mts +81 -0
- package/dist/schema/receipt.mjs +94 -0
- package/dist/schema/receipt.mjs.map +1 -0
- package/dist/schema/repository.d.mts +26 -0
- package/dist/schema/repository.mjs +25 -0
- package/dist/schema/repository.mjs.map +1 -0
- package/dist/schema/session.d.mts +135 -0
- package/dist/schema/session.mjs +53 -0
- package/dist/schema/session.mjs.map +1 -0
- package/dist/schema/signal.d.mts +105 -0
- package/dist/schema/signal.mjs +81 -0
- package/dist/schema/signal.mjs.map +1 -0
- package/dist/schema/stored-session.mjs +10 -0
- package/dist/schema/stored-session.mjs.map +1 -0
- package/dist/schema/stored-task.mjs +20 -0
- package/dist/schema/stored-task.mjs.map +1 -0
- package/dist/schema/task-effect.d.mts +39 -0
- package/dist/schema/task-effect.mjs +29 -0
- package/dist/schema/task-effect.mjs.map +1 -0
- package/dist/schema/task-graph.d.mts +3134 -0
- package/dist/schema/task-graph.mjs +97 -0
- package/dist/schema/task-graph.mjs.map +1 -0
- package/dist/schema/task-message.d.mts +254 -0
- package/dist/schema/task-message.mjs +189 -0
- package/dist/schema/task-message.mjs.map +1 -0
- package/dist/schema/task.d.mts +272 -0
- package/dist/schema/task.mjs +199 -0
- package/dist/schema/task.mjs.map +1 -0
- package/dist/schema/transcript.d.mts +170 -0
- package/dist/schema/transcript.mjs +86 -0
- package/dist/schema/transcript.mjs.map +1 -0
- package/dist/schema/transitions.d.mts +50 -0
- package/dist/schema/transitions.mjs +303 -0
- package/dist/schema/transitions.mjs.map +1 -0
- package/dist/schema/work.d.mts +101 -0
- package/dist/schema/work.mjs +102 -0
- package/dist/schema/work.mjs.map +1 -0
- package/dist/signal-triage.d.mts +20 -0
- package/dist/signal-triage.mjs +85 -0
- package/dist/signal-triage.mjs.map +1 -0
- package/dist/signals.d.mts +19 -0
- package/dist/signals.mjs +19 -0
- package/dist/signals.mjs.map +1 -0
- package/dist/stall.d.mts +38 -0
- package/dist/stall.mjs +79 -0
- package/dist/stall.mjs.map +1 -0
- package/dist/storage.d.mts +4 -0
- package/dist/storage.mjs +4 -0
- package/dist/store/driver.d.mts +65 -0
- package/dist/store/driver.mjs +42 -0
- package/dist/store/driver.mjs.map +1 -0
- package/dist/store/engine.d.mts +485 -0
- package/dist/store/engine.mjs +2175 -0
- package/dist/store/engine.mjs.map +1 -0
- package/dist/store/memory.d.mts +7 -0
- package/dist/store/memory.mjs +52 -0
- package/dist/store/memory.mjs.map +1 -0
- package/dist/store/task-effects.d.mts +38 -0
- package/dist/store/task-effects.mjs +118 -0
- package/dist/store/task-effects.mjs.map +1 -0
- package/dist/store/task-graphs.d.mts +60 -0
- package/dist/store/task-graphs.mjs +212 -0
- package/dist/store/task-graphs.mjs.map +1 -0
- package/dist/store/task-messages.d.mts +136 -0
- package/dist/store/task-messages.mjs +475 -0
- package/dist/store/task-messages.mjs.map +1 -0
- package/dist/store/task-work.d.mts +65 -0
- package/dist/store/task-work.mjs +134 -0
- package/dist/store/task-work.mjs.map +1 -0
- package/dist/store/work-notifications.d.mts +19 -0
- package/dist/store/work-notifications.mjs +48 -0
- package/dist/store/work-notifications.mjs.map +1 -0
- package/dist/sweep.d.mts +57 -0
- package/dist/sweep.mjs +143 -0
- package/dist/sweep.mjs.map +1 -0
- package/dist/task-communication.d.mts +35 -0
- package/dist/task-communication.mjs +47 -0
- package/dist/task-communication.mjs.map +1 -0
- package/dist/task-graph-view.d.mts +264 -0
- package/dist/task-graph-view.mjs +17 -0
- package/dist/task-graph-view.mjs.map +1 -0
- package/dist/task-message-processing.d.mts +60 -0
- package/dist/task-message-processing.mjs +200 -0
- package/dist/task-message-processing.mjs.map +1 -0
- package/dist/task-protocols.d.mts +80 -0
- package/dist/task-protocols.mjs +47 -0
- package/dist/task-protocols.mjs.map +1 -0
- package/dist/tasks.d.mts +17 -0
- package/dist/tasks.mjs +17 -0
- package/dist/vercel-git.d.mts +21 -0
- package/dist/vercel-git.mjs +112 -0
- package/dist/vercel-git.mjs.map +1 -0
- package/dist/vercel.d.mts +33 -2
- package/dist/vercel.mjs +48 -3
- package/dist/vercel.mjs.map +1 -1
- package/dist/work-triage/eve-tool.d.mts +29 -0
- package/dist/work-triage/eve-tool.mjs +32 -0
- package/dist/work-triage/eve-tool.mjs.map +1 -0
- package/dist/work-triage/find-existing-work.d.mts +32 -0
- package/dist/work-triage/find-existing-work.mjs +31 -0
- package/dist/work-triage/find-existing-work.mjs.map +1 -0
- package/dist/work-triage/github.d.mts +15 -0
- package/dist/work-triage/github.mjs +14 -0
- package/dist/work-triage/github.mjs.map +1 -0
- package/dist/work-triage.d.mts +3 -0
- package/dist/work-triage.mjs +3 -0
- package/dist/workflows.d.mts +48 -0
- package/dist/workflows.mjs +86 -0
- package/dist/workflows.mjs.map +1 -0
- package/dist/workspace-diff-assembly.d.mts +33 -0
- package/dist/workspace-diff-assembly.mjs +95 -0
- package/dist/workspace-diff-assembly.mjs.map +1 -0
- package/dist/workspace-diff.d.mts +90 -0
- package/dist/workspace-diff.mjs +61 -0
- package/dist/workspace-diff.mjs.map +1 -0
- package/dist/workspace-snapshot.d.mts +26 -0
- package/dist/workspace-snapshot.mjs +80 -0
- package/dist/workspace-snapshot.mjs.map +1 -0
- package/package.json +129 -40
- package/dist/approval-CwhTP1XB.mjs +0 -269
- package/dist/approval-CwhTP1XB.mjs.map +0 -1
- package/dist/change-CzEAoFVE.mjs +0 -620
- package/dist/change-CzEAoFVE.mjs.map +0 -1
- package/dist/dispatch-B77cuPxh.d.mts +0 -713
- package/dist/driver-BJutB0PE.d.mts +0 -34
- package/dist/driver-Bbd25rNM.mjs +0 -23
- package/dist/driver-Bbd25rNM.mjs.map +0 -1
- package/dist/factory-config-BJcjsPKl.mjs +0 -86
- package/dist/factory-config-BJcjsPKl.mjs.map +0 -1
- package/dist/factory-config-D2yU3G0c.d.mts +0 -58
- package/dist/github-DXsxboUL.d.mts +0 -271
- package/dist/id-DwCihQr4.mjs.map +0 -1
- package/dist/index-Cy4jfXh5.d.mts +0 -67
- package/dist/index.mjs.map +0 -1
- package/dist/signal-CHVEmzvI.d.mts +0 -59
package/README.md
CHANGED
|
@@ -5,8 +5,314 @@ persistence, agent tools, and provider adapters for durable, auditable software
|
|
|
5
5
|
|
|
6
6
|
The FDK extends Eve incrementally. Durable workflows retain authority over policy, budgets,
|
|
7
7
|
state transitions, retries, and external effects while agents and coding harnesses return bounded
|
|
8
|
-
results. The V1 reference runtime uses
|
|
8
|
+
results. The V1 reference runtime uses Blob, AI SDK `HarnessAgent`, and Vercel Sandbox,
|
|
9
9
|
with independent verification and human-owned merges.
|
|
10
10
|
|
|
11
11
|
See the [repository README](../../README.md) for development instructions and the
|
|
12
12
|
[architecture](../../docs/factory-architecture.md) for the complete contract.
|
|
13
|
+
|
|
14
|
+
## Public import paths
|
|
15
|
+
|
|
16
|
+
Use the narrowest capability entry point that owns an API. This keeps optional integrations and
|
|
17
|
+
browser/server boundaries visible and keeps dependencies aligned with the capability in use.
|
|
18
|
+
|
|
19
|
+
Factory targets Eve agents, and `eve` is a required peer dependency. Eve-specific APIs live with
|
|
20
|
+
their semantic owner instead of under a parallel `/eve` namespace.
|
|
21
|
+
|
|
22
|
+
| Import path | Use for |
|
|
23
|
+
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
24
|
+
| `@vercel/factory` | Configuration, shared primitives, and generic Eve sessions, hooks, and Task tools |
|
|
25
|
+
| `@vercel/factory/tasks` | Tasks, graphs, messages, effects, and their stores |
|
|
26
|
+
| `@vercel/factory/workflows` | Workflow definitions, work contracts, and agent routes |
|
|
27
|
+
| `@vercel/factory/execution` | Provider-neutral dispatch, execution lifecycle, and sweeps |
|
|
28
|
+
| `@vercel/factory/planning` | Provider-neutral planner contracts and runtime |
|
|
29
|
+
| `@vercel/factory/budgets` | Budget schemas, capacity policy, settlement, and maintenance sweeps |
|
|
30
|
+
| `@vercel/factory/signals` | Signal records, intake creation, decisions, and lifecycle |
|
|
31
|
+
| `@vercel/factory/receipts` | Immutable audit records, costs, identifiers, and append inputs |
|
|
32
|
+
| `@vercel/factory/storage`, `/storage/blob`, `/storage/postgres` | Store engine and optional persistence adapters |
|
|
33
|
+
| `@vercel/factory/communication` | Inbound normalization, routing, and outbox contracts |
|
|
34
|
+
| `@vercel/factory/client`, `/api`, `/next` | Browser client, server handlers, and Next.js integration |
|
|
35
|
+
| `@vercel/factory/changes` | Change lifecycle, verification, and multi-repository coordination |
|
|
36
|
+
| `@vercel/factory/findings` | Finding records, remediation, fingerprints, and agent reporting |
|
|
37
|
+
| `@vercel/factory/code-review` | Review policy, contracts, and agent tools |
|
|
38
|
+
| `@vercel/factory/pull-requests` | Publication and merge-conflict contracts and tools |
|
|
39
|
+
| `@vercel/factory/work-triage` | Existing-work lookup and its agent tool |
|
|
40
|
+
| `@vercel/factory/delivery-metrics` | Delivery ledger metrics and repository health |
|
|
41
|
+
| `@vercel/factory/presets/software-development` | Supplied software-development policy and Eve composition |
|
|
42
|
+
| `@vercel/factory/integrations/github` | GitHub API helpers and communication, review, publication, label, and triage adapters |
|
|
43
|
+
| `@vercel/factory/integrations/slack` | Slack communication delivery adapter |
|
|
44
|
+
| `@vercel/factory/integrations/deepsec` | DeepSec normalization and its Eve scanner tool |
|
|
45
|
+
| `@vercel/factory/integrations/vercel` | Vercel Queue and trusted Git transport adapters |
|
|
46
|
+
| `@vercel/factory/sandbox` | Optional isolated execution integration |
|
|
47
|
+
|
|
48
|
+
The package root owns common configuration, cross-cutting primitives, and generic Eve integration
|
|
49
|
+
that have no narrower capability owner. This package is pre-1.0: replaced paths and names are
|
|
50
|
+
removed during alpha API cleanup rather than retained as deprecated aliases. Each public
|
|
51
|
+
declaration has one canonical owner. The browser client and server API re-export shared HTTP wire
|
|
52
|
+
contracts at both consumption boundaries from the same source declarations.
|
|
53
|
+
|
|
54
|
+
Ordinary public values and functions use `camelCase`; type-like declarations, constructors, and UI
|
|
55
|
+
components use `PascalCase`; fixed constant-style values may use `UPPER_CASE`. Schemas use a
|
|
56
|
+
`thingSchema` / `Thing` pair; configuration objects, operation results, and error classes use
|
|
57
|
+
`*Options`, `*Result`, and `*Error`. Factories use `create*`, while declarative validators and
|
|
58
|
+
registries use `define*`. Provider and protocol payload keys retain their required wire spelling.
|
|
59
|
+
Oxlint is the repository's sole JavaScript and TypeScript linter and enforces the allowed
|
|
60
|
+
identifier shapes. Declaration-specific casing follows the conventions above in code and review.
|
|
61
|
+
|
|
62
|
+
## Reusable runtime integration
|
|
63
|
+
|
|
64
|
+
The package root exposes provider-neutral integration helpers that have no narrower capability owner:
|
|
65
|
+
|
|
66
|
+
- `repositoryIdForSlug` and `ensureConfiguredRepository` provide deterministic repository identity
|
|
67
|
+
and allowlist-bound admission. The caller supplies normalized `defaultBranch` and `dependsOn`
|
|
68
|
+
metadata from its own configuration; the package does not infer either value.
|
|
69
|
+
- `redactedErrorMessage` and `redactedErrorDetails` remove common credential forms and supplied
|
|
70
|
+
secret values from diagnostics.
|
|
71
|
+
|
|
72
|
+
The supplied software-development runtime is an explicit composition rather than part of the
|
|
73
|
+
kernel. Domain operations and their Eve tools live under their owning capability paths. The
|
|
74
|
+
`@vercel/factory/presets/software-development` entry point contains the supplied approval,
|
|
75
|
+
completion, communication, recovery, dispatch, and delegation behavior plus the DeepSec scan brief.
|
|
76
|
+
It also composes generic Task tools with the Change outcome tool. Applications inject repository
|
|
77
|
+
policy, planner behavior, launchers, credentials, budget, wakeup publication, and retry and batch
|
|
78
|
+
limits.
|
|
79
|
+
|
|
80
|
+
Capability APIs use their semantic owner paths, while external-provider APIs stay opt-in under
|
|
81
|
+
`@vercel/factory/integrations/<provider>`:
|
|
82
|
+
|
|
83
|
+
- `@vercel/factory` binds Task or conversation scope to authenticated Eve sessions through
|
|
84
|
+
semantic readers, owns the generic start, forward, cancel, and completed-turn lifecycle, and
|
|
85
|
+
supplies generic delegation and Task tools. It also materializes browser-safe transcript
|
|
86
|
+
projections through injected origin and header policy.
|
|
87
|
+
- Capability entry points expose agent tools beside the corresponding domain operation. For
|
|
88
|
+
example, `@vercel/factory/changes` records a Change and `@vercel/factory/code-review` exposes
|
|
89
|
+
review tools. The software-development preset composes the common Task and Change tools.
|
|
90
|
+
- Provider-specific Eve tool factories that implement a Factory capability stay on that
|
|
91
|
+
capability path and identify the provider in their symbol name.
|
|
92
|
+
- `@vercel/factory/storage/blob` includes content-addressed, Task-bound artifact storage with digest
|
|
93
|
+
verification in addition to the Blob store driver. Applications inject or namespace its narrow
|
|
94
|
+
Blob client when one project contains multiple factory state domains.
|
|
95
|
+
- `@vercel/factory/sandbox` supplies the retry-safe execution ledger, abort propagation, harness
|
|
96
|
+
continuation adapter, workspace contract, and scoped Vercel Sandbox lifecycle. Applications
|
|
97
|
+
inject prompt construction, evidence interpretation, pricing, credentials, repository seeding,
|
|
98
|
+
and the configured harness/model registry.
|
|
99
|
+
- `@vercel/factory/integrations/github` normalizes addressed review comments, question replies,
|
|
100
|
+
and repository identity alongside the GitHub API helpers. It also validates GitHub App token
|
|
101
|
+
scope; supplies bounded committed-tree publication, a Git Data/pull-request client, and checkout
|
|
102
|
+
primitives; and owns the standalone GitHub adapters for communication delivery, review
|
|
103
|
+
reporting, pull-request publication and labels, and existing-work triage. Applications still
|
|
104
|
+
choose credentials and authorize repositories.
|
|
105
|
+
- `@vercel/factory/integrations/slack` delivers communication events through an injected Slack
|
|
106
|
+
client.
|
|
107
|
+
- `@vercel/factory/integrations/deepsec` owns DeepSec output normalization and its provider-centric
|
|
108
|
+
Eve scanner tool.
|
|
109
|
+
- `@vercel/factory/integrations/vercel` configures hosted Vercel Queue wakeups. It validates
|
|
110
|
+
messages, provides stable idempotency keys and fixture isolation, and exports
|
|
111
|
+
`createVercelGitHubGitTransport` to read and publish Git bundles through fresh trusted sandboxes,
|
|
112
|
+
keeping credentials out of agent sandboxes.
|
|
113
|
+
Reads require read-only tokens; bundles include full history with a 50 MiB limit.
|
|
114
|
+
The application supplies queue transport, logging, and repository-scoped credentials.
|
|
115
|
+
- `@vercel/factory/api` exports the bounded sandbox snapshot and workspace-diff assembly used by
|
|
116
|
+
optional inspection adapters; sandbox discovery, base-blob retrieval, and repository
|
|
117
|
+
authorization remain application-owned.
|
|
118
|
+
|
|
119
|
+
These APIs deliberately stop before application policy: configured repositories, credentials,
|
|
120
|
+
agent routes, budgets, prompts, approval rules, and provider account choices remain in the concrete
|
|
121
|
+
factory.
|
|
122
|
+
|
|
123
|
+
The communication and execution capabilities supply policy injection points such as
|
|
124
|
+
`createTaskCommunicationReconciler` and the stall sweep's optional cancellation callback. Omitting
|
|
125
|
+
`approval` from the configuration selects a neutral allow-by-default policy; factories should
|
|
126
|
+
select a policy explicitly. A software factory opts into
|
|
127
|
+
`defaultSoftwareDevelopmentApprovalPolicy`, the supplied delegation and completion policies, and
|
|
128
|
+
the software presentation and dispatch behavior from
|
|
129
|
+
`@vercel/factory/presets/software-development`. Generated projects make those choices explicitly.
|
|
130
|
+
|
|
131
|
+
Every Task requires `work` (title, bounded JSON input, completion criteria, exact workflow
|
|
132
|
+
ID/version, and optional exact agent route), plus engine-owned root and parent membership.
|
|
133
|
+
`taskWork` defaults to the generic `task@1` JSON contract; explicit workflow registrations supply
|
|
134
|
+
Zod input/output contracts. `stores.graphs` owns per-root dependencies, and `stores.work.complete`
|
|
135
|
+
records validated output. Task kind is descriptive, not execution or success authority.
|
|
136
|
+
|
|
137
|
+
`stores.messages` and `processTaskMessage` provide authorized immutable messages, bounded inbox
|
|
138
|
+
leases, and durable decisions before idempotent effects. Access defaults to deny; supplied
|
|
139
|
+
assignment/handoff protocols and task-bound policy require explicit application configuration.
|
|
140
|
+
These are direct trusted APIs, not HTTP endpoints or an enabled recursive planner. See the
|
|
141
|
+
[Task contract](../../docs/factory-architecture.md#task) for bounds, recovery, and race limitations.
|
|
142
|
+
|
|
143
|
+
This is a breaking Task contract with no compatibility path. Old stored Task snapshots fail the
|
|
144
|
+
new required schema validation; there is no separate legacy-rejection mechanism. No live data is changed by this source update; rollout must explicitly
|
|
145
|
+
choose data migration or reset before deployment.
|
|
146
|
+
|
|
147
|
+
## Local Task primitives
|
|
148
|
+
|
|
149
|
+
Copy the following three blocks together into a TypeScript ES module with top-level await. This isolated example
|
|
150
|
+
uses an in-memory driver and a synthetic repository ID: no model, provider, HTTP endpoint, or live
|
|
151
|
+
planner is called. Production applications supply persistent storage and authenticated principals;
|
|
152
|
+
never derive a principal's Task binding from a message payload.
|
|
153
|
+
|
|
154
|
+
### Register a workflow
|
|
155
|
+
|
|
156
|
+
`taskWork({ title, input })` constructs generic `task@1` work. A custom contract requires explicit
|
|
157
|
+
registration and an exact binding; including `defaultTaskWorkflow` keeps generic work available
|
|
158
|
+
in the same registry. Registration alone starts nothing.
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
import { z } from "zod";
|
|
162
|
+
import {
|
|
163
|
+
assignmentPayloadSchema,
|
|
164
|
+
assignmentTaskMessageProtocol,
|
|
165
|
+
createDefaultTaskMessageProtocols,
|
|
166
|
+
processTaskMessage,
|
|
167
|
+
taskBoundMessagePolicy,
|
|
168
|
+
} from "@vercel/factory/tasks";
|
|
169
|
+
import { createInMemoryDriver, createStores } from "@vercel/factory/storage";
|
|
170
|
+
import {
|
|
171
|
+
defaultTaskWorkflow,
|
|
172
|
+
defineWorkflow,
|
|
173
|
+
defineWorkflows,
|
|
174
|
+
taskWork,
|
|
175
|
+
} from "@vercel/factory/workflows";
|
|
176
|
+
|
|
177
|
+
const countWords = defineWorkflow({
|
|
178
|
+
id: "word-count",
|
|
179
|
+
version: 1,
|
|
180
|
+
input: z.strictObject({ text: z.string().min(1).describe("Text to count.") }),
|
|
181
|
+
output: z.strictObject({ words: z.number().int().nonnegative().describe("Word count.") }),
|
|
182
|
+
});
|
|
183
|
+
const driver = createInMemoryDriver();
|
|
184
|
+
const stores = createStores({
|
|
185
|
+
driver,
|
|
186
|
+
workflows: defineWorkflows([defaultTaskWorkflow, countWords]),
|
|
187
|
+
messages: { protocols: createDefaultTaskMessageProtocols(), authorize: taskBoundMessagePolicy },
|
|
188
|
+
});
|
|
189
|
+
const scope = { repositoryIds: ["repo_example"], replyTo: { channel: "local", address: "demo" } };
|
|
190
|
+
const parent = await stores.tasks.create({
|
|
191
|
+
...scope,
|
|
192
|
+
kind: "analysis",
|
|
193
|
+
origin: { operator: "local:demo" },
|
|
194
|
+
work: taskWork({ title: "Count words in supplied text" }),
|
|
195
|
+
dedupeKey: "demo:root",
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Create children and canonical dependencies
|
|
200
|
+
|
|
201
|
+
The engine derives each child's root from its one parent. Dependencies belong to `stores.graphs`,
|
|
202
|
+
not Task snapshots. Editing requires the observed graph revision and a queued, unsealed Task.
|
|
203
|
+
Transitioning to running seals edges and requires every prerequisite to have succeeded.
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
const childScope = { ...scope, origin: {}, parentTaskId: parent.id };
|
|
207
|
+
const preparation = await stores.tasks.create({
|
|
208
|
+
...childScope,
|
|
209
|
+
kind: "analysis",
|
|
210
|
+
work: taskWork({ title: "Prepare input" }),
|
|
211
|
+
dedupeKey: "demo:prepare",
|
|
212
|
+
});
|
|
213
|
+
const worker = await stores.tasks.create({
|
|
214
|
+
...childScope,
|
|
215
|
+
kind: "analysis",
|
|
216
|
+
dedupeKey: "demo:count",
|
|
217
|
+
work: {
|
|
218
|
+
...taskWork({
|
|
219
|
+
title: "Count words",
|
|
220
|
+
input: { text: "Hello from Factory" },
|
|
221
|
+
workflow: countWords,
|
|
222
|
+
}),
|
|
223
|
+
completionCriteria: ["Return the number of whitespace-separated words"],
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
const graph = await stores.graphs.get(parent.rootTaskId);
|
|
227
|
+
if (!graph) throw new Error("Task graph must exist after admission");
|
|
228
|
+
await stores.graphs.setDependencies({
|
|
229
|
+
rootTaskId: parent.rootTaskId,
|
|
230
|
+
taskId: worker.id,
|
|
231
|
+
dependencies: [preparation.id],
|
|
232
|
+
expectedRevision: graph.revision,
|
|
233
|
+
});
|
|
234
|
+
await stores.tasks.transition(parent.id, "running");
|
|
235
|
+
await stores.work.waitForMessages({
|
|
236
|
+
task: { taskId: parent.id, attempt: parent.attempt },
|
|
237
|
+
phase: "children",
|
|
238
|
+
});
|
|
239
|
+
await stores.tasks.transition(preparation.id, "running");
|
|
240
|
+
await stores.work.complete({
|
|
241
|
+
task: { taskId: preparation.id, attempt: preparation.attempt },
|
|
242
|
+
output: { prepared: true },
|
|
243
|
+
});
|
|
244
|
+
await stores.tasks.transition(worker.id, "running");
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
These Tasks have no agent route: local workflow code owns execution. For agent work,
|
|
248
|
+
`routeTaskWork({ route, title, input })` adds an exact route but still selects generic `task@1`.
|
|
249
|
+
For typed agent work, add `route: parseAgentRouteBinding({ id, version })` to work constructed with
|
|
250
|
+
the custom workflow binding, or use the exact route returned by a registry. See the
|
|
251
|
+
[route example](../../docs/factory-architecture.md#task); recovery must use that exact route, not
|
|
252
|
+
kind or latest version.
|
|
253
|
+
|
|
254
|
+
### Send and process one message
|
|
255
|
+
|
|
256
|
+
The explicit policy above permits parent-child sends and recipient-local processing, not discard.
|
|
257
|
+
Stable operation IDs deduplicate sends. `processTaskMessage` stores a validated decision before
|
|
258
|
+
`apply`; this example's only effect is idempotent Task completion with that output.
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
await stores.messages.send({
|
|
262
|
+
principal: { id: "local:parent", taskId: parent.id },
|
|
263
|
+
message: {
|
|
264
|
+
operationId: "assign-count",
|
|
265
|
+
fromTaskId: parent.id,
|
|
266
|
+
toTaskId: worker.id,
|
|
267
|
+
expectAttempt: parent.attempt,
|
|
268
|
+
type: assignmentTaskMessageProtocol.binding,
|
|
269
|
+
payload: { instructions: "Count the words in your work input." },
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
const result = await processTaskMessage({
|
|
273
|
+
stores,
|
|
274
|
+
principal: { id: "local:worker", taskId: worker.id },
|
|
275
|
+
task: { taskId: worker.id, attempt: worker.attempt },
|
|
276
|
+
leaseMs: 30_000,
|
|
277
|
+
workflow: countWords.binding,
|
|
278
|
+
protocol: assignmentTaskMessageProtocol,
|
|
279
|
+
decisionSchema: countWords.output,
|
|
280
|
+
async decide({ task, message }) {
|
|
281
|
+
if (message.type.id !== "assignment" || message.type.version !== 1) {
|
|
282
|
+
throw new Error("Expected assignment@1");
|
|
283
|
+
}
|
|
284
|
+
assignmentPayloadSchema.parse(message.payload);
|
|
285
|
+
const { text } = countWords.input.parse(task.work.input);
|
|
286
|
+
return { words: text.trim() ? text.trim().split(/\s+/u).length : 0 };
|
|
287
|
+
},
|
|
288
|
+
async apply({ task, decision }) {
|
|
289
|
+
await stores.work.complete({
|
|
290
|
+
task: { taskId: task.id, attempt: task.attempt },
|
|
291
|
+
output: decision,
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
});
|
|
295
|
+
if (result.status === "processed") {
|
|
296
|
+
await stores.work.complete({
|
|
297
|
+
task: { taskId: parent.id, attempt: parent.attempt },
|
|
298
|
+
output: { childTaskId: worker.id, output: result.decision },
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
`idle` means empty or already leased, not necessarily drained. In durable application code, retry
|
|
304
|
+
processing against the same store and stable identities; a whole-script rerun is not a recovery loop.
|
|
305
|
+
External writes in `apply` must honor its `effectKey` (derive stable subkeys for multiple writes).
|
|
306
|
+
Lease assertions cannot fence external systems or eliminate cancellation races. Recovery after
|
|
307
|
+
success/failure requires the exact durable decision; cancelled Tasks cannot replay effects.
|
|
308
|
+
Inboxes hold at most 256 pending messages and leases last at most five minutes. Supplied
|
|
309
|
+
`assignment@1` / `handoff@1` protocols do not install a recursive planner or change lifecycle
|
|
310
|
+
on receipt. Without explicit message configuration, access is denied. See the
|
|
311
|
+
[message contract](../../docs/factory-architecture.md#task-messages) for recovery and discard rules.
|
|
312
|
+
|
|
313
|
+
## Operator clients
|
|
314
|
+
|
|
315
|
+
`@vercel/factory/client` exposes the browser-safe `FactoryClient`, operator request/response
|
|
316
|
+
schemas, durable `taskStates`, `Transcript`, and `followSessionStream`. It is shared by the
|
|
317
|
+
reference web UI and TUI. Supply a fixed factory origin and, for non-browser callers, an async `headers` callback for
|
|
318
|
+
authentication. Server handlers and their dependencies remain under `@vercel/factory/api`.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AgentRouteBinding, AgentRouteBindingInput, agentRouteBindingSchema, parseAgentRouteBinding } from "./schema/agent-route.mjs";
|
|
2
|
+
import { JsonValue, TaskWork } from "./schema/work.mjs";
|
|
3
|
+
import { TaskKind } from "./schema/task.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/agent-routes.d.ts
|
|
6
|
+
/** Validates an exact-version route from workflow work to one configured agent. */
|
|
7
|
+
declare const agentRouteSchema: z.core.$ZodBranded<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
version: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
agent: z.ZodString;
|
|
11
|
+
taskKind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
|
|
12
|
+
description: z.ZodString;
|
|
13
|
+
permissions: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
14
|
+
}, z.core.$strict>, "AgentRouteBinding", "out">;
|
|
15
|
+
/** Canonical `id@version` lookup key for one exact agent route. */
|
|
16
|
+
type AgentRouteKey<Id extends string = string, Version extends number = number> = `${Id}@${Version}`;
|
|
17
|
+
/** Validated immutable route describing an agent, Task kind, purpose, and permissions. */
|
|
18
|
+
type AgentRoute = Readonly<Omit<z.infer<typeof agentRouteSchema>, "permissions"> & {
|
|
19
|
+
readonly permissions: readonly string[];
|
|
20
|
+
}>;
|
|
21
|
+
/** Caller input accepted when registering an agent route, before defaults are applied. */
|
|
22
|
+
interface AgentRouteInput {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly version?: number;
|
|
25
|
+
readonly agent: string;
|
|
26
|
+
readonly taskKind: TaskKind;
|
|
27
|
+
readonly description: string;
|
|
28
|
+
readonly permissions?: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/** Task work with a required exact agent-route binding. */
|
|
31
|
+
type RoutedTaskWork<Input extends JsonValue = JsonValue, Route extends AgentRouteBinding = AgentRouteBinding> = Omit<TaskWork<Input>, "route"> & {
|
|
32
|
+
readonly route: Route;
|
|
33
|
+
};
|
|
34
|
+
/** Named fields for constructing generic work bound to an exact agent route. */
|
|
35
|
+
interface RouteTaskWorkOptions<Route extends AgentRouteBinding = AgentRouteBinding, Input extends JsonValue = JsonValue> {
|
|
36
|
+
readonly route: Route;
|
|
37
|
+
readonly title: string;
|
|
38
|
+
readonly input?: Input;
|
|
39
|
+
readonly workflow?: never;
|
|
40
|
+
readonly completionCriteria?: never;
|
|
41
|
+
}
|
|
42
|
+
/** Produces the canonical `id@version` lookup key for a route binding. */
|
|
43
|
+
declare function routeKey<const Binding extends AgentRouteBinding>(binding: Binding): AgentRouteKey<Binding["id"], Binding["version"]>;
|
|
44
|
+
/** Constructs generic Task work bound to the selected exact agent route. */
|
|
45
|
+
declare function routeTaskWork<const Route extends AgentRouteBinding, const Input extends JsonValue = JsonValue>(options: RouteTaskWorkOptions<Route, Input>): RoutedTaskWork<Input, AgentRouteBinding<Route["id"], Route["version"]>>;
|
|
46
|
+
type RegisteredAgentRoute<Input extends AgentRouteInput> = Input extends AgentRouteInput ? AgentRouteBinding<Input["id"], Input extends {
|
|
47
|
+
readonly version: infer Version extends number;
|
|
48
|
+
} ? Version : 1> & Readonly<Omit<Input, "version" | "permissions"> & {
|
|
49
|
+
readonly version: Input extends {
|
|
50
|
+
readonly version: infer Version extends number;
|
|
51
|
+
} ? Version : 1;
|
|
52
|
+
readonly permissions: readonly string[];
|
|
53
|
+
}> : never;
|
|
54
|
+
/** Immutable registry for exact agent-route lookup and unambiguous admission selection. */
|
|
55
|
+
interface AgentRouteRegistry<out Route extends AgentRoute = AgentRoute> {
|
|
56
|
+
readonly routes: readonly Route[];
|
|
57
|
+
/** Returns only the exact route binding supplied; never defaults a version. */
|
|
58
|
+
get<const Binding extends AgentRouteBinding>(binding: Binding): (Route & Readonly<Binding>) | undefined;
|
|
59
|
+
/** Lists every registered route for a descriptive Task kind in registration order. */
|
|
60
|
+
listForTaskKind<const Kind extends string>(kind: Kind): readonly (Route & {
|
|
61
|
+
readonly taskKind: Kind;
|
|
62
|
+
})[];
|
|
63
|
+
}
|
|
64
|
+
type RegisteredAgentRoutes<Input extends readonly AgentRouteInput[]> = [Input[number]] extends [never] ? AgentRoute : RegisteredAgentRoute<Input[number]>;
|
|
65
|
+
/** Descriptions inform judgment; exact registered bindings remain the authority. */
|
|
66
|
+
declare function defineAgentRoutes<const Input extends readonly AgentRouteInput[]>(inputs: Input): AgentRouteRegistry<RegisteredAgentRoutes<Input>>;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { AgentRoute, type AgentRouteBinding, type AgentRouteBindingInput, AgentRouteInput, AgentRouteKey, AgentRouteRegistry, RouteTaskWorkOptions, RoutedTaskWork, agentRouteBindingSchema, agentRouteSchema, defineAgentRoutes, parseAgentRouteBinding, routeKey, routeTaskWork };
|
|
69
|
+
//# sourceMappingURL=agent-routes.d.mts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { agentRouteBindingSchema, parseAgentRouteBinding } from "./schema/agent-route.mjs";
|
|
2
|
+
import { taskWork } from "./schema/work.mjs";
|
|
3
|
+
import { taskKindSchema } from "./schema/task.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/agent-routes.ts
|
|
6
|
+
/** Validates an exact-version route from workflow work to one configured agent. */
|
|
7
|
+
const agentRouteSchema = z.strictObject({
|
|
8
|
+
id: z.string().regex(/^[a-z][a-z0-9-]{0,63}$/u).describe("Stable route selected by a conversational agent or workflow."),
|
|
9
|
+
version: z.number().int().positive().default(1).describe("Exact version of this agent route; defaults to 1 at registration."),
|
|
10
|
+
agent: z.string().regex(/^[a-z][a-z0-9-]{0,31}$/u).describe("Internally addressable Eve agent that executes this route."),
|
|
11
|
+
taskKind: taskKindSchema.describe("Factory task kind created for this route."),
|
|
12
|
+
description: z.string().min(1).max(500).describe("Model-facing guidance for when this route is appropriate."),
|
|
13
|
+
permissions: z.array(z.string().min(1)).readonly().default([]).describe("Inspectable capabilities granted to the target agent.")
|
|
14
|
+
}).brand();
|
|
15
|
+
/** Produces the canonical `id@version` lookup key for a route binding. */
|
|
16
|
+
function routeKey(binding) {
|
|
17
|
+
return `${binding.id}@${binding.version}`;
|
|
18
|
+
}
|
|
19
|
+
const routeBinding = (route) => Object.freeze(parseAgentRouteBinding({
|
|
20
|
+
id: route.id,
|
|
21
|
+
version: route.version
|
|
22
|
+
}));
|
|
23
|
+
function routeTaskWork(options) {
|
|
24
|
+
const { route, title, input = {} } = options;
|
|
25
|
+
return {
|
|
26
|
+
...taskWork({
|
|
27
|
+
title,
|
|
28
|
+
input
|
|
29
|
+
}),
|
|
30
|
+
route: routeBinding(route)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Descriptions inform judgment; exact registered bindings remain the authority. */
|
|
34
|
+
function defineAgentRoutes(inputs) {
|
|
35
|
+
const routes = Object.freeze(inputs.map((input) => {
|
|
36
|
+
const route = agentRouteSchema.parse(input);
|
|
37
|
+
return Object.freeze({
|
|
38
|
+
...route,
|
|
39
|
+
permissions: Object.freeze([...route.permissions])
|
|
40
|
+
});
|
|
41
|
+
}));
|
|
42
|
+
const byBinding = /* @__PURE__ */ new Map();
|
|
43
|
+
const byTaskKind = /* @__PURE__ */ new Map();
|
|
44
|
+
for (const route of routes) {
|
|
45
|
+
const key = routeKey(route);
|
|
46
|
+
if (byBinding.has(key)) throw new Error(`Agent route ${key} is registered more than once.`);
|
|
47
|
+
byBinding.set(key, route);
|
|
48
|
+
const matchingRoutes = byTaskKind.get(route.taskKind) ?? [];
|
|
49
|
+
byTaskKind.set(route.taskKind, Object.freeze([...matchingRoutes, route]));
|
|
50
|
+
}
|
|
51
|
+
return Object.freeze({
|
|
52
|
+
routes,
|
|
53
|
+
get(binding) {
|
|
54
|
+
return byBinding.get(routeKey(routeBinding(binding)));
|
|
55
|
+
},
|
|
56
|
+
listForTaskKind(kind) {
|
|
57
|
+
return byTaskKind.get(kind) ?? Object.freeze([]);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { agentRouteBindingSchema, agentRouteSchema, defineAgentRoutes, parseAgentRouteBinding, routeKey, routeTaskWork };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=agent-routes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-routes.mjs","names":[],"sources":["../src/agent-routes.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { parseAgentRouteBinding, type AgentRouteBinding } from \"./schema/agent-route\";\nimport { taskKindSchema, type TaskKind } from \"./schema/task\";\nimport { taskWork, type JsonValue, type TaskWork } from \"./schema/work\";\n\nexport {\n agentRouteBindingSchema,\n parseAgentRouteBinding,\n type AgentRouteBinding,\n type AgentRouteBindingInput,\n} from \"./schema/agent-route\";\n\n/** Validates an exact-version route from workflow work to one configured agent. */\nexport const agentRouteSchema = z\n .strictObject({\n id: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,63}$/u)\n .describe(\"Stable route selected by a conversational agent or workflow.\"),\n version: z\n .number()\n .int()\n .positive()\n .default(1)\n .describe(\"Exact version of this agent route; defaults to 1 at registration.\"),\n agent: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,31}$/u)\n .describe(\"Internally addressable Eve agent that executes this route.\"),\n taskKind: taskKindSchema.describe(\"Factory task kind created for this route.\"),\n description: z\n .string()\n .min(1)\n .max(500)\n .describe(\"Model-facing guidance for when this route is appropriate.\"),\n permissions: z\n .array(z.string().min(1))\n .readonly()\n .default([])\n .describe(\"Inspectable capabilities granted to the target agent.\"),\n })\n .brand<\"AgentRouteBinding\">();\n\n/** Canonical `id@version` lookup key for one exact agent route. */\nexport type AgentRouteKey<\n Id extends string = string,\n Version extends number = number,\n> = `${Id}@${Version}`;\n/** Validated immutable route describing an agent, Task kind, purpose, and permissions. */\nexport type AgentRoute = Readonly<\n Omit<z.infer<typeof agentRouteSchema>, \"permissions\"> & {\n readonly permissions: readonly string[];\n }\n>;\n/** Caller input accepted when registering an agent route, before defaults are applied. */\nexport interface AgentRouteInput {\n readonly id: string;\n readonly version?: number;\n readonly agent: string;\n readonly taskKind: TaskKind;\n readonly description: string;\n readonly permissions?: readonly string[];\n}\n/** Task work with a required exact agent-route binding. */\nexport type RoutedTaskWork<\n Input extends JsonValue = JsonValue,\n Route extends AgentRouteBinding = AgentRouteBinding,\n> = Omit<TaskWork<Input>, \"route\"> & { readonly route: Route };\n\n/** Named fields for constructing generic work bound to an exact agent route. */\nexport interface RouteTaskWorkOptions<\n Route extends AgentRouteBinding = AgentRouteBinding,\n Input extends JsonValue = JsonValue,\n> {\n readonly route: Route;\n readonly title: string;\n readonly input?: Input;\n readonly workflow?: never;\n readonly completionCriteria?: never;\n}\n\n/** Produces the canonical `id@version` lookup key for a route binding. */\nexport function routeKey<const Binding extends AgentRouteBinding>(\n binding: Binding,\n): AgentRouteKey<Binding[\"id\"], Binding[\"version\"]> {\n return `${binding.id}@${binding.version}`;\n}\n\nconst routeBinding = <const Route extends AgentRouteBinding>(\n route: Route,\n): AgentRouteBinding<Route[\"id\"], Route[\"version\"]> =>\n Object.freeze(parseAgentRouteBinding({ id: route.id, version: route.version }));\n\n/** Constructs generic Task work bound to the selected exact agent route. */\nexport function routeTaskWork<\n const Route extends AgentRouteBinding,\n const Input extends JsonValue = JsonValue,\n>(\n options: RouteTaskWorkOptions<Route, Input>,\n): RoutedTaskWork<Input, AgentRouteBinding<Route[\"id\"], Route[\"version\"]>>;\nexport function routeTaskWork(options: RouteTaskWorkOptions): RoutedTaskWork {\n const { route, title, input = {} } = options;\n return {\n ...taskWork({ title, input }),\n route: routeBinding(route),\n };\n}\n\ntype RegisteredAgentRoute<Input extends AgentRouteInput> = Input extends AgentRouteInput\n ? AgentRouteBinding<\n Input[\"id\"],\n Input extends { readonly version: infer Version extends number } ? Version : 1\n > &\n Readonly<\n Omit<Input, \"version\" | \"permissions\"> & {\n readonly version: Input extends { readonly version: infer Version extends number }\n ? Version\n : 1;\n readonly permissions: readonly string[];\n }\n >\n : never;\n\n/** Immutable registry for exact agent-route lookup and unambiguous admission selection. */\nexport interface AgentRouteRegistry<out Route extends AgentRoute = AgentRoute> {\n readonly routes: readonly Route[];\n /** Returns only the exact route binding supplied; never defaults a version. */\n get<const Binding extends AgentRouteBinding>(\n binding: Binding,\n ): (Route & Readonly<Binding>) | undefined;\n /** Lists every registered route for a descriptive Task kind in registration order. */\n listForTaskKind<const Kind extends string>(\n kind: Kind,\n ): readonly (Route & { readonly taskKind: Kind })[];\n}\n\ntype RegisteredAgentRoutes<Input extends readonly AgentRouteInput[]> = [Input[number]] extends [\n never,\n]\n ? AgentRoute\n : RegisteredAgentRoute<Input[number]>;\n\n/** Descriptions inform judgment; exact registered bindings remain the authority. */\nexport function defineAgentRoutes<const Input extends readonly AgentRouteInput[]>(\n inputs: Input,\n): AgentRouteRegistry<RegisteredAgentRoutes<Input>> {\n type Route = RegisteredAgentRoutes<Input>;\n const routes = Object.freeze(\n inputs.map((input) => {\n const route = agentRouteSchema.parse(input);\n return Object.freeze({ ...route, permissions: Object.freeze([...route.permissions]) });\n }),\n ) as readonly Route[];\n const byBinding = new Map<string, Route>();\n const byTaskKind = new Map<string, readonly Route[]>();\n for (const route of routes) {\n const key = routeKey(route);\n if (byBinding.has(key)) {\n throw new Error(`Agent route ${key} is registered more than once.`);\n }\n byBinding.set(key, route);\n const matchingRoutes = byTaskKind.get(route.taskKind) ?? [];\n byTaskKind.set(route.taskKind, Object.freeze([...matchingRoutes, route]));\n }\n return Object.freeze({\n routes,\n get<const Binding extends AgentRouteBinding>(binding: Binding) {\n return byBinding.get(routeKey(routeBinding(binding))) as\n | (Route & Readonly<Binding>)\n | undefined;\n },\n listForTaskKind<const Kind extends string>(kind: Kind) {\n return (byTaskKind.get(kind) ?? Object.freeze([])) as readonly (Route & {\n readonly taskKind: Kind;\n })[];\n },\n });\n}\n"],"mappings":";;;;;;AAaA,MAAa,mBAAmB,EAC7B,aAAa;CACZ,IAAI,EACD,OAAO,CAAC,CACR,MAAM,yBAAyB,CAAC,CAChC,SAAS,8DAA8D;CAC1E,SAAS,EACN,OAAO,CAAC,CACR,IAAI,CAAC,CACL,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC,CACV,SAAS,mEAAmE;CAC/E,OAAO,EACJ,OAAO,CAAC,CACR,MAAM,yBAAyB,CAAC,CAChC,SAAS,4DAA4D;CACxE,UAAU,eAAe,SAAS,2CAA2C;CAC7E,aAAa,EACV,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SAAS,2DAA2D;CACvE,aAAa,EACV,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,uDAAuD;AACrE,CAAC,CAAC,CACD,MAA2B;;AAyC9B,SAAgB,SACd,SACkD;CAClD,OAAO,GAAG,QAAQ,GAAG,GAAG,QAAQ;AAClC;AAEA,MAAM,gBACJ,UAEA,OAAO,OAAO,uBAAuB;CAAE,IAAI,MAAM;CAAI,SAAS,MAAM;AAAQ,CAAC,CAAC;AAShF,SAAgB,cAAc,SAA+C;CAC3E,MAAM,EAAE,OAAO,OAAO,QAAQ,CAAC,MAAM;CACrC,OAAO;EACL,GAAG,SAAS;GAAE;GAAO;EAAM,CAAC;EAC5B,OAAO,aAAa,KAAK;CAC3B;AACF;;AAqCA,SAAgB,kBACd,QACkD;CAElD,MAAM,SAAS,OAAO,OACpB,OAAO,KAAK,UAAU;EACpB,MAAM,QAAQ,iBAAiB,MAAM,KAAK;EAC1C,OAAO,OAAO,OAAO;GAAE,GAAG;GAAO,aAAa,OAAO,OAAO,CAAC,GAAG,MAAM,WAAW,CAAC;EAAE,CAAC;CACvF,CAAC,CACH;CACA,MAAM,4BAAY,IAAI,IAAmB;CACzC,MAAM,6BAAa,IAAI,IAA8B;CACrD,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,MAAM,SAAS,KAAK;EAC1B,IAAI,UAAU,IAAI,GAAG,GACnB,MAAM,IAAI,MAAM,eAAe,IAAI,+BAA+B;EAEpE,UAAU,IAAI,KAAK,KAAK;EACxB,MAAM,iBAAiB,WAAW,IAAI,MAAM,QAAQ,KAAK,CAAC;EAC1D,WAAW,IAAI,MAAM,UAAU,OAAO,OAAO,CAAC,GAAG,gBAAgB,KAAK,CAAC,CAAC;CAC1E;CACA,OAAO,OAAO,OAAO;EACnB;EACA,IAA6C,SAAkB;GAC7D,OAAO,UAAU,IAAI,SAAS,aAAa,OAAO,CAAC,CAAC;EAGtD;EACA,gBAA2C,MAAY;GACrD,OAAQ,WAAW,IAAI,IAAI,KAAK,OAAO,OAAO,CAAC,CAAC;EAGlD;CACF,CAAC;AACH"}
|