Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AutoCua/agent_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ def resolve_agent_service(mode, os=None):
if kind == "computer":
host = platform.system()
if host == "Darwin":
from AutoCua.mac.agent.main_driver.service import AgentService
from AutoCua.mac.agent.computer_use.service import AgentService
elif host == "Windows":
from AutoCua.windows.agent.main_driver.service import AgentService
from AutoCua.windows.agent.computer_use.service import AgentService
elif host == "Linux":
from AutoCua.linux.agent.main_driver.service import AgentService
from AutoCua.linux.agent.computer_use.service import AgentService
else:
raise RuntimeError(f"Unsupported OS for computer use: {host}")
return AgentService
Expand Down Expand Up @@ -86,7 +86,7 @@ def resolve_agent_service(mode, os=None):
if kind == "mobile":
device = str(os or "").strip().lower()
if device == "ios":
from AutoCua.ios.agent.main_driver.service import AgentService
from AutoCua.ios.agent.iphone_use.service import AgentService
return AgentService
if device == "android":
raise NotImplementedError("Android support is not available yet")
Expand Down
4 changes: 2 additions & 2 deletions AutoCua/ios/agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AutoCua/ios/agent/__init__.py
from .main_driver.service import AgentService
from .main_driver.view import AgentResponseFormatter
from .iphone_use.service import AgentService
from .iphone_use.view import AgentResponseFormatter

__all__ = ['AgentService', 'AgentResponseFormatter']
2 changes: 1 addition & 1 deletion AutoCua/ios/agent/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def main():
# pymobiledevice3) and which one.
active_target.update({"kind": "simulation", "udid": args.sim_udid})

from AutoCua.ios.agent.main_driver.service import AgentService
from AutoCua.ios.agent.iphone_use.service import AgentService

