universal-mcp-agents 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl

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 universal-mcp-agents might be problematic. Click here for more details.

Files changed (49) hide show
  1. universal_mcp/agents/__init__.py +1 -1
  2. universal_mcp/agents/base.py +3 -0
  3. universal_mcp/agents/bigtool/__init__.py +1 -1
  4. universal_mcp/agents/bigtool/__main__.py +4 -3
  5. universal_mcp/agents/bigtool/agent.py +3 -2
  6. universal_mcp/agents/bigtool/graph.py +68 -31
  7. universal_mcp/agents/bigtool/prompts.py +2 -2
  8. universal_mcp/agents/bigtool/tools.py +17 -4
  9. universal_mcp/agents/builder/__main__.py +129 -28
  10. universal_mcp/agents/builder/builder.py +149 -161
  11. universal_mcp/agents/builder/helper.py +71 -0
  12. universal_mcp/agents/builder/prompts.py +94 -160
  13. universal_mcp/agents/codeact0/__init__.py +2 -1
  14. universal_mcp/agents/codeact0/agent.py +13 -5
  15. universal_mcp/agents/codeact0/langgraph_agent.py +14 -0
  16. universal_mcp/agents/codeact0/llm_tool.py +1 -2
  17. universal_mcp/agents/codeact0/playbook_agent.py +353 -0
  18. universal_mcp/agents/codeact0/prompts.py +126 -41
  19. universal_mcp/agents/codeact0/sandbox.py +43 -32
  20. universal_mcp/agents/codeact0/state.py +27 -3
  21. universal_mcp/agents/codeact0/tools.py +180 -0
  22. universal_mcp/agents/codeact0/utils.py +89 -75
  23. universal_mcp/agents/shared/__main__.py +44 -0
  24. universal_mcp/agents/shared/prompts.py +49 -98
  25. universal_mcp/agents/shared/tool_node.py +160 -176
  26. universal_mcp/agents/utils.py +71 -0
  27. universal_mcp/applications/ui/app.py +2 -2
  28. {universal_mcp_agents-0.1.13.dist-info → universal_mcp_agents-0.1.15.dist-info}/METADATA +3 -3
  29. universal_mcp_agents-0.1.15.dist-info/RECORD +50 -0
  30. universal_mcp/agents/codeact0/usecases/1-unsubscribe.yaml +0 -4
  31. universal_mcp/agents/codeact0/usecases/10-reddit2.yaml +0 -10
  32. universal_mcp/agents/codeact0/usecases/11-github.yaml +0 -13
  33. universal_mcp/agents/codeact0/usecases/2-reddit.yaml +0 -27
  34. universal_mcp/agents/codeact0/usecases/2.1-instructions.md +0 -81
  35. universal_mcp/agents/codeact0/usecases/2.2-instructions.md +0 -71
  36. universal_mcp/agents/codeact0/usecases/3-earnings.yaml +0 -4
  37. universal_mcp/agents/codeact0/usecases/4-maps.yaml +0 -41
  38. universal_mcp/agents/codeact0/usecases/5-gmailreply.yaml +0 -8
  39. universal_mcp/agents/codeact0/usecases/6-contract.yaml +0 -6
  40. universal_mcp/agents/codeact0/usecases/7-overnight.yaml +0 -14
  41. universal_mcp/agents/codeact0/usecases/8-sheets_chart.yaml +0 -25
  42. universal_mcp/agents/codeact0/usecases/9-learning.yaml +0 -9
  43. universal_mcp/agents/planner/__init__.py +0 -51
  44. universal_mcp/agents/planner/__main__.py +0 -28
  45. universal_mcp/agents/planner/graph.py +0 -85
  46. universal_mcp/agents/planner/prompts.py +0 -14
  47. universal_mcp/agents/planner/state.py +0 -11
  48. universal_mcp_agents-0.1.13.dist-info/RECORD +0 -63
  49. {universal_mcp_agents-0.1.13.dist-info → universal_mcp_agents-0.1.15.dist-info}/WHEEL +0 -0
@@ -1,85 +0,0 @@
1
- from typing import Any
2
-
3
- from langchain_core.messages import AIMessage, SystemMessage
4
- from langgraph.graph import END, START, StateGraph
5
- from loguru import logger
6
-
7
- from universal_mcp.agents.shared.tool_node import build_tool_node_graph
8
-
9
- from .state import State
10
-
11
-
12
- def build_graph(llm, registry, instructions, model, executor_agent_cls):
13
- """Build the graph for the planner agent."""
14
- graph_builder = StateGraph(State)
15
-
16
- async def _tool_finder_node(state: State) -> dict[str, Any]:
17
- """Runs the tool finder subgraph to identify necessary tools."""
18
- task = state["messages"][-1].content
19
- logger.info(f"Running tool finder for task: {task}")
20
- tool_finder_graph = build_tool_node_graph(llm, registry)
21
- tool_finder_state = await tool_finder_graph.ainvoke({"original_task": task, "messages": state["messages"]})
22
-
23
- if not tool_finder_state.get("apps_required"):
24
- logger.info("Tool finder determined no apps are required.")
25
- return {"apps_with_tools": {}}
26
-
27
- apps_with_tools = tool_finder_state.get("apps_with_tools", {})
28
- logger.info(f"Tool finder identified apps and tools: {apps_with_tools}")
29
- return {"apps_with_tools": apps_with_tools, "task": task}
30
-
31
- def _should_continue(state: State) -> str:
32
- """Determines whether to continue to the executor or end."""
33
- if state.get("apps_with_tools"):
34
- return "continue"
35
- return "end"
36
-
37
- async def _executor_node(state: State) -> dict[str, Any]:
38
- """Executes the task with the identified tools."""
39
- tool_config = state["apps_with_tools"]
40
-
41
- logger.info(f"Preparing executor with tools: {tool_config}")
42
- agent = executor_agent_cls(
43
- name="executor-agent",
44
- instructions=instructions,
45
- model=model,
46
- registry=registry,
47
- tools=tool_config,
48
- )
49
-
50
- await agent.ainit()
51
- react_graph = agent._graph
52
- logger.info("Invoking executor agent with tools.")
53
- # We invoke the agent to make it run the tool
54
- response = await react_graph.ainvoke({"messages": state["messages"]})
55
-
56
- final_message = AIMessage(content=response["messages"][-1].content)
57
- return {"messages": [final_message]}
58
-
59
- async def _no_tools_node(state: State) -> dict[str, Any]:
60
- """Handles tasks that don't require tools by invoking the LLM directly."""
61
- logger.info("No tools required. Invoking LLM directly.")
62
- messages = [
63
- SystemMessage(content=instructions),
64
- *state["messages"],
65
- ]
66
- response = await llm.ainvoke(messages)
67
- return {"messages": [response]}
68
-
69
- graph_builder.add_node("tool_finder", _tool_finder_node)
70
- graph_builder.add_node("executor", _executor_node)
71
- graph_builder.add_node("no_tools_executor", _no_tools_node)
72
-
73
- graph_builder.add_edge(START, "tool_finder")
74
- graph_builder.add_conditional_edges(
75
- "tool_finder",
76
- _should_continue,
77
- {
78
- "continue": "executor",
79
- "end": "no_tools_executor",
80
- },
81
- )
82
- graph_builder.add_edge("executor", END)
83
- graph_builder.add_edge("no_tools_executor", END)
84
-
85
- return graph_builder
@@ -1,14 +0,0 @@
1
- # prompts.py
2
-
3
- DEVELOPER_PROMPT = """
4
- You are a planner agent that orchestrates tasks by selecting the right tools.
5
-
6
- Your primary goal is to analyze a user's request and determine the most effective sequence of tools to accomplish it. You have access to a registry of applications and their corresponding tools.
7
-
8
- Here's your process:
9
- 1. **Assess the Task**: Understand the user's intent and what they want to achieve.
10
- 2. **Identify Necessary Tools**: Based on the task, identify which applications and tools are required.
11
- 3. **Orchestrate Execution**: Pass the selected tools and instructions to an executor agent to perform the task.
12
-
13
- {instructions}
14
- """
@@ -1,11 +0,0 @@
1
- from typing import Annotated
2
-
3
- from langgraph.graph.message import add_messages
4
- from typing_extensions import TypedDict
5
- from universal_mcp.types import ToolConfig
6
-
7
-
8
- class State(TypedDict):
9
- messages: Annotated[list, add_messages]
10
- task: str
11
- apps_with_tools: ToolConfig
@@ -1,63 +0,0 @@
1
- universal_mcp/agents/__init__.py,sha256=kM4mC6Pf6lmaaZF1volo7VtKgA8FDyzb1sNenpB7Ulk,1244
2
- universal_mcp/agents/base.py,sha256=le5vy02eXN15u8ntHWCu6Y-LgOmE_DA8tWmPOmLohAk,6908
3
- universal_mcp/agents/cli.py,sha256=AG9e4iSX3GazT537573YrYT1wSaZYOr42rrYQ7xP3YA,1016
4
- universal_mcp/agents/hil.py,sha256=_5PCK6q0goGm8qylJq44aSp2MadP-yCPvhOJYKqWLMo,3808
5
- universal_mcp/agents/llm.py,sha256=hVRwjZs3MHl5_3BWedmurs2Jt1oZDfFX0Zj9F8KH7fk,1787
6
- universal_mcp/agents/react.py,sha256=8XQvJ0HLVgc-K0qn9Ml48WGcgUGuIKtL67HatlT6Da0,3334
7
- universal_mcp/agents/simple.py,sha256=NSATg5TWzsRNS7V3LFiDG28WSOCIwCdcC1g7NRwg2nM,2095
8
- universal_mcp/agents/utils.py,sha256=QeysgwRCHvoe7LpIQkD05y9FGG7us4kWA8ApNj2ACr8,5274
9
- universal_mcp/agents/bigtool/__init__.py,sha256=uTA6KzZlRhL2reAUazwYmwCHFt9q4hERo27e13ifBX4,2250
10
- universal_mcp/agents/bigtool/__main__.py,sha256=a15OUoqPR938x7eseWtxu0aLX7lRS3nu8k5Ks3giUY4,472
11
- universal_mcp/agents/bigtool/agent.py,sha256=anXjMgFWS95RYrnQsZJJxYq8HoCB6z9Poi-Uv5fhPis,266
12
- universal_mcp/agents/bigtool/context.py,sha256=ny7gd-vvVpUOYAeQbAEUT0A6Vm6Nn2qGywxTzPBzYFg,929
13
- universal_mcp/agents/bigtool/graph.py,sha256=DEsuSm9OYWBTeGEmvPk_nv_yb7EvCflHe4pbja5-jC0,4337
14
- universal_mcp/agents/bigtool/prompts.py,sha256=Rz30qNGdscDG65vMj9d0Vfe7X1pQjBDQBBNc3BuyC94,1886
15
- universal_mcp/agents/bigtool/state.py,sha256=TQeGZD99okclkoCh5oz-VYIlEsC9yLQyDpnBnm7QCN8,759
16
- universal_mcp/agents/bigtool/tools.py,sha256=ynyEj9mVwKKDhxm76sjspyH51SFi63g2Vydi39pY0qY,5562
17
- universal_mcp/agents/builder/__main__.py,sha256=XaXpJNwkj5Os1Vn1er8wokPKd4O4WW_L2XkGkvqEhao,4912
18
- universal_mcp/agents/builder/builder.py,sha256=1p32txpFlG1l6XP1N5UOFAhNnQS02nmvA_uMDO5i-m4,9015
19
- universal_mcp/agents/builder/prompts.py,sha256=RFzDBdGxF5BsAQL09BVas9RjAwt_Q2ZACghG5pOxqas,8623
20
- universal_mcp/agents/builder/state.py,sha256=7DeWllxfN-yD6cd9wJ3KIgjO8TctkJvVjAbZT8W_zqk,922
21
- universal_mcp/agents/codeact/__init__.py,sha256=rLE8gvOo5H4YSr71DRq76b3RV3uuotxuAy_VnBVaVwk,60
22
- universal_mcp/agents/codeact/__main__.py,sha256=W2cHXRwH1dZG3ETIkMwUqA_d62K3IctHP-FDZWDjxdw,1067
23
- universal_mcp/agents/codeact/agent.py,sha256=sKZWokTHcuL68Y6SNyaaHe6_XkWxaIq36TrNmPJfQto,9762
24
- universal_mcp/agents/codeact/models.py,sha256=2fdAcF5bxWDpljjEwDEdPBflTMShSPwwncHrphRjsYg,222
25
- universal_mcp/agents/codeact/prompts.py,sha256=EMI-imnd0Ps0Bd2FOvSqgiicvvtFFu0MF9s93PiC_3k,4493
26
- universal_mcp/agents/codeact/sandbox.py,sha256=NjN6ISj8psFtHf8V0w24ChJdUMUWkq7OrlbHdzm4wBc,2299
27
- universal_mcp/agents/codeact/state.py,sha256=WTPfpxDlGRnlr5tZuXMg_KU7GS7TZbnrIKslOvZLbQI,565
28
- universal_mcp/agents/codeact/utils.py,sha256=JUbT_HYGS_D1BzmzoVpORIe7SGur1KgJguTZ_1tZ4JY,1918
29
- universal_mcp/agents/codeact0/__init__.py,sha256=rLE8gvOo5H4YSr71DRq76b3RV3uuotxuAy_VnBVaVwk,60
30
- universal_mcp/agents/codeact0/__main__.py,sha256=V2wLWW9ym3rtiSvPEs-N0Mki7G5dYHzV5dAsAoF-ygQ,1148
31
- universal_mcp/agents/codeact0/agent.py,sha256=e1v_XVRqblKrAgrkyiPz7bs4atgDRTVHPnZQUjnT_4o,6495
32
- universal_mcp/agents/codeact0/config.py,sha256=H-1woj_nhSDwf15F63WYn723y4qlRefXzGxuH81uYF0,2215
33
- universal_mcp/agents/codeact0/llm_tool.py,sha256=GEG8L2crRPyO5la_wlHohuqI9m6xH9KXgQxcP5fCFuU,13814
34
- universal_mcp/agents/codeact0/prompts.py,sha256=GTUwnxyyUVdeAoAwo4ODGOlEtZStMkoP_lJEFRbDglY,7324
35
- universal_mcp/agents/codeact0/sandbox.py,sha256=tkrhQoV7sAIT5rtd5kpNYEgDz4y82WSHKpMGE6bqthE,3108
36
- universal_mcp/agents/codeact0/state.py,sha256=kcoCoz-kd0Ukw1YNGDHNggixCK34KzMl2t6GztakSo4,412
37
- universal_mcp/agents/codeact0/utils.py,sha256=QIT4XIUln9o3H7MOmMen7i-dhDgvM8q0p--oy9Kbkss,15345
38
- universal_mcp/agents/codeact0/usecases/1-unsubscribe.yaml,sha256=DiChHW-mNOcaaiec7f_04_A0Xyf9a2ihzXiPA9-Fw1I,239
39
- universal_mcp/agents/codeact0/usecases/10-reddit2.yaml,sha256=R3vrZZNv_E-m_SuSJ5tSv11HqMomm8Gtxp_LDhkrnAw,618
40
- universal_mcp/agents/codeact0/usecases/11-github.yaml,sha256=IRom0gDPcj0w0qa2LSARQbvrwJhLGQRaHI2U2rglcG0,650
41
- universal_mcp/agents/codeact0/usecases/2-reddit.yaml,sha256=-dstvFMjsuP9UQM3B_G1HBn7ImNIMxSCNbITpfwgwAY,2525
42
- universal_mcp/agents/codeact0/usecases/2.1-instructions.md,sha256=0gQBY_A3jT_lgKNiu6GdyEYupbX0Xz2unlCoTQwv-Es,5098
43
- universal_mcp/agents/codeact0/usecases/2.2-instructions.md,sha256=Cx-VkcC55MrgFxlMBMBCD83jEge_yZgBWKwtuK1OPFc,4458
44
- universal_mcp/agents/codeact0/usecases/3-earnings.yaml,sha256=c1ipGMmqafz8zTzGNYyn_4VldC-PB5FY87l8HS9QkOM,344
45
- universal_mcp/agents/codeact0/usecases/4-maps.yaml,sha256=2KwGE1sFGtP8vEjKZ5Yjlro2j5LzafWbVlFy0E3a1CA,2462
46
- universal_mcp/agents/codeact0/usecases/5-gmailreply.yaml,sha256=2ExMgk3z453phZocmCw0bmnJXugy79YNaoAfZV5CfMU,593
47
- universal_mcp/agents/codeact0/usecases/6-contract.yaml,sha256=yVvoz1-pmJVsJSkCtTCuO57Ln5y1Kj7ErkjPyRweJb0,574
48
- universal_mcp/agents/codeact0/usecases/7-overnight.yaml,sha256=Vod5md6wxmhY4MFkc1soMOpNNDXquVufo48QkM2orz0,731
49
- universal_mcp/agents/codeact0/usecases/8-sheets_chart.yaml,sha256=aZpdyDMnrHjmV9wMqgV3VXsYGvNPFD58px6ZPjva5PM,1097
50
- universal_mcp/agents/codeact0/usecases/9-learning.yaml,sha256=MXAgTU1p0Ek1md8dvb5Srb1W6QU4xPUgb6KgNfoza10,535
51
- universal_mcp/agents/planner/__init__.py,sha256=7nGDDtmPk2LN4s5poIFkflm5ZoyRuQSQ73Qw_4GOov4,1415
52
- universal_mcp/agents/planner/__main__.py,sha256=OfhTfYDZK_ZUfc8sX-Sa6TWk-dNqD2rl13Ln64mNAtw,771
53
- universal_mcp/agents/planner/graph.py,sha256=70hhIoEZOcYojpiyVSCedgYpnmxVP7aqdn8s6VBu-D4,3228
54
- universal_mcp/agents/planner/prompts.py,sha256=_JoHqiAvswtqCDu90AGUHmfsu8eWE1-_yI4LLn3pqMU,657
55
- universal_mcp/agents/planner/state.py,sha256=qqyp-jSGsCxe1US-PRLT4-y1sITAcVE6nCMlQLnvop0,278
56
- universal_mcp/agents/shared/prompts.py,sha256=VOsXSUEwBXPaAuxJTUF6bgDGr41u6uctUNQSMRt_OJc,6414
57
- universal_mcp/agents/shared/tool_node.py,sha256=KPF_nONfF12BmUTb9stHnxveqL7enGBi7wBGLrOjMsQ,9489
58
- universal_mcp/applications/llm/__init__.py,sha256=xnpxq4Wl_pevvwtSUtEwcty8_d61ywO1V2YnEXyCREY,46
59
- universal_mcp/applications/llm/app.py,sha256=iNLU6z2LRZc01GfSKvV0vNzT1LhKAjq_UrSJEmjthjw,6032
60
- universal_mcp/applications/ui/app.py,sha256=56h9GvkHiELyAVOZvi0YjiowSymlqkJ5GW4O7LmGIPs,9459
61
- universal_mcp_agents-0.1.13.dist-info/METADATA,sha256=wiruytjCRQN0GSX6yMToFwnIlmqWJPZbdbUOHXpUXJY,878
62
- universal_mcp_agents-0.1.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
63
- universal_mcp_agents-0.1.13.dist-info/RECORD,,