initial impl

This commit is contained in:
2026-07-19 12:21:26 +02:00
commit e9b895366d
64 changed files with 4113 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
from __future__ import annotations
from agentci.domain.models import Job, JobKind
from agentci.workflows.common import Dependencies
from agentci.workflows.implement import ImplementWorkflow
from agentci.workflows.plan import PlanWorkflow
from agentci.workflows.pull_request import PullRequestWorkflow
class Dispatcher:
def __init__(self, dependencies: Dependencies) -> None:
plan = PlanWorkflow(dependencies)
pull_request = PullRequestWorkflow(dependencies)
self.handlers = {
JobKind.PLAN: plan.plan,
JobKind.DISCUSS: plan.discuss,
JobKind.ITERATE_PLAN: plan.iterate,
JobKind.IMPLEMENT: ImplementWorkflow(dependencies).run,
JobKind.ITERATE_IMPLEMENT: pull_request.iterate,
JobKind.FIX: pull_request.fix,
}
async def dispatch(self, job: Job) -> None:
await self.handlers[job.kind](job)