@vercel/factory 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +307 -1
- package/dist/agent-routes.d.mts +69 -0
- package/dist/agent-routes.mjs +64 -0
- package/dist/agent-routes.mjs.map +1 -0
- package/dist/api-contracts.d.mts +1749 -0
- package/dist/api-contracts.mjs +118 -0
- package/dist/api-contracts.mjs.map +1 -0
- package/dist/api-images.d.mts +30 -0
- package/dist/api-images.mjs +28 -0
- package/dist/api-images.mjs.map +1 -0
- package/dist/api-task-graph.mjs +57 -0
- package/dist/api-task-graph.mjs.map +1 -0
- package/dist/api.d.mts +77 -0
- package/dist/api.mjs +1087 -0
- package/dist/api.mjs.map +1 -0
- package/dist/approval-access.d.mts +39 -0
- package/dist/approval-access.mjs +62 -0
- package/dist/approval-access.mjs.map +1 -0
- package/dist/approval-contracts.d.mts +692 -0
- package/dist/approval-contracts.mjs +27 -0
- package/dist/approval-contracts.mjs.map +1 -0
- package/dist/approval.d.mts +49 -0
- package/dist/approval.mjs +39 -0
- package/dist/approval.mjs.map +1 -0
- package/dist/blob/artifacts.d.mts +37 -0
- package/dist/blob/artifacts.mjs +45 -0
- package/dist/blob/artifacts.mjs.map +1 -0
- package/dist/blob/index.d.mts +44 -8
- package/dist/blob/index.mjs +159 -35
- package/dist/blob/index.mjs.map +1 -1
- package/dist/budget.d.mts +108 -0
- package/dist/budget.mjs +141 -0
- package/dist/budget.mjs.map +1 -0
- package/dist/budgets.d.mts +4 -0
- package/dist/budgets.mjs +4 -0
- package/dist/build-factory.d.mts +6 -4
- package/dist/build-factory.mjs +2 -1
- package/dist/build-factory.mjs.map +1 -1
- package/dist/change-verification/brief.d.mts +9 -0
- package/dist/change-verification/brief.mjs +13 -0
- package/dist/change-verification/brief.mjs.map +1 -0
- package/dist/change-verification/dispatch.d.mts +24 -0
- package/dist/change-verification/dispatch.mjs +45 -0
- package/dist/change-verification/dispatch.mjs.map +1 -0
- package/dist/change-verification/eve-tool.d.mts +60 -0
- package/dist/change-verification/eve-tool.mjs +101 -0
- package/dist/change-verification/eve-tool.mjs.map +1 -0
- package/dist/changes/eve-record-change.d.mts +56 -0
- package/dist/changes/eve-record-change.mjs +97 -0
- package/dist/changes/eve-record-change.mjs.map +1 -0
- package/dist/changes/presentation.d.mts +14 -0
- package/dist/changes.d.mts +23 -0
- package/dist/changes.mjs +29 -0
- package/dist/changes.mjs.map +1 -0
- package/dist/client-events.d.mts +18 -0
- package/dist/client-events.mjs +41 -0
- package/dist/client-events.mjs.map +1 -0
- package/dist/client-stream.d.mts +28 -0
- package/dist/client-stream.mjs +204 -0
- package/dist/client-stream.mjs.map +1 -0
- package/dist/client-transcript.d.mts +41 -0
- package/dist/client-transcript.mjs +229 -0
- package/dist/client-transcript.mjs.map +1 -0
- package/dist/client.d.mts +234 -0
- package/dist/client.mjs +258 -0
- package/dist/client.mjs.map +1 -0
- package/dist/code-review/contracts.d.mts +26 -0
- package/dist/code-review/eve-post-review.d.mts +70 -0
- package/dist/code-review/eve-post-review.mjs +183 -0
- package/dist/code-review/eve-post-review.mjs.map +1 -0
- package/dist/code-review/eve-review-comments.d.mts +64 -0
- package/dist/code-review/eve-review-comments.mjs +159 -0
- package/dist/code-review/eve-review-comments.mjs.map +1 -0
- package/dist/code-review/github-contracts.d.mts +10 -0
- package/dist/code-review/github-reporter.d.mts +44 -0
- package/dist/code-review/github-reporter.mjs +260 -0
- package/dist/code-review/github-reporter.mjs.map +1 -0
- package/dist/code-review/preparation.d.mts +34 -0
- package/dist/code-review/preparation.mjs +23 -0
- package/dist/code-review/preparation.mjs.map +1 -0
- package/dist/code-review/stall.d.mts +17 -0
- package/dist/code-review/stall.mjs +30 -0
- package/dist/code-review/stall.mjs.map +1 -0
- package/dist/code-review.d.mts +6 -0
- package/dist/code-review.mjs +5 -0
- package/dist/communication.d.mts +9 -0
- package/dist/communication.mjs +9 -0
- package/dist/connectors/github.d.mts +26 -0
- package/dist/connectors/github.mjs +55 -0
- package/dist/connectors/github.mjs.map +1 -0
- package/dist/connectors/index.d.mts +35 -2
- package/dist/connectors/index.mjs +4 -26
- package/dist/connectors/index.mjs.map +1 -1
- package/dist/connectors/outbox.d.mts +34 -0
- package/dist/connectors/outbox.mjs +50 -0
- package/dist/connectors/outbox.mjs.map +1 -0
- package/dist/connectors/slack-approval-blocks.mjs +136 -0
- package/dist/connectors/slack-approval-blocks.mjs.map +1 -0
- package/dist/connectors/slack-approvals.d.mts +29 -0
- package/dist/connectors/slack-approvals.mjs +346 -0
- package/dist/connectors/slack-approvals.mjs.map +1 -0
- package/dist/connectors/slack.d.mts +35 -41
- package/dist/connectors/slack.mjs +13 -69
- package/dist/connectors/slack.mjs.map +1 -1
- package/dist/deepsec/eve-tool.d.mts +110 -0
- package/dist/deepsec/eve-tool.mjs +164 -0
- package/dist/deepsec/eve-tool.mjs.map +1 -0
- package/dist/deepsec/finding.d.mts +84 -0
- package/dist/deepsec/finding.mjs +56 -0
- package/dist/deepsec/finding.mjs.map +1 -0
- package/dist/deepsec.d.mts +3 -0
- package/dist/delivery-metrics/metrics.d.mts +93 -0
- package/dist/delivery-metrics/metrics.mjs +200 -0
- package/dist/delivery-metrics/metrics.mjs.map +1 -0
- package/dist/delivery-metrics.d.mts +2 -0
- package/dist/delivery-metrics.mjs +2 -0
- package/dist/dispatch.d.mts +81 -0
- package/dist/dispatch.mjs +140 -0
- package/dist/dispatch.mjs.map +1 -0
- package/dist/errors.d.mts +15 -0
- package/dist/errors.mjs +38 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/eve/index.d.mts +143 -1561
- package/dist/eve/index.mjs +244 -1063
- package/dist/eve/index.mjs.map +1 -1
- package/dist/eve/invoke.d.mts +144 -0
- package/dist/eve/invoke.mjs +241 -0
- package/dist/eve/invoke.mjs.map +1 -0
- package/dist/eve/session-client.d.mts +68 -0
- package/dist/eve/session-client.mjs +131 -0
- package/dist/eve/session-client.mjs.map +1 -0
- package/dist/eve/task-execution.mjs +18 -0
- package/dist/eve/task-execution.mjs.map +1 -0
- package/dist/eve/task-session.d.mts +87 -0
- package/dist/eve/task-session.mjs +203 -0
- package/dist/eve/task-session.mjs.map +1 -0
- package/dist/eve/transcript.d.mts +37 -0
- package/dist/eve/transcript.mjs +65 -0
- package/dist/eve/transcript.mjs.map +1 -0
- package/dist/execution-public.d.mts +8 -0
- package/dist/execution-public.mjs +7 -0
- package/dist/execution.d.mts +75 -0
- package/dist/execution.mjs +153 -0
- package/dist/execution.mjs.map +1 -0
- package/dist/finding-remediation/admission.d.mts +51 -0
- package/dist/finding-remediation/admission.mjs +87 -0
- package/dist/finding-remediation/admission.mjs.map +1 -0
- package/dist/finding-remediation/brief.d.mts +14 -0
- package/dist/finding-remediation/brief.mjs +25 -0
- package/dist/finding-remediation/brief.mjs.map +1 -0
- package/dist/finding-remediation/eve-tool.d.mts +29 -0
- package/dist/finding-remediation/eve-tool.mjs +34 -0
- package/dist/finding-remediation/eve-tool.mjs.map +1 -0
- package/dist/findings/fingerprint.d.mts +14 -0
- package/dist/findings/fingerprint.mjs +28 -0
- package/dist/findings/fingerprint.mjs.map +1 -0
- package/dist/findings.d.mts +6 -0
- package/dist/findings.mjs +6 -0
- package/dist/github-app.d.mts +54 -0
- package/dist/github-app.mjs +121 -0
- package/dist/github-app.mjs.map +1 -0
- package/dist/github-publication.d.mts +198 -0
- package/dist/github-publication.mjs +429 -0
- package/dist/github-publication.mjs.map +1 -0
- package/dist/github-transfer.d.mts +72 -0
- package/dist/github-transfer.mjs +125 -0
- package/dist/github-transfer.mjs.map +1 -0
- package/dist/github.d.mts +406 -2
- package/dist/github.mjs +250 -37
- package/dist/github.mjs.map +1 -1
- package/dist/image-input.d.mts +51 -0
- package/dist/image-input.mjs +63 -0
- package/dist/image-input.mjs.map +1 -0
- package/dist/index.d.mts +14 -314
- package/dist/index.mjs +14 -1124
- package/dist/intake-contracts.d.mts +56 -0
- package/dist/intake-contracts.mjs +33 -0
- package/dist/intake-contracts.mjs.map +1 -0
- package/dist/integrations/deepsec.d.mts +4 -0
- package/dist/integrations/deepsec.mjs +3 -0
- package/dist/integrations/github.d.mts +11 -0
- package/dist/integrations/github.mjs +9 -0
- package/dist/integrations/slack.d.mts +3 -0
- package/dist/integrations/slack.mjs +3 -0
- package/dist/integrations/vercel.d.mts +3 -0
- package/dist/integrations/vercel.mjs +3 -0
- package/dist/merge-resolution/contracts.d.mts +17 -0
- package/dist/merge-resolution/contracts.mjs +19 -0
- package/dist/merge-resolution/contracts.mjs.map +1 -0
- package/dist/merge-resolution/eve-tools.d.mts +46 -0
- package/dist/merge-resolution/eve-tools.mjs +117 -0
- package/dist/merge-resolution/eve-tools.mjs.map +1 -0
- package/dist/multi-repository-changes/coordination.d.mts +49 -0
- package/dist/multi-repository-changes/coordination.mjs +115 -0
- package/dist/multi-repository-changes/coordination.mjs.map +1 -0
- package/dist/planning/cancellation.mjs +82 -0
- package/dist/planning/cancellation.mjs.map +1 -0
- package/dist/planning/configuration.d.mts +23 -0
- package/dist/planning/configuration.mjs +56 -0
- package/dist/planning/configuration.mjs.map +1 -0
- package/dist/planning/contracts.d.mts +136 -0
- package/dist/planning/contracts.mjs +42 -0
- package/dist/planning/contracts.mjs.map +1 -0
- package/dist/planning/dependencies.mjs +44 -0
- package/dist/planning/dependencies.mjs.map +1 -0
- package/dist/planning/effects.mjs +122 -0
- package/dist/planning/effects.mjs.map +1 -0
- package/dist/planning/reconcile.mjs +273 -0
- package/dist/planning/reconcile.mjs.map +1 -0
- package/dist/planning/runtime.d.mts +27 -0
- package/dist/planning/runtime.mjs +25 -0
- package/dist/planning/runtime.mjs.map +1 -0
- package/dist/planning/state.mjs +92 -0
- package/dist/planning/state.mjs.map +1 -0
- package/dist/planning/turns.mjs +262 -0
- package/dist/planning/turns.mjs.map +1 -0
- package/dist/planning/validation.mjs +106 -0
- package/dist/planning/validation.mjs.map +1 -0
- package/dist/postgres/index.d.mts +7 -1
- package/dist/postgres/index.mjs +7 -3
- package/dist/postgres/index.mjs.map +1 -1
- package/dist/presets/software-development/approval.d.mts +14 -0
- package/dist/presets/software-development/approval.mjs +21 -0
- package/dist/presets/software-development/approval.mjs.map +1 -0
- package/dist/presets/software-development/deepsec-brief.d.mts +8 -0
- package/dist/presets/software-development/deepsec-brief.mjs +14 -0
- package/dist/presets/software-development/deepsec-brief.mjs.map +1 -0
- package/dist/presets/software-development/dispatch.d.mts +53 -0
- package/dist/presets/software-development/dispatch.mjs +66 -0
- package/dist/presets/software-development/dispatch.mjs.map +1 -0
- package/dist/presets/software-development/eve-delegation-policy.d.mts +7 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs +34 -0
- package/dist/presets/software-development/eve-delegation-policy.mjs.map +1 -0
- package/dist/presets/software-development/eve.d.mts +18 -0
- package/dist/presets/software-development/eve.mjs +19 -0
- package/dist/presets/software-development/eve.mjs.map +1 -0
- package/dist/presets/software-development/finish-task-policy.d.mts +7 -0
- package/dist/presets/software-development/finish-task-policy.mjs +9 -0
- package/dist/presets/software-development/finish-task-policy.mjs.map +1 -0
- package/dist/presets/software-development/recovery.d.mts +32 -0
- package/dist/presets/software-development/recovery.mjs +120 -0
- package/dist/presets/software-development/recovery.mjs.map +1 -0
- package/dist/presets/software-development/task-communication.d.mts +23 -0
- package/dist/presets/software-development/task-communication.mjs +120 -0
- package/dist/presets/software-development/task-communication.mjs.map +1 -0
- package/dist/presets/software-development.d.mts +9 -0
- package/dist/presets/software-development.mjs +9 -0
- package/dist/pull-requests/contracts.d.mts +72 -0
- package/dist/pull-requests/eve-fetch.d.mts +57 -0
- package/dist/pull-requests/eve-fetch.mjs +151 -0
- package/dist/pull-requests/eve-fetch.mjs.map +1 -0
- package/dist/pull-requests/github-label-manager.d.mts +27 -0
- package/dist/pull-requests/github-label-manager.mjs +40 -0
- package/dist/pull-requests/github-label-manager.mjs.map +1 -0
- package/dist/pull-requests/github-publisher.d.mts +53 -0
- package/dist/pull-requests/github-publisher.mjs +345 -0
- package/dist/pull-requests/github-publisher.mjs.map +1 -0
- package/dist/pull-requests.d.mts +5 -0
- package/dist/pull-requests.mjs +4 -0
- package/dist/receipts.d.mts +4 -0
- package/dist/receipts.mjs +3 -0
- package/dist/repositories.d.mts +18 -0
- package/dist/repositories.mjs +33 -0
- package/dist/repositories.mjs.map +1 -0
- package/dist/sandbox/command.d.mts +18 -0
- package/dist/sandbox/execution-abort.d.mts +16 -0
- package/dist/sandbox/execution-abort.mjs +49 -0
- package/dist/sandbox/execution-abort.mjs.map +1 -0
- package/dist/sandbox/execution-environment.d.mts +25 -0
- package/dist/sandbox/execution-run-ledger.d.mts +115 -0
- package/dist/sandbox/execution-run-ledger.mjs +209 -0
- package/dist/sandbox/execution-run-ledger.mjs.map +1 -0
- package/dist/sandbox/execution.d.mts +54 -0
- package/dist/sandbox/execution.mjs +228 -0
- package/dist/sandbox/execution.mjs.map +1 -0
- package/dist/sandbox/harness-runner.d.mts +79 -0
- package/dist/sandbox/harness-runner.mjs +162 -0
- package/dist/sandbox/harness-runner.mjs.map +1 -0
- package/dist/sandbox/index.d.mts +9 -0
- package/dist/sandbox/index.mjs +7 -0
- package/dist/sandbox/task-environment.d.mts +50 -0
- package/dist/sandbox/task-environment.mjs +140 -0
- package/dist/sandbox/task-environment.mjs.map +1 -0
- package/dist/sandbox/workspace.d.mts +29 -0
- package/dist/sandbox/workspace.mjs +28 -0
- package/dist/sandbox/workspace.mjs.map +1 -0
- package/dist/schema/agent-route.d.mts +22 -0
- package/dist/schema/agent-route.mjs +15 -0
- package/dist/schema/agent-route.mjs.map +1 -0
- package/dist/schema/answer.d.mts +23 -0
- package/dist/schema/answer.mjs +21 -0
- package/dist/schema/answer.mjs.map +1 -0
- package/dist/schema/budget.d.mts +38 -0
- package/dist/schema/budget.mjs +30 -0
- package/dist/schema/budget.mjs.map +1 -0
- package/dist/schema/catalog.mjs +72 -0
- package/dist/schema/catalog.mjs.map +1 -0
- package/dist/schema/change.d.mts +117 -0
- package/dist/schema/change.mjs +68 -0
- package/dist/schema/change.mjs.map +1 -0
- package/dist/schema/common.d.mts +33 -0
- package/dist/{id-DwCihQr4.mjs → schema/common.mjs} +7 -14
- package/dist/schema/common.mjs.map +1 -0
- package/dist/schema/communication.d.mts +52 -0
- package/dist/schema/communication.mjs +35 -0
- package/dist/schema/communication.mjs.map +1 -0
- package/dist/schema/execution.d.mts +101 -0
- package/dist/schema/execution.mjs +86 -0
- package/dist/schema/execution.mjs.map +1 -0
- package/dist/schema/factory-config.d.mts +95 -0
- package/dist/schema/factory-config.mjs +60 -0
- package/dist/schema/factory-config.mjs.map +1 -0
- package/dist/schema/finding.d.mts +125 -0
- package/dist/schema/finding.mjs +67 -0
- package/dist/schema/finding.mjs.map +1 -0
- package/dist/schema/id.d.mts +43 -0
- package/dist/schema/id.mjs +32 -0
- package/dist/schema/id.mjs.map +1 -0
- package/dist/schema/outbox.d.mts +240 -0
- package/dist/schema/outbox.mjs +53 -0
- package/dist/schema/outbox.mjs.map +1 -0
- package/dist/schema/question-route.mjs +16 -0
- package/dist/schema/question-route.mjs.map +1 -0
- package/dist/schema/receipt.d.mts +81 -0
- package/dist/schema/receipt.mjs +94 -0
- package/dist/schema/receipt.mjs.map +1 -0
- package/dist/schema/repository.d.mts +26 -0
- package/dist/schema/repository.mjs +25 -0
- package/dist/schema/repository.mjs.map +1 -0
- package/dist/schema/session.d.mts +135 -0
- package/dist/schema/session.mjs +53 -0
- package/dist/schema/session.mjs.map +1 -0
- package/dist/schema/signal.d.mts +105 -0
- package/dist/schema/signal.mjs +81 -0
- package/dist/schema/signal.mjs.map +1 -0
- package/dist/schema/stored-session.mjs +10 -0
- package/dist/schema/stored-session.mjs.map +1 -0
- package/dist/schema/stored-task.mjs +20 -0
- package/dist/schema/stored-task.mjs.map +1 -0
- package/dist/schema/task-effect.d.mts +39 -0
- package/dist/schema/task-effect.mjs +29 -0
- package/dist/schema/task-effect.mjs.map +1 -0
- package/dist/schema/task-graph.d.mts +3134 -0
- package/dist/schema/task-graph.mjs +97 -0
- package/dist/schema/task-graph.mjs.map +1 -0
- package/dist/schema/task-message.d.mts +254 -0
- package/dist/schema/task-message.mjs +189 -0
- package/dist/schema/task-message.mjs.map +1 -0
- package/dist/schema/task.d.mts +272 -0
- package/dist/schema/task.mjs +199 -0
- package/dist/schema/task.mjs.map +1 -0
- package/dist/schema/transcript.d.mts +170 -0
- package/dist/schema/transcript.mjs +86 -0
- package/dist/schema/transcript.mjs.map +1 -0
- package/dist/schema/transitions.d.mts +50 -0
- package/dist/schema/transitions.mjs +303 -0
- package/dist/schema/transitions.mjs.map +1 -0
- package/dist/schema/work.d.mts +101 -0
- package/dist/schema/work.mjs +102 -0
- package/dist/schema/work.mjs.map +1 -0
- package/dist/signal-triage.d.mts +20 -0
- package/dist/signal-triage.mjs +85 -0
- package/dist/signal-triage.mjs.map +1 -0
- package/dist/signals.d.mts +19 -0
- package/dist/signals.mjs +19 -0
- package/dist/signals.mjs.map +1 -0
- package/dist/stall.d.mts +38 -0
- package/dist/stall.mjs +79 -0
- package/dist/stall.mjs.map +1 -0
- package/dist/storage.d.mts +4 -0
- package/dist/storage.mjs +4 -0
- package/dist/store/driver.d.mts +65 -0
- package/dist/store/driver.mjs +42 -0
- package/dist/store/driver.mjs.map +1 -0
- package/dist/store/engine.d.mts +485 -0
- package/dist/store/engine.mjs +2175 -0
- package/dist/store/engine.mjs.map +1 -0
- package/dist/store/memory.d.mts +7 -0
- package/dist/store/memory.mjs +52 -0
- package/dist/store/memory.mjs.map +1 -0
- package/dist/store/task-effects.d.mts +38 -0
- package/dist/store/task-effects.mjs +118 -0
- package/dist/store/task-effects.mjs.map +1 -0
- package/dist/store/task-graphs.d.mts +60 -0
- package/dist/store/task-graphs.mjs +212 -0
- package/dist/store/task-graphs.mjs.map +1 -0
- package/dist/store/task-messages.d.mts +136 -0
- package/dist/store/task-messages.mjs +475 -0
- package/dist/store/task-messages.mjs.map +1 -0
- package/dist/store/task-work.d.mts +65 -0
- package/dist/store/task-work.mjs +134 -0
- package/dist/store/task-work.mjs.map +1 -0
- package/dist/store/work-notifications.d.mts +19 -0
- package/dist/store/work-notifications.mjs +48 -0
- package/dist/store/work-notifications.mjs.map +1 -0
- package/dist/sweep.d.mts +57 -0
- package/dist/sweep.mjs +143 -0
- package/dist/sweep.mjs.map +1 -0
- package/dist/task-communication.d.mts +35 -0
- package/dist/task-communication.mjs +47 -0
- package/dist/task-communication.mjs.map +1 -0
- package/dist/task-graph-view.d.mts +264 -0
- package/dist/task-graph-view.mjs +17 -0
- package/dist/task-graph-view.mjs.map +1 -0
- package/dist/task-message-processing.d.mts +60 -0
- package/dist/task-message-processing.mjs +200 -0
- package/dist/task-message-processing.mjs.map +1 -0
- package/dist/task-protocols.d.mts +80 -0
- package/dist/task-protocols.mjs +47 -0
- package/dist/task-protocols.mjs.map +1 -0
- package/dist/tasks.d.mts +17 -0
- package/dist/tasks.mjs +17 -0
- package/dist/vercel-git.d.mts +21 -0
- package/dist/vercel-git.mjs +112 -0
- package/dist/vercel-git.mjs.map +1 -0
- package/dist/vercel.d.mts +33 -2
- package/dist/vercel.mjs +48 -3
- package/dist/vercel.mjs.map +1 -1
- package/dist/work-triage/eve-tool.d.mts +29 -0
- package/dist/work-triage/eve-tool.mjs +32 -0
- package/dist/work-triage/eve-tool.mjs.map +1 -0
- package/dist/work-triage/find-existing-work.d.mts +32 -0
- package/dist/work-triage/find-existing-work.mjs +31 -0
- package/dist/work-triage/find-existing-work.mjs.map +1 -0
- package/dist/work-triage/github.d.mts +15 -0
- package/dist/work-triage/github.mjs +14 -0
- package/dist/work-triage/github.mjs.map +1 -0
- package/dist/work-triage.d.mts +3 -0
- package/dist/work-triage.mjs +3 -0
- package/dist/workflows.d.mts +48 -0
- package/dist/workflows.mjs +86 -0
- package/dist/workflows.mjs.map +1 -0
- package/dist/workspace-diff-assembly.d.mts +33 -0
- package/dist/workspace-diff-assembly.mjs +95 -0
- package/dist/workspace-diff-assembly.mjs.map +1 -0
- package/dist/workspace-diff.d.mts +90 -0
- package/dist/workspace-diff.mjs +61 -0
- package/dist/workspace-diff.mjs.map +1 -0
- package/dist/workspace-snapshot.d.mts +26 -0
- package/dist/workspace-snapshot.mjs +80 -0
- package/dist/workspace-snapshot.mjs.map +1 -0
- package/package.json +129 -40
- package/dist/approval-CwhTP1XB.mjs +0 -269
- package/dist/approval-CwhTP1XB.mjs.map +0 -1
- package/dist/change-CzEAoFVE.mjs +0 -620
- package/dist/change-CzEAoFVE.mjs.map +0 -1
- package/dist/dispatch-B77cuPxh.d.mts +0 -713
- package/dist/driver-BJutB0PE.d.mts +0 -34
- package/dist/driver-Bbd25rNM.mjs +0 -23
- package/dist/driver-Bbd25rNM.mjs.map +0 -1
- package/dist/factory-config-BJcjsPKl.mjs +0 -86
- package/dist/factory-config-BJcjsPKl.mjs.map +0 -1
- package/dist/factory-config-D2yU3G0c.d.mts +0 -58
- package/dist/github-DXsxboUL.d.mts +0 -271
- package/dist/id-DwCihQr4.mjs.map +0 -1
- package/dist/index-Cy4jfXh5.d.mts +0 -67
- package/dist/index.mjs.map +0 -1
- package/dist/signal-CHVEmzvI.d.mts +0 -59
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { changeIdSchema, repositoryIdSchema, taskIdSchema } from "./schema/id.mjs";
|
|
2
|
+
import { repositorySlugSchema } from "./schema/repository.mjs";
|
|
3
|
+
import { agentRouteBindingSchema } from "./schema/agent-route.mjs";
|
|
4
|
+
import { executionReferenceSchema, taskSchema } from "./schema/task.mjs";
|
|
5
|
+
import { hasMessageContent, imageAttachmentsSchema } from "./image-input.mjs";
|
|
6
|
+
import { agentSessionIdSchema, agentSessionMessageSchema, agentSessionSchema } from "./schema/session.mjs";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
//#region src/api-contracts.ts
|
|
9
|
+
/** Validates an agent exposed by the operator API. */
|
|
10
|
+
const apiAgentSchema = z.strictObject({
|
|
11
|
+
id: z.string().regex(/^[a-z][a-z0-9-]{0,31}$/u).describe("Agent name used for discovery, filtering, and session creation when allowed."),
|
|
12
|
+
description: z.string().describe("What this agent does."),
|
|
13
|
+
route: agentRouteBindingSchema.optional().describe("Exact registered specialist route; absent for conversations."),
|
|
14
|
+
canStart: z.boolean().describe("Whether an operator may start this agent directly through the session API."),
|
|
15
|
+
requiresRepository: z.boolean().describe("Whether creation requires a configured repository."),
|
|
16
|
+
requiresChange: z.boolean().describe("Whether creation requires an existing change ID.")
|
|
17
|
+
});
|
|
18
|
+
/** Validates an idempotent request to create an operator session. */
|
|
19
|
+
const createSessionRequestSchema = z.strictObject({
|
|
20
|
+
operationId: z.string().trim().min(1).max(200).describe("Client-generated idempotency key; retain when retrying creation."),
|
|
21
|
+
agent: apiAgentSchema.shape.id,
|
|
22
|
+
repository: repositorySlugSchema.optional().describe("Configured owner/repo slug."),
|
|
23
|
+
changeId: changeIdSchema.optional().describe("Existing change to review, verify, or continue."),
|
|
24
|
+
message: agentSessionMessageSchema,
|
|
25
|
+
attachments: imageAttachmentsSchema.optional().describe("Uploaded images accompanying this message.")
|
|
26
|
+
}).refine(hasMessageContent, "Enter a message or attach an image");
|
|
27
|
+
/** Validates a message sent to an existing session with optimistic execution matching. */
|
|
28
|
+
const sendSessionMessageRequestSchema = z.strictObject({
|
|
29
|
+
message: agentSessionMessageSchema,
|
|
30
|
+
attachments: imageAttachmentsSchema.optional().describe("Uploaded images accompanying this message."),
|
|
31
|
+
operationId: z.string().trim().min(1).max(200).optional().describe("Required for a follow-up after completion; retain unchanged for retries."),
|
|
32
|
+
turnPolicy: z.enum(["steer", "queue"]).default("steer").describe("Whether an active turn is steered immediately or the message is queued."),
|
|
33
|
+
executionId: z.string().min(1).nullable().describe("Observed execution ID; stale writes are rejected.")
|
|
34
|
+
}).refine(hasMessageContent, "Enter a message or attach an image");
|
|
35
|
+
const sessionInputResponseBase = { requestId: z.string().min(1).describe("Pending provider input request ID.") };
|
|
36
|
+
/** Validates an option selection or freeform answer to one provider input request. */
|
|
37
|
+
const sessionInputResponseSchema = z.union([z.strictObject({
|
|
38
|
+
...sessionInputResponseBase,
|
|
39
|
+
optionId: z.string().min(1).describe("Selected option ID."),
|
|
40
|
+
text: z.never().optional().describe("Absent for an option selection.")
|
|
41
|
+
}), z.strictObject({
|
|
42
|
+
...sessionInputResponseBase,
|
|
43
|
+
optionId: z.never().optional().describe("Absent for a freeform answer."),
|
|
44
|
+
text: z.string().min(1).describe("Freeform answer text.")
|
|
45
|
+
})]);
|
|
46
|
+
/** Validates responses submitted to pending provider input requests. */
|
|
47
|
+
const submitSessionInputRequestSchema = z.strictObject({
|
|
48
|
+
executionId: z.string().min(1).describe("Observed provider session ID; stale input responses are rejected."),
|
|
49
|
+
inputResponses: z.array(sessionInputResponseSchema).min(1).readonly().describe("Responses to pending human-input requests.")
|
|
50
|
+
});
|
|
51
|
+
/** Validates an execution-aware session control request. */
|
|
52
|
+
const controlSessionRequestSchema = z.strictObject({
|
|
53
|
+
executionId: z.string().min(1).optional().describe("Observed provider session ID; guards against a replaced execution."),
|
|
54
|
+
turnId: z.string().min(1).optional().describe("Observed turn ID for cooperative interruption.")
|
|
55
|
+
});
|
|
56
|
+
/** Validates an authenticated answer to a workflow question. */
|
|
57
|
+
const answerSessionQuestionRequestSchema = z.strictObject({
|
|
58
|
+
questionId: taskIdSchema.describe("Question Task belonging to this operator session."),
|
|
59
|
+
answer: z.string().min(1).max(16e3).describe("Authenticated immutable human answer.")
|
|
60
|
+
});
|
|
61
|
+
/** Validates the current operator-facing projection of a Factory session. */
|
|
62
|
+
const sessionViewSchema = z.strictObject({
|
|
63
|
+
session: agentSessionSchema.describe("Durable interaction binding."),
|
|
64
|
+
task: taskSchema.nullable().describe("Current task state, if workflow-backed."),
|
|
65
|
+
dependencyTaskIds: z.array(taskIdSchema).readonly().optional().describe("Read-only current Task dependencies projected from its authoritative task graph."),
|
|
66
|
+
execution: executionReferenceSchema.nullable().describe("Current execution; may change after recovery."),
|
|
67
|
+
activeAgent: z.string().optional().describe("Agent executing the selected work in this conversation."),
|
|
68
|
+
source: z.string().optional().describe("Original trigger of automatically started work."),
|
|
69
|
+
prUrl: z.string().optional().describe("Pull request associated with the conversation."),
|
|
70
|
+
attention: z.enum([
|
|
71
|
+
"question",
|
|
72
|
+
"failed",
|
|
73
|
+
"stalled",
|
|
74
|
+
"review",
|
|
75
|
+
"conversation"
|
|
76
|
+
]).optional().describe("Current human action: answer a question, inspect failed or stalled work, review a ready Change, or continue an external conversation."),
|
|
77
|
+
canFollowUp: z.boolean().optional().describe("Whether completed work can start a budgeted discussion in this conversation."),
|
|
78
|
+
hasWorkflowFailure: z.boolean().optional().describe("Whether delegated workflow work has failed, independently of a pending question."),
|
|
79
|
+
canCancel: z.boolean().optional().describe("Whether cancellation is available for the conversation or its delegated workflow work."),
|
|
80
|
+
history: z.array(z.strictObject({
|
|
81
|
+
taskId: taskIdSchema.optional().describe("Task owning this execution, if any."),
|
|
82
|
+
agent: z.string().describe("Agent that owns the provider execution."),
|
|
83
|
+
message: z.string().describe("Initial request displayed for this execution."),
|
|
84
|
+
attachments: imageAttachmentsSchema.optional().describe("Images accompanying this execution's initial user request."),
|
|
85
|
+
execution: executionReferenceSchema.describe("Authorized provider execution to replay.")
|
|
86
|
+
})).readonly().optional().describe("Earlier executions, in conversation order, including replacement attempts."),
|
|
87
|
+
relatedTasks: z.array(taskSchema).readonly().optional().describe("Work linked to this conversation, including specialist delegations."),
|
|
88
|
+
question: taskSchema.nullable().describe("Open Factory question requiring an authenticated answer.")
|
|
89
|
+
});
|
|
90
|
+
/** Validates a cursor-paginated page of operator-facing sessions. */
|
|
91
|
+
const sessionPageSchema = z.strictObject({
|
|
92
|
+
sessions: z.array(sessionViewSchema).readonly().describe("Sessions in this page."),
|
|
93
|
+
nextCursor: agentSessionIdSchema.nullable().default(null).describe("Session ID that starts the next page, or null after the final page."),
|
|
94
|
+
totalCount: z.number().int().nonnegative().optional().describe("Total matching sessions when explicitly requested.")
|
|
95
|
+
});
|
|
96
|
+
/** Validates one configured repository exposed by the operator API. */
|
|
97
|
+
const repositorySummarySchema = z.strictObject({
|
|
98
|
+
id: repositoryIdSchema.describe("Stable configured repository identifier."),
|
|
99
|
+
slug: repositorySlugSchema.describe("Configured owner/repository slug.")
|
|
100
|
+
});
|
|
101
|
+
/** Validates repository slugs and their stable identifiers. */
|
|
102
|
+
const repositoryDetailsSchema = z.strictObject({
|
|
103
|
+
repositories: z.array(repositorySlugSchema).readonly().describe("Configured owner/repository slugs."),
|
|
104
|
+
details: z.array(repositorySummarySchema).readonly().default([]).describe("Stable identifiers and slugs for configured repositories.")
|
|
105
|
+
});
|
|
106
|
+
/** Validates a locally retained follow-up awaiting confirmed API acceptance. */
|
|
107
|
+
const pendingFollowUpSchema = z.strictObject({
|
|
108
|
+
sessionId: agentSessionIdSchema.describe("Conversation containing this follow-up."),
|
|
109
|
+
operationId: z.string().min(1).max(200).describe("Stable operation id retained until acceptance is confirmed."),
|
|
110
|
+
executionId: z.string().nullable().describe("Execution observed before sending, or null before execution starts."),
|
|
111
|
+
message: agentSessionMessageSchema,
|
|
112
|
+
attachments: imageAttachmentsSchema.optional().describe("Uploaded images accompanying this message."),
|
|
113
|
+
turnPolicy: z.enum(["steer", "queue"]).describe("Requested turn policy.")
|
|
114
|
+
}).refine(hasMessageContent, "Enter a message or attach an image");
|
|
115
|
+
//#endregion
|
|
116
|
+
export { answerSessionQuestionRequestSchema, apiAgentSchema, controlSessionRequestSchema, createSessionRequestSchema, pendingFollowUpSchema, repositoryDetailsSchema, repositorySummarySchema, sendSessionMessageRequestSchema, sessionInputResponseSchema, sessionPageSchema, sessionViewSchema, submitSessionInputRequestSchema };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=api-contracts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-contracts.mjs","names":[],"sources":["../src/api-contracts.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { hasMessageContent, imageAttachmentsSchema, type ImageAttachment } from \"./image-input\";\nimport {\n changeIdSchema,\n repositoryIdSchema,\n taskIdSchema,\n type ChangeId,\n type TaskId,\n} from \"./schema/id\";\nimport { repositorySlugSchema, type RepositorySlug } from \"./schema/repository\";\nimport {\n agentRouteBindingSchema,\n type AgentRouteBinding,\n type AgentRouteBindingInput,\n} from \"./schema/agent-route\";\nimport {\n agentSessionIdSchema,\n agentSessionMessageSchema,\n agentSessionSchema,\n} from \"./schema/session\";\nimport { taskSchema, executionReferenceSchema } from \"./schema/task\";\n\n/** Validates an agent exposed by the operator API. */\nexport const apiAgentSchema = z.strictObject({\n id: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,31}$/u)\n .describe(\"Agent name used for discovery, filtering, and session creation when allowed.\"),\n description: z.string().describe(\"What this agent does.\"),\n route: agentRouteBindingSchema\n .optional()\n .describe(\"Exact registered specialist route; absent for conversations.\"),\n canStart: z\n .boolean()\n .describe(\"Whether an operator may start this agent directly through the session API.\"),\n requiresRepository: z.boolean().describe(\"Whether creation requires a configured repository.\"),\n requiresChange: z.boolean().describe(\"Whether creation requires an existing change ID.\"),\n});\n/** An agent exposed for operator discovery, filtering, or session creation. */\nexport type ApiAgent = Readonly<\n Omit<z.infer<typeof apiAgentSchema>, \"route\"> & {\n readonly route?: AgentRouteBinding;\n }\n>;\n\n/** Caller input for exposing an agent through the operator API before validation and branding. */\nexport interface ApiAgentInput {\n readonly id: string;\n readonly description: string;\n readonly route?: AgentRouteBindingInput;\n readonly canStart: boolean;\n readonly requiresRepository: boolean;\n readonly requiresChange: boolean;\n}\n\n/** Validates an idempotent request to create an operator session. */\nexport const createSessionRequestSchema = z\n .strictObject({\n operationId: z\n .string()\n .trim()\n .min(1)\n .max(200)\n .describe(\"Client-generated idempotency key; retain when retrying creation.\"),\n agent: apiAgentSchema.shape.id,\n repository: repositorySlugSchema.optional().describe(\"Configured owner/repo slug.\"),\n changeId: changeIdSchema.optional().describe(\"Existing change to review, verify, or continue.\"),\n message: agentSessionMessageSchema,\n attachments: imageAttachmentsSchema\n .optional()\n .describe(\"Uploaded images accompanying this message.\"),\n })\n .refine(hasMessageContent, \"Enter a message or attach an image\");\n/** An idempotent request to create an operator session. */\nexport type CreateSessionRequest = Readonly<\n Omit<z.input<typeof createSessionRequestSchema>, \"attachments\" | \"repository\" | \"changeId\">\n> & {\n readonly repository?: RepositorySlug;\n readonly changeId?: ChangeId;\n readonly attachments?: readonly ImageAttachment[];\n};\n\n/** Validates a message sent to an existing session with optimistic execution matching. */\nexport const sendSessionMessageRequestSchema = z\n .strictObject({\n message: agentSessionMessageSchema,\n attachments: imageAttachmentsSchema\n .optional()\n .describe(\"Uploaded images accompanying this message.\"),\n operationId: z\n .string()\n .trim()\n .min(1)\n .max(200)\n .optional()\n .describe(\"Required for a follow-up after completion; retain unchanged for retries.\"),\n turnPolicy: z\n .enum([\"steer\", \"queue\"])\n .default(\"steer\")\n .describe(\"Whether an active turn is steered immediately or the message is queued.\"),\n executionId: z\n .string()\n .min(1)\n .nullable()\n .describe(\"Observed execution ID; stale writes are rejected.\"),\n })\n .refine(hasMessageContent, \"Enter a message or attach an image\");\n\n/** Message sent to an existing session with optimistic execution matching. */\nexport type SendSessionMessageRequest = Readonly<\n Omit<z.input<typeof sendSessionMessageRequestSchema>, \"attachments\">\n> & {\n readonly attachments?: readonly ImageAttachment[];\n};\n\nconst sessionInputResponseBase = {\n requestId: z.string().min(1).describe(\"Pending provider input request ID.\"),\n};\n\n/** Validates an option selection or freeform answer to one provider input request. */\nexport const sessionInputResponseSchema = z.union([\n z.strictObject({\n ...sessionInputResponseBase,\n optionId: z.string().min(1).describe(\"Selected option ID.\"),\n text: z.never().optional().describe(\"Absent for an option selection.\"),\n }),\n z.strictObject({\n ...sessionInputResponseBase,\n optionId: z.never().optional().describe(\"Absent for a freeform answer.\"),\n text: z.string().min(1).describe(\"Freeform answer text.\"),\n }),\n]);\n/** A response to one pending provider input request. */\nexport type SessionInputResponse = Readonly<z.input<typeof sessionInputResponseSchema>>;\n\n/** Validates responses submitted to pending provider input requests. */\nexport const submitSessionInputRequestSchema = z.strictObject({\n executionId: z\n .string()\n .min(1)\n .describe(\"Observed provider session ID; stale input responses are rejected.\"),\n inputResponses: z\n .array(sessionInputResponseSchema)\n .min(1)\n .readonly()\n .describe(\"Responses to pending human-input requests.\"),\n});\n/** Responses submitted to pending provider input requests. */\nexport interface SubmitSessionInputRequest {\n readonly executionId: string;\n readonly inputResponses: readonly SessionInputResponse[];\n}\n\n/** Validates an execution-aware session control request. */\nexport const controlSessionRequestSchema = z.strictObject({\n executionId: z\n .string()\n .min(1)\n .optional()\n .describe(\"Observed provider session ID; guards against a replaced execution.\"),\n turnId: z.string().min(1).optional().describe(\"Observed turn ID for cooperative interruption.\"),\n});\n/** Execution and turn observed before requesting a session control operation. */\nexport type ControlSessionRequest = Readonly<z.input<typeof controlSessionRequestSchema>>;\n\n/** Validates an authenticated answer to a workflow question. */\nexport const answerSessionQuestionRequestSchema = z.strictObject({\n questionId: taskIdSchema.describe(\"Question Task belonging to this operator session.\"),\n answer: z.string().min(1).max(16000).describe(\"Authenticated immutable human answer.\"),\n});\n/** Authenticated answer to a workflow question in a session. */\nexport interface AnswerSessionQuestionRequest {\n readonly questionId: TaskId;\n readonly answer: string;\n}\n\n/** Validates the current operator-facing projection of a Factory session. */\nexport const sessionViewSchema = z.strictObject({\n session: agentSessionSchema.describe(\"Durable interaction binding.\"),\n task: taskSchema.nullable().describe(\"Current task state, if workflow-backed.\"),\n dependencyTaskIds: z\n .array(taskIdSchema)\n .readonly()\n .optional()\n .describe(\"Read-only current Task dependencies projected from its authoritative task graph.\"),\n execution: executionReferenceSchema\n .nullable()\n .describe(\"Current execution; may change after recovery.\"),\n activeAgent: z\n .string()\n .optional()\n .describe(\"Agent executing the selected work in this conversation.\"),\n source: z.string().optional().describe(\"Original trigger of automatically started work.\"),\n prUrl: z.string().optional().describe(\"Pull request associated with the conversation.\"),\n attention: z\n .enum([\"question\", \"failed\", \"stalled\", \"review\", \"conversation\"])\n .optional()\n .describe(\n \"Current human action: answer a question, inspect failed or stalled work, review a ready Change, or continue an external conversation.\",\n ),\n canFollowUp: z\n .boolean()\n .optional()\n .describe(\"Whether completed work can start a budgeted discussion in this conversation.\"),\n hasWorkflowFailure: z\n .boolean()\n .optional()\n .describe(\"Whether delegated workflow work has failed, independently of a pending question.\"),\n canCancel: z\n .boolean()\n .optional()\n .describe(\n \"Whether cancellation is available for the conversation or its delegated workflow work.\",\n ),\n history: z\n .array(\n z.strictObject({\n taskId: taskIdSchema.optional().describe(\"Task owning this execution, if any.\"),\n agent: z.string().describe(\"Agent that owns the provider execution.\"),\n message: z.string().describe(\"Initial request displayed for this execution.\"),\n attachments: imageAttachmentsSchema\n .optional()\n .describe(\"Images accompanying this execution's initial user request.\"),\n execution: executionReferenceSchema.describe(\"Authorized provider execution to replay.\"),\n }),\n )\n .readonly()\n .optional()\n .describe(\"Earlier executions, in conversation order, including replacement attempts.\"),\n relatedTasks: z\n .array(taskSchema)\n .readonly()\n .optional()\n .describe(\"Work linked to this conversation, including specialist delegations.\"),\n question: taskSchema\n .nullable()\n .describe(\"Open Factory question requiring an authenticated answer.\"),\n});\n/** The current operator-facing projection of a Factory session. */\nexport type SessionView = z.infer<typeof sessionViewSchema>;\n\n/** Validates a cursor-paginated page of operator-facing sessions. */\nexport const sessionPageSchema = z.strictObject({\n sessions: z.array(sessionViewSchema).readonly().describe(\"Sessions in this page.\"),\n nextCursor: agentSessionIdSchema\n .nullable()\n .default(null)\n .describe(\"Session ID that starts the next page, or null after the final page.\"),\n totalCount: z\n .number()\n .int()\n .nonnegative()\n .optional()\n .describe(\"Total matching sessions when explicitly requested.\"),\n});\n/** Cursor-paginated operator-facing sessions. */\nexport type SessionPage = z.infer<typeof sessionPageSchema>;\n\n/** Validates one configured repository exposed by the operator API. */\nexport const repositorySummarySchema = z.strictObject({\n id: repositoryIdSchema.describe(\"Stable configured repository identifier.\"),\n slug: repositorySlugSchema.describe(\"Configured owner/repository slug.\"),\n});\n/** Configured repository exposed by the operator API. */\nexport type RepositorySummary = z.infer<typeof repositorySummarySchema>;\n\n/** Validates repository slugs and their stable identifiers. */\nexport const repositoryDetailsSchema = z.strictObject({\n repositories: z\n .array(repositorySlugSchema)\n .readonly()\n .describe(\"Configured owner/repository slugs.\"),\n details: z\n .array(repositorySummarySchema)\n .readonly()\n .default([])\n .describe(\"Stable identifiers and slugs for configured repositories.\"),\n});\n/** Repository slugs and their stable configured identifiers. */\nexport type RepositoryDetails = z.infer<typeof repositoryDetailsSchema>;\n\n/** Validates a locally retained follow-up awaiting confirmed API acceptance. */\nexport const pendingFollowUpSchema = z\n .strictObject({\n sessionId: agentSessionIdSchema.describe(\"Conversation containing this follow-up.\"),\n operationId: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Stable operation id retained until acceptance is confirmed.\"),\n executionId: z\n .string()\n .nullable()\n .describe(\"Execution observed before sending, or null before execution starts.\"),\n message: agentSessionMessageSchema,\n attachments: imageAttachmentsSchema\n .optional()\n .describe(\"Uploaded images accompanying this message.\"),\n turnPolicy: z.enum([\"steer\", \"queue\"]).describe(\"Requested turn policy.\"),\n })\n .refine(hasMessageContent, \"Enter a message or attach an image\");\n/** A locally retained follow-up awaiting confirmed API acceptance. */\nexport type PendingFollowUp = Readonly<\n Omit<z.output<typeof pendingFollowUpSchema>, \"attachments\">\n> & {\n readonly attachments?: readonly ImageAttachment[];\n};\n"],"mappings":";;;;;;;;;AAuBA,MAAa,iBAAiB,EAAE,aAAa;CAC3C,IAAI,EACD,OAAO,CAAC,CACR,MAAM,yBAAyB,CAAC,CAChC,SAAS,8EAA8E;CAC1F,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;CACxD,OAAO,wBACJ,SAAS,CAAC,CACV,SAAS,8DAA8D;CAC1E,UAAU,EACP,QAAQ,CAAC,CACT,SAAS,4EAA4E;CACxF,oBAAoB,EAAE,QAAQ,CAAC,CAAC,SAAS,oDAAoD;CAC7F,gBAAgB,EAAE,QAAQ,CAAC,CAAC,SAAS,kDAAkD;AACzF,CAAC;;A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ACpD,cAAc,EACX,MAAM,oBAAoB,CAAC,CAC3B,SAAS,CAAC,CACV,SAAS,oCAAoC;CAChD,SAAS,EACN,MAAM,uBAAuB,CAAC,CAC9B,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,2DAA2D;AACzE,CAAC;;AAKD,MAAa,wBAAwB,EAClC,aAAa;CACZ,WAAW,qBAAqB,SAAS,yCAAyC;CAClF,aAAa,EACV,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SAAS,6DAA6D;CACzE,aAAa,EACV,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,qEAAqE;CACjF,SAAS;CACT,aAAa,uBACV,SAAS,CAAC,CACV,SAAS,4CAA4C;CACxD,YAAY,EAAE,KAAK,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,SAAS,wBAAwB;AAC1E,CAAC,CAAC,CACD,OAAO,mBAAmB,oCAAoC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ImageAttachment } from "./image-input.mjs";
|
|
2
|
+
import { FactoryStores } from "./store/engine.mjs";
|
|
3
|
+
//#region src/api-images.d.ts
|
|
4
|
+
/** Minimal image-store operations required to resolve stored attachments. */
|
|
5
|
+
interface ResolveImageMessageStores {
|
|
6
|
+
readonly images: Pick<FactoryStores["images"], "get" | "validate">;
|
|
7
|
+
}
|
|
8
|
+
/** Identifies the owner, text, and stored attachments for one Eve message. */
|
|
9
|
+
interface ResolveImageMessageInput {
|
|
10
|
+
readonly owner: string;
|
|
11
|
+
readonly message: string;
|
|
12
|
+
readonly attachments?: readonly ImageAttachment[];
|
|
13
|
+
}
|
|
14
|
+
/** One text or stored-image part in a resolved Eve message. */
|
|
15
|
+
type ResolvedImageMessagePart = Readonly<{
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
type: "file";
|
|
20
|
+
filename: string;
|
|
21
|
+
mediaType: ImageAttachment["mediaType"];
|
|
22
|
+
data: `data:${ImageAttachment["mediaType"]};base64,${string}`;
|
|
23
|
+
}>;
|
|
24
|
+
/** Eve-compatible message text or parts after stored image references are resolved. */
|
|
25
|
+
type ResolvedImageMessage = string | readonly ResolvedImageMessagePart[];
|
|
26
|
+
/** Resolve authorized stored image references into an Eve-compatible message. */
|
|
27
|
+
declare function resolveImageMessage(stores: ResolveImageMessageStores, input: ResolveImageMessageInput): Promise<ResolvedImageMessage>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ResolveImageMessageInput, ResolveImageMessageStores, ResolvedImageMessage, ResolvedImageMessagePart, resolveImageMessage };
|
|
30
|
+
//# sourceMappingURL=api-images.d.mts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { imageAttachmentsSchema, imagePartFilename } from "./image-input.mjs";
|
|
2
|
+
//#region src/api-images.ts
|
|
3
|
+
/** Resolve authorized stored image references into an Eve-compatible message. */
|
|
4
|
+
async function resolveImageMessage(stores, input) {
|
|
5
|
+
const { owner, message, attachments = [] } = input;
|
|
6
|
+
imageAttachmentsSchema.parse(attachments);
|
|
7
|
+
await stores.images.validate(owner, attachments);
|
|
8
|
+
if (attachments.length === 0) return message;
|
|
9
|
+
const files = await Promise.all(attachments.map(async (attachment) => {
|
|
10
|
+
const image = await stores.images.get(owner, attachment.id);
|
|
11
|
+
if (!image) throw new Error("Image is unavailable");
|
|
12
|
+
const data = `data:${image.mediaType};base64,${image.base64}`;
|
|
13
|
+
return {
|
|
14
|
+
type: "file",
|
|
15
|
+
filename: imagePartFilename(image),
|
|
16
|
+
mediaType: image.mediaType,
|
|
17
|
+
data
|
|
18
|
+
};
|
|
19
|
+
}));
|
|
20
|
+
return [...message ? [{
|
|
21
|
+
type: "text",
|
|
22
|
+
text: message
|
|
23
|
+
}] : [], ...files];
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { resolveImageMessage };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=api-images.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-images.mjs","names":[],"sources":["../src/api-images.ts"],"sourcesContent":["import type { FactoryStores } from \"./store/engine\";\nimport { imageAttachmentsSchema, imagePartFilename, type ImageAttachment } from \"./image-input\";\n\n/** Minimal image-store operations required to resolve stored attachments. */\nexport interface ResolveImageMessageStores {\n readonly images: Pick<FactoryStores[\"images\"], \"get\" | \"validate\">;\n}\n\n/** Identifies the owner, text, and stored attachments for one Eve message. */\nexport interface ResolveImageMessageInput {\n readonly owner: string;\n readonly message: string;\n readonly attachments?: readonly ImageAttachment[];\n}\n\n/** One text or stored-image part in a resolved Eve message. */\nexport type ResolvedImageMessagePart =\n | Readonly<{ type: \"text\"; text: string }>\n | Readonly<{\n type: \"file\";\n filename: string;\n mediaType: ImageAttachment[\"mediaType\"];\n data: `data:${ImageAttachment[\"mediaType\"]};base64,${string}`;\n }>;\n\n/** Eve-compatible message text or parts after stored image references are resolved. */\nexport type ResolvedImageMessage = string | readonly ResolvedImageMessagePart[];\n\n/** Resolve authorized stored image references into an Eve-compatible message. */\nexport async function resolveImageMessage(\n stores: ResolveImageMessageStores,\n input: ResolveImageMessageInput,\n): Promise<ResolvedImageMessage> {\n const { owner, message, attachments = [] } = input;\n imageAttachmentsSchema.parse(attachments);\n await stores.images.validate(owner, attachments);\n if (attachments.length === 0) return message;\n const files = await Promise.all(\n attachments.map(async (attachment) => {\n const image = await stores.images.get(owner, attachment.id);\n if (!image) throw new Error(\"Image is unavailable\");\n const data: `data:${ImageAttachment[\"mediaType\"]};base64,${string}` = `data:${image.mediaType};base64,${image.base64}`;\n return {\n type: \"file\" as const,\n filename: imagePartFilename(image),\n mediaType: image.mediaType,\n data,\n };\n }),\n );\n return [...(message ? [{ type: \"text\" as const, text: message }] : []), ...files];\n}\n"],"mappings":";;;AA6BA,eAAsB,oBACpB,QACA,OAC+B;CAC/B,MAAM,EAAE,OAAO,SAAS,cAAc,CAAC,MAAM;CAC7C,uBAAuB,MAAM,WAAW;CACxC,MAAM,OAAO,OAAO,SAAS,OAAO,WAAW;CAC/C,IAAI,YAAY,WAAW,GAAG,OAAO;CACrC,MAAM,QAAQ,MAAM,QAAQ,IAC1B,YAAY,IAAI,OAAO,eAAe;EACpC,MAAM,QAAQ,MAAM,OAAO,OAAO,IAAI,OAAO,WAAW,EAAE;EAC1D,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,sBAAsB;EAClD,MAAM,OAAgE,QAAQ,MAAM,UAAU,UAAU,MAAM;EAC9G,OAAO;GACL,MAAM;GACN,UAAU,kBAAkB,KAAK;GACjC,WAAW,MAAM;GACjB;EACF;CACF,CAAC,CACH;CACA,OAAO,CAAC,GAAI,UAAU,CAAC;EAAE,MAAM;EAAiB,MAAM;CAAQ,CAAC,IAAI,CAAC,GAAI,GAAG,KAAK;AAClF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { agentSessionIdSchema } from "./schema/session.mjs";
|
|
2
|
+
//#region src/api-task-graph.ts
|
|
3
|
+
var TaskGraphAccessError = class extends Error {
|
|
4
|
+
status;
|
|
5
|
+
constructor(status, message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.status = status;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
async function readSessionGraph(options, session) {
|
|
11
|
+
const { stores } = options;
|
|
12
|
+
if (!session.taskId) return {
|
|
13
|
+
rootTaskId: null,
|
|
14
|
+
nodes: []
|
|
15
|
+
};
|
|
16
|
+
const bound = await stores.tasks.get(session.taskId);
|
|
17
|
+
if (!bound) throw new TaskGraphAccessError(409, "The entrypoint Task is unavailable; refresh the graph.");
|
|
18
|
+
const graph = await stores.graphs.get(bound.rootTaskId);
|
|
19
|
+
if (!graph || !graph.nodes.some((node) => node.taskId === bound.id)) throw new TaskGraphAccessError(409, "The Task graph is unavailable; refresh to retry.");
|
|
20
|
+
const nodes = [];
|
|
21
|
+
const repositories = /* @__PURE__ */ new Map();
|
|
22
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
23
|
+
for (let start = 0; start < graph.nodes.length; start += 16) nodes.push(...await Promise.all(graph.nodes.slice(start, start + 16).map(async (node) => {
|
|
24
|
+
const task = await stores.tasks.get(node.taskId);
|
|
25
|
+
if (!task || task.rootTaskId !== graph.rootTaskId || task.parentTaskId !== node.parentTaskId) throw new TaskGraphAccessError(409, "Task graph membership is incomplete; refresh to retry.");
|
|
26
|
+
for (const id of task.repositoryIds) {
|
|
27
|
+
if (!repositories.has(id)) repositories.set(id, stores.repositories.get(id).then((repo) => Boolean(repo?.enabled && options.repositories.includes(repo.slug))));
|
|
28
|
+
if (!await repositories.get(id)) throw new TaskGraphAccessError(403, "The graph includes a repository that is no longer enabled and configured.");
|
|
29
|
+
}
|
|
30
|
+
let context = session;
|
|
31
|
+
if (task.replyTo.channel === "api") {
|
|
32
|
+
if (!sessions.has(task.replyTo.address)) sessions.set(task.replyTo.address, stores.sessions.get(agentSessionIdSchema.parse(task.replyTo.address)));
|
|
33
|
+
const owned = await sessions.get(task.replyTo.address);
|
|
34
|
+
if (!owned || owned.owner !== session.owner) throw new TaskGraphAccessError(404, "Task graph not found");
|
|
35
|
+
context = owned;
|
|
36
|
+
} else if (task.origin.operator !== session.owner && !await options.canAccessTask?.({ id: session.owner }, task)) throw new TaskGraphAccessError(404, "Task graph not found");
|
|
37
|
+
const binding = task.work.route;
|
|
38
|
+
const route = binding ? options.routes.get(binding) : void 0;
|
|
39
|
+
const continuation = context.continuations?.find((item) => item.taskId === task.id);
|
|
40
|
+
const candidate = route?.agent ?? (binding?.id === "conversation" && binding.version === 1 && continuation?.agent === options.continuationAgent ? options.continuationAgent : void 0);
|
|
41
|
+
const agent = candidate && options.agents.some((item) => item.id === candidate) ? candidate : null;
|
|
42
|
+
return {
|
|
43
|
+
task,
|
|
44
|
+
dependencyTaskIds: node.dependencies,
|
|
45
|
+
session: context,
|
|
46
|
+
agent
|
|
47
|
+
};
|
|
48
|
+
})));
|
|
49
|
+
return {
|
|
50
|
+
rootTaskId: graph.rootTaskId,
|
|
51
|
+
nodes
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { TaskGraphAccessError, readSessionGraph };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=api-task-graph.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-task-graph.mjs","names":[],"sources":["../src/api-task-graph.ts"],"sourcesContent":["import type { FactoryApiOptions } from \"./api\";\nimport { agentSessionIdSchema, type AgentSession } from \"./schema/session\";\nimport type { Task } from \"./schema/task\";\nimport type { TaskId } from \"./schema/id\";\n\nexport class TaskGraphAccessError extends Error {\n constructor(\n readonly status: number,\n message: string,\n ) {\n super(message);\n }\n}\n\nexport async function readSessionGraph(options: FactoryApiOptions, session: AgentSession) {\n const { stores } = options;\n if (!session.taskId) return { rootTaskId: null, nodes: [] };\n const bound = await stores.tasks.get(session.taskId);\n if (!bound)\n throw new TaskGraphAccessError(409, \"The entrypoint Task is unavailable; refresh the graph.\");\n const graph = await stores.graphs.get(bound.rootTaskId);\n if (!graph || !graph.nodes.some((node) => node.taskId === bound.id))\n throw new TaskGraphAccessError(409, \"The Task graph is unavailable; refresh to retry.\");\n const nodes: {\n task: Task;\n dependencyTaskIds: readonly TaskId[];\n session: AgentSession;\n agent: string | null;\n }[] = [];\n const repositories = new Map<string, Promise<boolean>>();\n const sessions = new Map<string, Promise<AgentSession | null>>();\n // Bound fan-out: a graph contains at most 256 directly addressed Tasks.\n for (let start = 0; start < graph.nodes.length; start += 16) {\n nodes.push(\n ...(await Promise.all(\n graph.nodes.slice(start, start + 16).map(async (node) => {\n const task = await stores.tasks.get(node.taskId);\n if (\n !task ||\n task.rootTaskId !== graph.rootTaskId ||\n task.parentTaskId !== node.parentTaskId\n )\n throw new TaskGraphAccessError(\n 409,\n \"Task graph membership is incomplete; refresh to retry.\",\n );\n for (const id of task.repositoryIds) {\n if (!repositories.has(id))\n repositories.set(\n id,\n stores.repositories\n .get(id)\n .then((repo) =>\n Boolean(repo?.enabled && options.repositories.includes(repo.slug)),\n ),\n );\n if (!(await repositories.get(id)))\n throw new TaskGraphAccessError(\n 403,\n \"The graph includes a repository that is no longer enabled and configured.\",\n );\n }\n let context: AgentSession = session;\n if (task.replyTo.channel === \"api\") {\n if (!sessions.has(task.replyTo.address))\n sessions.set(\n task.replyTo.address,\n stores.sessions.get(agentSessionIdSchema.parse(task.replyTo.address)),\n );\n const owned = await sessions.get(task.replyTo.address);\n if (!owned || owned.owner !== session.owner)\n throw new TaskGraphAccessError(404, \"Task graph not found\");\n context = owned;\n } else if (\n task.origin.operator !== session.owner &&\n !(await options.canAccessTask?.({ id: session.owner }, task))\n ) {\n throw new TaskGraphAccessError(404, \"Task graph not found\");\n }\n const binding = task.work.route;\n const route = binding ? options.routes.get(binding) : undefined;\n const continuation = context.continuations?.find((item) => item.taskId === task.id);\n const candidate =\n route?.agent ??\n (binding?.id === \"conversation\" &&\n binding.version === 1 &&\n continuation?.agent === options.continuationAgent\n ? options.continuationAgent\n : undefined);\n const agent =\n candidate && options.agents.some((item) => item.id === candidate) ? candidate : null;\n return { task, dependencyTaskIds: node.dependencies, session: context, agent };\n }),\n )),\n );\n }\n return { rootTaskId: graph.rootTaskId, nodes };\n}\n"],"mappings":";;AAKA,IAAa,uBAAb,cAA0C,MAAM;CAEnC;CADX,YACE,QACA,SACA;EACA,MAAM,OAAO;EAHJ,KAAA,SAAA;CAIX;AACF;AAEA,eAAsB,iBAAiB,SAA4B,SAAuB;CACxF,MAAM,EAAE,WAAW;CACnB,IAAI,CAAC,QAAQ,QAAQ,OAAO;EAAE,YAAY;EAAM,OAAO,CAAC;CAAE;CAC1D,MAAM,QAAQ,MAAM,OAAO,MAAM,IAAI,QAAQ,MAAM;CACnD,IAAI,CAAC,OACH,MAAM,IAAI,qBAAqB,KAAK,wDAAwD;CAC9F,MAAM,QAAQ,MAAM,OAAO,OAAO,IAAI,MAAM,UAAU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SACjC,CAAE,MAAM,QAAQ,gBAAgB,EAAE,IAAI,QAAQ,MAAM,GAAG,IAAI,GAE3D,MAAM,IAAI,qBAAqB,KAAK,sBAAsB;EAE5D,MAAM,UAAU,KAAK,KAAK;EAC1B,MAAM,QAAQ,UAAU,QAAQ,OAAO,IAAI,OAAO,IAAI,KAAA;EACtD,MAAM,eAAe,QAAQ,eAAe,MAAM,SAAS,KAAK,WAAW,KAAK,EAAE;EAClF,MAAM,YACJ,OAAO,UACN,SAAS,OAAO,kBACjB,QAAQ,YAAY,KACpB,cAAc,UAAU,QAAQ,oBAC5B,QAAQ,oBACR,KAAA;EACN,MAAM,QACJ,aAAa,QAAQ,OAAO,MAAM,SAAS,KAAK,OAAO,SAAS,IAAI,YAAY;EAClF,OAAO;GAAE;GAAM,mBAAmB,KAAK;GAAc,SAAS;GAAS;EAAM;CAC/E,CAAC,CACH,CACF;CAEF,OAAO;EAAE,YAAY,MAAM;EAAY;CAAM;AAC/C"}
|
package/dist/api.d.mts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Signal } from "./schema/signal.mjs";
|
|
2
|
+
import { Repository, RepositorySlug } from "./schema/repository.mjs";
|
|
3
|
+
import { ExecutionReference, Task } from "./schema/task.mjs";
|
|
4
|
+
import { AgentRouteRegistry } from "./agent-routes.mjs";
|
|
5
|
+
import { ImageAttachment, imagePartFilename } from "./image-input.mjs";
|
|
6
|
+
import { AgentSession, AgentSessionId, DirectAgentSession, ExternalAgentSession, TaskAgentSession, agentSessionIdSchema, agentSessionSchema } from "./schema/session.mjs";
|
|
7
|
+
import { FactoryStores, ImageInputError, SessionConflictError } from "./store/engine.mjs";
|
|
8
|
+
import { ApiPrincipal } from "./approval-contracts.mjs";
|
|
9
|
+
import { ResolveImageMessageInput, ResolveImageMessageStores, ResolvedImageMessage, ResolvedImageMessagePart, resolveImageMessage } from "./api-images.mjs";
|
|
10
|
+
import { DispatchBudget } from "./dispatch.mjs";
|
|
11
|
+
import { UnavailableWorkspaceDiffInput, WorkspaceDiff, WorkspaceDiffFile, unavailableWorkspaceDiff, workspaceDiffFileSchema, workspaceDiffSchema } from "./workspace-diff.mjs";
|
|
12
|
+
import { WorkspaceSnapshot, workspaceSnapshotSchema, workspaceSnapshotScript } from "./workspace-snapshot.mjs";
|
|
13
|
+
import { WorkspaceBaseBlob, WorkspaceBaseEntry, WorkspaceDiffAssemblyOptions, assembleWorkspaceDiff } from "./workspace-diff-assembly.mjs";
|
|
14
|
+
import { AnswerSessionQuestionRequest, ApiAgent, ApiAgentInput, ControlSessionRequest, CreateSessionRequest, RepositoryDetails, RepositorySummary, SendSessionMessageRequest, SessionInputResponse, SessionPage, SessionView, SubmitSessionInputRequest, answerSessionQuestionRequestSchema, apiAgentSchema, controlSessionRequestSchema, createSessionRequestSchema, repositoryDetailsSchema, repositorySummarySchema, sendSessionMessageRequestSchema, sessionInputResponseSchema, sessionPageSchema, sessionViewSchema, submitSessionInputRequestSchema } from "./api-contracts.mjs";
|
|
15
|
+
//#region src/api.d.ts
|
|
16
|
+
/** Identifies the session launch requested by the Factory HTTP API. */
|
|
17
|
+
interface FactoryApiStartInput {
|
|
18
|
+
readonly session: AgentSession;
|
|
19
|
+
readonly task: Task | null;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
readonly operationId: string;
|
|
22
|
+
readonly attachments?: readonly ImageAttachment[];
|
|
23
|
+
}
|
|
24
|
+
/** Identifies one request forwarded from the Factory API to an active execution. */
|
|
25
|
+
interface FactoryApiForwardInput {
|
|
26
|
+
readonly session: AgentSession;
|
|
27
|
+
readonly execution: ExecutionReference;
|
|
28
|
+
readonly path: string;
|
|
29
|
+
readonly request: Request;
|
|
30
|
+
}
|
|
31
|
+
/** Identifies the active execution whose workspace diff the Factory API requests. */
|
|
32
|
+
interface FactoryApiWorkspaceDiffInput {
|
|
33
|
+
readonly session: AgentSession;
|
|
34
|
+
readonly execution: ExecutionReference;
|
|
35
|
+
readonly signal: AbortSignal;
|
|
36
|
+
}
|
|
37
|
+
/** Application-owned dependencies and authorization policies for the Factory HTTP API. */
|
|
38
|
+
interface FactoryApiOptions {
|
|
39
|
+
stores: FactoryStores;
|
|
40
|
+
agents: readonly ApiAgentInput[];
|
|
41
|
+
routes: AgentRouteRegistry;
|
|
42
|
+
repositories: readonly RepositorySlug[];
|
|
43
|
+
budget: DispatchBudget;
|
|
44
|
+
authenticate(request: Request): Promise<ApiPrincipal | Response>;
|
|
45
|
+
/** Exact provider-qualified actors allowed to read and decide approvals. Absent disables approval access. */
|
|
46
|
+
operators?: readonly string[];
|
|
47
|
+
/** Explicit operator policy for inspecting and controlling external work; absent denies access. */
|
|
48
|
+
canAccessTask?(operator: {
|
|
49
|
+
id: string;
|
|
50
|
+
}, task: Task): Promise<boolean>;
|
|
51
|
+
/** Exposed conversational agent used for separately budgeted follow-up investigations. */
|
|
52
|
+
continuationAgent?: string;
|
|
53
|
+
/** Application-owned launcher for an explicitly retried, stopped intake attempt. */
|
|
54
|
+
retryIntake?(signal: Signal, options: {
|
|
55
|
+
expectedAttempt: number;
|
|
56
|
+
by: string;
|
|
57
|
+
}): Promise<Signal>;
|
|
58
|
+
resumeTask?(task: Task): Promise<ExecutionReference>;
|
|
59
|
+
ensureRepository(slug: RepositorySlug): Promise<Repository>;
|
|
60
|
+
start(input: FactoryApiStartInput): Promise<ExecutionReference>;
|
|
61
|
+
forward(input: FactoryApiForwardInput): Promise<Response>;
|
|
62
|
+
workspaceDiff?(input: FactoryApiWorkspaceDiffInput): Promise<WorkspaceDiff>;
|
|
63
|
+
reportError?(error: unknown, context: {
|
|
64
|
+
method: string;
|
|
65
|
+
path: string;
|
|
66
|
+
}): void;
|
|
67
|
+
}
|
|
68
|
+
/** Authenticated Factory HTTP handler plus the launcher for durable continuation Tasks. */
|
|
69
|
+
interface FactoryApi {
|
|
70
|
+
handle(request: Request): Promise<Response>;
|
|
71
|
+
startContinuation(task: Task): Promise<ExecutionReference>;
|
|
72
|
+
}
|
|
73
|
+
/** Creates the authenticated request handler for the public Factory HTTP API. */
|
|
74
|
+
declare function createFactoryApi(options: FactoryApiOptions): FactoryApi;
|
|
75
|
+
//#endregion
|
|
76
|
+
export { type AgentSession, type AgentSessionId, type AnswerSessionQuestionRequest, type ApiAgent, type ApiAgentInput, type ApiPrincipal, type ControlSessionRequest, type CreateSessionRequest, type DirectAgentSession, type ExternalAgentSession, FactoryApi, FactoryApiForwardInput, FactoryApiOptions, FactoryApiStartInput, FactoryApiWorkspaceDiffInput, ImageInputError, type RepositoryDetails, type RepositorySummary, type ResolveImageMessageInput, type ResolveImageMessageStores, type ResolvedImageMessage, type ResolvedImageMessagePart, type SendSessionMessageRequest, SessionConflictError, type SessionInputResponse, type SessionPage, type SessionView, type SubmitSessionInputRequest, type TaskAgentSession, type UnavailableWorkspaceDiffInput, type WorkspaceBaseBlob, type WorkspaceBaseEntry, type WorkspaceDiff, type WorkspaceDiffAssemblyOptions, type WorkspaceDiffFile, type WorkspaceSnapshot, agentSessionIdSchema, agentSessionSchema, answerSessionQuestionRequestSchema, apiAgentSchema, assembleWorkspaceDiff, controlSessionRequestSchema, createFactoryApi, createSessionRequestSchema, imagePartFilename, repositoryDetailsSchema, repositorySummarySchema, resolveImageMessage, sendSessionMessageRequestSchema, sessionInputResponseSchema, sessionPageSchema, sessionViewSchema, submitSessionInputRequestSchema, unavailableWorkspaceDiff, workspaceDiffFileSchema, workspaceDiffSchema, workspaceSnapshotSchema, workspaceSnapshotScript };
|
|
77
|
+
//# sourceMappingURL=api.d.mts.map
|