@vercel/factory 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +356 -0
- package/README.md +96 -2
- package/dist/agent-routes.d.mts +113 -0
- package/dist/agent-routes.mjs +91 -0
- package/dist/agent-routes.mjs.map +1 -0
- package/dist/api-contracts.d.mts +1768 -0
- package/dist/api-contracts.mjs +119 -0
- package/dist/api-contracts.mjs.map +1 -0
- package/dist/api-images.d.mts +30 -0
- package/dist/api-images.mjs +28 -0
- package/dist/api-images.mjs.map +1 -0
- package/dist/api-task-graph.mjs +57 -0
- package/dist/api-task-graph.mjs.map +1 -0
- package/dist/api.d.mts +111 -216
- package/dist/api.mjs +1063 -99
- package/dist/api.mjs.map +1 -1
- package/dist/approval-access.d.mts +39 -0
- package/dist/approval-access.mjs +62 -0
- package/dist/approval-access.mjs.map +1 -0
- package/dist/approval-contracts.d.mts +698 -0
- package/dist/approval-contracts.mjs +27 -0
- package/dist/approval-contracts.mjs.map +1 -0
- package/dist/approval.d.mts +49 -0
- package/dist/approval.mjs +39 -0
- package/dist/approval.mjs.map +1 -0
- package/dist/blob/artifacts.d.mts +37 -0
- package/dist/blob/artifacts.mjs +45 -0
- package/dist/blob/artifacts.mjs.map +1 -0
- package/dist/blob/index.d.mts +84 -12
- package/dist/blob/index.mjs +179 -45
- package/dist/blob/index.mjs.map +1 -1
- package/dist/budget.d.mts +115 -0
- package/dist/budget.mjs +147 -0
- package/dist/budget.mjs.map +1 -0
- package/dist/budgets.d.mts +4 -0
- package/dist/budgets.mjs +4 -0
- package/dist/build-factory.d.mts +7 -4
- package/dist/build-factory.mjs +2 -1
- package/dist/build-factory.mjs.map +1 -1
- package/dist/change-verification/brief.d.mts +9 -0
- package/dist/change-verification/brief.mjs +13 -0
- package/dist/change-verification/brief.mjs.map +1 -0
- package/dist/change-verification/dispatch.d.mts +37 -0
- package/dist/change-verification/dispatch.mjs +83 -0
- package/dist/change-verification/dispatch.mjs.map +1 -0
- package/dist/change-verification/eve-tool.d.mts +61 -0
- package/dist/change-verification/eve-tool.mjs +89 -0
- package/dist/change-verification/eve-tool.mjs.map +1 -0
- package/dist/change-verification/result.mjs +130 -0
- package/dist/change-verification/result.mjs.map +1 -0
- package/dist/changes/eve-record-change.d.mts +56 -0
- package/dist/changes/eve-record-change.mjs +131 -0
- package/dist/changes/eve-record-change.mjs.map +1 -0
- package/dist/changes/presentation.d.mts +14 -0
- package/dist/changes.d.mts +24 -0
- package/dist/changes.mjs +29 -0
- package/dist/changes.mjs.map +1 -0
- package/dist/client-events.d.mts +25 -0
- package/dist/client-events.mjs +45 -0
- package/dist/client-events.mjs.map +1 -0
- package/dist/client-stream.d.mts +28 -0
- package/dist/client-stream.mjs +210 -0
- package/dist/client-stream.mjs.map +1 -0
- package/dist/client-transcript.d.mts +41 -0
- package/dist/client-transcript.mjs +233 -0
- package/dist/client-transcript.mjs.map +1 -0
- package/dist/client.d.mts +343 -0
- package/dist/client.mjs +366 -0
- package/dist/client.mjs.map +1 -0
- package/dist/code-review/contracts.d.mts +27 -0
- package/dist/code-review/eve-post-review.d.mts +70 -0
- package/dist/code-review/eve-post-review.mjs +195 -0
- package/dist/code-review/eve-post-review.mjs.map +1 -0
- package/dist/code-review/eve-review-comments.d.mts +75 -0
- package/dist/code-review/eve-review-comments.mjs +193 -0
- package/dist/code-review/eve-review-comments.mjs.map +1 -0
- package/dist/code-review/github-contracts.d.mts +10 -0
- package/dist/code-review/github-reporter.d.mts +46 -0
- package/dist/code-review/github-reporter.mjs +262 -0
- package/dist/code-review/github-reporter.mjs.map +1 -0
- package/dist/code-review/preparation.d.mts +34 -0
- package/dist/code-review/preparation.mjs +23 -0
- package/dist/code-review/preparation.mjs.map +1 -0
- package/dist/code-review/stall.d.mts +17 -0
- package/dist/code-review/stall.mjs +30 -0
- package/dist/code-review/stall.mjs.map +1 -0
- package/dist/code-review.d.mts +7 -0
- package/dist/code-review.mjs +5 -0
- package/dist/communication.d.mts +9 -0
- package/dist/communication.mjs +9 -0
- package/dist/connectors/github.d.mts +26 -0
- package/dist/connectors/github.mjs +55 -0
- package/dist/connectors/github.mjs.map +1 -0
- package/dist/connectors/index.d.mts +35 -3
- package/dist/connectors/index.mjs +3 -52
- package/dist/connectors/index.mjs.map +1 -1
- package/dist/connectors/outbox.d.mts +34 -0
- package/dist/connectors/outbox.mjs +50 -0
- package/dist/connectors/outbox.mjs.map +1 -0
- package/dist/connectors/slack-approval-blocks.mjs +136 -0
- package/dist/connectors/slack-approval-blocks.mjs.map +1 -0
- package/dist/connectors/slack-approvals.d.mts +29 -0
- package/dist/connectors/slack-approvals.mjs +346 -0
- package/dist/connectors/slack-approvals.mjs.map +1 -0
- package/dist/connectors/slack.d.mts +35 -52
- package/dist/connectors/slack.mjs +13 -85
- package/dist/connectors/slack.mjs.map +1 -1
- package/dist/deepsec/eve-tool.d.mts +110 -0
- package/dist/deepsec/eve-tool.mjs +166 -0
- package/dist/deepsec/eve-tool.mjs.map +1 -0
- package/dist/deepsec/finding.d.mts +84 -0
- package/dist/deepsec/finding.mjs +56 -0
- package/dist/deepsec/finding.mjs.map +1 -0
- package/dist/deepsec.d.mts +3 -0
- package/dist/delivery-metrics/metrics.d.mts +93 -0
- package/dist/delivery-metrics/metrics.mjs +200 -0
- package/dist/delivery-metrics/metrics.mjs.map +1 -0
- package/dist/delivery-metrics.d.mts +2 -0
- package/dist/delivery-metrics.mjs +2 -0
- package/dist/dispatch.d.mts +152 -0
- package/dist/dispatch.mjs +199 -0
- package/dist/dispatch.mjs.map +1 -0
- package/dist/errors.d.mts +15 -0
- package/dist/errors.mjs +38 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/eve/index.d.mts +209 -1277
- package/dist/eve/index.mjs +312 -1073
- package/dist/eve/index.mjs.map +1 -1
- package/dist/eve/invoke.d.mts +144 -0
- package/dist/eve/invoke.mjs +254 -0
- package/dist/eve/invoke.mjs.map +1 -0
- package/dist/eve/session-client.d.mts +186 -0
- package/dist/eve/session-client.mjs +245 -0
- package/dist/eve/session-client.mjs.map +1 -0
- package/dist/eve/task-execution.d.mts +380 -0
- package/dist/eve/task-execution.mjs +73 -0
- package/dist/eve/task-execution.mjs.map +1 -0
- package/dist/eve/task-session.d.mts +129 -0
- package/dist/eve/task-session.mjs +245 -0
- package/dist/eve/task-session.mjs.map +1 -0
- package/dist/eve/transcript.d.mts +37 -0
- package/dist/eve/transcript.mjs +69 -0
- package/dist/eve/transcript.mjs.map +1 -0
- package/dist/execution-public.d.mts +8 -0
- package/dist/execution-public.mjs +7 -0
- package/dist/execution.d.mts +183 -0
- package/dist/execution.mjs +223 -0
- package/dist/execution.mjs.map +1 -0
- package/dist/finding-remediation/admission.d.mts +53 -0
- package/dist/finding-remediation/admission.mjs +90 -0
- package/dist/finding-remediation/admission.mjs.map +1 -0
- package/dist/finding-remediation/brief.d.mts +14 -0
- package/dist/finding-remediation/brief.mjs +25 -0
- package/dist/finding-remediation/brief.mjs.map +1 -0
- package/dist/finding-remediation/eve-tool.d.mts +29 -0
- package/dist/finding-remediation/eve-tool.mjs +34 -0
- package/dist/finding-remediation/eve-tool.mjs.map +1 -0
- package/dist/findings/fingerprint.d.mts +14 -0
- package/dist/findings/fingerprint.mjs +28 -0
- package/dist/findings/fingerprint.mjs.map +1 -0
- package/dist/findings.d.mts +7 -0
- package/dist/findings.mjs +6 -0
- package/dist/github-app.d.mts +54 -0
- package/dist/github-app.mjs +121 -0
- package/dist/github-app.mjs.map +1 -0
- package/dist/github-publication.d.mts +199 -0
- package/dist/github-publication.mjs +442 -0
- package/dist/github-publication.mjs.map +1 -0
- package/dist/github-transfer.d.mts +81 -0
- package/dist/github-transfer.mjs +273 -0
- package/dist/github-transfer.mjs.map +1 -0
- package/dist/github.d.mts +446 -2
- package/dist/github.mjs +357 -56
- package/dist/github.mjs.map +1 -1
- package/dist/image-input.d.mts +51 -0
- package/dist/image-input.mjs +63 -0
- package/dist/image-input.mjs.map +1 -0
- package/dist/inbox-activity.d.mts +53 -0
- package/dist/inbox-activity.mjs +41 -0
- package/dist/inbox-activity.mjs.map +1 -0
- package/dist/index.d.mts +16 -484
- package/dist/index.mjs +15 -522
- package/dist/intake-contracts.d.mts +55 -0
- package/dist/intake-contracts.mjs +33 -0
- package/dist/intake-contracts.mjs.map +1 -0
- package/dist/integrations/deepsec.d.mts +5 -0
- package/dist/integrations/deepsec.mjs +3 -0
- package/dist/integrations/github.d.mts +11 -0
- package/dist/integrations/github.mjs +9 -0
- package/dist/integrations/slack.d.mts +5 -0
- package/dist/integrations/slack.mjs +5 -0
- package/dist/integrations/vercel.d.mts +5 -0
- package/dist/integrations/vercel.mjs +4 -0
- package/dist/merge-resolution/contracts.d.mts +17 -0
- package/dist/merge-resolution/contracts.mjs +19 -0
- package/dist/merge-resolution/contracts.mjs.map +1 -0
- package/dist/merge-resolution/eve-tools.d.mts +47 -0
- package/dist/merge-resolution/eve-tools.mjs +122 -0
- package/dist/merge-resolution/eve-tools.mjs.map +1 -0
- package/dist/model-settings.d.mts +41 -0
- package/dist/model-settings.mjs +35 -0
- package/dist/model-settings.mjs.map +1 -0
- package/dist/multi-repository-changes/coordination.d.mts +49 -0
- package/dist/multi-repository-changes/coordination.mjs +115 -0
- package/dist/multi-repository-changes/coordination.mjs.map +1 -0
- package/dist/planning/cancellation.mjs +82 -0
- package/dist/planning/cancellation.mjs.map +1 -0
- package/dist/planning/configuration.d.mts +23 -0
- package/dist/planning/configuration.mjs +56 -0
- package/dist/planning/configuration.mjs.map +1 -0
- package/dist/planning/contracts.d.mts +136 -0
- package/dist/planning/contracts.mjs +42 -0
- package/dist/planning/contracts.mjs.map +1 -0
- package/dist/planning/dependencies.mjs +44 -0
- package/dist/planning/dependencies.mjs.map +1 -0
- package/dist/planning/effects.mjs +122 -0
- package/dist/planning/effects.mjs.map +1 -0
- package/dist/planning/reconcile.mjs +279 -0
- package/dist/planning/reconcile.mjs.map +1 -0
- package/dist/planning/runtime.d.mts +27 -0
- package/dist/planning/runtime.mjs +25 -0
- package/dist/planning/runtime.mjs.map +1 -0
- package/dist/planning/state.mjs +92 -0
- package/dist/planning/state.mjs.map +1 -0
- package/dist/planning/turns.mjs +262 -0
- package/dist/planning/turns.mjs.map +1 -0
- package/dist/planning/validation.mjs +106 -0
- package/dist/planning/validation.mjs.map +1 -0
- package/dist/postgres/index.d.mts +48 -1
- package/dist/postgres/index.mjs +45 -3
- package/dist/postgres/index.mjs.map +1 -1
- package/dist/presets/software-development/approval.d.mts +14 -0
- package/dist/presets/software-development/approval.mjs +21 -0
- package/dist/presets/software-development/approval.mjs.map +1 -0
- package/dist/presets/software-development/deepsec-brief.d.mts +8 -0
- package/dist/presets/software-development/deepsec-brief.mjs +14 -0
- package/dist/presets/software-development/deepsec-brief.mjs.map +1 -0
- package/dist/presets/software-development/dispatch.d.mts +56 -0
- package/dist/presets/software-development/dispatch.mjs +67 -0
- package/dist/presets/software-development/dispatch.mjs.map +1 -0
- package/dist/presets/software-development/eve-delegation-policy.d.mts +7 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs +34 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs.map +1 -0
- package/dist/presets/software-development/eve.d.mts +18 -0
- package/dist/presets/software-development/eve.mjs +19 -0
- package/dist/presets/software-development/eve.mjs.map +1 -0
- package/dist/presets/software-development/finish-task-policy.d.mts +7 -0
- package/dist/presets/software-development/finish-task-policy.mjs +9 -0
- package/dist/presets/software-development/finish-task-policy.mjs.map +1 -0
- package/dist/presets/software-development/recovery.d.mts +32 -0
- package/dist/presets/software-development/recovery.mjs +120 -0
- package/dist/presets/software-development/recovery.mjs.map +1 -0
- package/dist/presets/software-development/task-communication.d.mts +24 -0
- package/dist/presets/software-development/task-communication.mjs +157 -0
- package/dist/presets/software-development/task-communication.mjs.map +1 -0
- package/dist/presets/software-development.d.mts +10 -0
- package/dist/presets/software-development.mjs +9 -0
- package/dist/pull-requests/contracts.d.mts +72 -0
- package/dist/pull-requests/eve-fetch.d.mts +57 -0
- package/dist/pull-requests/eve-fetch.mjs +151 -0
- package/dist/pull-requests/eve-fetch.mjs.map +1 -0
- package/dist/pull-requests/github-label-manager.d.mts +27 -0
- package/dist/pull-requests/github-label-manager.mjs +40 -0
- package/dist/pull-requests/github-label-manager.mjs.map +1 -0
- package/dist/pull-requests/github-publisher.d.mts +67 -0
- package/dist/pull-requests/github-publisher.mjs +405 -0
- package/dist/pull-requests/github-publisher.mjs.map +1 -0
- package/dist/pull-requests.d.mts +6 -0
- package/dist/pull-requests.mjs +4 -0
- package/dist/receipts.d.mts +4 -0
- package/dist/receipts.mjs +3 -0
- package/dist/repositories.d.mts +18 -0
- package/dist/repositories.mjs +33 -0
- package/dist/repositories.mjs.map +1 -0
- package/dist/sandbox/command.d.mts +18 -0
- package/dist/sandbox/execution-abort.d.mts +16 -0
- package/dist/sandbox/execution-abort.mjs +49 -0
- package/dist/sandbox/execution-abort.mjs.map +1 -0
- package/dist/sandbox/execution-environment.d.mts +25 -0
- package/dist/sandbox/execution-run-ledger.d.mts +115 -0
- package/dist/sandbox/execution-run-ledger.mjs +209 -0
- package/dist/sandbox/execution-run-ledger.mjs.map +1 -0
- package/dist/sandbox/execution.d.mts +54 -0
- package/dist/sandbox/execution.mjs +228 -0
- package/dist/sandbox/execution.mjs.map +1 -0
- package/dist/sandbox/harness-runner.d.mts +79 -0
- package/dist/sandbox/harness-runner.mjs +162 -0
- package/dist/sandbox/harness-runner.mjs.map +1 -0
- package/dist/sandbox/index.d.mts +10 -0
- package/dist/sandbox/index.mjs +7 -0
- package/dist/sandbox/task-environment.d.mts +50 -0
- package/dist/sandbox/task-environment.mjs +140 -0
- package/dist/sandbox/task-environment.mjs.map +1 -0
- package/dist/sandbox/workspace.d.mts +29 -0
- package/dist/sandbox/workspace.mjs +28 -0
- package/dist/sandbox/workspace.mjs.map +1 -0
- package/dist/schema/agent-route.d.mts +40 -0
- package/dist/schema/agent-route.mjs +33 -0
- package/dist/schema/agent-route.mjs.map +1 -0
- package/dist/schema/answer.d.mts +23 -0
- package/dist/schema/answer.mjs +21 -0
- package/dist/schema/answer.mjs.map +1 -0
- package/dist/schema/budget.d.mts +38 -0
- package/dist/schema/budget.mjs +30 -0
- package/dist/schema/budget.mjs.map +1 -0
- package/dist/schema/catalog.mjs +72 -0
- package/dist/schema/catalog.mjs.map +1 -0
- package/dist/schema/change.d.mts +117 -0
- package/dist/schema/change.mjs +68 -0
- package/dist/schema/change.mjs.map +1 -0
- package/dist/schema/common.d.mts +33 -0
- package/dist/{id-BLIkCVue.mjs → schema/common.mjs} +7 -16
- package/dist/schema/common.mjs.map +1 -0
- package/dist/schema/communication.d.mts +52 -0
- package/dist/{communication-Kd9nU5RP.mjs → schema/communication.mjs} +8 -3
- package/dist/schema/communication.mjs.map +1 -0
- package/dist/schema/execution.d.mts +101 -0
- package/dist/schema/execution.mjs +86 -0
- package/dist/schema/execution.mjs.map +1 -0
- package/dist/schema/factory-config.d.mts +122 -0
- package/dist/schema/factory-config.mjs +90 -0
- package/dist/schema/factory-config.mjs.map +1 -0
- package/dist/schema/finding.d.mts +125 -0
- package/dist/schema/finding.mjs +67 -0
- package/dist/schema/finding.mjs.map +1 -0
- package/dist/schema/id.d.mts +43 -0
- package/dist/schema/id.mjs +32 -0
- package/dist/schema/id.mjs.map +1 -0
- package/dist/schema/outbox.d.mts +240 -0
- package/dist/schema/outbox.mjs +53 -0
- package/dist/schema/outbox.mjs.map +1 -0
- package/dist/schema/question-route.mjs +16 -0
- package/dist/schema/question-route.mjs.map +1 -0
- package/dist/schema/receipt.d.mts +81 -0
- package/dist/schema/receipt.mjs +94 -0
- package/dist/schema/receipt.mjs.map +1 -0
- package/dist/schema/repository.d.mts +30 -0
- package/dist/schema/repository.mjs +29 -0
- package/dist/schema/repository.mjs.map +1 -0
- package/dist/schema/session.d.mts +136 -0
- package/dist/schema/session.mjs +54 -0
- package/dist/schema/session.mjs.map +1 -0
- package/dist/schema/signal.d.mts +105 -0
- package/dist/schema/signal.mjs +81 -0
- package/dist/schema/signal.mjs.map +1 -0
- package/dist/schema/slack-pr-notifications.d.mts +12 -0
- package/dist/schema/slack-pr-notifications.mjs +11 -0
- package/dist/schema/slack-pr-notifications.mjs.map +1 -0
- package/dist/schema/stored-session.mjs +10 -0
- package/dist/schema/stored-session.mjs.map +1 -0
- package/dist/schema/stored-task.mjs +20 -0
- package/dist/schema/stored-task.mjs.map +1 -0
- package/dist/schema/task-effect.d.mts +39 -0
- package/dist/schema/task-effect.mjs +29 -0
- package/dist/schema/task-effect.mjs.map +1 -0
- package/dist/schema/task-graph.d.mts +3173 -0
- package/dist/schema/task-graph.mjs +97 -0
- package/dist/schema/task-graph.mjs.map +1 -0
- package/dist/schema/task-message.d.mts +254 -0
- package/dist/schema/task-message.mjs +189 -0
- package/dist/schema/task-message.mjs.map +1 -0
- package/dist/schema/task.d.mts +273 -0
- package/dist/schema/task.mjs +200 -0
- package/dist/schema/task.mjs.map +1 -0
- package/dist/schema/transcript.d.mts +176 -0
- package/dist/schema/transcript.mjs +87 -0
- package/dist/schema/transcript.mjs.map +1 -0
- package/dist/schema/transitions.d.mts +50 -0
- package/dist/schema/transitions.mjs +303 -0
- package/dist/schema/transitions.mjs.map +1 -0
- package/dist/schema/work.d.mts +150 -0
- package/dist/schema/work.mjs +102 -0
- package/dist/schema/work.mjs.map +1 -0
- package/dist/session-previews.d.mts +76 -0
- package/dist/session-previews.mjs +55 -0
- package/dist/session-previews.mjs.map +1 -0
- package/dist/session-review.d.mts +120 -0
- package/dist/session-review.mjs +79 -0
- package/dist/session-review.mjs.map +1 -0
- package/dist/signal-triage.d.mts +20 -0
- package/dist/signal-triage.mjs +85 -0
- package/dist/signal-triage.mjs.map +1 -0
- package/dist/signals.d.mts +20 -0
- package/dist/signals.mjs +19 -0
- package/dist/signals.mjs.map +1 -0
- package/dist/stall.d.mts +41 -0
- package/dist/stall.mjs +83 -0
- package/dist/stall.mjs.map +1 -0
- package/dist/storage.d.mts +4 -0
- package/dist/storage.mjs +4 -0
- package/dist/store/driver.d.mts +65 -0
- package/dist/store/driver.mjs +42 -0
- package/dist/store/driver.mjs.map +1 -0
- package/dist/store/engine.d.mts +683 -0
- package/dist/store/engine.mjs +2309 -0
- package/dist/store/engine.mjs.map +1 -0
- package/dist/store/memory.d.mts +24 -0
- package/dist/store/memory.mjs +69 -0
- package/dist/store/memory.mjs.map +1 -0
- package/dist/store/slack-pr-notifications.d.mts +44 -0
- package/dist/store/slack-pr-notifications.mjs +121 -0
- package/dist/store/slack-pr-notifications.mjs.map +1 -0
- package/dist/store/task-effects.d.mts +38 -0
- package/dist/store/task-effects.mjs +118 -0
- package/dist/store/task-effects.mjs.map +1 -0
- package/dist/store/task-graphs.d.mts +60 -0
- package/dist/store/task-graphs.mjs +212 -0
- package/dist/store/task-graphs.mjs.map +1 -0
- package/dist/store/task-messages.d.mts +136 -0
- package/dist/store/task-messages.mjs +475 -0
- package/dist/store/task-messages.mjs.map +1 -0
- package/dist/store/task-work.d.mts +180 -0
- package/dist/store/task-work.mjs +137 -0
- package/dist/store/task-work.mjs.map +1 -0
- package/dist/store/work-notifications.d.mts +19 -0
- package/dist/store/work-notifications.mjs +48 -0
- package/dist/store/work-notifications.mjs.map +1 -0
- package/dist/sweep.d.mts +79 -0
- package/dist/sweep.mjs +171 -0
- package/dist/sweep.mjs.map +1 -0
- package/dist/task-communication.d.mts +35 -0
- package/dist/task-communication.mjs +47 -0
- package/dist/task-communication.mjs.map +1 -0
- package/dist/task-graph-view.d.mts +267 -0
- package/dist/task-graph-view.mjs +17 -0
- package/dist/task-graph-view.mjs.map +1 -0
- package/dist/task-message-processing.d.mts +60 -0
- package/dist/task-message-processing.mjs +200 -0
- package/dist/task-message-processing.mjs.map +1 -0
- package/dist/task-protocols.d.mts +80 -0
- package/dist/task-protocols.mjs +47 -0
- package/dist/task-protocols.mjs.map +1 -0
- package/dist/tasks.d.mts +17 -0
- package/dist/tasks.mjs +17 -0
- package/dist/vercel-git.d.mts +53 -0
- package/dist/vercel-git.mjs +344 -0
- package/dist/vercel-git.mjs.map +1 -0
- package/dist/vercel-github-api.d.mts +103 -0
- package/dist/vercel-github-api.mjs +363 -0
- package/dist/vercel-github-api.mjs.map +1 -0
- package/dist/vercel.d.mts +34 -2
- package/dist/vercel.mjs +49 -3
- package/dist/vercel.mjs.map +1 -1
- package/dist/work-triage/eve-tool.d.mts +29 -0
- package/dist/work-triage/eve-tool.mjs +32 -0
- package/dist/work-triage/eve-tool.mjs.map +1 -0
- package/dist/work-triage/find-existing-work.d.mts +32 -0
- package/dist/work-triage/find-existing-work.mjs +31 -0
- package/dist/work-triage/find-existing-work.mjs.map +1 -0
- package/dist/work-triage/github.d.mts +15 -0
- package/dist/work-triage/github.mjs +14 -0
- package/dist/work-triage/github.mjs.map +1 -0
- package/dist/work-triage.d.mts +4 -0
- package/dist/work-triage.mjs +3 -0
- package/dist/workflows.d.mts +146 -0
- package/dist/workflows.mjs +139 -0
- package/dist/workflows.mjs.map +1 -0
- package/dist/workspace-diff-assembly.d.mts +33 -0
- package/dist/workspace-diff-assembly.mjs +95 -0
- package/dist/workspace-diff-assembly.mjs.map +1 -0
- package/dist/workspace-diff.d.mts +90 -0
- package/dist/workspace-diff.mjs +61 -0
- package/dist/workspace-diff.mjs.map +1 -0
- package/dist/workspace-files-git.d.mts +15 -0
- package/dist/workspace-files-git.mjs +61 -0
- package/dist/workspace-files-git.mjs.map +1 -0
- package/dist/workspace-files.d.mts +107 -0
- package/dist/workspace-files.mjs +74 -0
- package/dist/workspace-files.mjs.map +1 -0
- package/dist/workspace-snapshot.d.mts +26 -0
- package/dist/workspace-snapshot.mjs +80 -0
- package/dist/workspace-snapshot.mjs.map +1 -0
- package/docs/getting-started.md +104 -0
- package/docs/index.md +100 -0
- package/docs/recipes/cancellation.md +215 -0
- package/docs/recipes/custom-workflow.md +153 -0
- package/docs/recipes/dependent-tasks.md +207 -0
- package/docs/recipes/eve-agent.md +277 -0
- package/docs/recipes/human-input.md +204 -0
- package/docs/recipes/persistence-recovery.md +268 -0
- package/docs/recipes/retry-recovery.md +241 -0
- package/docs/recipes/task-messaging.md +215 -0
- package/docs/recipes/typed-eve-result.md +161 -0
- package/docs/runtime-integration.md +137 -0
- package/package.json +142 -46
- package/dist/approval-JX2Px9IC.mjs +0 -132
- package/dist/approval-JX2Px9IC.mjs.map +0 -1
- package/dist/budget-DzSiIA4t.mjs +0 -42
- package/dist/budget-DzSiIA4t.mjs.map +0 -1
- package/dist/change-D2U6v7Ek.mjs +0 -554
- package/dist/change-D2U6v7Ek.mjs.map +0 -1
- package/dist/communication-Kd9nU5RP.mjs.map +0 -1
- package/dist/coordination-Cq08hb1l.mjs +0 -76
- package/dist/coordination-Cq08hb1l.mjs.map +0 -1
- package/dist/dispatch-BaZS3PT8.d.mts +0 -76
- package/dist/driver-BC0Mt5KG.d.mts +0 -34
- package/dist/driver-Bbd25rNM.mjs +0 -23
- package/dist/driver-Bbd25rNM.mjs.map +0 -1
- package/dist/engine-DFHU2Pe-.d.mts +0 -781
- package/dist/engine-WaUM2cGA.mjs +0 -1068
- package/dist/engine-WaUM2cGA.mjs.map +0 -1
- package/dist/factory-config-BoRXOw43.mjs +0 -50
- package/dist/factory-config-BoRXOw43.mjs.map +0 -1
- package/dist/factory-config-D2yU3G0c.d.mts +0 -58
- package/dist/github-C5HNBN6p.d.mts +0 -279
- package/dist/id-BLIkCVue.mjs.map +0 -1
- package/dist/index-Bw6hggoH.d.mts +0 -40
- package/dist/index.mjs.map +0 -1
- package/dist/task-CcOyOJ3k.mjs +0 -154
- package/dist/task-CcOyOJ3k.mjs.map +0 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/session.d.ts
|
|
3
|
+
/** Validates a stable Factory interaction identifier distinct from provider sessions. */
|
|
4
|
+
declare const agentSessionIdSchema: z.ZodType<`ses_${string}`, string>;
|
|
5
|
+
/** Stable Factory interaction identifier independent of provider session IDs. */
|
|
6
|
+
type AgentSessionId = z.infer<typeof agentSessionIdSchema>;
|
|
7
|
+
/** Base object fields used to decode current and legacy session snapshots. */
|
|
8
|
+
declare const agentSessionBaseSchema: z.ZodObject<{
|
|
9
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
10
|
+
id: z.ZodType<`ses_${string}`, string, z.core.$ZodTypeInternals<`ses_${string}`, string>>;
|
|
11
|
+
owner: z.ZodString;
|
|
12
|
+
agent: z.ZodString;
|
|
13
|
+
repositoryId: z.ZodOptional<z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>;
|
|
14
|
+
route: z.ZodOptional<z.core.$ZodBranded<z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
version: z.ZodNumber;
|
|
17
|
+
}, z.core.$strict>, "AgentRouteBinding", "out">>;
|
|
18
|
+
message: z.ZodString;
|
|
19
|
+
model: z.ZodOptional<z.ZodString>;
|
|
20
|
+
attachments: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
21
|
+
id: z.ZodType<`img_${string}`, string, z.core.$ZodTypeInternals<`img_${string}`, string>>;
|
|
22
|
+
filename: z.ZodString;
|
|
23
|
+
mediaType: z.ZodEnum<{
|
|
24
|
+
"image/png": "image/png";
|
|
25
|
+
"image/jpeg": "image/jpeg";
|
|
26
|
+
"image/webp": "image/webp";
|
|
27
|
+
}>;
|
|
28
|
+
size: z.ZodNumber;
|
|
29
|
+
}, z.core.$strict>>>>;
|
|
30
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
31
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
32
|
+
attached: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
continuations: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
34
|
+
operationId: z.ZodString;
|
|
35
|
+
taskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
|
|
36
|
+
parentTaskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
|
|
37
|
+
agent: z.ZodString;
|
|
38
|
+
message: z.ZodString;
|
|
39
|
+
attachments: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
40
|
+
id: z.ZodType<`img_${string}`, string, z.core.$ZodTypeInternals<`img_${string}`, string>>;
|
|
41
|
+
filename: z.ZodString;
|
|
42
|
+
mediaType: z.ZodEnum<{
|
|
43
|
+
"image/png": "image/png";
|
|
44
|
+
"image/jpeg": "image/jpeg";
|
|
45
|
+
"image/webp": "image/webp";
|
|
46
|
+
}>;
|
|
47
|
+
size: z.ZodNumber;
|
|
48
|
+
}, z.core.$strict>>>>;
|
|
49
|
+
contextAttachments: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
50
|
+
id: z.ZodType<`img_${string}`, string, z.core.$ZodTypeInternals<`img_${string}`, string>>;
|
|
51
|
+
filename: z.ZodString;
|
|
52
|
+
mediaType: z.ZodEnum<{
|
|
53
|
+
"image/png": "image/png";
|
|
54
|
+
"image/jpeg": "image/jpeg";
|
|
55
|
+
"image/webp": "image/webp";
|
|
56
|
+
}>;
|
|
57
|
+
size: z.ZodNumber;
|
|
58
|
+
}, z.core.$strict>>>>;
|
|
59
|
+
context: z.ZodOptional<z.ZodString>;
|
|
60
|
+
createdAt: z.ZodISODateTime;
|
|
61
|
+
}, z.core.$strict>>>>>;
|
|
62
|
+
execution: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
provider: z.ZodString;
|
|
64
|
+
sessionId: z.ZodString;
|
|
65
|
+
environmentId: z.ZodOptional<z.ZodString>;
|
|
66
|
+
harness: z.ZodOptional<z.ZodString>;
|
|
67
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
external: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
70
|
+
replyTo: z.ZodObject<{
|
|
71
|
+
channel: z.ZodString;
|
|
72
|
+
address: z.ZodString;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
75
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
76
|
+
}, z.core.$strict>>>;
|
|
77
|
+
notifications: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
78
|
+
eventId: z.ZodString;
|
|
79
|
+
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
80
|
+
taskId: z.ZodOptional<z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>>;
|
|
81
|
+
changeId: z.ZodOptional<z.ZodType<`chg_${string}`, string, z.core.$ZodTypeInternals<`chg_${string}`, string>>>;
|
|
82
|
+
replyTo: z.ZodObject<{
|
|
83
|
+
channel: z.ZodString;
|
|
84
|
+
address: z.ZodString;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
outcome: z.ZodEnum<{
|
|
87
|
+
message: "message";
|
|
88
|
+
succeeded: "succeeded";
|
|
89
|
+
failed: "failed";
|
|
90
|
+
needs_human: "needs_human";
|
|
91
|
+
cancelled: "cancelled";
|
|
92
|
+
accepted: "accepted";
|
|
93
|
+
question: "question";
|
|
94
|
+
rolled_back: "rolled_back";
|
|
95
|
+
started: "started";
|
|
96
|
+
digest: "digest";
|
|
97
|
+
budget_warning: "budget_warning";
|
|
98
|
+
budget_exhausted: "budget_exhausted";
|
|
99
|
+
}>;
|
|
100
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
101
|
+
}, z.core.$strict>>>>;
|
|
102
|
+
createdAt: z.ZodISODateTime;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
type AgentSessionBase = Readonly<z.infer<typeof agentSessionBaseSchema>>;
|
|
105
|
+
type BindingKeys = "taskId" | "execution" | "external" | "route" | "continuations";
|
|
106
|
+
/** Durable session bound to workflow-owned Task work. */
|
|
107
|
+
type TaskAgentSession = Readonly<Omit<AgentSessionBase, BindingKeys> & {
|
|
108
|
+
taskId: NonNullable<AgentSessionBase["taskId"]>;
|
|
109
|
+
execution?: never;
|
|
110
|
+
external?: never;
|
|
111
|
+
route?: AgentSessionBase["route"];
|
|
112
|
+
continuations?: AgentSessionBase["continuations"];
|
|
113
|
+
}>;
|
|
114
|
+
/** Durable internal conversation whose provider execution is stored directly. */
|
|
115
|
+
type DirectAgentSession = Readonly<Omit<AgentSessionBase, BindingKeys> & {
|
|
116
|
+
taskId?: never;
|
|
117
|
+
execution?: AgentSessionBase["execution"];
|
|
118
|
+
external?: never;
|
|
119
|
+
route?: AgentSessionBase["route"];
|
|
120
|
+
continuations?: AgentSessionBase["continuations"];
|
|
121
|
+
}>;
|
|
122
|
+
/** Durable external conversation with a required direct provider execution. */
|
|
123
|
+
type ExternalAgentSession = Readonly<Omit<AgentSessionBase, BindingKeys> & {
|
|
124
|
+
taskId?: never;
|
|
125
|
+
execution: NonNullable<AgentSessionBase["execution"]>;
|
|
126
|
+
external: NonNullable<AgentSessionBase["external"]>;
|
|
127
|
+
route?: never;
|
|
128
|
+
continuations?: never;
|
|
129
|
+
}>;
|
|
130
|
+
/** Durable interaction whose binding fields identify task, direct, or external ownership. */
|
|
131
|
+
type AgentSession = TaskAgentSession | DirectAgentSession | ExternalAgentSession;
|
|
132
|
+
/** Validates a persisted session and rejects contradictory task, execution, and external bindings. */
|
|
133
|
+
declare const agentSessionSchema: z.ZodType<AgentSession>;
|
|
134
|
+
//#endregion
|
|
135
|
+
export { AgentSession, AgentSessionId, DirectAgentSession, ExternalAgentSession, TaskAgentSession, agentSessionBaseSchema, agentSessionIdSchema, agentSessionSchema };
|
|
136
|
+
//# sourceMappingURL=session.d.mts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { changeIdSchema, repositoryIdSchema, repositoryIdsSchema, taskIdSchema } from "./id.mjs";
|
|
2
|
+
import { isoDateTimeSchema, replyToSchema, schemaVersionSchema } from "./common.mjs";
|
|
3
|
+
import { agentRouteBindingSchema } from "./agent-route.mjs";
|
|
4
|
+
import { executionReferenceSchema } from "./task.mjs";
|
|
5
|
+
import { hasMessageContent, imageAttachmentsSchema } from "../image-input.mjs";
|
|
6
|
+
import { communicationEventSchema } from "./communication.mjs";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
//#region src/schema/session.ts
|
|
9
|
+
/** Validates a stable Factory interaction identifier distinct from provider sessions. */
|
|
10
|
+
const agentSessionIdSchema = z.string().regex(/^ses_[a-z0-9]{6,64}$/u, "Expected ses_ followed by 6 to 64 lowercase letters or digits").describe("Stable Factory interaction ID; independent of provider session IDs.");
|
|
11
|
+
/** Validates the initial human request retained by a Factory session. */
|
|
12
|
+
const agentSessionMessageSchema = z.string().max(16e3).describe("Initial request, retained for idempotent admission and recovery.");
|
|
13
|
+
const continuationSchema = z.strictObject({
|
|
14
|
+
operationId: z.string().min(1).max(200).describe("Idempotency key for this follow-up."),
|
|
15
|
+
taskId: taskIdSchema.describe("Budgeted investigation answering this follow-up."),
|
|
16
|
+
parentTaskId: taskIdSchema.describe("Earlier work being discussed."),
|
|
17
|
+
agent: z.string().min(1).describe("Conversation agent handling this follow-up."),
|
|
18
|
+
message: z.string().max(16e3).describe("Operator's follow-up request."),
|
|
19
|
+
attachments: imageAttachmentsSchema.optional().describe("Images accompanying this follow-up."),
|
|
20
|
+
contextAttachments: imageAttachmentsSchema.optional().describe("Earlier images selected with the cached conversation context."),
|
|
21
|
+
context: z.string().max(8e4).optional().describe("Bounded conversation context captured before launch and retained for recovery."),
|
|
22
|
+
createdAt: isoDateTimeSchema
|
|
23
|
+
}).refine(hasMessageContent, "Enter a message or attach an image").readonly();
|
|
24
|
+
const externalConversationSchema = z.strictObject({
|
|
25
|
+
replyTo: replyToSchema.describe("Original external conversation destination; never rewritten by the console."),
|
|
26
|
+
repositoryIds: repositoryIdsSchema.describe("Repositories authorized for this external conversation."),
|
|
27
|
+
url: z.url({ protocol: /^https$/u }).optional().describe("HTTPS link to the original conversation.")
|
|
28
|
+
}).readonly();
|
|
29
|
+
/** Base object fields used to decode current and legacy session snapshots. */
|
|
30
|
+
const agentSessionBaseSchema = z.strictObject({
|
|
31
|
+
schemaVersion: schemaVersionSchema,
|
|
32
|
+
id: agentSessionIdSchema,
|
|
33
|
+
owner: z.string().min(1).describe("Authenticated principal owning this interaction."),
|
|
34
|
+
agent: z.string().regex(/^[a-z][a-z0-9-]{0,31}$/u).describe("Selected application agent."),
|
|
35
|
+
repositoryId: repositoryIdSchema.optional().describe("Configured repository selected for this interaction."),
|
|
36
|
+
route: agentRouteBindingSchema.optional().describe("Exact specialist route selected when this session was admitted."),
|
|
37
|
+
message: agentSessionMessageSchema,
|
|
38
|
+
model: z.string().trim().min(1).max(200).optional().describe("Opaque model selected at admission; unchanged by later repository defaults."),
|
|
39
|
+
attachments: imageAttachmentsSchema.optional().describe("Images accompanying the initial request."),
|
|
40
|
+
changeId: changeIdSchema.optional().describe("Existing change selected for this work."),
|
|
41
|
+
taskId: taskIdSchema.optional().describe("Workflow-owned task and authoritative execution binding."),
|
|
42
|
+
attached: z.boolean().optional().describe("Operator view of existing work that preserves its original origin and reply destination."),
|
|
43
|
+
continuations: z.array(continuationSchema).readonly().optional().describe("Ordered immutable follow-up intents, each with separate work and usage."),
|
|
44
|
+
execution: executionReferenceSchema.optional().describe("Provider reference for taskless conversations only."),
|
|
45
|
+
external: externalConversationSchema.optional().describe("Read-only projection of an externally admitted taskless conversation."),
|
|
46
|
+
notifications: z.array(communicationEventSchema).readonly().default([]).describe("Durable connector deliveries, deduplicated by eventId."),
|
|
47
|
+
createdAt: isoDateTimeSchema
|
|
48
|
+
});
|
|
49
|
+
/** Validates a persisted session and rejects contradictory task, execution, and external bindings. */
|
|
50
|
+
const agentSessionSchema = agentSessionBaseSchema.refine(hasMessageContent, "Enter a message or attach an image").refine((session) => session.taskId === void 0 || session.execution === void 0, "A session binds either a task or a conversation execution").refine((session) => session.external === void 0 || session.execution !== void 0 && session.taskId === void 0 && session.continuations === void 0 && session.route === void 0, "An external conversation requires an execution and cannot bind a Task, route, or continuations");
|
|
51
|
+
//#endregion
|
|
52
|
+
export { agentSessionBaseSchema, agentSessionIdSchema, agentSessionMessageSchema, agentSessionSchema };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=session.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.mjs","names":[],"sources":["../../src/schema/session.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { hasMessageContent, imageAttachmentsSchema } from \"../image-input\";\nimport { communicationEventSchema } from \"./communication\";\nimport { isoDateTimeSchema, replyToSchema, schemaVersionSchema } from \"./common\";\nimport { changeIdSchema, repositoryIdSchema, repositoryIdsSchema, taskIdSchema } from \"./id\";\nimport { agentRouteBindingSchema } from \"./agent-route\";\nimport { executionReferenceSchema } from \"./task\";\n\n/** Validates a stable Factory interaction identifier distinct from provider sessions. */\nexport const agentSessionIdSchema = z\n .string()\n .regex(/^ses_[a-z0-9]{6,64}$/u, \"Expected ses_ followed by 6 to 64 lowercase letters or digits\")\n .describe(\"Stable Factory interaction ID; independent of provider session IDs.\") as z.ZodType<\n `ses_${string}`,\n string\n>;\n/** Stable Factory interaction identifier independent of provider session IDs. */\nexport type AgentSessionId = z.infer<typeof agentSessionIdSchema>;\n\n/** Validates the initial human request retained by a Factory session. */\nexport const agentSessionMessageSchema = z\n .string()\n .max(16000)\n .describe(\"Initial request, retained for idempotent admission and recovery.\");\n\nconst continuationSchema = z\n .strictObject({\n operationId: z.string().min(1).max(200).describe(\"Idempotency key for this follow-up.\"),\n taskId: taskIdSchema.describe(\"Budgeted investigation answering this follow-up.\"),\n parentTaskId: taskIdSchema.describe(\"Earlier work being discussed.\"),\n agent: z.string().min(1).describe(\"Conversation agent handling this follow-up.\"),\n message: z.string().max(16000).describe(\"Operator's follow-up request.\"),\n attachments: imageAttachmentsSchema.optional().describe(\"Images accompanying this follow-up.\"),\n contextAttachments: imageAttachmentsSchema\n .optional()\n .describe(\"Earlier images selected with the cached conversation context.\"),\n context: z\n .string()\n .max(80000)\n .optional()\n .describe(\"Bounded conversation context captured before launch and retained for recovery.\"),\n createdAt: isoDateTimeSchema,\n })\n .refine(hasMessageContent, \"Enter a message or attach an image\")\n .readonly();\n\nconst externalConversationSchema = z\n .strictObject({\n replyTo: replyToSchema.describe(\n \"Original external conversation destination; never rewritten by the console.\",\n ),\n repositoryIds: repositoryIdsSchema.describe(\n \"Repositories authorized for this external conversation.\",\n ),\n url: z\n .url({ protocol: /^https$/u })\n .optional()\n .describe(\"HTTPS link to the original conversation.\"),\n })\n .readonly();\n\n/** Base object fields used to decode current and legacy session snapshots. */\nexport const agentSessionBaseSchema = z.strictObject({\n schemaVersion: schemaVersionSchema,\n id: agentSessionIdSchema,\n owner: z.string().min(1).describe(\"Authenticated principal owning this interaction.\"),\n agent: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,31}$/u)\n .describe(\"Selected application agent.\"),\n repositoryId: repositoryIdSchema\n .optional()\n .describe(\"Configured repository selected for this interaction.\"),\n route: agentRouteBindingSchema\n .optional()\n .describe(\"Exact specialist route selected when this session was admitted.\"),\n message: agentSessionMessageSchema,\n model: z\n .string()\n .trim()\n .min(1)\n .max(200)\n .optional()\n .describe(\"Opaque model selected at admission; unchanged by later repository defaults.\"),\n attachments: imageAttachmentsSchema\n .optional()\n .describe(\"Images accompanying the initial request.\"),\n changeId: changeIdSchema.optional().describe(\"Existing change selected for this work.\"),\n taskId: taskIdSchema\n .optional()\n .describe(\"Workflow-owned task and authoritative execution binding.\"),\n attached: z\n .boolean()\n .optional()\n .describe(\n \"Operator view of existing work that preserves its original origin and reply destination.\",\n ),\n continuations: z\n .array(continuationSchema)\n .readonly()\n .optional()\n .describe(\"Ordered immutable follow-up intents, each with separate work and usage.\"),\n execution: executionReferenceSchema\n .optional()\n .describe(\"Provider reference for taskless conversations only.\"),\n external: externalConversationSchema\n .optional()\n .describe(\"Read-only projection of an externally admitted taskless conversation.\"),\n notifications: z\n .array(communicationEventSchema)\n .readonly()\n .default([])\n .describe(\"Durable connector deliveries, deduplicated by eventId.\"),\n createdAt: isoDateTimeSchema,\n});\n\ntype AgentSessionBase = Readonly<z.infer<typeof agentSessionBaseSchema>>;\ntype BindingKeys = \"taskId\" | \"execution\" | \"external\" | \"route\" | \"continuations\";\n\n/** Durable session bound to workflow-owned Task work. */\nexport type TaskAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId: NonNullable<AgentSessionBase[\"taskId\"]>;\n execution?: never;\n external?: never;\n route?: AgentSessionBase[\"route\"];\n continuations?: AgentSessionBase[\"continuations\"];\n }\n>;\n\n/** Durable internal conversation whose provider execution is stored directly. */\nexport type DirectAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId?: never;\n execution?: AgentSessionBase[\"execution\"];\n external?: never;\n route?: AgentSessionBase[\"route\"];\n continuations?: AgentSessionBase[\"continuations\"];\n }\n>;\n\n/** Durable external conversation with a required direct provider execution. */\nexport type ExternalAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId?: never;\n execution: NonNullable<AgentSessionBase[\"execution\"]>;\n external: NonNullable<AgentSessionBase[\"external\"]>;\n route?: never;\n continuations?: never;\n }\n>;\n\n/** Durable interaction whose binding fields identify task, direct, or external ownership. */\nexport type AgentSession = TaskAgentSession | DirectAgentSession | ExternalAgentSession;\n\n/** Validates a persisted session and rejects contradictory task, execution, and external bindings. */\nexport const agentSessionSchema = agentSessionBaseSchema\n .refine(hasMessageContent, \"Enter a message or attach an image\")\n .refine(\n (session) => session.taskId === undefined || session.execution === undefined,\n \"A session binds either a task or a conversation execution\",\n )\n .refine(\n (session) =>\n session.external === undefined ||\n (session.execution !== undefined &&\n session.taskId === undefined &&\n session.continuations === undefined &&\n session.route === undefined),\n \"An external conversation requires an execution and cannot bind a Task, route, or continuations\",\n ) as z.ZodType<AgentSession>;\n"],"mappings":";;;;;;;;;AASA,MAAa,uBAAuB,EACjC,OAAO,CAAC,CACR,MAAM,yBAAyB,+DAA+D,CAAC,CAC/F,SAAS,qEAAqE;;AAQjF,MAAa,4BAA4B,EACtC,OAAO,CAAC,CACR,IAAI,IAAK,CAAC,CACV,SAAS,kEAAkE;AAE9E,MAAM,qBAAqB,EACxB,aAAa;CACZ,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,qCAAqC;CACtF,QAAQ,aAAa,SAAS,kDAAkD;CAChF,cAAc,aAAa,SAAS,+BAA+B;CACnE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,6CAA6C;CAC/E,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,IAAK,CAAC,CAAC,SAAS,+BAA+B;CACvE,aAAa,uBAAuB,SAAS,CAAC,CAAC,SAAS,qCAAqC;CAC7F,oBAAoB,uBACjB,SAAS,CAAC,CACV,SAAS,+DAA+D;CAC3E,SAAS,EACN,OAAO,CAAC,CACR,IAAI,GAAK,CAAC,CACV,SAAS,CAAC,CACV,SAAS,gFAAgF;CAC5F,WAAW;AACb,CAAC,CAAC,CACD,OAAO,mBAAmB,oCAAoC,CAAC,CAC/D,SAAS;AAEZ,MAAM,6BAA6B,EAChC,aAAa;CACZ,SAAS,cAAc,SACrB,6EACF;CACA,eAAe,oBAAoB,SACjC,yDACF;CACA,KAAK,EACF,IAAI,EAAE,UAAU,WAAW,CAAC,CAAC,CAC7B,SAAS,CAAC,CACV,SAAS,0CAA0C;AACxD,CAAC,CAAC,CACD,SAAS;;AAGZ,MAAa,yBAAyB,EAAE,aAAa;CACnD,eAAe;CACf,IAAI;CACJ,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,kDAAkD;CACpF,OAAO,EACJ,OAAO,CAAC,CACR,MAAM,yBAAyB,CAAC,CAChC,SAAS,6BAA6B;CACzC,cAAc,mBACX,SAAS,CAAC,CACV,SAAS,sDAAsD;CAClE,OAAO,wBACJ,SAAS,CAAC,CACV,SAAS,iEAAiE;CAC7E,SAAS;CACT,OAAO,EACJ,OAAO,CAAC,CACR,KAAK,CAAC,CACN,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SAAS,CAAC,CACV,SAAS,6EAA6E;CACzF,aAAa,uBACV,SAAS,CAAC,CACV,SAAS,0CAA0C;CACtD,UAAU,eAAe,SAAS,CAAC,CAAC,SAAS,yCAAyC;CACtF,QAAQ,aACL,SAAS,CAAC,CACV,SAAS,0DAA0D;CACtE,UAAU,EACP,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SACC,0FACF;CACF,eAAe,EACZ,MAAM,kBAAkB,CAAC,CACzB,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,yEAAyE;CACrF,WAAW,yBACR,SAAS,CAAC,CACV,SAAS,qDAAqD;CACjE,UAAU,2BACP,SAAS,CAAC,CACV,SAAS,uEAAuE;CACnF,eAAe,EACZ,MAAM,wBAAwB,CAAC,CAC/B,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,wDAAwD;CACpE,WAAW;AACb,CAAC;;AA0CD,MAAa,qBAAqB,uBAC/B,OAAO,mBAAmB,oCAAoC,CAAC,CAC/D,QACE,YAAY,QAAQ,WAAW,KAAA,KAAa,QAAQ,cAAc,KAAA,GACnE,2DACF,CAAC,CACA,QACE,YACC,QAAQ,aAAa,KAAA,KACpB,QAAQ,cAAc,KAAA,KACrB,QAAQ,WAAW,KAAA,KACnB,QAAQ,kBAAkB,KAAA,KAC1B,QAAQ,UAAU,KAAA,GACtB,gGACF"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/signal.d.ts
|
|
3
|
+
/** Sources used by the standard connectors. Any vocabulary value is valid. */
|
|
4
|
+
declare const standardSignalSources: readonly ["github_issue", "github_pr", "github_pr_comment", "slack", "human", "github_ci_failure", "vercel_deploy_failure", "security_scan", "investigation", "api"];
|
|
5
|
+
/** Standard Signal sources with support for caller-defined connector values. */
|
|
6
|
+
type SignalSource = (typeof standardSignalSources)[number] | (string & Record<never, never>);
|
|
7
|
+
/** Validates the open vocabulary naming what produced an inbound Signal. */
|
|
8
|
+
declare const signalSourceSchema: z.ZodType<SignalSource>;
|
|
9
|
+
/** Validates the one-time triage decision recorded for a Signal. */
|
|
10
|
+
declare const signalOutcomeSchema: z.ZodEnum<{
|
|
11
|
+
pending: "pending";
|
|
12
|
+
accepted: "accepted";
|
|
13
|
+
duplicate: "duplicate";
|
|
14
|
+
unactionable: "unactionable";
|
|
15
|
+
low_confidence: "low_confidence";
|
|
16
|
+
ignored: "ignored";
|
|
17
|
+
}>;
|
|
18
|
+
/** Validates the latest durable Foreman triage attempt. */
|
|
19
|
+
declare const signalTriageSchema: z.ZodObject<{
|
|
20
|
+
attempt: z.ZodNumber;
|
|
21
|
+
state: z.ZodEnum<{
|
|
22
|
+
running: "running";
|
|
23
|
+
blocked: "blocked";
|
|
24
|
+
uncertain: "uncertain";
|
|
25
|
+
}>;
|
|
26
|
+
by: z.ZodString;
|
|
27
|
+
startedAt: z.ZodISODateTime;
|
|
28
|
+
updatedAt: z.ZodISODateTime;
|
|
29
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
failure: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
cancelled: "cancelled";
|
|
32
|
+
billing_verification_required: "billing_verification_required";
|
|
33
|
+
provider_failed: "provider_failed";
|
|
34
|
+
no_decision: "no_decision";
|
|
35
|
+
launch_unconfirmed: "launch_unconfirmed";
|
|
36
|
+
}>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
/** Latest durable pre-task triage attempt. */
|
|
39
|
+
type SignalTriage = z.infer<typeof signalTriageSchema>;
|
|
40
|
+
/** Validates a persisted, normalized, and still-untrusted inbound Signal. */
|
|
41
|
+
declare const signalRecordSchema: z.ZodObject<{
|
|
42
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
43
|
+
id: z.ZodType<`sig_${string}`, string, z.core.$ZodTypeInternals<`sig_${string}`, string>>;
|
|
44
|
+
repositoryId: z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>;
|
|
45
|
+
source: z.ZodType<SignalSource, unknown, z.core.$ZodTypeInternals<SignalSource, unknown>>;
|
|
46
|
+
deliveryId: z.ZodString;
|
|
47
|
+
replyTo: z.ZodObject<{
|
|
48
|
+
channel: z.ZodString;
|
|
49
|
+
address: z.ZodString;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
payload: z.ZodUnknown;
|
|
52
|
+
receivedAt: z.ZodISODateTime;
|
|
53
|
+
outcome: z.ZodEnum<{
|
|
54
|
+
pending: "pending";
|
|
55
|
+
accepted: "accepted";
|
|
56
|
+
duplicate: "duplicate";
|
|
57
|
+
unactionable: "unactionable";
|
|
58
|
+
low_confidence: "low_confidence";
|
|
59
|
+
ignored: "ignored";
|
|
60
|
+
}>;
|
|
61
|
+
triage: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
attempt: z.ZodNumber;
|
|
63
|
+
state: z.ZodEnum<{
|
|
64
|
+
running: "running";
|
|
65
|
+
blocked: "blocked";
|
|
66
|
+
uncertain: "uncertain";
|
|
67
|
+
}>;
|
|
68
|
+
by: z.ZodString;
|
|
69
|
+
startedAt: z.ZodISODateTime;
|
|
70
|
+
updatedAt: z.ZodISODateTime;
|
|
71
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
72
|
+
failure: z.ZodOptional<z.ZodEnum<{
|
|
73
|
+
cancelled: "cancelled";
|
|
74
|
+
billing_verification_required: "billing_verification_required";
|
|
75
|
+
provider_failed: "provider_failed";
|
|
76
|
+
no_decision: "no_decision";
|
|
77
|
+
launch_unconfirmed: "launch_unconfirmed";
|
|
78
|
+
}>>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
81
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
82
|
+
decidedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
/** Triage disposition that determines whether a Signal starts work. */
|
|
85
|
+
type SignalOutcome = z.infer<typeof signalOutcomeSchema>;
|
|
86
|
+
type SignalRecord = z.infer<typeof signalRecordSchema>;
|
|
87
|
+
type SignalDecisionFields = "outcome" | "decidedAt";
|
|
88
|
+
type SchemaWithOutput<Schema extends z.ZodType, Output> = Omit<Schema, keyof z.ZodType> & z.ZodType<Output, z.input<Schema>>;
|
|
89
|
+
/** Persisted normalized input that has not received a triage decision. */
|
|
90
|
+
type PendingSignal = Omit<SignalRecord, SignalDecisionFields> & {
|
|
91
|
+
outcome: "pending";
|
|
92
|
+
decidedAt?: never;
|
|
93
|
+
};
|
|
94
|
+
/** Persisted normalized input carrying its completed triage decision time. */
|
|
95
|
+
type DecidedSignal = Omit<SignalRecord, SignalDecisionFields> & {
|
|
96
|
+
outcome: Exclude<SignalOutcome, "pending">;
|
|
97
|
+
decidedAt: string;
|
|
98
|
+
};
|
|
99
|
+
/** Persisted normalized input awaiting or carrying a workflow triage decision. */
|
|
100
|
+
type Signal = PendingSignal | DecidedSignal;
|
|
101
|
+
/** Validates a persisted, normalized, and still-untrusted inbound Signal. */
|
|
102
|
+
declare const signalSchema: SchemaWithOutput<typeof signalRecordSchema, Signal>;
|
|
103
|
+
//#endregion
|
|
104
|
+
export { DecidedSignal, PendingSignal, Signal, SignalOutcome, SignalSource, SignalTriage, signalOutcomeSchema, signalSchema, signalSourceSchema, signalTriageSchema, standardSignalSources };
|
|
105
|
+
//# sourceMappingURL=signal.d.mts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { repositoryIdSchema, signalIdSchema } from "./id.mjs";
|
|
2
|
+
import { isoDateTimeSchema, replyToSchema, schemaVersionSchema, vocabularySchema } from "./common.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/schema/signal.ts
|
|
5
|
+
/** Sources used by the standard connectors. Any vocabulary value is valid. */
|
|
6
|
+
const standardSignalSources = [
|
|
7
|
+
"github_issue",
|
|
8
|
+
"github_pr",
|
|
9
|
+
"github_pr_comment",
|
|
10
|
+
"slack",
|
|
11
|
+
"human",
|
|
12
|
+
"github_ci_failure",
|
|
13
|
+
"vercel_deploy_failure",
|
|
14
|
+
"security_scan",
|
|
15
|
+
"investigation",
|
|
16
|
+
"api"
|
|
17
|
+
];
|
|
18
|
+
/** Validates the open vocabulary naming what produced an inbound Signal. */
|
|
19
|
+
const signalSourceSchema = vocabularySchema.describe("What produced the signal, e.g. github_issue or a custom connector's own name.");
|
|
20
|
+
/** Validates the one-time triage decision recorded for a Signal. */
|
|
21
|
+
const signalOutcomeSchema = z.enum([
|
|
22
|
+
"pending",
|
|
23
|
+
"accepted",
|
|
24
|
+
"duplicate",
|
|
25
|
+
"unactionable",
|
|
26
|
+
"low_confidence",
|
|
27
|
+
"ignored"
|
|
28
|
+
]).describe("Triage outcome. A signal starts pending and is decided exactly once.");
|
|
29
|
+
/** Validates safe failure categories; provider error text is never persisted here. */
|
|
30
|
+
const signalTriageFailureSchema = z.enum([
|
|
31
|
+
"billing_verification_required",
|
|
32
|
+
"provider_failed",
|
|
33
|
+
"cancelled",
|
|
34
|
+
"no_decision",
|
|
35
|
+
"launch_unconfirmed"
|
|
36
|
+
]).describe("Safe failure category for pre-task Foreman triage.");
|
|
37
|
+
/** Validates the latest durable Foreman triage attempt. */
|
|
38
|
+
const signalTriageSchema = z.strictObject({
|
|
39
|
+
attempt: z.number().int().positive().describe("Monotonic attempt fence."),
|
|
40
|
+
state: z.enum([
|
|
41
|
+
"running",
|
|
42
|
+
"blocked",
|
|
43
|
+
"uncertain"
|
|
44
|
+
]).describe("Running, confirmed stopped, or launch outcome unknown."),
|
|
45
|
+
by: z.string().min(1).describe("Trusted initiator of this attempt, including the retry operator."),
|
|
46
|
+
startedAt: isoDateTimeSchema.describe("When this attempt was admitted."),
|
|
47
|
+
updatedAt: isoDateTimeSchema.describe("When its latest observation was recorded."),
|
|
48
|
+
sessionId: z.string().min(1).optional().describe("Provider session handle, when observed."),
|
|
49
|
+
failure: signalTriageFailureSchema.optional().describe("Safe category requiring operator attention.")
|
|
50
|
+
});
|
|
51
|
+
/** Validates a persisted, normalized, and still-untrusted inbound Signal. */
|
|
52
|
+
const signalSchema = z.strictObject({
|
|
53
|
+
schemaVersion: schemaVersionSchema,
|
|
54
|
+
id: signalIdSchema.describe("Signal id, derived from source and deliveryId."),
|
|
55
|
+
repositoryId: repositoryIdSchema.describe("Repository the signal is about."),
|
|
56
|
+
source: signalSourceSchema,
|
|
57
|
+
deliveryId: z.string().min(1).describe("Provider idempotency key; a redelivered event maps to the same signal."),
|
|
58
|
+
replyTo: replyToSchema,
|
|
59
|
+
payload: z.unknown().describe("Provider-shaped payload. Untrusted data, never instructions."),
|
|
60
|
+
receivedAt: isoDateTimeSchema,
|
|
61
|
+
outcome: signalOutcomeSchema,
|
|
62
|
+
triage: signalTriageSchema.optional().describe("Absent for intake recorded before attempt tracking or handled by another workflow."),
|
|
63
|
+
detail: z.string().min(1).optional().describe("Outcome nuance, e.g. severity when accepted or the duplicate-of signal id."),
|
|
64
|
+
reason: z.string().min(1).optional().describe("Why the outcome was chosen."),
|
|
65
|
+
decidedAt: isoDateTimeSchema.optional()
|
|
66
|
+
}).superRefine((signal, ctx) => {
|
|
67
|
+
if (signal.outcome === "pending" && signal.decidedAt !== void 0) ctx.addIssue({
|
|
68
|
+
code: "custom",
|
|
69
|
+
path: ["decidedAt"],
|
|
70
|
+
message: "pending signals must not carry decidedAt"
|
|
71
|
+
});
|
|
72
|
+
if (signal.outcome !== "pending" && signal.decidedAt === void 0) ctx.addIssue({
|
|
73
|
+
code: "custom",
|
|
74
|
+
path: ["decidedAt"],
|
|
75
|
+
message: "decided signals require decidedAt"
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
//#endregion
|
|
79
|
+
export { signalOutcomeSchema, signalSchema, signalSourceSchema, signalTriageSchema, standardSignalSources };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=signal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal.mjs","names":[],"sources":["../../src/schema/signal.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, replyToSchema, schemaVersionSchema, vocabularySchema } from \"./common\";\nimport { repositoryIdSchema, signalIdSchema } from \"./id\";\n\n/** Sources used by the standard connectors. Any vocabulary value is valid. */\nexport const standardSignalSources = [\n \"github_issue\",\n \"github_pr\",\n \"github_pr_comment\",\n \"slack\",\n \"human\",\n \"github_ci_failure\",\n \"vercel_deploy_failure\",\n \"security_scan\",\n \"investigation\",\n \"api\",\n] as const;\n\n/** Standard Signal sources with support for caller-defined connector values. */\nexport type SignalSource = (typeof standardSignalSources)[number] | (string & Record<never, never>);\n\n/** Validates the open vocabulary naming what produced an inbound Signal. */\nexport const signalSourceSchema = vocabularySchema.describe(\n \"What produced the signal, e.g. github_issue or a custom connector's own name.\",\n) as z.ZodType<SignalSource>;\n\n/** Validates the one-time triage decision recorded for a Signal. */\nexport const signalOutcomeSchema = z\n .enum([\"pending\", \"accepted\", \"duplicate\", \"unactionable\", \"low_confidence\", \"ignored\"])\n .describe(\"Triage outcome. A signal starts pending and is decided exactly once.\");\n\n/** Validates safe failure categories; provider error text is never persisted here. */\nconst signalTriageFailureSchema = z\n .enum([\n \"billing_verification_required\",\n \"provider_failed\",\n \"cancelled\",\n \"no_decision\",\n \"launch_unconfirmed\",\n ])\n .describe(\"Safe failure category for pre-task Foreman triage.\");\n\n/** Validates the latest durable Foreman triage attempt. */\nexport const signalTriageSchema = z.strictObject({\n attempt: z.number().int().positive().describe(\"Monotonic attempt fence.\"),\n state: z\n .enum([\"running\", \"blocked\", \"uncertain\"])\n .describe(\"Running, confirmed stopped, or launch outcome unknown.\"),\n by: z\n .string()\n .min(1)\n .describe(\"Trusted initiator of this attempt, including the retry operator.\"),\n startedAt: isoDateTimeSchema.describe(\"When this attempt was admitted.\"),\n updatedAt: isoDateTimeSchema.describe(\"When its latest observation was recorded.\"),\n sessionId: z.string().min(1).optional().describe(\"Provider session handle, when observed.\"),\n failure: signalTriageFailureSchema\n .optional()\n .describe(\"Safe category requiring operator attention.\"),\n});\n/** Latest durable pre-task triage attempt. */\nexport type SignalTriage = z.infer<typeof signalTriageSchema>;\n\n/** Validates a persisted, normalized, and still-untrusted inbound Signal. */\nconst signalRecordSchema = z\n .strictObject({\n schemaVersion: schemaVersionSchema,\n id: signalIdSchema.describe(\"Signal id, derived from source and deliveryId.\"),\n repositoryId: repositoryIdSchema.describe(\"Repository the signal is about.\"),\n source: signalSourceSchema,\n deliveryId: z\n .string()\n .min(1)\n .describe(\"Provider idempotency key; a redelivered event maps to the same signal.\"),\n replyTo: replyToSchema,\n payload: z.unknown().describe(\"Provider-shaped payload. Untrusted data, never instructions.\"),\n receivedAt: isoDateTimeSchema,\n outcome: signalOutcomeSchema,\n triage: signalTriageSchema\n .optional()\n .describe(\n \"Absent for intake recorded before attempt tracking or handled by another workflow.\",\n ),\n detail: z\n .string()\n .min(1)\n .optional()\n .describe(\"Outcome nuance, e.g. severity when accepted or the duplicate-of signal id.\"),\n reason: z.string().min(1).optional().describe(\"Why the outcome was chosen.\"),\n decidedAt: isoDateTimeSchema.optional(),\n })\n .superRefine((signal, ctx) => {\n if (signal.outcome === \"pending\" && signal.decidedAt !== undefined) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"decidedAt\"],\n message: \"pending signals must not carry decidedAt\",\n });\n }\n if (signal.outcome !== \"pending\" && signal.decidedAt === undefined) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"decidedAt\"],\n message: \"decided signals require decidedAt\",\n });\n }\n });\n\n/** Triage disposition that determines whether a Signal starts work. */\nexport type SignalOutcome = z.infer<typeof signalOutcomeSchema>;\ntype SignalRecord = z.infer<typeof signalRecordSchema>;\ntype SignalDecisionFields = \"outcome\" | \"decidedAt\";\ntype SchemaWithOutput<Schema extends z.ZodType, Output> = Omit<Schema, keyof z.ZodType> &\n z.ZodType<Output, z.input<Schema>>;\n\n/** Persisted normalized input that has not received a triage decision. */\nexport type PendingSignal = Omit<SignalRecord, SignalDecisionFields> & {\n outcome: \"pending\";\n decidedAt?: never;\n};\n\n/** Persisted normalized input carrying its completed triage decision time. */\nexport type DecidedSignal = Omit<SignalRecord, SignalDecisionFields> & {\n outcome: Exclude<SignalOutcome, \"pending\">;\n decidedAt: string;\n};\n\n/** Persisted normalized input awaiting or carrying a workflow triage decision. */\nexport type Signal = PendingSignal | DecidedSignal;\n\n/** Validates a persisted, normalized, and still-untrusted inbound Signal. */\nexport const signalSchema = signalRecordSchema as SchemaWithOutput<\n typeof signalRecordSchema,\n Signal\n>;\n"],"mappings":";;;;;AAKA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAMA,MAAa,qBAAqB,iBAAiB,SACjD,+EACF;;AAGA,MAAa,sBAAsB,EAChC,KAAK;CAAC;CAAW;CAAY;CAAa;CAAgB;CAAkB;AAAS,CAAC,CAAC,CACvF,SAAS,sEAAsE;;AAGlF,MAAM,4BAA4B,EAC/B,KAAK;CACJ;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,CACD,SAAS,oDAAoD;;AAGhE,MAAa,qBAAqB,EAAE,aAAa;CAC/C,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,0BAA0B;CACxE,OAAO,EACJ,KAAK;EAAC;EAAW;EAAW;CAAW,CAAC,CAAC,CACzC,SAAS,wDAAwD;CACpE,IAAI,EACD,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,kEAAkE;CAC9E,WAAW,kBAAkB,SAAS,iCAAiC;CACvE,WAAW,kBAAkB,SAAS,2CAA2C;CACjF,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,yCAAyC;CAC1F,SAAS,0BACN,SAAS,CAAC,CACV,SAAS,6CAA6C;AAC3D,CAAC;;AAwED,MAAa,eAnEc,EACxB,aAAa;CACZ,eAAe;CACf,IAAI,eAAe,SAAS,gDAAgD;CAC5E,cAAc,mBAAmB,SAAS,iCAAiC;CAC3E,QAAQ;CACR,YAAY,EACT,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,wEAAwE;CACpF,SAAS;CACT,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,8DAA8D;CAC5F,YAAY;CACZ,SAAS;CACT,QAAQ,mBACL,SAAS,CAAC,CACV,SACC,oFACF;CACF,QAAQ,EACL,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,4EAA4E;CACxF,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,6BAA6B;CAC3E,WAAW,kBAAkB,SAAS;AACxC,CAAC,CAAC,CACD,aAAa,QAAQ,QAAQ;CAC5B,IAAI,OAAO,YAAY,aAAa,OAAO,cAAc,KAAA,GACvD,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,WAAW;EAClB,SAAS;CACX,CAAC;CAEH,IAAI,OAAO,YAAY,aAAa,OAAO,cAAc,KAAA,GACvD,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,WAAW;EAClB,SAAS;CACX,CAAC;AAEL,CAyB0B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/slack-pr-notifications.d.ts
|
|
3
|
+
/** Validates the Slack destination and individual mentions for Factory-produced PR announcements. */
|
|
4
|
+
declare const slackPrNotificationsSchema: z.ZodReadonly<z.ZodObject<{
|
|
5
|
+
channelId: z.ZodString;
|
|
6
|
+
mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
7
|
+
}, z.core.$strict>>;
|
|
8
|
+
/** Slack destination and individual mentions for Factory-produced PR announcements. */
|
|
9
|
+
type SlackPrNotifications = z.infer<typeof slackPrNotificationsSchema>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SlackPrNotifications, slackPrNotificationsSchema };
|
|
12
|
+
//# sourceMappingURL=slack-pr-notifications.d.mts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/slack-pr-notifications.ts
|
|
3
|
+
/** Validates the Slack destination and individual mentions for Factory-produced PR announcements. */
|
|
4
|
+
const slackPrNotificationsSchema = z.strictObject({
|
|
5
|
+
channelId: z.string().regex(/^[CG][A-Z0-9]+$/u).describe("Existing Slack channel for PR announcements."),
|
|
6
|
+
mentionUserIds: z.array(z.string().regex(/^[UW][A-Z0-9]+$/u)).min(1).max(10).readonly().refine((ids) => new Set(ids).size === ids.length, "Slack mention users must be unique.").describe("Slack users to mention when the factory opens a PR.")
|
|
7
|
+
}).readonly();
|
|
8
|
+
//#endregion
|
|
9
|
+
export { slackPrNotificationsSchema };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=slack-pr-notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-pr-notifications.mjs","names":[],"sources":["../../src/schema/slack-pr-notifications.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/** Validates the Slack destination and individual mentions for Factory-produced PR announcements. */\nexport const slackPrNotificationsSchema = z\n .strictObject({\n channelId: z\n .string()\n .regex(/^[CG][A-Z0-9]+$/u)\n .describe(\"Existing Slack channel for PR announcements.\"),\n mentionUserIds: z\n .array(z.string().regex(/^[UW][A-Z0-9]+$/u))\n .min(1)\n .max(10)\n .readonly()\n .refine((ids) => new Set(ids).size === ids.length, \"Slack mention users must be unique.\")\n .describe(\"Slack users to mention when the factory opens a PR.\"),\n })\n .readonly();\n\n/** Slack destination and individual mentions for Factory-produced PR announcements. */\nexport type SlackPrNotifications = z.infer<typeof slackPrNotificationsSchema>;\n"],"mappings":";;;AAGA,MAAa,6BAA6B,EACvC,aAAa;CACZ,WAAW,EACR,OAAO,CAAC,CACR,MAAM,kBAAkB,CAAC,CACzB,SAAS,8CAA8C;CAC1D,gBAAgB,EACb,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,kBAAkB,CAAC,CAAC,CAC3C,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,SAAS,CAAC,CACV,QAAQ,QAAQ,IAAI,IAAI,GAAG,CAAC,CAAC,SAAS,IAAI,QAAQ,qCAAqC,CAAC,CACxF,SAAS,qDAAqD;AACnE,CAAC,CAAC,CACD,SAAS"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { agentSessionSchema } from "./session.mjs";
|
|
2
|
+
//#region src/schema/stored-session.ts
|
|
3
|
+
/** Validates ordinary Factory-owned session records, excluding external projections. */
|
|
4
|
+
const storedSessionSchema = agentSessionSchema.refine((session) => session.external === void 0, "External conversations belong only in externalSessions");
|
|
5
|
+
/** Validates read-only descriptors of conversations admitted outside Factory. */
|
|
6
|
+
const externalSessionSchema = agentSessionSchema.refine((session) => session.external !== void 0, "External session records require an external conversation descriptor");
|
|
7
|
+
//#endregion
|
|
8
|
+
export { externalSessionSchema, storedSessionSchema };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=stored-session.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stored-session.mjs","names":[],"sources":["../../src/schema/stored-session.ts"],"sourcesContent":["import { agentSessionSchema } from \"./session\";\n\n/** Validates ordinary Factory-owned session records, excluding external projections. */\nexport const storedSessionSchema = agentSessionSchema.refine(\n (session) => session.external === undefined,\n \"External conversations belong only in externalSessions\",\n);\n\n/** Validates read-only descriptors of conversations admitted outside Factory. */\nexport const externalSessionSchema = agentSessionSchema.refine(\n (session) => session.external !== undefined,\n \"External session records require an external conversation descriptor\",\n);\n"],"mappings":";;;AAGA,MAAa,sBAAsB,mBAAmB,QACnD,YAAY,QAAQ,aAAa,KAAA,GAClC,wDACF;;AAGA,MAAa,wBAAwB,mBAAmB,QACrD,YAAY,QAAQ,aAAa,KAAA,GAClC,sEACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { taskSchema } from "./task.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/schema/stored-task.ts
|
|
4
|
+
/**
|
|
5
|
+
* Validates persisted Tasks while narrowly repairing legacy human-action text;
|
|
6
|
+
* all required unified work and graph fields still validate without fallback.
|
|
7
|
+
*/
|
|
8
|
+
const storedTaskSchema = z.preprocess((value) => {
|
|
9
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) || !("state" in value) || value.state !== "needs_human" || Object.hasOwn(value, "needsHumanAction")) return value;
|
|
10
|
+
const question = "question" in value ? value.question : void 0;
|
|
11
|
+
const text = typeof question === "object" && question !== null && "text" in question ? question.text : void 0;
|
|
12
|
+
return {
|
|
13
|
+
...value,
|
|
14
|
+
needsHumanAction: typeof text === "string" && text.trim() !== "" ? text.trim() : "This task entered needs_human before Factory recorded why; check its question and history for context."
|
|
15
|
+
};
|
|
16
|
+
}, taskSchema);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { storedTaskSchema };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=stored-task.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stored-task.mjs","names":[],"sources":["../../src/schema/stored-task.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { taskSchema } from \"./task\";\n\n/**\n * Validates persisted Tasks while narrowly repairing legacy human-action text;\n * all required unified work and graph fields still validate without fallback.\n */\nexport const storedTaskSchema = z.preprocess((value) => {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value) ||\n !(\"state\" in value) ||\n value.state !== \"needs_human\" ||\n Object.hasOwn(value, \"needsHumanAction\")\n )\n return value;\n const question = \"question\" in value ? value.question : undefined;\n const text =\n typeof question === \"object\" && question !== null && \"text\" in question\n ? question.text\n : undefined;\n return {\n ...value,\n needsHumanAction:\n typeof text === \"string\" && text.trim() !== \"\"\n ? text.trim()\n : \"This task entered needs_human before Factory recorded why; check its question and history for context.\",\n };\n}, taskSchema);\n"],"mappings":";;;;;;;AAOA,MAAa,mBAAmB,EAAE,YAAY,UAAU;CACtD,IACE,OAAO,UAAU,YACjB,UAAU,QACV,MAAM,QAAQ,KAAK,KACnB,EAAE,WAAW,UACb,MAAM,UAAU,iBAChB,OAAO,OAAO,OAAO,kBAAkB,GAEvC,OAAO;CACT,MAAM,WAAW,cAAc,QAAQ,MAAM,WAAW,KAAA;CACxD,MAAM,OACJ,OAAO,aAAa,YAAY,aAAa,QAAQ,UAAU,WAC3D,SAAS,OACT,KAAA;CACN,OAAO;EACL,GAAG;EACH,kBACE,OAAO,SAAS,YAAY,KAAK,KAAK,MAAM,KACxC,KAAK,KAAK,IACV;CACR;AACF,GAAG,UAAU"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/task-effect.d.ts
|
|
3
|
+
/** Validates the capability namespace and name identifying a Task-scoped effect. */
|
|
4
|
+
declare const taskEffectKeySchema: z.ZodObject<{
|
|
5
|
+
namespace: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
/** Validates an opaque provider resource retained for effect reconciliation. */
|
|
9
|
+
declare const taskEffectReferenceSchema: z.ZodObject<{
|
|
10
|
+
provider: z.ZodString;
|
|
11
|
+
resourceId: z.ZodString;
|
|
12
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
/** Validates durable recovery state for one Task-scoped external effect. */
|
|
15
|
+
declare const taskEffectSchema: z.ZodObject<{
|
|
16
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
17
|
+
taskId: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
|
|
18
|
+
key: z.ZodObject<{
|
|
19
|
+
namespace: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
reference: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
provider: z.ZodString;
|
|
24
|
+
resourceId: z.ZodString;
|
|
25
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
resolvedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
28
|
+
createdAt: z.ZodISODateTime;
|
|
29
|
+
updatedAt: z.ZodISODateTime;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
/** Capability-owned namespaced identity of a Task-scoped effect. */
|
|
32
|
+
type TaskEffectKey = z.infer<typeof taskEffectKeySchema>;
|
|
33
|
+
/** Opaque provider resource handle retained for effect reconciliation. */
|
|
34
|
+
type TaskEffectReference = z.infer<typeof taskEffectReferenceSchema>;
|
|
35
|
+
/** Durable, CAS-protected recovery state for one external Task effect. */
|
|
36
|
+
type TaskEffect = z.infer<typeof taskEffectSchema>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { TaskEffect, TaskEffectKey, TaskEffectReference, taskEffectKeySchema, taskEffectReferenceSchema, taskEffectSchema };
|
|
39
|
+
//# sourceMappingURL=task-effect.d.mts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { taskIdSchema } from "./id.mjs";
|
|
2
|
+
import { isoDateTimeSchema, schemaVersionSchema, vocabularySchema } from "./common.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/schema/task-effect.ts
|
|
5
|
+
/** Validates the capability namespace and name identifying a Task-scoped effect. */
|
|
6
|
+
const taskEffectKeySchema = z.strictObject({
|
|
7
|
+
namespace: vocabularySchema.describe("Capability that owns this effect, e.g. software."),
|
|
8
|
+
name: vocabularySchema.describe("Effect name within the owning capability.")
|
|
9
|
+
}).describe("Namespaced identity for one task-scoped external effect.");
|
|
10
|
+
/** Validates an opaque provider resource retained for effect reconciliation. */
|
|
11
|
+
const taskEffectReferenceSchema = z.strictObject({
|
|
12
|
+
provider: vocabularySchema.describe("External provider that owns the resource."),
|
|
13
|
+
resourceId: z.string().min(1).max(512).describe("Provider-side resource identity."),
|
|
14
|
+
subject: z.string().min(1).max(512).optional().describe("Provider-side subject or version the resource applies to.")
|
|
15
|
+
}).describe("Opaque handle for an external resource created by an effect.");
|
|
16
|
+
/** Validates durable recovery state for one Task-scoped external effect. */
|
|
17
|
+
const taskEffectSchema = z.strictObject({
|
|
18
|
+
schemaVersion: schemaVersionSchema,
|
|
19
|
+
taskId: taskIdSchema,
|
|
20
|
+
key: taskEffectKeySchema,
|
|
21
|
+
reference: taskEffectReferenceSchema.optional(),
|
|
22
|
+
resolvedAt: isoDateTimeSchema.optional().describe("Write-once stamp showing that this effect needs no further reconciliation."),
|
|
23
|
+
createdAt: isoDateTimeSchema,
|
|
24
|
+
updatedAt: isoDateTimeSchema
|
|
25
|
+
}).refine((effect) => effect.reference !== void 0 || effect.resolvedAt !== void 0, { message: "A task effect requires a reference or resolution stamp." });
|
|
26
|
+
//#endregion
|
|
27
|
+
export { taskEffectKeySchema, taskEffectReferenceSchema, taskEffectSchema };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=task-effect.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-effect.mjs","names":[],"sources":["../../src/schema/task-effect.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, schemaVersionSchema, vocabularySchema } from \"./common\";\nimport { taskIdSchema } from \"./id\";\n\n/** Validates the capability namespace and name identifying a Task-scoped effect. */\nexport const taskEffectKeySchema = z\n .strictObject({\n namespace: vocabularySchema.describe(\"Capability that owns this effect, e.g. software.\"),\n name: vocabularySchema.describe(\"Effect name within the owning capability.\"),\n })\n .describe(\"Namespaced identity for one task-scoped external effect.\");\n\n/** Validates an opaque provider resource retained for effect reconciliation. */\nexport const taskEffectReferenceSchema = z\n .strictObject({\n provider: vocabularySchema.describe(\"External provider that owns the resource.\"),\n resourceId: z.string().min(1).max(512).describe(\"Provider-side resource identity.\"),\n subject: z\n .string()\n .min(1)\n .max(512)\n .optional()\n .describe(\"Provider-side subject or version the resource applies to.\"),\n })\n .describe(\"Opaque handle for an external resource created by an effect.\");\n\n/** Validates durable recovery state for one Task-scoped external effect. */\nexport const taskEffectSchema = z\n .strictObject({\n schemaVersion: schemaVersionSchema,\n taskId: taskIdSchema,\n key: taskEffectKeySchema,\n reference: taskEffectReferenceSchema.optional(),\n resolvedAt: isoDateTimeSchema\n .optional()\n .describe(\"Write-once stamp showing that this effect needs no further reconciliation.\"),\n createdAt: isoDateTimeSchema,\n updatedAt: isoDateTimeSchema,\n })\n .refine((effect) => effect.reference !== undefined || effect.resolvedAt !== undefined, {\n message: \"A task effect requires a reference or resolution stamp.\",\n });\n\n/** Capability-owned namespaced identity of a Task-scoped effect. */\nexport type TaskEffectKey = z.infer<typeof taskEffectKeySchema>;\n/** Opaque provider resource handle retained for effect reconciliation. */\nexport type TaskEffectReference = z.infer<typeof taskEffectReferenceSchema>;\n/** Durable, CAS-protected recovery state for one external Task effect. */\nexport type TaskEffect = z.infer<typeof taskEffectSchema>;\n"],"mappings":";;;;;AAKA,MAAa,sBAAsB,EAChC,aAAa;CACZ,WAAW,iBAAiB,SAAS,kDAAkD;CACvF,MAAM,iBAAiB,SAAS,2CAA2C;AAC7E,CAAC,CAAC,CACD,SAAS,0DAA0D;;AAGtE,MAAa,4BAA4B,EACtC,aAAa;CACZ,UAAU,iBAAiB,SAAS,2CAA2C;CAC/E,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,kCAAkC;CAClF,SAAS,EACN,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SAAS,CAAC,CACV,SAAS,2DAA2D;AACzE,CAAC,CAAC,CACD,SAAS,8DAA8D;;AAG1E,MAAa,mBAAmB,EAC7B,aAAa;CACZ,eAAe;CACf,QAAQ;CACR,KAAK;CACL,WAAW,0BAA0B,SAAS;CAC9C,YAAY,kBACT,SAAS,CAAC,CACV,SAAS,4EAA4E;CACxF,WAAW;CACX,WAAW;AACb,CAAC,CAAC,CACD,QAAQ,WAAW,OAAO,cAAc,KAAA,KAAa,OAAO,eAAe,KAAA,GAAW,EACrF,SAAS,0DACX,CAAC"}
|