agent = AgentService(
provider=args.provider,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AutoCua/ios/agent/main_driver/__init__.py
# AutoCua/ios/agent/iphone_use/__init__.py
from .service import AgentService
from .view import AgentResponseFormatter

Expand Down
2 changes: 1 addition & 1 deletion AutoCua/ios/tool_registry/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _main_tools(track: dict, notes: dict = None) -> list:

Descriptions are the system prompt's OWN tool text, copied verbatim from
<tool_capability> / <os_interaction> / <task_completion> in
agent/main_driver/system_prompt.md - the prompt stays the source of truth
agent/iphone_use/system_prompt.md - the prompt stays the source of truth
(it is user-managed and never edited from here); this just puts the same
words where a native tool call can read them. Built twice, each with NO
per-call params (`track` stays {}) and a dedicated notes tool in front:
Expand Down
4 changes: 2 additions & 2 deletions AutoCua/linux/agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AutoCua/linux/agent/__init__.py
from .main_driver.service import AgentService
from .main_driver.view import AgentResponseFormatter
from .computer_use.service import AgentService
from .computer_use.view import AgentResponseFormatter

__all__ = ['AgentService', 'AgentResponseFormatter']
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AutoCua/linux/agent/main_driver/__init__.py
# AutoCua/linux/agent/computer_use/__init__.py
from .service import AgentService
from .view import AgentResponseFormatter

Expand Down
6 changes: 3 additions & 3 deletions AutoCua/linux/remote_connection/telegram/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def _build_prior_history(task, assistant_messages, tool_responses,
surface deliberately avoids. Packages a finished run's memory lists into
the prior_history dict AgentService expects, capped with the synthetic
terminal bridge step + None tool slot. The bridge JSON must contain
main_driver's _BRIDGE_SIGNATURE ('"next_goal": "Previous run concluded.')
computer_use's _BRIDGE_SIGNATURE ('"next_goal": "Previous run concluded.')
verbatim, or the <updated_user_request> run-marker logic silently stops
firing on resume. Returns None when the run produced no
steps — the caller keeps the previous memory then. prior_task freezes the
Expand Down Expand Up @@ -870,7 +870,7 @@ def _run_agent(task, provider, model, chat_id, bot, loop, prior_history=None,
try:
# Imported lazily — pulls in tree/element → skimage etc., which we
# don't want to load until a task actually runs.
from AutoCua.linux.agent.main_driver.service import AgentService
from AutoCua.linux.agent.computer_use.service import AgentService

# Look up the runtime API key for the chosen provider so LLMManager
# doesn't fall back to an os.getenv() the user never set. Telegram
Expand All @@ -888,7 +888,7 @@ def _run_agent(task, provider, model, chat_id, bot, loop, prior_history=None,
# Pipe each step's formatted response (thinking + next_goal +
# memory, with action stripped) into the compact banner.
# The agent already calls text_callback at
# main_driver/service.py:704-705 with exactly this content — same
# computer_use/service.py:704-705 with exactly this content — same
# path the frontend's streamAgentText uses in app.py. update()
# serialises onto the banner's UI thread, so the agent loop never
# blocks on it.
Expand Down
4 changes: 2 additions & 2 deletions AutoCua/mac/agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AutoCua/mac/agent/__init__.py
from .main_driver.service import AgentService
from .main_driver.view import AgentResponseFormatter
from .computer_use.service import AgentService
from .computer_use.view import AgentResponseFormatter

__all__ = ['AgentService', 'AgentResponseFormatter']
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AutoCua/mac/agent/main_driver/__init__.py
# AutoCua/mac/agent/computer_use/__init__.py
from .service import AgentService
from .view import AgentResponseFormatter

Expand Down
2 changes: 1 addition & 1 deletion AutoCua/mac/controller/tool/ios_agent_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def main():
from AutoCua.ios_connector.session import active_target
active_target.update({"kind": "hardware", "udid": os.environ.get("PYMOBILEDEVICE3_UDID")})

from AutoCua.ios.agent.main_driver.service import AgentService
from AutoCua.ios.agent.iphone_use.service import AgentService

# Only these two: web_callback and shell_callback add sleeps, and
# token_callback would move the main agent's memory bar
Expand Down
6 changes: 3 additions & 3 deletions AutoCua/mac/remote_connection/telegram/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def _build_prior_history(task, assistant_messages, tool_responses,
surface deliberately avoids. Packages a finished run's memory lists into
the prior_history dict AgentService expects, capped with the synthetic
terminal bridge step + None tool slot. The bridge JSON must contain
main_driver's _BRIDGE_SIGNATURE ('"next_goal": "Previous run concluded.')
computer_use's _BRIDGE_SIGNATURE ('"next_goal": "Previous run concluded.')
verbatim, or the <updated_user_request> run-marker logic silently stops
firing on resume. Returns None when the run produced no
steps — the caller keeps the previous memory then. prior_task freezes the
Expand Down Expand Up @@ -831,7 +831,7 @@ def _run_agent(task, provider, model, chat_id, bot, loop, prior_history=None,
try:
# Imported lazily — pulls in tree/element → skimage etc., which we
# don't want to load until a task actually runs.
from AutoCua.mac.agent.main_driver.service import AgentService
from AutoCua.mac.agent.computer_use.service import AgentService

# Look up the runtime API key for the chosen provider so LLMManager
# doesn't fall back to an os.getenv() the user never set. Telegram
Expand All @@ -849,7 +849,7 @@ def _run_agent(task, provider, model, chat_id, bot, loop, prior_history=None,
# Pipe each step's formatted response (thinking + next_goal +
# memory, with action stripped) into the compact banner.
# The agent already calls text_callback at
# main_driver/service.py:704-705 with exactly this content — same
# computer_use/service.py:704-705 with exactly this content — same
# path the frontend's streamAgentText uses in app.py. update()
# serialises onto the banner's UI thread, so the agent loop never
# blocks on it.
Expand Down
9 changes: 5 additions & 4 deletions AutoCua/ui/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2246,10 +2246,11 @@ def monitor_todo():
agent_glow.start()
# The browser agent is the Rust extension (AutoCua/web/agent
# holds .rs, not .py): its AgentService is re-exported from the
# package facade. Every other agent is a Python main_driver.
# package facade. iOS is agent/iphone_use; mac, windows and linux are agent/computer_use.
AgentService = importlib.import_module(
"AutoCua.web.agent" if run_pkg == 'web'
else f"AutoCua.{run_pkg}.agent.main_driver.service"
else "AutoCua.ios.agent.iphone_use.service" if run_pkg == 'ios'
else f"AutoCua.{run_pkg}.agent.computer_use.service"
).AgentService

agent = AgentService(
Expand Down Expand Up @@ -3684,10 +3685,10 @@ def delete_chat(chat_id):


def _read_main_system_prompt():
"""Best-effort read of the active platform's main_driver system prompt, so a
"""Best-effort read of the active platform's computer_use system prompt, so a
downloaded conversation log shows the same SYSTEM PROMPT block as a main.py run."""
try:
p = get_platform_path() / "agent" / "main_driver" / "system_prompt.md"
p = get_platform_path() / "agent" / "computer_use" / "system_prompt.md"
with open(p, "r", encoding="utf-8") as f:
return f.read()
except Exception:
Expand Down
4 changes: 2 additions & 2 deletions AutoCua/windows/agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .main_driver.service import AgentService
from .main_driver.view import AgentResponseFormatter
from .computer_use.service import AgentService
from .computer_use.view import AgentResponseFormatter

__all__ = ['AgentService', 'AgentResponseFormatter']
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AutoCua/windows/agent/main_driver/__init__.py
# AutoCua/windows/agent/computer_use/__init__.py
from .service import AgentService
from .view import AgentResponseFormatter

Expand Down
2 changes: 1 addition & 1 deletion AutoCua/windows/agent/minions/claude_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Rules for the report:
**OS: Windows PowerShell. You are READ-ONLY.**
1. You MUST NEVER modify the filesystem. No editing, creating, deleting, moving, or renaming files. No `Set-Content`, `Add-Content`, `Out-File`, `New-Item`, `Remove-Item`, `Move-Item`, `Rename-Item`, redirection (`>`, `>>`), or any side-effecting shell command. You have NO `write` tool and NO `replace` tool. If you find yourself wanting to edit, instead record the exact location in your final report so the parent agent can apply the change.
2. Drill-down workflow: start broad (`glob`/`grep` to find candidates), then narrow (`view` exact ranges) - never dump whole large files into context. Standard pair: `grep` (locate the line), then `view` (read a 20-50 line range around the hit).
3. Always anchor findings to `path:line_no` (e.g. `AutoCua\windows\agent\main_driver\service.py:418`). Vague references like "somewhere in service.py" are never acceptable.
3. Always anchor findings to `path:line_no` (e.g. `AutoCua\windows\agent\computer_use\service.py:418`). Vague references like "somewhere in service.py" are never acceptable.
4. For change requests: trace every connection - definition site, every caller, every place that reads/writes the affected state, related tests, related prompts. Report ALL of them, not just the obvious one. Missing one place = parent agent ships a broken change.
5. Keep running notes in `<scratchpad>` after every confirmed finding so they survive across iterations and assemble into the final report.
6. When `view` shows `[line_number] text`, those numbers are the file's real line numbers - quote them exactly in your report. For files over 2000 lines, whole-file `view` returns only the first 2000 plus a footer showing the total — re-call `view` with `start`/`end` for other sections.
Expand Down
2 changes: 1 addition & 1 deletion AutoCua/windows/agent/minions/system_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ Rules for the report:
**OS: Windows PowerShell. You are READ-ONLY.**
1. You MUST NEVER modify the filesystem. No editing, creating, deleting, moving, or renaming files. No `Set-Content`, `Add-Content`, `Out-File`, `New-Item`, `Remove-Item`, `Move-Item`, `Rename-Item`, redirection (`>`, `>>`), or any side-effecting shell command. You have NO `write` tool and NO `replace` tool. If you find yourself wanting to edit, instead record the exact location in your final report so the parent agent can apply the change.
2. Drill-down workflow: start broad (`glob`/`grep` to find candidates), then narrow (`view` exact ranges) - never dump whole large files into context. Standard pair: `grep` (locate the line), then `view` (read a 20-50 line range around the hit).
3. Always anchor findings to `path:line_no` (e.g. `AutoCua\windows\agent\main_driver\service.py:418`). Vague references like "somewhere in service.py" are never acceptable.
3. Always anchor findings to `path:line_no` (e.g. `AutoCua\windows\agent\computer_use\service.py:418`). Vague references like "somewhere in service.py" are never acceptable.
4. For change requests: trace every connection - definition site, every caller, every place that reads/writes the affected state, related tests, related prompts. Report ALL of them, not just the obvious one. Missing one place = parent agent ships a broken change.
5. Keep running notes in `<scratchpad>` after every confirmed finding so they survive across iterations and assemble into the final report.
6. When `view` shows `[line_number] text`, those numbers are the file's real line numbers - quote them exactly in your report. For files over 2000 lines, whole-file `view` returns only the first 2000 plus a footer showing the total — re-call `view` with `start`/`end` for other sections.
Expand Down
6 changes: 3 additions & 3 deletions AutoCua/windows/remote_connection/telegram/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _build_prior_history(task, assistant_messages, tool_responses,
surface deliberately avoids. Packages a finished run's memory lists into
the prior_history dict AgentService expects, capped with the synthetic
terminal bridge step + None tool slot. The bridge JSON must contain
main_driver's _BRIDGE_SIGNATURE ('"next_goal": "Previous run concluded.')
computer_use's _BRIDGE_SIGNATURE ('"next_goal": "Previous run concluded.')
verbatim, or the <updated_user_request> run-marker logic silently stops
firing on resume. Returns None when the run produced no
steps — the caller keeps the previous memory then. prior_task freezes the
Expand Down Expand Up @@ -832,7 +832,7 @@ def _run_agent(task, provider, model, chat_id, bot, loop, prior_history=None,
try:
# Imported lazily — pulls in tree/element → skimage etc., which we
# don't want to load until a task actually runs.
from AutoCua.windows.agent.main_driver.service import AgentService
from AutoCua.windows.agent.computer_use.service import AgentService

# Look up the runtime API key for the chosen provider so
# LLMManager doesn't fall back to an os.getenv() that the user
Expand All @@ -852,7 +852,7 @@ def _run_agent(task, provider, model, chat_id, bot, loop, prior_history=None,
# Pipe each step's formatted response (thinking + next_goal +
# memory, with action stripped) into the compact banner.
# The agent already calls text_callback at
# main_driver/service.py with exactly this content — same path the
# computer_use/service.py with exactly this content — same path the
# frontend's streamAgentText uses in app.py. update() forwards via
# the MSG stdin command to the banner subprocess; the call returns
# quickly so the agent loop never blocks on it.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ AutoCua/
default_skills/ the shipped skills, read-only; yours go in AutoCua_data/skills/
llm_provider/ every LLM endpoint and the model tables, one copy for all platforms
mac/ windows/ computer use: agent, controller, tree, sandbox, tool_registry
agent/main_driver/ the desktop loop
agent/computer_use/ the desktop loop
agent/coder/ the coding agent
agent/minions/ read-only scouts
controller/tool/ shell, open_app, screenshot, applescript, kernel_input
Expand Down
4 changes: 2 additions & 2 deletions agent_capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ run_agent(
## Under the hood

Each platform's `AgentService.__init__` (e.g.
[AutoCua/windows/agent/main_driver/service.py](AutoCua/windows/agent/main_driver/service.py))
[AutoCua/windows/agent/computer_use/service.py](AutoCua/windows/agent/computer_use/service.py))
normalises `speed`, loads `fast_system_prompt.md` or `system_prompt.md` from
the same folder, and passes the mode to `LLMManager`, which sends the
`MAIN_TOOLS_FAST` registry (notes tool `memory`) or `MAIN_TOOLS` (notes tool
Expand Down Expand Up @@ -446,7 +446,7 @@ Remove the argument (or pass `False`) to stop writing logs.
## Under the hood

Each `AgentService.__init__` (e.g.
[AutoCua/windows/agent/main_driver/service.py](AutoCua/windows/agent/main_driver/service.py))
[AutoCua/windows/agent/computer_use/service.py](AutoCua/windows/agent/computer_use/service.py))
resets `conversation/` and `raw_reasoning/` and, when the flag is on, calls
`_save_conversation_snapshot()` after every LLM step to write
`conversation_N.txt`. The web agent does the same in Rust
Expand Down
Loading