@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,234 @@
|
|
|
1
|
+
import { SignalSource } from "./schema/signal.mjs";
|
|
2
|
+
import { TaskId } from "./schema/id.mjs";
|
|
3
|
+
import { RepositorySlug } from "./schema/repository.mjs";
|
|
4
|
+
import { Task } from "./schema/task.mjs";
|
|
5
|
+
import { MaybePromise } from "./schema/common.mjs";
|
|
6
|
+
import { ImageAttachment, ImageId, ImageUploadInput, MAX_IMAGES, MAX_IMAGE_BYTES, imageAttachmentSchema, imageAttachmentsSchema, imageIdSchema } from "./image-input.mjs";
|
|
7
|
+
import { AgentSession, AgentSessionId, DirectAgentSession, ExternalAgentSession, TaskAgentSession, agentSessionIdSchema, agentSessionSchema } from "./schema/session.mjs";
|
|
8
|
+
import { Change } from "./schema/change.mjs";
|
|
9
|
+
import { InputRequest, ToolCall, TranscriptBlock, TranscriptSnapshot, inputRequestSchema, toolCallSchema, transcriptBlockSchema, transcriptSnapshotSchema } from "./schema/transcript.mjs";
|
|
10
|
+
import { ApprovalListOptions, ApprovalPage, ApprovalView } from "./approval-contracts.mjs";
|
|
11
|
+
import { WorkspaceDiff, WorkspaceDiffFile, workspaceDiffFileSchema, workspaceDiffSchema } from "./workspace-diff.mjs";
|
|
12
|
+
import "./signals.mjs";
|
|
13
|
+
import { IntakeView, describeIntake } from "./intake-contracts.mjs";
|
|
14
|
+
import { TaskGraphView } from "./task-graph-view.mjs";
|
|
15
|
+
import { StreamEvent, readEvents, streamEventSchema } from "./client-events.mjs";
|
|
16
|
+
import { Transcript } from "./client-transcript.mjs";
|
|
17
|
+
import { FollowSessionStreamOptions, SessionStreamClient, followSessionStream } from "./client-stream.mjs";
|
|
18
|
+
import { AnswerSessionQuestionRequest, ApiAgent, ControlSessionRequest, CreateSessionRequest, PendingFollowUp, RepositoryDetails, RepositorySummary, SendSessionMessageRequest, SessionInputResponse, SessionPage, SessionView, SubmitSessionInputRequest, answerSessionQuestionRequestSchema, apiAgentSchema, controlSessionRequestSchema, createSessionRequestSchema, pendingFollowUpSchema, repositoryDetailsSchema, repositorySummarySchema, sendSessionMessageRequestSchema, sessionInputResponseSchema, sessionPageSchema, sessionViewSchema, submitSessionInputRequestSchema } from "./api-contracts.mjs";
|
|
19
|
+
//#region src/client.d.ts
|
|
20
|
+
/** All durable Task states in their schema-defined order. */
|
|
21
|
+
declare const taskStates: readonly ("queued" | "running" | "stalled" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled")[];
|
|
22
|
+
/** Filters and pagination accepted by the session-list API. */
|
|
23
|
+
interface SessionListOptions {
|
|
24
|
+
readonly scope?: "all" | "interactive";
|
|
25
|
+
readonly detail?: "full" | "summary";
|
|
26
|
+
readonly limit?: number;
|
|
27
|
+
readonly cursor?: AgentSessionId;
|
|
28
|
+
readonly query?: string;
|
|
29
|
+
readonly repository?: RepositorySlug;
|
|
30
|
+
readonly agent?: string;
|
|
31
|
+
readonly source?: "automatic";
|
|
32
|
+
readonly state?: Task["state"] | "conversation";
|
|
33
|
+
readonly attention?: boolean;
|
|
34
|
+
readonly topLevel?: boolean;
|
|
35
|
+
readonly includeTotal?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** An unsuccessful Factory API response surfaced by the browser-safe client. */
|
|
38
|
+
declare class ApiError extends Error {
|
|
39
|
+
readonly status: number;
|
|
40
|
+
readonly actor?: string | undefined;
|
|
41
|
+
constructor(status: number, message: string, actor?: string | undefined);
|
|
42
|
+
}
|
|
43
|
+
/** Connection and request customization for {@link FactoryClient}. */
|
|
44
|
+
interface FactoryClientOptions {
|
|
45
|
+
readonly url: string;
|
|
46
|
+
readonly headers?: () => MaybePromise<HeadersInit>;
|
|
47
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
48
|
+
}
|
|
49
|
+
/** Identifies an uploaded image and optionally controls cancellation of its download. */
|
|
50
|
+
interface GetImageOptions {
|
|
51
|
+
readonly id: ImageId;
|
|
52
|
+
readonly signal?: AbortSignal;
|
|
53
|
+
}
|
|
54
|
+
/** Identifies an operator session and the amount of detail to return. */
|
|
55
|
+
interface GetSessionOptions {
|
|
56
|
+
readonly id: AgentSessionId;
|
|
57
|
+
readonly detail?: "full" | "summary";
|
|
58
|
+
}
|
|
59
|
+
/** Identifies the operator session whose canonical task graph should be read. */
|
|
60
|
+
interface GetSessionGraphOptions {
|
|
61
|
+
readonly id: AgentSessionId;
|
|
62
|
+
readonly signal?: AbortSignal;
|
|
63
|
+
}
|
|
64
|
+
/** Identifies an exact task execution transcript within an operator session. */
|
|
65
|
+
interface GraphTranscriptOptions {
|
|
66
|
+
readonly sessionId: AgentSessionId;
|
|
67
|
+
readonly taskId: TaskId;
|
|
68
|
+
readonly executionId: string;
|
|
69
|
+
readonly signal?: AbortSignal;
|
|
70
|
+
}
|
|
71
|
+
/** Identifies the execution whose committed workspace should be compared. */
|
|
72
|
+
interface WorkspaceDiffOptions {
|
|
73
|
+
readonly sessionId: AgentSessionId;
|
|
74
|
+
readonly executionId: string | null;
|
|
75
|
+
readonly signal?: AbortSignal;
|
|
76
|
+
}
|
|
77
|
+
/** Identifies a materialized transcript response used by the stream follower. */
|
|
78
|
+
interface SessionTranscriptRequest {
|
|
79
|
+
readonly sessionId: AgentSessionId;
|
|
80
|
+
readonly executionId: string;
|
|
81
|
+
readonly taskId?: TaskId;
|
|
82
|
+
readonly history?: boolean;
|
|
83
|
+
readonly signal: AbortSignal;
|
|
84
|
+
}
|
|
85
|
+
/** Identifies a cursor-addressed event stream used by the stream follower. */
|
|
86
|
+
interface SessionEventStreamRequest {
|
|
87
|
+
readonly sessionId: AgentSessionId;
|
|
88
|
+
readonly executionId: string;
|
|
89
|
+
readonly cursor: number;
|
|
90
|
+
readonly taskId?: TaskId;
|
|
91
|
+
readonly signal: AbortSignal;
|
|
92
|
+
}
|
|
93
|
+
/** Browser-safe typed client for the public Factory HTTP API. */
|
|
94
|
+
declare class FactoryClient {
|
|
95
|
+
private readonly options;
|
|
96
|
+
private readonly origin;
|
|
97
|
+
constructor(options: FactoryClientOptions);
|
|
98
|
+
private response;
|
|
99
|
+
/** Read authorized intake and pre-task triage failures. */
|
|
100
|
+
intake(options?: {
|
|
101
|
+
repository?: string;
|
|
102
|
+
cursor?: string;
|
|
103
|
+
limit?: number;
|
|
104
|
+
}): Promise<{
|
|
105
|
+
items: {
|
|
106
|
+
id: `sig_${string}`;
|
|
107
|
+
schemaVersion: 1;
|
|
108
|
+
repositoryId: `repo_${string}`;
|
|
109
|
+
source: SignalSource;
|
|
110
|
+
deliveryId: string;
|
|
111
|
+
replyTo: {
|
|
112
|
+
channel: string;
|
|
113
|
+
address: string;
|
|
114
|
+
};
|
|
115
|
+
receivedAt: string;
|
|
116
|
+
outcome: "pending" | "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored";
|
|
117
|
+
repository: string;
|
|
118
|
+
taskIds: `task_${string}`[];
|
|
119
|
+
triage?: {
|
|
120
|
+
attempt: number;
|
|
121
|
+
state: "running" | "blocked" | "uncertain";
|
|
122
|
+
by: string;
|
|
123
|
+
startedAt: string;
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
sessionId?: string | undefined;
|
|
126
|
+
failure?: "cancelled" | "billing_verification_required" | "provider_failed" | "no_decision" | "launch_unconfirmed" | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
detail?: string | undefined;
|
|
129
|
+
reason?: string | undefined;
|
|
130
|
+
decidedAt?: string | undefined;
|
|
131
|
+
}[];
|
|
132
|
+
nextCursor: string | null;
|
|
133
|
+
}>;
|
|
134
|
+
/** Retry only the observed stopped attempt; concurrent or stale retries conflict. */
|
|
135
|
+
retryIntake(id: string, expectedAttempt: number): Promise<{
|
|
136
|
+
id: `sig_${string}`;
|
|
137
|
+
schemaVersion: 1;
|
|
138
|
+
repositoryId: `repo_${string}`;
|
|
139
|
+
source: SignalSource;
|
|
140
|
+
deliveryId: string;
|
|
141
|
+
replyTo: {
|
|
142
|
+
channel: string;
|
|
143
|
+
address: string;
|
|
144
|
+
};
|
|
145
|
+
receivedAt: string;
|
|
146
|
+
outcome: "pending" | "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored";
|
|
147
|
+
repository: string;
|
|
148
|
+
taskIds: `task_${string}`[];
|
|
149
|
+
triage?: {
|
|
150
|
+
attempt: number;
|
|
151
|
+
state: "running" | "blocked" | "uncertain";
|
|
152
|
+
by: string;
|
|
153
|
+
startedAt: string;
|
|
154
|
+
updatedAt: string;
|
|
155
|
+
sessionId?: string | undefined;
|
|
156
|
+
failure?: "cancelled" | "billing_verification_required" | "provider_failed" | "no_decision" | "launch_unconfirmed" | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
detail?: string | undefined;
|
|
159
|
+
reason?: string | undefined;
|
|
160
|
+
decidedAt?: string | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
/** Lists approval proposals visible to the authenticated operator. */
|
|
163
|
+
listApprovals(options?: ApprovalListOptions): Promise<ApprovalPage>;
|
|
164
|
+
/** Reads one approval proposal by Task ID. */
|
|
165
|
+
getApproval(id: TaskId): Promise<ApprovalView>;
|
|
166
|
+
/** Approves one proposal, optionally recording an operator reason. */
|
|
167
|
+
approveTask(id: TaskId, reason?: string): Promise<ApprovalView>;
|
|
168
|
+
/** Rejects one proposal with the required operator reason. */
|
|
169
|
+
rejectTask(id: TaskId, reason: string): Promise<ApprovalView>;
|
|
170
|
+
/** Uploads one bounded image for use in a later message. */
|
|
171
|
+
uploadImage(input: ImageUploadInput): Promise<ImageAttachment>;
|
|
172
|
+
/** Downloads a previously uploaded image. */
|
|
173
|
+
getImage(options: GetImageOptions): Promise<Blob>;
|
|
174
|
+
/** Lists agents exposed for operator session creation. */
|
|
175
|
+
listAgents(): Promise<readonly ApiAgent[]>;
|
|
176
|
+
/** Reports whether the configured origin is the isolated local fixture runtime. */
|
|
177
|
+
isLocalTestRuntime(): Promise<boolean>;
|
|
178
|
+
/** Lists configured repository slugs. */
|
|
179
|
+
listRepositories(): Promise<readonly RepositorySlug[]>;
|
|
180
|
+
/** Reads repository slugs together with their stable configured identifiers. */
|
|
181
|
+
getRepositoryDetails(): Promise<RepositoryDetails>;
|
|
182
|
+
/** Lists open Changes, optionally scoped to one repository slug. */
|
|
183
|
+
listChanges(repository?: RepositorySlug): Promise<readonly Change[]>;
|
|
184
|
+
/** Lists canonical Tasks exposed by the operator API. */
|
|
185
|
+
listTasks(): Promise<readonly Task[]>;
|
|
186
|
+
/** Lists sessions matching the requested operator scope. */
|
|
187
|
+
listSessions(options?: Pick<SessionListOptions, "scope" | "detail">): Promise<readonly SessionView[]>;
|
|
188
|
+
/** Reads a filtered, cursor-paginated page of sessions. */
|
|
189
|
+
getSessionPage(options?: SessionListOptions): Promise<SessionPage>;
|
|
190
|
+
/** Counts sessions that currently require operator attention. */
|
|
191
|
+
getInboxCount(): Promise<number>;
|
|
192
|
+
/** Reads a summary batch for the provided session IDs. */
|
|
193
|
+
getSessionBatch(ids: readonly AgentSessionId[]): Promise<readonly SessionView[]>;
|
|
194
|
+
/** Reads one operator session. */
|
|
195
|
+
getSession(options: GetSessionOptions): Promise<SessionView>;
|
|
196
|
+
/** Reads the canonical task graph projected for one session. */
|
|
197
|
+
getSessionGraph(options: GetSessionGraphOptions): Promise<TaskGraphView>;
|
|
198
|
+
/** Reads the materialized transcript for one exact graph task execution. */
|
|
199
|
+
getGraphTranscript(options: GraphTranscriptOptions): Promise<TranscriptSnapshot>;
|
|
200
|
+
/** Refreshes a session summary and reloads its history when the active execution changes. */
|
|
201
|
+
refreshSession(previous: SessionView): Promise<SessionView>;
|
|
202
|
+
/** Reads the committed workspace comparison for one observed execution. */
|
|
203
|
+
getWorkspaceDiff(options: WorkspaceDiffOptions): Promise<WorkspaceDiff>;
|
|
204
|
+
/** Creates or recovers an idempotent conversational session. */
|
|
205
|
+
createSession(input: CreateSessionRequest): Promise<SessionView>;
|
|
206
|
+
/** Creates or recovers idempotent workflow work through a specialist signal. */
|
|
207
|
+
createSignal(input: CreateSessionRequest): Promise<SessionView>;
|
|
208
|
+
/** Sends a message to an existing session. */
|
|
209
|
+
sendSessionMessage(id: AgentSessionId, input: SendSessionMessageRequest): Promise<void>;
|
|
210
|
+
/** Submits responses to pending provider input requests. */
|
|
211
|
+
submitSessionInput(id: AgentSessionId, input: SubmitSessionInputRequest): Promise<void>;
|
|
212
|
+
/** Dispatches queued workflow work associated with a session. */
|
|
213
|
+
dispatchSession(id: AgentSessionId): Promise<SessionView>;
|
|
214
|
+
/** Answers a workflow question associated with a session. */
|
|
215
|
+
answerSessionQuestion(id: AgentSessionId, input: AnswerSessionQuestionRequest): Promise<SessionView>;
|
|
216
|
+
/** Cooperatively interrupts the currently observed turn. */
|
|
217
|
+
interruptSession(id: AgentSessionId, input?: ControlSessionRequest): Promise<void>;
|
|
218
|
+
/** Cancels active workflow and provider work in a session. */
|
|
219
|
+
cancelSession(id: AgentSessionId, input?: ControlSessionRequest): Promise<void>;
|
|
220
|
+
/** Compacts the provider context for a session. */
|
|
221
|
+
compactSession(id: AgentSessionId, input?: ControlSessionRequest): Promise<void>;
|
|
222
|
+
/** Clears the provider context for a session. */
|
|
223
|
+
clearSession(id: AgentSessionId, input?: ControlSessionRequest): Promise<void>;
|
|
224
|
+
/** Resets a session after cancelling its active work. */
|
|
225
|
+
resetSession(id: AgentSessionId, input?: ControlSessionRequest): Promise<void>;
|
|
226
|
+
/** Reads a materialized transcript as a raw HTTP response for incremental following. */
|
|
227
|
+
getSessionTranscriptResponse(input: SessionTranscriptRequest): Promise<Response>;
|
|
228
|
+
/** Opens a cursor-addressed session event stream as a raw HTTP response. */
|
|
229
|
+
getSessionEventStreamResponse(input: SessionEventStreamRequest): Promise<Response>;
|
|
230
|
+
private controlSession;
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
export { type AgentSession, type AgentSessionId, type AnswerSessionQuestionRequest, type ApiAgent, ApiError, type ApprovalListOptions, type ApprovalPage, type ApprovalView, type ControlSessionRequest, type CreateSessionRequest, type DirectAgentSession, type ExternalAgentSession, FactoryClient, FactoryClientOptions, type FollowSessionStreamOptions, GetImageOptions, GetSessionGraphOptions, GetSessionOptions, GraphTranscriptOptions, type ImageAttachment, type ImageId, type ImageUploadInput, type InputRequest, type IntakeView, MAX_IMAGES, MAX_IMAGE_BYTES, type PendingFollowUp, type RepositoryDetails, type RepositorySummary, type SendSessionMessageRequest, SessionEventStreamRequest, type SessionInputResponse, SessionListOptions, type SessionPage, type SessionStreamClient, SessionTranscriptRequest, type SessionView, type StreamEvent, type SubmitSessionInputRequest, type TaskAgentSession, type TaskGraphView, type ToolCall, Transcript, type TranscriptBlock, type TranscriptSnapshot, type WorkspaceDiff, type WorkspaceDiffFile, WorkspaceDiffOptions, agentSessionIdSchema, agentSessionSchema, answerSessionQuestionRequestSchema, apiAgentSchema, controlSessionRequestSchema, createSessionRequestSchema, describeIntake, followSessionStream, imageAttachmentSchema, imageAttachmentsSchema, imageIdSchema, inputRequestSchema, pendingFollowUpSchema, readEvents, repositoryDetailsSchema, repositorySummarySchema, sendSessionMessageRequestSchema, sessionInputResponseSchema, sessionPageSchema, sessionViewSchema, streamEventSchema, submitSessionInputRequestSchema, taskStates, toolCallSchema, transcriptBlockSchema, transcriptSnapshotSchema, workspaceDiffFileSchema, workspaceDiffSchema };
|
|
234
|
+
//# sourceMappingURL=client.d.mts.map
|
package/dist/client.mjs
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { repositorySlugSchema } from "./schema/repository.mjs";
|
|
2
|
+
import { taskSchema, taskStateSchema } from "./schema/task.mjs";
|
|
3
|
+
import { readEvents, streamEventSchema } from "./client-events.mjs";
|
|
4
|
+
import { MAX_IMAGES, MAX_IMAGE_BYTES, imageAttachmentSchema, imageAttachmentsSchema, imageIdSchema } from "./image-input.mjs";
|
|
5
|
+
import { inputRequestSchema, toolCallSchema, transcriptBlockSchema, transcriptSnapshotSchema } from "./schema/transcript.mjs";
|
|
6
|
+
import { Transcript } from "./client-transcript.mjs";
|
|
7
|
+
import { approvalPageSchema, approvalRequestSchema, approvalViewSchema } from "./approval-contracts.mjs";
|
|
8
|
+
import { agentSessionIdSchema, agentSessionSchema } from "./schema/session.mjs";
|
|
9
|
+
import { changeSchema } from "./schema/change.mjs";
|
|
10
|
+
import { describeIntake, intakePageSchema, intakeViewSchema, retryIntakeSchema } from "./intake-contracts.mjs";
|
|
11
|
+
import { answerSessionQuestionRequestSchema, apiAgentSchema, controlSessionRequestSchema, createSessionRequestSchema, pendingFollowUpSchema, repositoryDetailsSchema, repositorySummarySchema, sendSessionMessageRequestSchema, sessionInputResponseSchema, sessionPageSchema, sessionViewSchema, submitSessionInputRequestSchema } from "./api-contracts.mjs";
|
|
12
|
+
import { workspaceDiffFileSchema, workspaceDiffSchema } from "./workspace-diff.mjs";
|
|
13
|
+
import { taskGraphViewSchema } from "./task-graph-view.mjs";
|
|
14
|
+
import { followSessionStream } from "./client-stream.mjs";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
//#region src/client.ts
|
|
17
|
+
/** All durable Task states in their schema-defined order. */
|
|
18
|
+
const taskStates = Object.freeze([...taskStateSchema.options]);
|
|
19
|
+
/** An unsuccessful Factory API response surfaced by the browser-safe client. */
|
|
20
|
+
var ApiError = class extends Error {
|
|
21
|
+
status;
|
|
22
|
+
actor;
|
|
23
|
+
constructor(status, message, actor) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.status = status;
|
|
26
|
+
this.actor = actor;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/** Browser-safe typed client for the public Factory HTTP API. */
|
|
30
|
+
var FactoryClient = class {
|
|
31
|
+
options;
|
|
32
|
+
origin;
|
|
33
|
+
constructor(options) {
|
|
34
|
+
this.options = options;
|
|
35
|
+
const url = new URL(options.url);
|
|
36
|
+
if (url.username || url.password || url.pathname !== "/" || url.search || url.hash || url.protocol !== "https:" && !(url.protocol === "http:" && [
|
|
37
|
+
"localhost",
|
|
38
|
+
"127.0.0.1",
|
|
39
|
+
"[::1]"
|
|
40
|
+
].includes(url.hostname))) throw new Error("Factory URL must be an HTTPS origin, or HTTP on loopback");
|
|
41
|
+
this.origin = url.origin;
|
|
42
|
+
}
|
|
43
|
+
async response(path, body, signal) {
|
|
44
|
+
const url = new URL(`/api/v1/${path}`, this.origin);
|
|
45
|
+
if (url.origin !== this.origin || !url.pathname.startsWith("/api/v1/")) throw new Error("Invalid Factory API path");
|
|
46
|
+
const headers = new Headers(await this.options.headers?.());
|
|
47
|
+
headers.set("content-type", "application/json");
|
|
48
|
+
const response = await (this.options.fetch ?? globalThis.fetch)(url.href, {
|
|
49
|
+
method: body === void 0 ? "GET" : "POST",
|
|
50
|
+
headers,
|
|
51
|
+
...body === void 0 ? {} : { body: JSON.stringify(body) },
|
|
52
|
+
credentials: "same-origin",
|
|
53
|
+
cache: "no-store",
|
|
54
|
+
redirect: "manual",
|
|
55
|
+
signal: signal ?? AbortSignal.timeout(3e4)
|
|
56
|
+
});
|
|
57
|
+
if (response.type === "opaqueredirect" || [
|
|
58
|
+
301,
|
|
59
|
+
302,
|
|
60
|
+
303,
|
|
61
|
+
307,
|
|
62
|
+
308
|
|
63
|
+
].includes(response.status)) {
|
|
64
|
+
await response.body?.cancel();
|
|
65
|
+
throw new ApiError(response.status, `Factory at ${this.origin} returned a redirect. Reload to sign in, or set factory.url to the factory's canonical origin. Redirects are not followed.`);
|
|
66
|
+
}
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
const value = await response.json().catch(() => null);
|
|
69
|
+
const detail = value !== null && typeof value === "object" && "error" in value && typeof value.error === "string" ? value.error : `HTTP ${response.status}`;
|
|
70
|
+
const actor = value !== null && typeof value === "object" && "actor" in value && typeof value.actor === "string" ? value.actor : void 0;
|
|
71
|
+
throw new ApiError(response.status, response.status === 401 ? "Authentication rejected. Reload to sign in, or run vercel login for the terminal client." : detail, actor);
|
|
72
|
+
}
|
|
73
|
+
return response;
|
|
74
|
+
}
|
|
75
|
+
/** Read authorized intake and pre-task triage failures. */
|
|
76
|
+
async intake(options = {}) {
|
|
77
|
+
const query = new URLSearchParams();
|
|
78
|
+
for (const [key, value] of Object.entries(options)) if (value !== void 0) query.set(key, String(value));
|
|
79
|
+
return intakePageSchema.parse(await (await this.response(`intake?${query}`)).json());
|
|
80
|
+
}
|
|
81
|
+
/** Retry only the observed stopped attempt; concurrent or stale retries conflict. */
|
|
82
|
+
async retryIntake(id, expectedAttempt) {
|
|
83
|
+
return intakeViewSchema.parse(await (await this.response(`intake/${encodeURIComponent(id)}/retry`, retryIntakeSchema.parse({ expectedAttempt }))).json());
|
|
84
|
+
}
|
|
85
|
+
/** Lists approval proposals visible to the authenticated operator. */
|
|
86
|
+
async listApprovals(options = {}) {
|
|
87
|
+
const query = new URLSearchParams(Object.entries(options).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)]));
|
|
88
|
+
return approvalPageSchema.parse(await (await this.response(`approvals?${query}`)).json());
|
|
89
|
+
}
|
|
90
|
+
/** Reads one approval proposal by Task ID. */
|
|
91
|
+
async getApproval(id) {
|
|
92
|
+
return approvalViewSchema.parse(await (await this.response(`tasks/${encodeURIComponent(id)}/approval`)).json());
|
|
93
|
+
}
|
|
94
|
+
/** Approves one proposal, optionally recording an operator reason. */
|
|
95
|
+
async approveTask(id, reason) {
|
|
96
|
+
return approvalViewSchema.parse(await (await this.response(`tasks/${encodeURIComponent(id)}/approve`, approvalRequestSchema.parse({ reason }))).json());
|
|
97
|
+
}
|
|
98
|
+
/** Rejects one proposal with the required operator reason. */
|
|
99
|
+
async rejectTask(id, reason) {
|
|
100
|
+
return approvalViewSchema.parse(await (await this.response(`tasks/${encodeURIComponent(id)}/reject`, approvalRequestSchema.parse({ reason }))).json());
|
|
101
|
+
}
|
|
102
|
+
/** Uploads one bounded image for use in a later message. */
|
|
103
|
+
async uploadImage(input) {
|
|
104
|
+
return imageAttachmentSchema.parse(await (await this.response("images", input)).json());
|
|
105
|
+
}
|
|
106
|
+
/** Downloads a previously uploaded image. */
|
|
107
|
+
async getImage(options) {
|
|
108
|
+
return (await this.response(`images/${encodeURIComponent(options.id)}`, void 0, options.signal)).blob();
|
|
109
|
+
}
|
|
110
|
+
/** Lists agents exposed for operator session creation. */
|
|
111
|
+
async listAgents() {
|
|
112
|
+
return z.object({ agents: z.array(apiAgentSchema).readonly() }).parse(await (await this.response("agents")).json()).agents;
|
|
113
|
+
}
|
|
114
|
+
/** Reports whether the configured origin is the isolated local fixture runtime. */
|
|
115
|
+
async isLocalTestRuntime() {
|
|
116
|
+
const response = await this.response("agents");
|
|
117
|
+
const local = response.headers.get("x-factory-local-test") === "1";
|
|
118
|
+
await response.body?.cancel();
|
|
119
|
+
return local;
|
|
120
|
+
}
|
|
121
|
+
/** Lists configured repository slugs. */
|
|
122
|
+
async listRepositories() {
|
|
123
|
+
return z.object({ repositories: z.array(repositorySlugSchema).readonly() }).parse(await (await this.response("repositories")).json()).repositories;
|
|
124
|
+
}
|
|
125
|
+
/** Reads repository slugs together with their stable configured identifiers. */
|
|
126
|
+
async getRepositoryDetails() {
|
|
127
|
+
return repositoryDetailsSchema.parse(await (await this.response("repositories")).json());
|
|
128
|
+
}
|
|
129
|
+
/** Lists open Changes, optionally scoped to one repository slug. */
|
|
130
|
+
async listChanges(repository) {
|
|
131
|
+
return z.object({ changes: z.array(changeSchema).readonly() }).parse(await (await this.response(repository === void 0 ? "changes" : `changes?repository=${encodeURIComponent(repository)}`)).json()).changes;
|
|
132
|
+
}
|
|
133
|
+
/** Lists canonical Tasks exposed by the operator API. */
|
|
134
|
+
async listTasks() {
|
|
135
|
+
return z.strictObject({ tasks: z.array(taskSchema).readonly() }).parse(await (await this.response("tasks")).json()).tasks;
|
|
136
|
+
}
|
|
137
|
+
/** Lists sessions matching the requested operator scope. */
|
|
138
|
+
async listSessions(options = {}) {
|
|
139
|
+
return (await this.getSessionPage(options)).sessions;
|
|
140
|
+
}
|
|
141
|
+
/** Reads a filtered, cursor-paginated page of sessions. */
|
|
142
|
+
async getSessionPage(options = {}) {
|
|
143
|
+
const query = new URLSearchParams(Object.entries(options).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])).toString();
|
|
144
|
+
return sessionPageSchema.parse(await (await this.response(`sessions${query ? `?${query}` : ""}`)).json());
|
|
145
|
+
}
|
|
146
|
+
/** Counts sessions that currently require operator attention. */
|
|
147
|
+
async getInboxCount() {
|
|
148
|
+
return z.object({ totalCount: z.number().int().nonnegative() }).parse(await (await this.response("sessions?scope=all&detail=summary&attention=true&includeTotal=true&limit=1")).json()).totalCount;
|
|
149
|
+
}
|
|
150
|
+
/** Reads a summary batch for the provided session IDs. */
|
|
151
|
+
async getSessionBatch(ids) {
|
|
152
|
+
if (ids.length === 0) return [];
|
|
153
|
+
const query = new URLSearchParams({
|
|
154
|
+
ids: ids.join(","),
|
|
155
|
+
detail: "summary"
|
|
156
|
+
});
|
|
157
|
+
return z.object({ sessions: z.array(sessionViewSchema).readonly() }).parse(await (await this.response(`sessions?${query}`)).json()).sessions;
|
|
158
|
+
}
|
|
159
|
+
/** Reads one operator session. */
|
|
160
|
+
async getSession(options) {
|
|
161
|
+
return sessionViewSchema.parse(await (await this.response(`sessions/${encodeURIComponent(options.id)}${options.detail ? `?detail=${options.detail}` : ""}`)).json());
|
|
162
|
+
}
|
|
163
|
+
/** Reads the canonical task graph projected for one session. */
|
|
164
|
+
async getSessionGraph(options) {
|
|
165
|
+
return taskGraphViewSchema.parse(await (await this.response(`sessions/${encodeURIComponent(options.id)}/graph`, void 0, options.signal)).json());
|
|
166
|
+
}
|
|
167
|
+
/** Reads the materialized transcript for one exact graph task execution. */
|
|
168
|
+
async getGraphTranscript(options) {
|
|
169
|
+
const query = new URLSearchParams({
|
|
170
|
+
taskId: options.taskId,
|
|
171
|
+
executionId: options.executionId
|
|
172
|
+
});
|
|
173
|
+
return transcriptSnapshotSchema.parse(await (await this.response(`sessions/${encodeURIComponent(options.sessionId)}/graph-transcript?${query}`, void 0, options.signal)).json());
|
|
174
|
+
}
|
|
175
|
+
/** Refreshes a session summary and reloads its history when the active execution changes. */
|
|
176
|
+
async refreshSession(previous) {
|
|
177
|
+
const current = await this.getSession({
|
|
178
|
+
id: previous.session.id,
|
|
179
|
+
detail: "summary"
|
|
180
|
+
});
|
|
181
|
+
if (current.task?.id !== previous.task?.id || current.execution?.sessionId !== previous.execution?.sessionId || current.execution?.provider !== previous.execution?.provider) return this.getSession({ id: previous.session.id });
|
|
182
|
+
return {
|
|
183
|
+
...current,
|
|
184
|
+
history: previous.history
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/** Reads the committed workspace comparison for one observed execution. */
|
|
188
|
+
async getWorkspaceDiff(options) {
|
|
189
|
+
return workspaceDiffSchema.parse(await (await this.response(`sessions/${encodeURIComponent(options.sessionId)}/diff?${new URLSearchParams({ executionId: options.executionId ?? "" })}`, void 0, options.signal)).json());
|
|
190
|
+
}
|
|
191
|
+
/** Creates or recovers an idempotent conversational session. */
|
|
192
|
+
async createSession(input) {
|
|
193
|
+
return sessionViewSchema.parse(await (await this.response("sessions", createSessionRequestSchema.parse(input))).json());
|
|
194
|
+
}
|
|
195
|
+
/** Creates or recovers idempotent workflow work through a specialist signal. */
|
|
196
|
+
async createSignal(input) {
|
|
197
|
+
return sessionViewSchema.parse(await (await this.response("signals", createSessionRequestSchema.parse(input))).json());
|
|
198
|
+
}
|
|
199
|
+
/** Sends a message to an existing session. */
|
|
200
|
+
async sendSessionMessage(id, input) {
|
|
201
|
+
await (await this.response(`sessions/${encodeURIComponent(id)}/messages`, sendSessionMessageRequestSchema.parse(input))).body?.cancel();
|
|
202
|
+
}
|
|
203
|
+
/** Submits responses to pending provider input requests. */
|
|
204
|
+
async submitSessionInput(id, input) {
|
|
205
|
+
await (await this.response(`sessions/${encodeURIComponent(id)}/input`, submitSessionInputRequestSchema.parse(input))).body?.cancel();
|
|
206
|
+
}
|
|
207
|
+
/** Dispatches queued workflow work associated with a session. */
|
|
208
|
+
async dispatchSession(id) {
|
|
209
|
+
return sessionViewSchema.parse(await (await this.response(`sessions/${encodeURIComponent(id)}/dispatch`, {})).json());
|
|
210
|
+
}
|
|
211
|
+
/** Answers a workflow question associated with a session. */
|
|
212
|
+
async answerSessionQuestion(id, input) {
|
|
213
|
+
return sessionViewSchema.parse(await (await this.response(`sessions/${encodeURIComponent(id)}/answer`, answerSessionQuestionRequestSchema.parse(input))).json());
|
|
214
|
+
}
|
|
215
|
+
/** Cooperatively interrupts the currently observed turn. */
|
|
216
|
+
async interruptSession(id, input = {}) {
|
|
217
|
+
return this.controlSession(id, "interrupt", input);
|
|
218
|
+
}
|
|
219
|
+
/** Cancels active workflow and provider work in a session. */
|
|
220
|
+
async cancelSession(id, input = {}) {
|
|
221
|
+
return this.controlSession(id, "cancel", input);
|
|
222
|
+
}
|
|
223
|
+
/** Compacts the provider context for a session. */
|
|
224
|
+
async compactSession(id, input = {}) {
|
|
225
|
+
return this.controlSession(id, "compact", input);
|
|
226
|
+
}
|
|
227
|
+
/** Clears the provider context for a session. */
|
|
228
|
+
async clearSession(id, input = {}) {
|
|
229
|
+
return this.controlSession(id, "clear", input);
|
|
230
|
+
}
|
|
231
|
+
/** Resets a session after cancelling its active work. */
|
|
232
|
+
async resetSession(id, input = {}) {
|
|
233
|
+
return this.controlSession(id, "reset", input);
|
|
234
|
+
}
|
|
235
|
+
/** Reads a materialized transcript as a raw HTTP response for incremental following. */
|
|
236
|
+
async getSessionTranscriptResponse(input) {
|
|
237
|
+
const query = new URLSearchParams({ executionId: input.executionId });
|
|
238
|
+
if (input.history === true) query.set("history", "1");
|
|
239
|
+
if (input.taskId !== void 0) query.set("taskId", input.taskId);
|
|
240
|
+
return this.response(`sessions/${encodeURIComponent(input.sessionId)}/${input.taskId ? "graph-transcript" : "transcript"}?${query}`, void 0, input.signal);
|
|
241
|
+
}
|
|
242
|
+
/** Opens a cursor-addressed session event stream as a raw HTTP response. */
|
|
243
|
+
async getSessionEventStreamResponse(input) {
|
|
244
|
+
const query = new URLSearchParams({
|
|
245
|
+
executionId: input.executionId,
|
|
246
|
+
startIndex: String(input.cursor)
|
|
247
|
+
});
|
|
248
|
+
if (input.taskId !== void 0) query.set("taskId", input.taskId);
|
|
249
|
+
return this.response(`sessions/${encodeURIComponent(input.sessionId)}/${input.taskId ? "graph-stream" : "stream"}?${query}`, void 0, input.signal);
|
|
250
|
+
}
|
|
251
|
+
async controlSession(id, action, input) {
|
|
252
|
+
await (await this.response(`sessions/${encodeURIComponent(id)}/${action}`, controlSessionRequestSchema.parse(input))).body?.cancel();
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
//#endregion
|
|
256
|
+
export { ApiError, FactoryClient, MAX_IMAGES, MAX_IMAGE_BYTES, Transcript, agentSessionIdSchema, agentSessionSchema, answerSessionQuestionRequestSchema, apiAgentSchema, controlSessionRequestSchema, createSessionRequestSchema, describeIntake, followSessionStream, imageAttachmentSchema, imageAttachmentsSchema, imageIdSchema, inputRequestSchema, pendingFollowUpSchema, readEvents, repositoryDetailsSchema, repositorySummarySchema, sendSessionMessageRequestSchema, sessionInputResponseSchema, sessionPageSchema, sessionViewSchema, streamEventSchema, submitSessionInputRequestSchema, taskStates, toolCallSchema, transcriptBlockSchema, transcriptSnapshotSchema, workspaceDiffFileSchema, workspaceDiffSchema };
|
|
257
|
+
|
|
258
|
+
//# sourceMappingURL=client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import { intakePageSchema, intakeViewSchema, retryIntakeSchema } from \"./intake-contracts\";\nexport { describeIntake } from \"./intake-contracts\";\nexport type { IntakeView } from \"./intake-contracts\";\nimport {\n approvalPageSchema,\n approvalRequestSchema,\n approvalViewSchema,\n type ApprovalListOptions,\n type ApprovalPage,\n type ApprovalView,\n} from \"./approval-contracts\";\nexport type { ApprovalListOptions, ApprovalPage, ApprovalView } from \"./approval-contracts\";\nimport { z } from \"zod\";\nimport {\n imageAttachmentSchema,\n type ImageAttachment,\n type ImageId,\n type ImageUploadInput,\n} from \"./image-input\";\nexport {\n MAX_IMAGE_BYTES,\n MAX_IMAGES,\n imageAttachmentSchema,\n imageAttachmentsSchema,\n imageIdSchema,\n} from \"./image-input\";\nexport type { ImageAttachment, ImageId, ImageUploadInput } from \"./image-input\";\nimport {\n answerSessionQuestionRequestSchema,\n apiAgentSchema,\n controlSessionRequestSchema,\n createSessionRequestSchema,\n repositoryDetailsSchema,\n sendSessionMessageRequestSchema,\n sessionPageSchema,\n sessionViewSchema,\n submitSessionInputRequestSchema,\n type AnswerSessionQuestionRequest,\n type ApiAgent,\n type ControlSessionRequest,\n type CreateSessionRequest,\n type RepositoryDetails,\n type SendSessionMessageRequest,\n type SessionPage,\n type SessionView,\n type SubmitSessionInputRequest,\n} from \"./api-contracts\";\nimport { changeSchema, type Change } from \"./schema/change\";\nimport type { MaybePromise } from \"./schema/common\";\nimport type { TaskId } from \"./schema/id\";\nimport { repositorySlugSchema, type RepositorySlug } from \"./schema/repository\";\nimport type { AgentSessionId } from \"./schema/session\";\nimport { workspaceDiffSchema, type WorkspaceDiff } from \"./workspace-diff\";\nimport { taskSchema, taskStateSchema, type Task } from \"./schema/task\";\nimport { taskGraphViewSchema, type TaskGraphView } from \"./task-graph-view\";\nimport { transcriptSnapshotSchema, type TranscriptSnapshot } from \"./schema/transcript\";\nexport type { TaskGraphView } from \"./task-graph-view\";\n\n/** All durable Task states in their schema-defined order. */\nexport const taskStates = Object.freeze([...taskStateSchema.options]);\n\n/** Filters and pagination accepted by the session-list API. */\nexport interface SessionListOptions {\n readonly scope?: \"all\" | \"interactive\";\n readonly detail?: \"full\" | \"summary\";\n readonly limit?: number;\n readonly cursor?: AgentSessionId;\n readonly query?: string;\n readonly repository?: RepositorySlug;\n readonly agent?: string;\n readonly source?: \"automatic\";\n readonly state?: Task[\"state\"] | \"conversation\";\n readonly attention?: boolean;\n readonly topLevel?: boolean;\n readonly includeTotal?: boolean;\n}\n\nexport type { WorkspaceDiff, WorkspaceDiffFile } from \"./workspace-diff\";\nexport { workspaceDiffFileSchema, workspaceDiffSchema } from \"./workspace-diff\";\nexport { agentSessionIdSchema, agentSessionSchema } from \"./schema/session\";\nexport type {\n AgentSession,\n AgentSessionId,\n DirectAgentSession,\n ExternalAgentSession,\n TaskAgentSession,\n} from \"./schema/session\";\n\nexport {\n answerSessionQuestionRequestSchema,\n pendingFollowUpSchema,\n apiAgentSchema,\n controlSessionRequestSchema,\n createSessionRequestSchema,\n repositoryDetailsSchema,\n repositorySummarySchema,\n sendSessionMessageRequestSchema,\n sessionInputResponseSchema,\n sessionPageSchema,\n sessionViewSchema,\n submitSessionInputRequestSchema,\n} from \"./api-contracts\";\nexport type {\n AnswerSessionQuestionRequest,\n PendingFollowUp,\n ApiAgent,\n ControlSessionRequest,\n CreateSessionRequest,\n RepositoryDetails,\n RepositorySummary,\n SendSessionMessageRequest,\n SessionInputResponse,\n SessionPage,\n SessionView,\n SubmitSessionInputRequest,\n} from \"./api-contracts\";\nexport { readEvents, streamEventSchema, type StreamEvent } from \"./client-events\";\nexport {\n Transcript,\n type InputRequest,\n type TranscriptBlock,\n type ToolCall,\n type TranscriptSnapshot,\n} from \"./client-transcript\";\nexport {\n inputRequestSchema,\n toolCallSchema,\n transcriptBlockSchema,\n transcriptSnapshotSchema,\n} from \"./schema/transcript\";\nexport {\n followSessionStream,\n type FollowSessionStreamOptions,\n type SessionStreamClient,\n} from \"./client-stream\";\n\n/** An unsuccessful Factory API response surfaced by the browser-safe client. */\nexport class ApiError extends Error {\n constructor(\n readonly status: number,\n message: string,\n readonly actor?: string,\n ) {\n super(message);\n }\n}\n\n/** Connection and request customization for {@link FactoryClient}. */\nexport interface FactoryClientOptions {\n readonly url: string;\n readonly headers?: () => MaybePromise<HeadersInit>;\n readonly fetch?: typeof globalThis.fetch;\n}\n\n/** Identifies an uploaded image and optionally controls cancellation of its download. */\nexport interface GetImageOptions {\n readonly id: ImageId;\n readonly signal?: AbortSignal;\n}\n\n/** Identifies an operator session and the amount of detail to return. */\nexport interface GetSessionOptions {\n readonly id: AgentSessionId;\n readonly detail?: \"full\" | \"summary\";\n}\n\n/** Identifies the operator session whose canonical task graph should be read. */\nexport interface GetSessionGraphOptions {\n readonly id: AgentSessionId;\n readonly signal?: AbortSignal;\n}\n\n/** Identifies an exact task execution transcript within an operator session. */\nexport interface GraphTranscriptOptions {\n readonly sessionId: AgentSessionId;\n readonly taskId: TaskId;\n readonly executionId: string;\n readonly signal?: AbortSignal;\n}\n\n/** Identifies the execution whose committed workspace should be compared. */\nexport interface WorkspaceDiffOptions {\n readonly sessionId: AgentSessionId;\n readonly executionId: string | null;\n readonly signal?: AbortSignal;\n}\n\n/** Identifies a materialized transcript response used by the stream follower. */\nexport interface SessionTranscriptRequest {\n readonly sessionId: AgentSessionId;\n readonly executionId: string;\n readonly taskId?: TaskId;\n readonly history?: boolean;\n readonly signal: AbortSignal;\n}\n\n/** Identifies a cursor-addressed event stream used by the stream follower. */\nexport interface SessionEventStreamRequest {\n readonly sessionId: AgentSessionId;\n readonly executionId: string;\n readonly cursor: number;\n readonly taskId?: TaskId;\n readonly signal: AbortSignal;\n}\n\n/** Browser-safe typed client for the public Factory HTTP API. */\nexport class FactoryClient {\n private readonly origin: string;\n constructor(private readonly options: FactoryClientOptions) {\n const url = new URL(options.url);\n if (\n url.username ||\n url.password ||\n url.pathname !== \"/\" ||\n url.search ||\n url.hash ||\n (url.protocol !== \"https:\" &&\n !(url.protocol === \"http:\" && [\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(url.hostname)))\n ) {\n throw new Error(\"Factory URL must be an HTTPS origin, or HTTP on loopback\");\n }\n this.origin = url.origin;\n }\n\n private async response(path: string, body?: unknown, signal?: AbortSignal): Promise<Response> {\n const url = new URL(`/api/v1/${path}`, this.origin);\n if (url.origin !== this.origin || !url.pathname.startsWith(\"/api/v1/\"))\n throw new Error(\"Invalid Factory API path\");\n const headers = new Headers(await this.options.headers?.());\n headers.set(\"content-type\", \"application/json\");\n const response = await (this.options.fetch ?? globalThis.fetch)(url.href, {\n method: body === undefined ? \"GET\" : \"POST\",\n headers,\n ...(body === undefined ? {} : { body: JSON.stringify(body) }),\n credentials: \"same-origin\",\n cache: \"no-store\",\n redirect: \"manual\",\n signal: signal ?? AbortSignal.timeout(30_000),\n });\n if (response.type === \"opaqueredirect\" || [301, 302, 303, 307, 308].includes(response.status)) {\n await response.body?.cancel();\n throw new ApiError(\n response.status,\n `Factory at ${this.origin} returned a redirect. Reload to sign in, or set factory.url to the factory's canonical origin. Redirects are not followed.`,\n );\n }\n if (!response.ok) {\n const value: unknown = await response.json().catch(() => null);\n const detail =\n value !== null &&\n typeof value === \"object\" &&\n \"error\" in value &&\n typeof value.error === \"string\"\n ? value.error\n : `HTTP ${response.status}`;\n const actor =\n value !== null &&\n typeof value === \"object\" &&\n \"actor\" in value &&\n typeof value.actor === \"string\"\n ? value.actor\n : undefined;\n throw new ApiError(\n response.status,\n response.status === 401\n ? \"Authentication rejected. Reload to sign in, or run vercel login for the terminal client.\"\n : detail,\n actor,\n );\n }\n return response;\n }\n\n /** Read authorized intake and pre-task triage failures. */\n async intake(options: { repository?: string; cursor?: string; limit?: number } = {}) {\n const query = new URLSearchParams();\n for (const [key, value] of Object.entries(options))\n if (value !== undefined) query.set(key, String(value));\n return intakePageSchema.parse(await (await this.response(`intake?${query}`)).json());\n }\n\n /** Retry only the observed stopped attempt; concurrent or stale retries conflict. */\n async retryIntake(id: string, expectedAttempt: number) {\n return intakeViewSchema.parse(\n await (\n await this.response(\n `intake/${encodeURIComponent(id)}/retry`,\n retryIntakeSchema.parse({ expectedAttempt }),\n )\n ).json(),\n );\n }\n\n /** Lists approval proposals visible to the authenticated operator. */\n async listApprovals(options: ApprovalListOptions = {}): Promise<ApprovalPage> {\n const query = new URLSearchParams(\n Object.entries(options)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => [key, String(value)]),\n );\n return approvalPageSchema.parse(await (await this.response(`approvals?${query}`)).json());\n }\n /** Reads one approval proposal by Task ID. */\n async getApproval(id: TaskId): Promise<ApprovalView> {\n return approvalViewSchema.parse(\n await (await this.response(`tasks/${encodeURIComponent(id)}/approval`)).json(),\n );\n }\n /** Approves one proposal, optionally recording an operator reason. */\n async approveTask(id: TaskId, reason?: string): Promise<ApprovalView> {\n return approvalViewSchema.parse(\n await (\n await this.response(\n `tasks/${encodeURIComponent(id)}/approve`,\n approvalRequestSchema.parse({ reason }),\n )\n ).json(),\n );\n }\n\n /** Rejects one proposal with the required operator reason. */\n async rejectTask(id: TaskId, reason: string): Promise<ApprovalView> {\n return approvalViewSchema.parse(\n await (\n await this.response(\n `tasks/${encodeURIComponent(id)}/reject`,\n approvalRequestSchema.parse({ reason }),\n )\n ).json(),\n );\n }\n\n /** Uploads one bounded image for use in a later message. */\n async uploadImage(input: ImageUploadInput): Promise<ImageAttachment> {\n return imageAttachmentSchema.parse(await (await this.response(\"images\", input)).json());\n }\n /** Downloads a previously uploaded image. */\n async getImage(options: GetImageOptions): Promise<Blob> {\n return (\n await this.response(`images/${encodeURIComponent(options.id)}`, undefined, options.signal)\n ).blob();\n }\n\n /** Lists agents exposed for operator session creation. */\n async listAgents(): Promise<readonly ApiAgent[]> {\n return z\n .object({ agents: z.array(apiAgentSchema).readonly() })\n .parse(await (await this.response(\"agents\")).json()).agents;\n }\n /** Reports whether the configured origin is the isolated local fixture runtime. */\n async isLocalTestRuntime(): Promise<boolean> {\n const response = await this.response(\"agents\");\n const local = response.headers.get(\"x-factory-local-test\") === \"1\";\n await response.body?.cancel();\n return local;\n }\n /** Lists configured repository slugs. */\n async listRepositories(): Promise<readonly RepositorySlug[]> {\n return z\n .object({ repositories: z.array(repositorySlugSchema).readonly() })\n .parse(await (await this.response(\"repositories\")).json()).repositories;\n }\n /** Reads repository slugs together with their stable configured identifiers. */\n async getRepositoryDetails(): Promise<RepositoryDetails> {\n return repositoryDetailsSchema.parse(await (await this.response(\"repositories\")).json());\n }\n /** Lists open Changes, optionally scoped to one repository slug. */\n async listChanges(repository?: RepositorySlug): Promise<readonly Change[]> {\n return z\n .object({ changes: z.array(changeSchema).readonly() })\n .parse(\n await (\n await this.response(\n repository === undefined\n ? \"changes\"\n : `changes?repository=${encodeURIComponent(repository)}`,\n )\n ).json(),\n ).changes;\n }\n /** Lists canonical Tasks exposed by the operator API. */\n async listTasks(): Promise<readonly Task[]> {\n return z\n .strictObject({ tasks: z.array(taskSchema).readonly() })\n .parse(await (await this.response(\"tasks\")).json()).tasks;\n }\n /** Lists sessions matching the requested operator scope. */\n async listSessions(\n options: Pick<SessionListOptions, \"scope\" | \"detail\"> = {},\n ): Promise<readonly SessionView[]> {\n return (await this.getSessionPage(options)).sessions;\n }\n /** Reads a filtered, cursor-paginated page of sessions. */\n async getSessionPage(options: SessionListOptions = {}): Promise<SessionPage> {\n const query = new URLSearchParams(\n Object.entries(options)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => [key, String(value)]),\n ).toString();\n return sessionPageSchema.parse(\n await (await this.response(`sessions${query ? `?${query}` : \"\"}`)).json(),\n );\n }\n /** Counts sessions that currently require operator attention. */\n async getInboxCount(): Promise<number> {\n return z\n .object({ totalCount: z.number().int().nonnegative() })\n .parse(\n await (\n await this.response(\n \"sessions?scope=all&detail=summary&attention=true&includeTotal=true&limit=1\",\n )\n ).json(),\n ).totalCount;\n }\n /** Reads a summary batch for the provided session IDs. */\n async getSessionBatch(ids: readonly AgentSessionId[]): Promise<readonly SessionView[]> {\n if (ids.length === 0) return [];\n const query = new URLSearchParams({ ids: ids.join(\",\"), detail: \"summary\" });\n return z\n .object({ sessions: z.array(sessionViewSchema).readonly() })\n .parse(await (await this.response(`sessions?${query}`)).json()).sessions;\n }\n /** Reads one operator session. */\n async getSession(options: GetSessionOptions): Promise<SessionView> {\n return sessionViewSchema.parse(\n await (\n await this.response(\n `sessions/${encodeURIComponent(options.id)}${options.detail ? `?detail=${options.detail}` : \"\"}`,\n )\n ).json(),\n );\n }\n /** Reads the canonical task graph projected for one session. */\n async getSessionGraph(options: GetSessionGraphOptions): Promise<TaskGraphView> {\n return taskGraphViewSchema.parse(\n await (\n await this.response(\n `sessions/${encodeURIComponent(options.id)}/graph`,\n undefined,\n options.signal,\n )\n ).json(),\n );\n }\n /** Reads the materialized transcript for one exact graph task execution. */\n async getGraphTranscript(options: GraphTranscriptOptions): Promise<TranscriptSnapshot> {\n const query = new URLSearchParams({\n taskId: options.taskId,\n executionId: options.executionId,\n });\n return transcriptSnapshotSchema.parse(\n await (\n await this.response(\n `sessions/${encodeURIComponent(options.sessionId)}/graph-transcript?${query}`,\n undefined,\n options.signal,\n )\n ).json(),\n );\n }\n /** Refreshes a session summary and reloads its history when the active execution changes. */\n async refreshSession(previous: SessionView): Promise<SessionView> {\n const current = await this.getSession({ id: previous.session.id, detail: \"summary\" });\n if (\n current.task?.id !== previous.task?.id ||\n current.execution?.sessionId !== previous.execution?.sessionId ||\n current.execution?.provider !== previous.execution?.provider\n )\n return this.getSession({ id: previous.session.id });\n return { ...current, history: previous.history };\n }\n /** Reads the committed workspace comparison for one observed execution. */\n async getWorkspaceDiff(options: WorkspaceDiffOptions): Promise<WorkspaceDiff> {\n return workspaceDiffSchema.parse(\n await (\n await this.response(\n `sessions/${encodeURIComponent(options.sessionId)}/diff?${new URLSearchParams({ executionId: options.executionId ?? \"\" })}`,\n undefined,\n options.signal,\n )\n ).json(),\n );\n }\n /** Creates or recovers an idempotent conversational session. */\n async createSession(input: CreateSessionRequest): Promise<SessionView> {\n return sessionViewSchema.parse(\n await (await this.response(\"sessions\", createSessionRequestSchema.parse(input))).json(),\n );\n }\n\n /** Creates or recovers idempotent workflow work through a specialist signal. */\n async createSignal(input: CreateSessionRequest): Promise<SessionView> {\n return sessionViewSchema.parse(\n await (await this.response(\"signals\", createSessionRequestSchema.parse(input))).json(),\n );\n }\n\n /** Sends a message to an existing session. */\n async sendSessionMessage(id: AgentSessionId, input: SendSessionMessageRequest): Promise<void> {\n const response = await this.response(\n `sessions/${encodeURIComponent(id)}/messages`,\n sendSessionMessageRequestSchema.parse(input),\n );\n await response.body?.cancel();\n }\n\n /** Submits responses to pending provider input requests. */\n async submitSessionInput(id: AgentSessionId, input: SubmitSessionInputRequest): Promise<void> {\n const response = await this.response(\n `sessions/${encodeURIComponent(id)}/input`,\n submitSessionInputRequestSchema.parse(input),\n );\n await response.body?.cancel();\n }\n\n /** Dispatches queued workflow work associated with a session. */\n async dispatchSession(id: AgentSessionId): Promise<SessionView> {\n return sessionViewSchema.parse(\n await (await this.response(`sessions/${encodeURIComponent(id)}/dispatch`, {})).json(),\n );\n }\n\n /** Answers a workflow question associated with a session. */\n async answerSessionQuestion(\n id: AgentSessionId,\n input: AnswerSessionQuestionRequest,\n ): Promise<SessionView> {\n return sessionViewSchema.parse(\n await (\n await this.response(\n `sessions/${encodeURIComponent(id)}/answer`,\n answerSessionQuestionRequestSchema.parse(input),\n )\n ).json(),\n );\n }\n\n /** Cooperatively interrupts the currently observed turn. */\n async interruptSession(id: AgentSessionId, input: ControlSessionRequest = {}): Promise<void> {\n return this.controlSession(id, \"interrupt\", input);\n }\n\n /** Cancels active workflow and provider work in a session. */\n async cancelSession(id: AgentSessionId, input: ControlSessionRequest = {}): Promise<void> {\n return this.controlSession(id, \"cancel\", input);\n }\n\n /** Compacts the provider context for a session. */\n async compactSession(id: AgentSessionId, input: ControlSessionRequest = {}): Promise<void> {\n return this.controlSession(id, \"compact\", input);\n }\n\n /** Clears the provider context for a session. */\n async clearSession(id: AgentSessionId, input: ControlSessionRequest = {}): Promise<void> {\n return this.controlSession(id, \"clear\", input);\n }\n\n /** Resets a session after cancelling its active work. */\n async resetSession(id: AgentSessionId, input: ControlSessionRequest = {}): Promise<void> {\n return this.controlSession(id, \"reset\", input);\n }\n\n /** Reads a materialized transcript as a raw HTTP response for incremental following. */\n async getSessionTranscriptResponse(input: SessionTranscriptRequest): Promise<Response> {\n const query = new URLSearchParams({ executionId: input.executionId });\n if (input.history === true) query.set(\"history\", \"1\");\n if (input.taskId !== undefined) query.set(\"taskId\", input.taskId);\n return this.response(\n `sessions/${encodeURIComponent(input.sessionId)}/${input.taskId ? \"graph-transcript\" : \"transcript\"}?${query}`,\n undefined,\n input.signal,\n );\n }\n\n /** Opens a cursor-addressed session event stream as a raw HTTP response. */\n async getSessionEventStreamResponse(input: SessionEventStreamRequest): Promise<Response> {\n const query = new URLSearchParams({\n executionId: input.executionId,\n startIndex: String(input.cursor),\n });\n if (input.taskId !== undefined) query.set(\"taskId\", input.taskId);\n return this.response(\n `sessions/${encodeURIComponent(input.sessionId)}/${input.taskId ? \"graph-stream\" : \"stream\"}?${query}`,\n undefined,\n input.signal,\n );\n }\n\n private async controlSession(\n id: AgentSessionId,\n action: \"interrupt\" | \"cancel\" | \"compact\" | \"clear\" | \"reset\",\n input: ControlSessionRequest,\n ): Promise<void> {\n const response = await this.response(\n `sessions/${encodeURIComponent(id)}/${action}`,\n controlSessionRequestSchema.parse(input),\n );\n await response.body?.cancel();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2D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;EAKf,OAAM,MAJiB,KAAK,SAC1B,YAAY,mBAAmB,EAAE,EAAE,GAAG,UACtC,4BAA4B,MAAM,KAAK,CACzC,EAAA,CACe,MAAM,OAAO;CAC9B;AACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChangeId, TaskId } from "../schema/id.mjs";
|
|
2
|
+
import { RepositorySlug } from "../schema/repository.mjs";
|
|
3
|
+
//#region src/code-review/contracts.d.ts
|
|
4
|
+
/** A review result bound to the exact Task, Change, repository, pull request, and head commit. */
|
|
5
|
+
interface CompletedReview {
|
|
6
|
+
taskId: TaskId;
|
|
7
|
+
changeId: ChangeId;
|
|
8
|
+
repository: RepositorySlug;
|
|
9
|
+
pullRequestNumber: number;
|
|
10
|
+
headSha: string;
|
|
11
|
+
verdict: "approve" | "request_changes" | "comment";
|
|
12
|
+
summary: string;
|
|
13
|
+
comments: readonly CompletedReviewFinding[];
|
|
14
|
+
}
|
|
15
|
+
/** One stable, fingerprinted inline finding from a completed review. */
|
|
16
|
+
interface CompletedReviewFinding {
|
|
17
|
+
fingerprint: string;
|
|
18
|
+
key: string;
|
|
19
|
+
title: string;
|
|
20
|
+
path: string;
|
|
21
|
+
line: number;
|
|
22
|
+
body: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { CompletedReview, CompletedReviewFinding };
|
|
26
|
+
//# sourceMappingURL=contracts.d.mts.map
|