universal-mcp-agents 0.1.22__py3-none-any.whl → 0.1.23rc1__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.

@@ -39,7 +39,6 @@ class CodeActPlaybookAgent(BaseAgent):
39
39
  instructions: str,
40
40
  model: str,
41
41
  memory: BaseCheckpointSaver | None = None,
42
- tools: ToolConfig | None = None,
43
42
  registry: ToolRegistry | None = None,
44
43
  playbook_registry: object | None = None,
45
44
  sandbox_timeout: int = 20,
@@ -54,10 +53,10 @@ class CodeActPlaybookAgent(BaseAgent):
54
53
  )
55
54
  self.model_instance = load_chat_model(model)
56
55
  self.playbook_model_instance = load_chat_model("azure/gpt-4.1")
57
- self.tools_config = tools or {}
58
56
  self.registry = registry
59
57
  self.playbook_registry = playbook_registry
60
58
  self.playbook = playbook_registry.get_agent() if playbook_registry else None
59
+ self.tools_config = self.playbook.tools if self.playbook else {}
61
60
  self.eval_fn = eval_unsafe
62
61
  self.sandbox_timeout = sandbox_timeout
63
62
  self.default_tools = {
@@ -169,7 +168,7 @@ class CodeActPlaybookAgent(BaseAgent):
169
168
  self.tools_config.extend(new_tool_ids)
170
169
  self.exported_tools = await self.registry.export_tools(new_tool_ids, ToolFormat.LANGCHAIN)
171
170
  self.final_instructions, self.tools_context = create_default_prompt(
172
- self.exported_tools, self.additional_tools, self.instructions, await get_connected_apps_string(self.registry)
171
+ self.exported_tools, self.additional_tools, self.instructions, await get_connected_apps_string(self.registry), self.playbook
173
172
  )
174
173
  if ask_user:
175
174
  tool_messages.append(AIMessage(content=ai_msg))
@@ -226,23 +225,47 @@ class CodeActPlaybookAgent(BaseAgent):
226
225
 
227
226
  t = user_text.lower()
228
227
  if t == "yes, this is great":
229
- # Generate playbook metadata (name and description) before moving to generation
230
- meta_id = str(uuid.uuid4())
231
- writer({
232
- "type": "custom",
233
- id: meta_id,
234
- "name": "metadata",
235
- "data": {"update": bool(self.playbook)}
236
- })
237
- meta_instructions = self.instructions + PLAYBOOK_META_PROMPT
238
- messages = [{"role": "system", "content": meta_instructions}] + state["messages"]
239
-
240
- model_with_structured_output = self.playbook_model_instance.with_structured_output(PlaybookMeta)
241
- meta_response = model_with_structured_output.invoke(messages)
242
- meta = cast(PlaybookMeta, meta_response)
243
-
244
- writer({"type": "custom", id: meta_id, "name": "metadata", "data": {"name": meta.name, "description": meta.description}})
245
- return Command(goto="playbook", update={"playbook_mode": "generating", "playbook_name": meta.name, "playbook_description": meta.description})
228
+ self.meta_id = str(uuid.uuid4())
229
+ name, description = None, None
230
+ if self.playbook:
231
+ # Update flow: use existing name/description and do not re-generate
232
+ name = getattr(self.playbook, "name", None)
233
+ description = getattr(self.playbook, "description", None)
234
+ writer({
235
+ "type": "custom",
236
+ id: self.meta_id,
237
+ "name": "generating",
238
+ "data": {
239
+ "update": True,
240
+ "name": name,
241
+ "description": description,
242
+ }
243
+ })
244
+ else:
245
+ writer({
246
+ "type": "custom",
247
+ id: self.meta_id,
248
+ "name": "generating",
249
+ "data": {"update": False}
250
+ })
251
+
252
+ meta_instructions = self.instructions + PLAYBOOK_META_PROMPT
253
+ messages = [{"role": "system", "content": meta_instructions}] + state["messages"]
254
+
255
+ model_with_structured_output = self.playbook_model_instance.with_structured_output(PlaybookMeta)
256
+ meta_response = model_with_structured_output.invoke(messages)
257
+ meta = cast(PlaybookMeta, meta_response)
258
+ name, description = meta.name, meta.description
259
+
260
+ # Emit intermediary UI update with created name/description
261
+ writer({
262
+ "type": "custom",
263
+ id: self.meta_id,
264
+ "name": "generating",
265
+ "data": {"update": False, "name": name, "description": description}
266
+ })
267
+
268
+ return Command(goto="playbook", update={"playbook_mode": "generating", "playbook_name": name, "playbook_description": description})
246
269
  if t == "i would like to modify the plan":
247
270
  prompt_ai = AIMessage(content="What would you like to change about the plan? Let me know and I'll update the plan accordingly.", additional_kwargs={"stream": "true"})
248
271
  return Command(update={"playbook_mode": "planning", "messages": [prompt_ai]})
@@ -253,13 +276,6 @@ class CodeActPlaybookAgent(BaseAgent):
253
276
  return Command(goto="call_model", update={"playbook_mode": "inactive"})
254
277
 
255
278
  elif playbook_mode == "generating":
256
- generate_id = str(uuid.uuid4())
257
- writer({
258
- "type": "custom",
259
- id: generate_id,
260
- "name": "generating",
261
- "data": {"update": bool(self.playbook)}
262
- })
263
279
  generating_instructions = self.instructions + PLAYBOOK_GENERATING_PROMPT
264
280
  messages = [{"role": "system", "content": generating_instructions}] + state["messages"]
265
281
 
@@ -304,11 +320,25 @@ class CodeActPlaybookAgent(BaseAgent):
304
320
 
305
321
  writer({
306
322
  "type": "custom",
307
- id: generate_id,
323
+ id: self.meta_id,
308
324
  "name": "generating",
309
- "data": {"id": str(res.id), "update": bool(self.playbook)}
325
+ "data": {
326
+ "id": str(res.id),
327
+ "update": bool(self.playbook),
328
+ "name": final_name,
329
+ "description": final_description,
330
+ }
310
331
  })
311
- mock_assistant_message = AIMessage(content=json.dumps(response.dict()), additional_kwargs={"type": "generating", "id": str(res.id), "update": bool(self.playbook)})
332
+ mock_assistant_message = AIMessage(
333
+ content=json.dumps(response.dict()),
334
+ additional_kwargs={
335
+ "type": "generating",
336
+ "id": str(res.id),
337
+ "update": bool(self.playbook),
338
+ "name": final_name,
339
+ "description": final_description,
340
+ },
341
+ )
312
342
 
313
343
  return Command(
314
344
  update={"messages": [mock_assistant_message], "playbook_mode": "normal"}
@@ -320,7 +350,7 @@ class CodeActPlaybookAgent(BaseAgent):
320
350
  self.tools_config.extend(state.get("selected_tool_ids", []))
321
351
  self.exported_tools = await self.registry.export_tools(self.tools_config, ToolFormat.LANGCHAIN)
322
352
  self.final_instructions, self.tools_context = create_default_prompt(
323
- self.exported_tools, self.additional_tools, self.instructions, await get_connected_apps_string(self.registry)
353
+ self.exported_tools, self.additional_tools, self.instructions, await get_connected_apps_string(self.registry), self.playbook
324
354
  )
325
355
  if state.get("playbook_mode") in ["planning", "confirming", "generating"]:
326
356
  return "playbook"
@@ -14,12 +14,6 @@ def enter_playbook_mode():
14
14
  """Call this function to enter playbook mode. Playbook mode is when the user wants to store a repeated task as a script with some inputs for the future."""
15
15
  return
16
16
 
17
-
18
- def exit_playbook_mode():
19
- """Call this function to exit playbook mode. Playbook mode is when the user wants to store a repeated task as a script with some inputs for the future."""
20
- return
21
-
22
-
23
17
  def create_meta_tools(tool_registry: AgentrRegistry) -> dict[str, Any]:
24
18
  """Create the meta tools for searching and loading tools"""
25
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: universal-mcp-agents
3
- Version: 0.1.22
3
+ Version: 0.1.23rc1
4
4
  Summary: Add your description here
5
5
  Project-URL: Homepage, https://github.com/universal-mcp/applications
6
6
  Project-URL: Repository, https://github.com/universal-mcp/applications
@@ -22,14 +22,14 @@ universal_mcp/agents/builder/prompts.py,sha256=8Xs6uzTUHguDRngVMLak3lkXFkk2VV_uQ
22
22
  universal_mcp/agents/builder/state.py,sha256=7DeWllxfN-yD6cd9wJ3KIgjO8TctkJvVjAbZT8W_zqk,922
23
23
  universal_mcp/agents/codeact0/__init__.py,sha256=8-fvUo1Sm6dURGI-lW-X3Kd78LqySYbb5NMkNJ4NDwg,76
24
24
  universal_mcp/agents/codeact0/__main__.py,sha256=_7qSz97YnRgYJTESkALS5_eBIGHiMjA5rhr3IAeBvVo,896
25
- universal_mcp/agents/codeact0/agent.py,sha256=Cxdh9eJvrIfUISdFQKXnYrGc6PePrIGusSvWiALmAJo,16634
25
+ universal_mcp/agents/codeact0/agent.py,sha256=--cAjQ05VntXga2ofpnL9oFXAk6ANZ2SftwtLkQgy00,17844
26
26
  universal_mcp/agents/codeact0/config.py,sha256=H-1woj_nhSDwf15F63WYn723y4qlRefXzGxuH81uYF0,2215
27
27
  universal_mcp/agents/codeact0/langgraph_agent.py,sha256=8nz2wq-LexImx-l1y9_f81fK72IQetnCeljwgnduNGY,420
28
28
  universal_mcp/agents/codeact0/llm_tool.py,sha256=-pAz04OrbZ_dJ2ueysT1qZd02DrbLY4EbU0tiuF_UNU,798
29
29
  universal_mcp/agents/codeact0/prompts.py,sha256=Gk6WTx2X7IOlbC3wYtGwKWDoeUtgpkMeiyfhj6LEq2I,11221
30
30
  universal_mcp/agents/codeact0/sandbox.py,sha256=Xw4tbUV_6haYIZZvteJi6lIYsW6ni_3DCRCOkslTKgM,4459
31
31
  universal_mcp/agents/codeact0/state.py,sha256=co3BZBuMIt1FP2qzgsbsLkyKbddCG1ieKyAw9TAskSU,1944
32
- universal_mcp/agents/codeact0/tools.py,sha256=WRJKNIf6_cP_enElboEyVd-aHF-kk6aq8Bg0biZijR4,13363
32
+ universal_mcp/agents/codeact0/tools.py,sha256=1EBStJQQQCuNeWOqt0VP-XFiT0fE4oCR9nvUiwzRhe4,13164
33
33
  universal_mcp/agents/codeact0/utils.py,sha256=PgisAxmqYIzimc4lFA1nV-R7gxkICIrtO1q0FQZ-UoY,17580
34
34
  universal_mcp/agents/shared/__main__.py,sha256=XxH5qGDpgFWfq7fwQfgKULXGiUgeTp_YKfcxftuVZq8,1452
35
35
  universal_mcp/agents/shared/prompts.py,sha256=yjP3zbbuKi87qCj21qwTTicz8TqtkKgnyGSeEjMu3ho,3761
@@ -39,6 +39,6 @@ universal_mcp/applications/filesystem/app.py,sha256=0TRjjm8YnslVRSmfkXI7qQOAlqWl
39
39
  universal_mcp/applications/llm/__init__.py,sha256=_XGRxN3O1--ZS5joAsPf8IlI9Qa6negsJrwJ5VJXno0,46
40
40
  universal_mcp/applications/llm/app.py,sha256=g9mK-luOLUshZzBGyQZMOHBeCSXmh2kCKir40YnsGUo,12727
41
41
  universal_mcp/applications/ui/app.py,sha256=c7OkZsO2fRtndgAzAQbKu-1xXRuRp9Kjgml57YD2NR4,9459
42
- universal_mcp_agents-0.1.22.dist-info/METADATA,sha256=6f34bvvybyI6et8rvKIu-4BtFJHGmt0YZmaZutJBXuw,878
43
- universal_mcp_agents-0.1.22.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
- universal_mcp_agents-0.1.22.dist-info/RECORD,,
42
+ universal_mcp_agents-0.1.23rc1.dist-info/METADATA,sha256=Fa-ACWH1oawoVDBAbp2iSSDGSCRovD2rWP9e9lUhcYE,881
43
+ universal_mcp_agents-0.1.23rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
+ universal_mcp_agents-0.1.23rc1.dist-info/RECORD,,