cua-agent 0.4.26__tar.gz → 0.4.28__tar.gz

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.

Potentially problematic release.


This version of cua-agent might be problematic. Click here for more details.

Files changed (51) hide show
  1. {cua_agent-0.4.26 → cua_agent-0.4.28}/PKG-INFO +1 -1
  2. cua_agent-0.4.28/agent/callbacks/prompt_instructions.py +47 -0
  3. {cua_agent-0.4.26 → cua_agent-0.4.28}/pyproject.toml +1 -1
  4. {cua_agent-0.4.26 → cua_agent-0.4.28}/README.md +0 -0
  5. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/__init__.py +0 -0
  6. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/__main__.py +0 -0
  7. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/adapters/__init__.py +0 -0
  8. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/adapters/huggingfacelocal_adapter.py +0 -0
  9. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/adapters/human_adapter.py +0 -0
  10. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/adapters/mlxvlm_adapter.py +0 -0
  11. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/agent.py +0 -0
  12. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/__init__.py +0 -0
  13. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/base.py +0 -0
  14. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/budget_manager.py +0 -0
  15. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/image_retention.py +0 -0
  16. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/logging.py +0 -0
  17. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/operator_validator.py +0 -0
  18. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/pii_anonymization.py +0 -0
  19. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/telemetry.py +0 -0
  20. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/callbacks/trajectory_saver.py +0 -0
  21. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/cli.py +0 -0
  22. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/computers/__init__.py +0 -0
  23. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/computers/base.py +0 -0
  24. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/computers/cua.py +0 -0
  25. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/computers/custom.py +0 -0
  26. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/decorators.py +0 -0
  27. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/human_tool/__init__.py +0 -0
  28. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/human_tool/__main__.py +0 -0
  29. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/human_tool/server.py +0 -0
  30. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/human_tool/ui.py +0 -0
  31. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/integrations/hud/__init__.py +0 -0
  32. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/integrations/hud/proxy.py +0 -0
  33. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/__init__.py +0 -0
  34. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/anthropic.py +0 -0
  35. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/base.py +0 -0
  36. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/composed_grounded.py +0 -0
  37. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/glm45v.py +0 -0
  38. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/gta1.py +0 -0
  39. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/model_types.csv +0 -0
  40. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/omniparser.py +0 -0
  41. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/openai.py +0 -0
  42. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/loops/uitars.py +0 -0
  43. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/proxy/examples.py +0 -0
  44. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/proxy/handlers.py +0 -0
  45. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/responses.py +0 -0
  46. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/types.py +0 -0
  47. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/ui/__init__.py +0 -0
  48. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/ui/__main__.py +0 -0
  49. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/ui/gradio/__init__.py +0 -0
  50. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/ui/gradio/app.py +0 -0
  51. {cua_agent-0.4.26 → cua_agent-0.4.28}/agent/ui/gradio/ui_components.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cua-agent
3
- Version: 0.4.26
3
+ Version: 0.4.28
4
4
  Summary: CUA (Computer Use) Agent for AI-driven computer interaction
5
5
  Author-Email: TryCua <gh@trycua.com>
6
6
  Requires-Python: >=3.12
@@ -0,0 +1,47 @@
1
+ """
2
+ Prompt instructions callback.
3
+
4
+ This callback allows simple prompt engineering by pre-pending a user
5
+ instructions message to the start of the conversation before each LLM call.
6
+
7
+ Usage:
8
+
9
+ from agent.callbacks import PromptInstructionsCallback
10
+ agent = ComputerAgent(
11
+ model="openai/computer-use-preview",
12
+ callbacks=[PromptInstructionsCallback("Follow these rules...")]
13
+ )
14
+
15
+ """
16
+
17
+ from typing import Any, Dict, List, Optional
18
+
19
+ from .base import AsyncCallbackHandler
20
+
21
+
22
+ class PromptInstructionsCallback(AsyncCallbackHandler):
23
+ """
24
+ Prepend a user instructions message to the message list.
25
+
26
+ This is a minimal, non-invasive way to guide the agent's behavior without
27
+ modifying agent loops or tools. It works with any provider/loop since it
28
+ only alters the messages array before sending to the model.
29
+ """
30
+
31
+ def __init__(self, instructions: Optional[str]) -> None:
32
+ self.instructions = instructions
33
+
34
+ async def on_llm_start(self, messages: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
35
+ # Pre-pend instructions message
36
+ if not self.instructions:
37
+ return messages
38
+
39
+ # Ensure we don't duplicate if already present at the front
40
+ if messages and isinstance(messages[0], dict):
41
+ first = messages[0]
42
+ if first.get("role") == "user" and first.get("content") == self.instructions:
43
+ return messages
44
+
45
+ return [
46
+ {"role": "user", "content": self.instructions},
47
+ ] + messages
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "cua-agent"
9
- version = "0.4.26"
9
+ version = "0.4.28"
10
10
  description = "CUA (Computer Use) Agent for AI-driven computer interaction"
11
11
  readme = "README.md"
12
12
  authors = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes