Merge pull request #190 from Pythagora-io/v2_z

V2 z
This commit is contained in:
LeonOstrez
2025-06-06 08:07:47 +01:00
committed by GitHub
8 changed files with 38 additions and 13 deletions

View File

@@ -109,6 +109,18 @@ class Architect(BaseAgent):
self.next_state.specification = spec
telemetry.set("templates", spec.templates)
self.next_state.action = ARCHITECTURE_STEP_NAME
await self.ui.clear_main_logs()
await self.ui.send_front_logs_headers("be_0", ["E2 / T3", "done"], "Setting up backend")
await self.ui.send_back_logs(
[
{
"id": "be_0",
"title": "Setting up backend",
"project_state_id": "be_0",
"labels": ["E2 / T3", "Backend setup", "done"],
}
]
)
return AgentResponse.done(self)
async def select_templates(self, spec: Specification) -> tuple[str, dict[ProjectTemplateEnum, Any]]:

View File

@@ -220,6 +220,7 @@ class Developer(ChatWithBreakdownMixin, RelevantFilesMixin, BaseAgent):
await self.send_message("Thinking about how to implement this task ...")
await self.ui.start_breakdown_stream()
await self.ui.start_important_stream()
related_api_endpoints = current_task.get("related_api_endpoints", [])
llm = self.get_llm(TASK_BREAKDOWN_AGENT_NAME, stream_output=True)
# TODO: Temp fix for old projects
@@ -337,6 +338,20 @@ class Developer(ChatWithBreakdownMixin, RelevantFilesMixin, BaseAgent):
"task_index": task_index,
}
)
await self.ui.clear_main_logs()
await self.ui.send_front_logs_headers(
f"be_{task_index}_{task_index + 1}", [f"E{task_index} / T{task_index + 1}", "working"], description
)
await self.ui.send_back_logs(
[
{
"id": f"be_{task_index}_{task_index + 1}",
"title": description,
"project_state_id": f"be_{task_index}_{task_index + 1}",
"labels": [f"E{task_index} / T{task_index + 1}", "working"],
}
]
)
await self.send_message(f"Starting task #{task_index} with the description:\n\n## {description}")
if self.current_state.run_command:
await self.ui.send_run_command(self.current_state.run_command)

View File

@@ -44,7 +44,6 @@ class Frontend(FileDiffMixin, GitMixin, BaseAgent):
if finished is None:
await self.ui.clear_main_logs()
await self.ui.send_front_logs_headers("fe_0", ["E2 / T1", "done"], "Building frontend")
await self.ui.send_front_logs_headers("be_0", ["E2 / T2", "working"], "Setting up backend")
await self.ui.send_back_logs(
[
{
@@ -55,6 +54,8 @@ class Frontend(FileDiffMixin, GitMixin, BaseAgent):
}
]
)
await self.ui.send_front_logs_headers("be_0", ["E2 / T2", "working"], "Setting up backend")
await self.ui.send_back_logs(
[
{

View File

@@ -36,12 +36,5 @@ class HumanInput(BaseAgent):
# figure out where its local files are and how to open it.
full_path = self.state_manager.file_system.get_full_path(file)
await self.send_message(f"Input required on {file}:{line}")
await self.ui.open_editor(full_path, line)
await self.ask_question(
f"Please open {file} and modify line {line} according to the instructions.",
buttons={"continue": "Continue"},
default="continue",
buttons_only=True,
)
await self.ui.open_editor(full_path, line, True)
return AgentResponse.done(self)

View File

@@ -351,7 +351,7 @@ class UIBase:
"""
raise NotImplementedError()
async def open_editor(self, file: str, line: Optional[int] = None):
async def open_editor(self, file: str, line: Optional[int] = None, wait_for_response: bool = False):
"""
Open an editor at the specified file and line.

View File

@@ -178,7 +178,7 @@ class PlainConsoleUI(UIBase):
async def send_app_link(self, app_link: str):
pass
async def open_editor(self, file: str, line: Optional[int] = None):
async def open_editor(self, file: str, line: Optional[int] = None, wait_for_response: bool = False):
pass
async def send_project_info(self, name: str, project_id: str, folder_name: str, created_at: str):

View File

@@ -473,7 +473,7 @@ class IPCClientUI(UIBase):
content=app_link,
)
async def open_editor(self, file: str, line: Optional[int] = None):
async def open_editor(self, file: str, line: Optional[int] = None, wait_for_response: bool = False):
if not line:
pass
await self._send(
@@ -482,7 +482,11 @@ class IPCClientUI(UIBase):
"path": file, # we assume it's a full path, read the rant in HumanInput.input_required()
"line": line,
},
wait_for_response=wait_for_response,
)
if wait_for_response:
response = await self._receive()
return response
async def send_project_info(self, name: str, project_id: str, folder_name: str, created_at: str):
await self._send(

View File

@@ -166,7 +166,7 @@ class VirtualUI(UIBase):
async def send_app_link(self, app_link: str):
pass
async def open_editor(self, file: str, line: Optional[int] = None):
async def open_editor(self, file: str, line: Optional[int] = None, wait_for_response: bool = False):
pass
async def send_project_info(self, name: str, project_id: str, folder_name: str, created_at: str):