Implement Apex Agent MVP scaffold

This commit is contained in:
2026-07-06 13:22:15 +08:00
commit 02ef4d23f2
49 changed files with 2767 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any
from core.models import Scene
from runtime.context import TaskContext
@dataclass(frozen=True)
class PlannedStep:
action: str
description: str
args: dict[str, Any] = field(default_factory=dict)
expected_text: str | None = None
class Planner:
def plan(
self,
*,
goal: str,
scene: Scene,
context: TaskContext,
) -> list[PlannedStep]:
if context.step_results:
return []
return [
PlannedStep(
action="describe_screen",
description=f"Observe current screen for goal: {goal}",
args={},
)
]
def goal_reached(self, *, goal: str, scene: Scene, context: TaskContext) -> bool:
return bool(context.step_results) and all(
result.success for result in context.step_results
)