open-swarm 0.1.1745125933__py3-none-any.whl → 0.1.1745126277__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.
Files changed (52) hide show
  1. {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/METADATA +12 -8
  2. {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/RECORD +52 -25
  3. swarm/blueprints/README.md +19 -18
  4. swarm/blueprints/blueprint_audit_status.json +1 -1
  5. swarm/blueprints/chatbot/blueprint_chatbot.py +160 -72
  6. swarm/blueprints/codey/README.md +88 -8
  7. swarm/blueprints/codey/blueprint_codey.py +1116 -210
  8. swarm/blueprints/codey/codey_cli.py +10 -0
  9. swarm/blueprints/codey/session_logs/session_2025-04-19T01-15-31.md +17 -0
  10. swarm/blueprints/codey/session_logs/session_2025-04-19T01-16-03.md +17 -0
  11. swarm/blueprints/common/operation_box_utils.py +83 -0
  12. swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py +21 -298
  13. swarm/blueprints/divine_code/blueprint_divine_code.py +182 -9
  14. swarm/blueprints/django_chat/blueprint_django_chat.py +150 -24
  15. swarm/blueprints/echocraft/blueprint_echocraft.py +142 -13
  16. swarm/blueprints/geese/README.md +97 -0
  17. swarm/blueprints/geese/blueprint_geese.py +677 -93
  18. swarm/blueprints/geese/geese_cli.py +102 -0
  19. swarm/blueprints/jeeves/blueprint_jeeves.py +712 -0
  20. swarm/blueprints/jeeves/jeeves_cli.py +55 -0
  21. swarm/blueprints/mcp_demo/blueprint_mcp_demo.py +109 -22
  22. swarm/blueprints/mission_improbable/blueprint_mission_improbable.py +172 -40
  23. swarm/blueprints/monkai_magic/blueprint_monkai_magic.py +79 -41
  24. swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py +82 -35
  25. swarm/blueprints/omniplex/blueprint_omniplex.py +56 -24
  26. swarm/blueprints/poets/blueprint_poets.py +141 -100
  27. swarm/blueprints/poets/poets_cli.py +23 -0
  28. swarm/blueprints/rue_code/README.md +8 -0
  29. swarm/blueprints/rue_code/blueprint_rue_code.py +188 -20
  30. swarm/blueprints/rue_code/rue_code_cli.py +43 -0
  31. swarm/blueprints/stewie/apps.py +12 -0
  32. swarm/blueprints/stewie/blueprint_family_ties.py +349 -0
  33. swarm/blueprints/stewie/models.py +19 -0
  34. swarm/blueprints/stewie/serializers.py +10 -0
  35. swarm/blueprints/stewie/settings.py +17 -0
  36. swarm/blueprints/stewie/urls.py +11 -0
  37. swarm/blueprints/stewie/views.py +26 -0
  38. swarm/blueprints/suggestion/blueprint_suggestion.py +54 -39
  39. swarm/blueprints/whinge_surf/README.md +22 -0
  40. swarm/blueprints/whinge_surf/__init__.py +1 -0
  41. swarm/blueprints/whinge_surf/blueprint_whinge_surf.py +565 -0
  42. swarm/blueprints/whinge_surf/whinge_surf_cli.py +99 -0
  43. swarm/blueprints/whiskeytango_foxtrot/blueprint_whiskeytango_foxtrot.py +66 -37
  44. swarm/blueprints/zeus/__init__.py +2 -0
  45. swarm/blueprints/zeus/apps.py +4 -0
  46. swarm/blueprints/zeus/blueprint_zeus.py +270 -0
  47. swarm/blueprints/zeus/zeus_cli.py +13 -0
  48. swarm/cli/async_input.py +65 -0
  49. swarm/cli/async_input_demo.py +32 -0
  50. {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/WHEEL +0 -0
  51. {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/entry_points.txt +0 -0
  52. {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,102 @@
1
+ import argparse
2
+ from swarm.blueprints.geese.blueprint_geese import GeeseBlueprint
3
+
4
+ def main():
5
+ parser = argparse.ArgumentParser(description="Run the Geese Blueprint")
6
+ parser.add_argument('--message', dest='prompt', nargs='?', default=None, help='Prompt for the agent (optional, aliased as --message for compatibility)')
7
+ parser.add_argument('--config', type=str, help='Path to config file', default=None)
8
+ parser.add_argument('--agent-mcp', action='append', help='Agent to MCP assignment, e.g. --agent-mcp agent1:mcpA,mcpB')
9
+ parser.add_argument('--model', type=str, help='Model name (overrides DEFAULT_LLM envvar)', default=None)
10
+ args = parser.parse_args()
11
+
12
+ agent_mcp_assignments = None
13
+ if args.agent_mcp:
14
+ agent_mcp_assignments = {}
15
+ for assignment in args.agent_mcp:
16
+ agent, mcps = assignment.split(':', 1)
17
+ agent_mcp_assignments[agent] = [m.strip() for m in mcps.split(',')]
18
+
19
+ blueprint = GeeseBlueprint(
20
+ blueprint_id='geese',
21
+ config_path=args.config,
22
+ agent_mcp_assignments=agent_mcp_assignments
23
+ )
24
+ import asyncio
25
+ messages = []
26
+ if args.prompt:
27
+ # PATCH: Always use blueprint.run for progressive UX
28
+ messages = [{"role": "user", "content": args.prompt}]
29
+ import asyncio
30
+ from swarm.blueprints.geese.blueprint_geese import SPINNER_STATES, SLOW_SPINNER, display_operation_box
31
+ import time
32
+ async def run_and_print():
33
+ spinner_idx = 0
34
+ spinner_start = time.time()
35
+ async for chunk in blueprint.run(messages, model=args.model):
36
+ if isinstance(chunk, dict) and (chunk.get("progress") or chunk.get("matches") or chunk.get("spinner_state")):
37
+ elapsed = time.time() - spinner_start
38
+ spinner_state = chunk.get("spinner_state")
39
+ if not spinner_state:
40
+ spinner_state = SLOW_SPINNER if elapsed > 10 else SPINNER_STATES[spinner_idx % len(SPINNER_STATES)]
41
+ spinner_idx += 1
42
+ op_type = chunk.get("type", "search")
43
+ result_count = len(chunk.get("matches", [])) if chunk.get("matches") is not None else None
44
+ box_content = f"Matches so far: {result_count}" if result_count is not None else str(chunk)
45
+ display_operation_box(
46
+ title="Searching Filesystem" if chunk.get("progress") else "Geese Output",
47
+ content=box_content,
48
+ result_count=result_count,
49
+ params={k: v for k, v in chunk.items() if k not in {'matches', 'progress', 'total', 'truncated', 'done', 'spinner_state'}},
50
+ progress_line=chunk.get('progress'),
51
+ total_lines=chunk.get('total'),
52
+ spinner_state=spinner_state,
53
+ emoji="🔍" if chunk.get("progress") else "💡"
54
+ )
55
+ else:
56
+ if isinstance(chunk, dict) and 'content' in chunk:
57
+ print(chunk['content'], end="")
58
+ else:
59
+ print(chunk, end="")
60
+ asyncio.run(run_and_print())
61
+ return
62
+
63
+ # Set DEFAULT_LLM envvar if --model is given
64
+ import os
65
+ if args.model:
66
+ os.environ['DEFAULT_LLM'] = args.model
67
+
68
+ async def run_and_print():
69
+ spinner_idx = 0
70
+ spinner_start = time.time()
71
+ from swarm.blueprints.geese.blueprint_geese import GeeseBlueprint, SPINNER_STATES, SLOW_SPINNER, display_operation_box
72
+ import time
73
+ async for chunk in blueprint.run(messages, model=args.model):
74
+ # If chunk is a dict with progress info, show operation box
75
+ if isinstance(chunk, dict) and (chunk.get("progress") or chunk.get("matches") or chunk.get("spinner_state")):
76
+ elapsed = time.time() - spinner_start
77
+ spinner_state = chunk.get("spinner_state")
78
+ if not spinner_state:
79
+ spinner_state = SLOW_SPINNER if elapsed > 10 else SPINNER_STATES[spinner_idx % len(SPINNER_STATES)]
80
+ spinner_idx += 1
81
+ op_type = chunk.get("type", "search")
82
+ result_count = len(chunk.get("matches", [])) if chunk.get("matches") is not None else None
83
+ box_content = f"Matches so far: {result_count}" if result_count is not None else str(chunk)
84
+ display_operation_box(
85
+ title="Searching Filesystem" if chunk.get("progress") else "Geese Output",
86
+ content=box_content,
87
+ result_count=result_count,
88
+ params={k: v for k, v in chunk.items() if k not in {'matches', 'progress', 'total', 'truncated', 'done', 'spinner_state'}},
89
+ progress_line=chunk.get('progress'),
90
+ total_lines=chunk.get('total'),
91
+ spinner_state=spinner_state,
92
+ emoji="🔍" if chunk.get("progress") else "💡"
93
+ )
94
+ else:
95
+ if isinstance(chunk, dict) and 'content' in chunk:
96
+ print(chunk['content'], end="")
97
+ else:
98
+ print(chunk, end="")
99
+ asyncio.run(run_and_print())
100
+
101
+ if __name__ == "__main__":
102
+ main()