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.
- {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/METADATA +12 -8
- {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/RECORD +52 -25
- swarm/blueprints/README.md +19 -18
- swarm/blueprints/blueprint_audit_status.json +1 -1
- swarm/blueprints/chatbot/blueprint_chatbot.py +160 -72
- swarm/blueprints/codey/README.md +88 -8
- swarm/blueprints/codey/blueprint_codey.py +1116 -210
- swarm/blueprints/codey/codey_cli.py +10 -0
- swarm/blueprints/codey/session_logs/session_2025-04-19T01-15-31.md +17 -0
- swarm/blueprints/codey/session_logs/session_2025-04-19T01-16-03.md +17 -0
- swarm/blueprints/common/operation_box_utils.py +83 -0
- swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py +21 -298
- swarm/blueprints/divine_code/blueprint_divine_code.py +182 -9
- swarm/blueprints/django_chat/blueprint_django_chat.py +150 -24
- swarm/blueprints/echocraft/blueprint_echocraft.py +142 -13
- swarm/blueprints/geese/README.md +97 -0
- swarm/blueprints/geese/blueprint_geese.py +677 -93
- swarm/blueprints/geese/geese_cli.py +102 -0
- swarm/blueprints/jeeves/blueprint_jeeves.py +712 -0
- swarm/blueprints/jeeves/jeeves_cli.py +55 -0
- swarm/blueprints/mcp_demo/blueprint_mcp_demo.py +109 -22
- swarm/blueprints/mission_improbable/blueprint_mission_improbable.py +172 -40
- swarm/blueprints/monkai_magic/blueprint_monkai_magic.py +79 -41
- swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py +82 -35
- swarm/blueprints/omniplex/blueprint_omniplex.py +56 -24
- swarm/blueprints/poets/blueprint_poets.py +141 -100
- swarm/blueprints/poets/poets_cli.py +23 -0
- swarm/blueprints/rue_code/README.md +8 -0
- swarm/blueprints/rue_code/blueprint_rue_code.py +188 -20
- swarm/blueprints/rue_code/rue_code_cli.py +43 -0
- swarm/blueprints/stewie/apps.py +12 -0
- swarm/blueprints/stewie/blueprint_family_ties.py +349 -0
- swarm/blueprints/stewie/models.py +19 -0
- swarm/blueprints/stewie/serializers.py +10 -0
- swarm/blueprints/stewie/settings.py +17 -0
- swarm/blueprints/stewie/urls.py +11 -0
- swarm/blueprints/stewie/views.py +26 -0
- swarm/blueprints/suggestion/blueprint_suggestion.py +54 -39
- swarm/blueprints/whinge_surf/README.md +22 -0
- swarm/blueprints/whinge_surf/__init__.py +1 -0
- swarm/blueprints/whinge_surf/blueprint_whinge_surf.py +565 -0
- swarm/blueprints/whinge_surf/whinge_surf_cli.py +99 -0
- swarm/blueprints/whiskeytango_foxtrot/blueprint_whiskeytango_foxtrot.py +66 -37
- swarm/blueprints/zeus/__init__.py +2 -0
- swarm/blueprints/zeus/apps.py +4 -0
- swarm/blueprints/zeus/blueprint_zeus.py +270 -0
- swarm/blueprints/zeus/zeus_cli.py +13 -0
- swarm/cli/async_input.py +65 -0
- swarm/cli/async_input_demo.py +32 -0
- {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/WHEEL +0 -0
- {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/entry_points.txt +0 -0
- {open_swarm-0.1.1745125933.dist-info → open_swarm-0.1.1745126277.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: open-swarm
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1745126277
|
4
4
|
Summary: Open Swarm: Orchestrating AI Agent Swarms with Django
|
5
5
|
Project-URL: Homepage, https://github.com/yourusername/open-swarm
|
6
6
|
Project-URL: Documentation, https://github.com/yourusername/open-swarm/blob/main/README.md
|
@@ -335,18 +335,22 @@ Open Swarm and its blueprints use a variety of environment variables for configu
|
|
335
335
|
| `DJANGO_CSRF_TRUSTED_ORIGINS` | Comma-separated trusted origins for CSRF protection | `http://localhost:8000,...`|
|
336
336
|
| `ENABLE_ADMIN` | Enable admin web interface | `false` |
|
337
337
|
| `ENABLE_API_AUTH` | Require API authentication | `true` |
|
338
|
+
| `SWARM_COMMAND_TIMEOUT` | Timeout in seconds for all shell commands run by blueprints | Optional (recommended) |
|
338
339
|
|
339
340
|
#### Blueprint/Tool-Specific Variables
|
340
341
|
- Some blueprints and MCP tools may require additional env vars (e.g., Google API keys, Slack tokens, etc.).
|
341
342
|
- Refer to the blueprint's docstring or config for details.
|
342
343
|
|
343
|
-
####
|
344
|
-
|
345
|
-
export
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
344
|
+
#### Timeout Configuration
|
345
|
+
- **SWARM_COMMAND_TIMEOUT**: Controls the maximum time (in seconds) a shell command is allowed to run in any blueprint. If not set, defaults to 60 seconds for most commands, 120 seconds for cloud CLI tools (AWS, Fly.io, Vercel).
|
346
|
+
- Set via environment variable: `export SWARM_COMMAND_TIMEOUT=90`
|
347
|
+
- If a command exceeds the timeout, a clear error message will be shown in the CLI or operation box.
|
348
|
+
- Applies to all blueprints and CLI tools that execute shell commands.
|
349
|
+
- To override for a single run: `SWARM_COMMAND_TIMEOUT=30 swarm-cli run ...`
|
350
|
+
|
351
|
+
#### Test Timeouts
|
352
|
+
- All integration tests have a global timeout (30s) via pytest-timeout.
|
353
|
+
- Some tests have explicit per-test timeouts (see test source for details).
|
350
354
|
|
351
355
|
---
|
352
356
|
|
@@ -13,40 +13,67 @@ swarm/urls.py,sha256=9eRQWsB-Vs3Nmes4mtlZtk_Rvuixf4Y9uwrX9dVQ9Is,3292
|
|
13
13
|
swarm/util.py,sha256=G4x2hXopHhB7IdGCkUXGoykYWyiICnjxg7wcr-WqL8I,4644
|
14
14
|
swarm/wsgi.py,sha256=REM_u4HpMCkO0ddrOUXgtY-ITL-VTbRB1-WHvFJAtAU,408
|
15
15
|
swarm/agent/__init__.py,sha256=YESGu_UXEBxrlQwghodUMN0vmXZDwWMU7DclCUvoklA,104
|
16
|
-
swarm/blueprints/README.md,sha256=
|
17
|
-
swarm/blueprints/blueprint_audit_status.json,sha256
|
18
|
-
swarm/blueprints/chatbot/blueprint_chatbot.py,sha256=
|
16
|
+
swarm/blueprints/README.md,sha256=scDx32t4UBC3TLgNzUe0dRmlcC2yJH-yY4Pxde1n5_A,9257
|
17
|
+
swarm/blueprints/blueprint_audit_status.json,sha256=6uv6_M8WU5VGr1GhG49_p0-iHHRoi3iDLo-sy5GmuS8,1852
|
18
|
+
swarm/blueprints/chatbot/blueprint_chatbot.py,sha256=Fuy_kPQUaZtIKoM01aWGjieak1zGTxI8VBVbi-TzHH0,14441
|
19
19
|
swarm/blueprints/chatbot/templates/chatbot/chatbot.html,sha256=REFnqNg0EHsXxAUfaCJe1YgOKiV_umBXuC6y8veF5CU,1568
|
20
20
|
swarm/blueprints/codey/CODEY.md,sha256=JxGcR0INH0dLk_q4ua1D0YdvX99szyESsbbs4dIy5Sc,742
|
21
|
-
swarm/blueprints/codey/README.md,sha256=
|
22
|
-
swarm/blueprints/codey/blueprint_codey.py,sha256=
|
23
|
-
swarm/blueprints/codey/codey_cli.py,sha256=
|
21
|
+
swarm/blueprints/codey/README.md,sha256=_wQ8MuEFj4cMmKaJYfgvoepkCaF-zIZYfdhAyhvmzAg,7369
|
22
|
+
swarm/blueprints/codey/blueprint_codey.py,sha256=u3VvUSPDu7hULMGpouVNOwNslwDtNFPSUofV8mUDxu8,61216
|
23
|
+
swarm/blueprints/codey/codey_cli.py,sha256=I_xvePNqTdqeNmFAuI3blgvQM6u40nh7u-wah8dB7yM,6750
|
24
24
|
swarm/blueprints/codey/instructions.md,sha256=XMvJngQ23vl7xJQx-Sp5UIME2-JQyyxeZFFtIuOtTOI,1209
|
25
|
-
swarm/blueprints/
|
25
|
+
swarm/blueprints/codey/session_logs/session_2025-04-19T01-15-31.md,sha256=IRzOdr9wisTQYOc0FZQi-4zlX_vickQrq900SNZ9dPU,270
|
26
|
+
swarm/blueprints/codey/session_logs/session_2025-04-19T01-16-03.md,sha256=2GQcj850IZMz3Fqvet3dynXuTom4ZT7VwoxwWMhgTH8,270
|
27
|
+
swarm/blueprints/common/operation_box_utils.py,sha256=YYntqT6p44r7hxq5GLOS0gyOuInmhvWo1hp6-qKk36Q,3087
|
28
|
+
swarm/blueprints/digitalbutlers/blueprint_digitalbutlers.py,sha256=AnMjzfIDIj771NLc20Am2OSMqARoTiX8me2TG3-oQDY,1028
|
26
29
|
swarm/blueprints/divine_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
30
|
swarm/blueprints/divine_code/apps.py,sha256=k615JHdfOuo_GwfVbC7ah8X9OblkAL2XWm9aLBjmMyY,306
|
28
|
-
swarm/blueprints/divine_code/blueprint_divine_code.py,sha256=
|
31
|
+
swarm/blueprints/divine_code/blueprint_divine_code.py,sha256=mHe-8h9TNiPzPcAxeLG5FLED9Cf29ffoiuXWCKyKnOc,27285
|
29
32
|
swarm/blueprints/django_chat/apps.py,sha256=rn1Eu11c4zZ6DYZeFb6AkCDMoM_dcQTzeNwW-IxXpCI,200
|
30
|
-
swarm/blueprints/django_chat/blueprint_django_chat.py,sha256=
|
33
|
+
swarm/blueprints/django_chat/blueprint_django_chat.py,sha256=rCxfYCcSNEKnzST0Zrq_Y9XHOwnURfbCK3FON5P6F9k,11544
|
31
34
|
swarm/blueprints/django_chat/urls.py,sha256=TTTF3pgymvCYbuxpwi4WRBPv8ftQNH4pEoURT8sEVAg,147
|
32
35
|
swarm/blueprints/django_chat/views.py,sha256=MUKjXXjXsq8jMZtAb4RR9g2mEYrwFemN6Bqxpeyi7p4,1299
|
33
36
|
swarm/blueprints/django_chat/templates/django_chat/django_chat_webpage.html,sha256=wAEOI4Wg0JJ8drXaOcr2Pel6lW3JSHmyIpbocLS5tI8,1649
|
34
|
-
swarm/blueprints/echocraft/blueprint_echocraft.py,sha256=
|
37
|
+
swarm/blueprints/echocraft/blueprint_echocraft.py,sha256=1ttrbOWxGTerlip_lgLzCoCmzPJhDdfEIN6FoxnsP2A,16597
|
35
38
|
swarm/blueprints/flock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
|
-
swarm/blueprints/geese/
|
37
|
-
swarm/blueprints/
|
39
|
+
swarm/blueprints/geese/README.md,sha256=o5tgiL7cK0m0JdHxMuZ-u8iKuzVO7EQKkuW4gP2mkHU,3699
|
40
|
+
swarm/blueprints/geese/blueprint_geese.py,sha256=fSf8pmXOCDrW4FQ2S_yX9L62xJYzxntgdlkWY55RjvI,37255
|
41
|
+
swarm/blueprints/geese/geese_cli.py,sha256=JNx2Te4F-HvYnCldXOtzDRKyNznse2N8_LXPlpZ_vbk,5354
|
42
|
+
swarm/blueprints/jeeves/blueprint_jeeves.py,sha256=5pr5Wy3Apf1_hxG57BHuqX4ZtfLcMRbU-98PDdVwO1k,33790
|
43
|
+
swarm/blueprints/jeeves/jeeves_cli.py,sha256=n_2CeiqPjwPA-xnRKXeizO6A1WtxpsI06HsWaIz_51M,2630
|
44
|
+
swarm/blueprints/mcp_demo/blueprint_mcp_demo.py,sha256=036QxkuxvX7cSgX1MernL0qicbsAXO3HXDiOqZKznV4,21341
|
38
45
|
swarm/blueprints/messenger/templates/messenger/messenger.html,sha256=izuFtFn40Gm7M4gSUAUT5CIezjBjmNv2w4_fwSlv7VA,2323
|
39
|
-
swarm/blueprints/mission_improbable/blueprint_mission_improbable.py,sha256=
|
40
|
-
swarm/blueprints/monkai_magic/blueprint_monkai_magic.py,sha256=
|
41
|
-
swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py,sha256=
|
42
|
-
swarm/blueprints/omniplex/blueprint_omniplex.py,sha256=
|
43
|
-
swarm/blueprints/poets/blueprint_poets.py,sha256=
|
46
|
+
swarm/blueprints/mission_improbable/blueprint_mission_improbable.py,sha256=hvwbg6LwaVKnH-fzQdyg7zTvDC5Get3sVt8xx82WpZc,21074
|
47
|
+
swarm/blueprints/monkai_magic/blueprint_monkai_magic.py,sha256=nI4YNDndJN44TPh3rr7WrNBbK2I9x2xIU98GepzQe-0,18636
|
48
|
+
swarm/blueprints/nebula_shellz/blueprint_nebula_shellz.py,sha256=DhHzsHQS98h7Of62g9eSasSWis2MK4R3x5JhNT3K1Z0,14101
|
49
|
+
swarm/blueprints/omniplex/blueprint_omniplex.py,sha256=SNjMXprI_kvJ9yxihsVqroDt627R17U3rYPYXljR_pk,15275
|
50
|
+
swarm/blueprints/poets/blueprint_poets.py,sha256=dw7oQrsOnnfF4EApPbdL7d3azM7V5LXR3USLBWhq--w,29031
|
51
|
+
swarm/blueprints/poets/poets_cli.py,sha256=DRAXxRGJZhFZaGhvfBxMe3qlxnjCClKlYfLIE6cUiuI,890
|
52
|
+
swarm/blueprints/rue_code/README.md,sha256=j9EXCkimV1yY5qJHLgcH_JGhQtV9SefZGZCzDRdaprQ,302
|
44
53
|
swarm/blueprints/rue_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
45
|
-
swarm/blueprints/rue_code/blueprint_rue_code.py,sha256=
|
46
|
-
swarm/blueprints/
|
54
|
+
swarm/blueprints/rue_code/blueprint_rue_code.py,sha256=nxR9nHYbB_Pp5Pft1VwK4-ktiWZHMsiMywpmdGPZyCc,20937
|
55
|
+
swarm/blueprints/rue_code/rue_code_cli.py,sha256=E760-LOYv2Uw0VoLTHEEK7LdhaG6oSflJfsaxV7S1v8,2194
|
56
|
+
swarm/blueprints/stewie/apps.py,sha256=D_Nvpx7SPdUgtE8KaaMmlEDghUwadMmSPI-aGJlnFos,341
|
57
|
+
swarm/blueprints/stewie/blueprint_family_ties.py,sha256=0LPsHLPg6bXJ5Tia7uezdF0mNddWaGgg3x2kIBvs0TE,17297
|
58
|
+
swarm/blueprints/stewie/models.py,sha256=C3_okdVVYuu9xOpoKRsaLoGrM2775cS_cU4UKYAkJ9s,903
|
59
|
+
swarm/blueprints/stewie/serializers.py,sha256=YFxiMYJcQuI1KkBXEcfefPDZkU_cB-J_XJfc1OPROhg,383
|
60
|
+
swarm/blueprints/stewie/settings.py,sha256=Q3aB1KfxyKrxSvtoFJdXQsuqb99Wod75xW0xJXyQ9xE,443
|
61
|
+
swarm/blueprints/stewie/urls.py,sha256=5hWn-75wdmyaFTViV5-8vF1aH0c3XnyZMKg_9CP_39I,308
|
62
|
+
swarm/blueprints/stewie/views.py,sha256=FbPkDNlFEixtRFbSpkr51IyJ28FRkXa1W5xyO_KeXH0,1081
|
63
|
+
swarm/blueprints/suggestion/blueprint_suggestion.py,sha256=zKQUybUYcM8TD9UBzVDZMZ-efizbk2ZwBXtsW012Gn4,11647
|
64
|
+
swarm/blueprints/whinge_surf/README.md,sha256=tXV2vVHAs3VKdqjDSzxVCz44xCRt8mjxVEuQGCBKhio,953
|
65
|
+
swarm/blueprints/whinge_surf/__init__.py,sha256=N-BmmHagDPSdh3UCNqFDJPk4LKtPIqsttTANj0tQIXw,32
|
66
|
+
swarm/blueprints/whinge_surf/blueprint_whinge_surf.py,sha256=LJSNYuASGXz0DakedGb7uHVi41a7EievawcxD5j4d-Y,23319
|
67
|
+
swarm/blueprints/whinge_surf/whinge_surf_cli.py,sha256=t9OJWNlcFLGcGH9t6jhE-6EGjPsRgRedVoXrywC1www,4101
|
47
68
|
swarm/blueprints/whiskeytango_foxtrot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
48
69
|
swarm/blueprints/whiskeytango_foxtrot/apps.py,sha256=V1QKvyb2Vz-EtDNhhNe4tw2W9LYhNDuiaIq_fAU4ilw,334
|
49
|
-
swarm/blueprints/whiskeytango_foxtrot/blueprint_whiskeytango_foxtrot.py,sha256=
|
70
|
+
swarm/blueprints/whiskeytango_foxtrot/blueprint_whiskeytango_foxtrot.py,sha256=6QbSQxE26fRDNGSQZKyS8VK1_C6WGPqOsZc8YRDC76k,18352
|
71
|
+
swarm/blueprints/zeus/__init__.py,sha256=jeKj20cgtIU59RfhOnLaMTPPAyqzrAHOVXNrN40RlI4,94
|
72
|
+
swarm/blueprints/zeus/apps.py,sha256=HZ7rLf_HANy4yJtCv9bfY_2DZUg-N-gl8xXj8EJ4cTs,99
|
73
|
+
swarm/blueprints/zeus/blueprint_zeus.py,sha256=tCYpS07ZAQP3XyzZBFLgT_hzBzH2o_PY933fQWvXQ8A,13408
|
74
|
+
swarm/blueprints/zeus/zeus_cli.py,sha256=7gKqT9Vp6VQsqphaJZj-Cw91q_ZIlD_WBbVsWhNxPrw,460
|
75
|
+
swarm/cli/async_input.py,sha256=6Is9KRc7zwe9VPBeVuRleqKg_kc6aDU5eFmby0NOTow,2297
|
76
|
+
swarm/cli/async_input_demo.py,sha256=mKn1ffQbiCBWshvlCXES78ASbVUi5kprYejbImR_QH4,1005
|
50
77
|
swarm/core/agent_utils.py,sha256=exKnbJEm1VRL270x6XqQXHtJhqD8ogY3ZBIGZO_tYUE,552
|
51
78
|
swarm/core/blueprint_base.py,sha256=ZXfgCqaAVprML0KS3njHNxgldrwOCSGZrcI-fj7HyZs,40178
|
52
79
|
swarm/core/blueprint_discovery.py,sha256=UyJuBq_u7KLQC2_I9KGioX-Bcbj2-qjhKke4ensk_Xw,5622
|
@@ -271,8 +298,8 @@ swarm/views/message_views.py,sha256=sDUnXyqKXC8WwIIMAlWf00s2_a2T9c75Na5FvYMJwBM,
|
|
271
298
|
swarm/views/model_views.py,sha256=aAbU4AZmrOTaPeKMWtoKK7FPYHdaN3Zbx55JfKzYTRY,2937
|
272
299
|
swarm/views/utils.py,sha256=8Usc0g0L0NPegNAyY20tJBNBy-JLwODf4VmxV0yUtpw,3627
|
273
300
|
swarm/views/web_views.py,sha256=T1CKe-Nyv1C8aDt6QFTGWo_dkH7ojWAvS_QW9mZnZp0,7371
|
274
|
-
open_swarm-0.1.
|
275
|
-
open_swarm-0.1.
|
276
|
-
open_swarm-0.1.
|
277
|
-
open_swarm-0.1.
|
278
|
-
open_swarm-0.1.
|
301
|
+
open_swarm-0.1.1745126277.dist-info/METADATA,sha256=mL5x1if5U2sZ_NfcbQOORnBV5TO-NS39NGzR1ZPw_tw,27659
|
302
|
+
open_swarm-0.1.1745126277.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
303
|
+
open_swarm-0.1.1745126277.dist-info/entry_points.txt,sha256=fo28d0_zJrytRsh8QqkdlWQT_9lyAwYUx1WuSTDI3HM,177
|
304
|
+
open_swarm-0.1.1745126277.dist-info/licenses/LICENSE,sha256=BU9bwRlnOt_JDIb6OT55Q4leLZx9RArDLTFnlDIrBEI,1062
|
305
|
+
open_swarm-0.1.1745126277.dist-info/RECORD,,
|
swarm/blueprints/README.md
CHANGED
@@ -6,24 +6,25 @@ This directory contains example blueprints for the Open Swarm framework, showcas
|
|
6
6
|
|
7
7
|
These blueprints have been updated to use the `BlueprintBase` class, `openai-agents` library conventions (like `Agent`, `@function_tool`, agent-as-tool delegation), and standardized configuration loading.
|
8
8
|
|
9
|
-
| Blueprint Name | CLI (`uv run ...`) Example Instruction | What it Demonstrates | Key Features | MCP Servers Used (Examples) |
|
10
|
-
|
11
|
-
| **EchoCraft** | `--instruction "Repeat this message"` | Simplest blueprint, direct input echo | Basic `BlueprintBase` structure, Agent `process` override | None |
|
12
|
-
| **Suggestion** | `--instruction "Topic: AI Ethics"` | Generating structured JSON output | Agent `output_type=TypedDict`, JSON mode | None |
|
13
|
-
| **Chatbot** | `--instruction "Tell me a joke"` | Basic single-agent conversation | Standard `Agent` interaction with LLM | None |
|
14
|
-
| **BurntNoodles** | `--instruction "Check git status"` | Coordinating Git & testing tasks via function tools & agent delegation | `@function_tool` for CLI commands, Agent-as-tool delegation | None |
|
15
|
-
| **RueCode** | `--instruction "Refactor this python code..."` | Multi-agent code generation/refactoring workflow | Agent-as-tool delegation, specialized agent roles (Coordinator, Code, etc.) | memory |
|
16
|
-
| **NebulaShellzzar** | `--instruction "List files in /tmp"` | Matrix-themed sysadmin/coding tasks with delegation | Agent-as-tool delegation, `@function_tool` for shell/code analysis | memory |
|
17
|
-
| **DigitalButlers** | `--instruction "Search for nearby restaurants"` | Delegating tasks requiring specific MCPs (search, home automation) | Agent-as-tool delegation, MCP usage by specialist agents | duckduckgo-search, home-assistant |
|
18
|
-
| **DilbotUniverse (SQLite)** | `--instruction "Start the SDLC"` | Comedic SDLC simulation, instructions loaded from SQLite | Agent-as-tool delegation, SQLite integration for dynamic prompts | sqlite |
|
19
|
-
| **
|
20
|
-
| **MissionImprobable (SQLite)** | `--instruction "Use RollinFumble to run 'pwd'"` | Spy-themed ops, instructions from SQLite, multi-level delegation | Agent-as-tool delegation, SQLite integration, MCP usage (fs, shell, mem) | memory, filesystem, mcp-shell |
|
21
|
-
| **WhiskeyTangoFoxtrot**
|
22
|
-
| **
|
23
|
-
| **
|
24
|
-
| **
|
25
|
-
| **
|
26
|
-
| **
|
9
|
+
| Blueprint Name | CLI (`uv run ...`) Example Instruction | What it Demonstrates | Key Features | Tags | MCP Servers Used (Examples) |
|
10
|
+
|---------------------------------|-------------------------------------------------------|--------------------------------------------------------------------------------|---------------------------------------------------------------------------|-----------------------|-----------------------------|
|
11
|
+
| **EchoCraft** | `--instruction "Repeat this message"` | Simplest blueprint, direct input echo | Basic `BlueprintBase` structure, Agent `process` override | | None |
|
12
|
+
| **Suggestion** | `--instruction "Topic: AI Ethics"` | Generating structured JSON output | Agent `output_type=TypedDict`, JSON mode | | None |
|
13
|
+
| **Chatbot** | `--instruction "Tell me a joke"` | Basic single-agent conversation | Standard `Agent` interaction with LLM | | None |
|
14
|
+
| **BurntNoodles** | `--instruction "Check git status"` | Coordinating Git & testing tasks via function tools & agent delegation | `@function_tool` for CLI commands, Agent-as-tool delegation | | None |
|
15
|
+
| **RueCode** | `--instruction "Refactor this python code..."` | Multi-agent code generation/refactoring workflow | Agent-as-tool delegation, specialized agent roles (Coordinator, Code, etc.) | software-development | memory |
|
16
|
+
| **NebulaShellzzar** | `--instruction "List files in /tmp"` | Matrix-themed sysadmin/coding tasks with delegation | Agent-as-tool delegation, `@function_tool` for shell/code analysis | | memory |
|
17
|
+
| **DigitalButlers** | `--instruction "Search for nearby restaurants"` | Delegating tasks requiring specific MCPs (search, home automation) | Agent-as-tool delegation, MCP usage by specialist agents | | duckduckgo-search, home-assistant |
|
18
|
+
| **DilbotUniverse (SQLite)** | `--instruction "Start the SDLC"` | Comedic SDLC simulation, instructions loaded from SQLite | Agent-as-tool delegation, SQLite integration for dynamic prompts | | sqlite |
|
19
|
+
| **Stewie** | `--instruction "Create WP post titled 'Hello'..."` | Coordinating WordPress operations via MCP | Agent-as-tool delegation, specialized agent using specific MCP (WP) | | server-wp-mcp |
|
20
|
+
| **MissionImprobable (SQLite)** | `--instruction "Use RollinFumble to run 'pwd'"` | Spy-themed ops, instructions from SQLite, multi-level delegation | Agent-as-tool delegation, SQLite integration, MCP usage (fs, shell, mem) | | memory, filesystem, mcp-shell |
|
21
|
+
| **WhiskeyTangoFoxtrot** | `--instruction "Find free vector DBs"` | Hierarchical agents tracking services using DB & web search | Multi-level agent delegation, SQLite, various search/scrape/doc MCPs | | sqlite, brave-search, mcp-npx-fetch, mcp-doc-forge, filesystem |
|
22
|
+
| **Zeus** | `--instruction "Design user auth API"` | Replacement for DivineOps/DivineCode/DivineAss, large-scale SW dev coordination (Design, Implement, DB, DevOps, Docs) | Complex delegation, wide range of MCP usage (search, shell, db, fs...) | software-development | memory, filesystem, mcp-shell, sqlite, sequential-thinking, brave-search |
|
23
|
+
| **WhingeSurf** | `--instruction "Analyze blueprint code"` | Self-analyzing/auto-improving blueprint, meta-agent demo | Code analysis, self-improvement, UX/ANSI output, meta-agent logic | software-development | None |
|
24
|
+
| **Gaggle** | `--instruction "Write story: cat library"` | Collaborative story writing (Planner, Writer, Editor) | Agent-as-tool delegation, function tools for writing steps | | None |
|
25
|
+
| **MonkaiMagic** | `--instruction "List AWS S3 buckets"` | Cloud operations (AWS, Fly, Vercel) via direct CLI function tools | `@function_tool` for external CLIs, agent-as-tool delegation | | mcp-shell (for Sandy) |
|
26
|
+
| **UnapologeticPress (SQLite)** | `--instruction "Write poem: city rain"` | Collaborative poetry writing by distinct "poet" agents, SQLite instructions | Agent-as-tool (all-to-all), SQLite, broad MCP usage | | Various (see blueprint) |
|
27
|
+
| **Omniplex** | `--instruction "Use filesystem to read README.md"` | Dynamically routes tasks based on MCP server type (npx, uvx, other) | Dynamic agent/tool creation based on available MCPs | | Dynamic (all available) |
|
27
28
|
|
28
29
|
## WIP / Needs Refactoring
|
29
30
|
|
@@ -11,7 +11,6 @@
|
|
11
11
|
{"name": "dilbot", "status": "unknown", "notes": "Needs audit"},
|
12
12
|
{"name": "divine_code", "status": "unknown", "notes": "Needs audit"},
|
13
13
|
{"name": "django_chat", "status": "unknown", "notes": "Needs audit"},
|
14
|
-
{"name": "family_ties", "status": "unknown", "notes": "Needs audit"},
|
15
14
|
{"name": "flock", "status": "unknown", "notes": "Needs audit"},
|
16
15
|
{"name": "gaggle", "status": "unknown", "notes": "Needs audit"},
|
17
16
|
{"name": "gatcha", "status": "unknown", "notes": "Needs audit"},
|
@@ -21,6 +20,7 @@
|
|
21
20
|
{"name": "nebula_shellz", "status": "unknown", "notes": "Needs audit"},
|
22
21
|
{"name": "omniplex", "status": "unknown", "notes": "Needs audit"},
|
23
22
|
{"name": "shell_demo", "status": "unknown", "notes": "Needs audit"},
|
23
|
+
{"name": "stewie", "status": "unknown", "notes": "Needs audit"},
|
24
24
|
{"name": "unapologetic_press", "status": "unknown", "notes": "Needs audit"},
|
25
25
|
{"name": "whiskeytango_foxtrot", "status": "unknown", "notes": "Needs audit"}
|
26
26
|
]
|
@@ -7,18 +7,6 @@ import sys
|
|
7
7
|
from typing import Dict, Any, List, ClassVar, Optional
|
8
8
|
import argparse
|
9
9
|
|
10
|
-
# Set logging to WARNING by default unless SWARM_DEBUG=1
|
11
|
-
if not os.environ.get("SWARM_DEBUG"):
|
12
|
-
logging.basicConfig(level=logging.WARNING)
|
13
|
-
else:
|
14
|
-
logging.basicConfig(level=logging.DEBUG)
|
15
|
-
|
16
|
-
# Set logging to WARNING by default unless SWARM_DEBUG=1
|
17
|
-
if not os.environ.get("SWARM_DEBUG"):
|
18
|
-
logging.basicConfig(level=logging.WARNING)
|
19
|
-
else:
|
20
|
-
logging.basicConfig(level=logging.DEBUG)
|
21
|
-
|
22
10
|
# Set logging to WARNING by default unless SWARM_DEBUG=1
|
23
11
|
if not os.environ.get("SWARM_DEBUG"):
|
24
12
|
logging.basicConfig(level=logging.WARNING)
|
@@ -30,40 +18,22 @@ project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..
|
|
30
18
|
src_path = os.path.join(project_root, 'src')
|
31
19
|
if src_path not in sys.path: sys.path.insert(0, src_path)
|
32
20
|
|
33
|
-
from
|
34
|
-
from
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
def __init__(self, func, name):
|
42
|
-
self.func = func
|
43
|
-
self.name = name
|
44
|
-
except ImportError:
|
45
|
-
class MCPServer:
|
46
|
-
pass
|
47
|
-
from agents import Agent, function_tool
|
48
|
-
try:
|
49
|
-
from agents.mcp import MCPServer as MCPServer2
|
50
|
-
except ImportError:
|
51
|
-
MCPServer2 = MCPServer
|
52
|
-
from agents.models.interface import Model
|
53
|
-
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
54
|
-
from openai import AsyncOpenAI
|
55
|
-
from swarm.core.blueprint_base import BlueprintBase
|
56
|
-
except ImportError as e:
|
57
|
-
print(f"ERROR: Import failed in ChatbotBlueprint: {e}. Check dependencies.")
|
58
|
-
print(f"sys.path: {sys.path}")
|
59
|
-
sys.exit(1)
|
21
|
+
from agents import Agent, function_tool
|
22
|
+
from agents.mcp import MCPServer
|
23
|
+
from agents.models.interface import Model
|
24
|
+
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
25
|
+
from openai import AsyncOpenAI
|
26
|
+
from swarm.core.blueprint_base import BlueprintBase
|
27
|
+
from swarm.core.blueprint_ux import BlueprintUXImproved
|
28
|
+
from agents import Runner
|
60
29
|
|
61
30
|
logger = logging.getLogger(__name__)
|
62
31
|
|
63
32
|
# --- Define the Blueprint ---
|
64
33
|
class ChatbotBlueprint(BlueprintBase):
|
65
|
-
def __init__(self, blueprint_id: str
|
66
|
-
super().__init__(blueprint_id, config_path=config_path, **kwargs)
|
34
|
+
def __init__(self, blueprint_id: str = "chatbot", config=None, config_path=None, **kwargs):
|
35
|
+
super().__init__(blueprint_id, config=config, config_path=config_path, **kwargs)
|
36
|
+
self.ux = BlueprintUXImproved(style="serious")
|
67
37
|
class DummyLLM:
|
68
38
|
def chat_completion_stream(self, messages, **_):
|
69
39
|
class DummyStream:
|
@@ -93,18 +63,15 @@ class ChatbotBlueprint(BlueprintBase):
|
|
93
63
|
_openai_client_cache: Dict[str, AsyncOpenAI] = {}
|
94
64
|
_model_instance_cache: Dict[str, Model] = {}
|
95
65
|
|
96
|
-
|
97
|
-
class PatchedFunctionTool:
|
98
|
-
def __init__(self, func, name):
|
99
|
-
self.func = func
|
100
|
-
self.name = name
|
101
|
-
|
66
|
+
@function_tool
|
102
67
|
def read_file(path: str) -> str:
|
103
68
|
try:
|
104
69
|
with open(path, 'r') as f:
|
105
70
|
return f.read()
|
106
71
|
except Exception as e:
|
107
72
|
return f"ERROR: {e}"
|
73
|
+
|
74
|
+
@function_tool
|
108
75
|
def write_file(path: str, content: str) -> str:
|
109
76
|
try:
|
110
77
|
with open(path, 'w') as f:
|
@@ -112,22 +79,37 @@ class ChatbotBlueprint(BlueprintBase):
|
|
112
79
|
return "OK: file written"
|
113
80
|
except Exception as e:
|
114
81
|
return f"ERROR: {e}"
|
82
|
+
|
83
|
+
@function_tool
|
115
84
|
def list_files(directory: str = '.') -> str:
|
116
85
|
try:
|
117
86
|
return '\n'.join(os.listdir(directory))
|
118
87
|
except Exception as e:
|
119
88
|
return f"ERROR: {e}"
|
89
|
+
|
90
|
+
@function_tool
|
120
91
|
def execute_shell_command(command: str) -> str:
|
121
92
|
import subprocess
|
93
|
+
import os
|
94
|
+
import logging
|
95
|
+
logger = logging.getLogger(__name__)
|
96
|
+
logger.info(f"Executing shell command: {command}")
|
122
97
|
try:
|
123
|
-
|
124
|
-
|
98
|
+
timeout = int(os.getenv("SWARM_COMMAND_TIMEOUT", "60"))
|
99
|
+
result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=timeout)
|
100
|
+
output = f"Exit Code: {result.returncode}\n"
|
101
|
+
if result.stdout:
|
102
|
+
output += f"STDOUT:\n{result.stdout}\n"
|
103
|
+
if result.stderr:
|
104
|
+
output += f"STDERR:\n{result.stderr}\n"
|
105
|
+
logger.info(f"Command finished. Exit Code: {result.returncode}")
|
106
|
+
return output.strip()
|
107
|
+
except subprocess.TimeoutExpired:
|
108
|
+
logger.error(f"Command timed out: {command}")
|
109
|
+
return f"Error: Command timed out after {os.getenv('SWARM_COMMAND_TIMEOUT', '60')} seconds."
|
125
110
|
except Exception as e:
|
126
|
-
|
127
|
-
|
128
|
-
write_file_tool = PatchedFunctionTool(write_file, 'write_file')
|
129
|
-
list_files_tool = PatchedFunctionTool(list_files, 'list_files')
|
130
|
-
execute_shell_command_tool = PatchedFunctionTool(execute_shell_command, 'execute_shell_command')
|
111
|
+
logger.error(f"Error executing command '{command}': {e}", exc_info=True)
|
112
|
+
return f"Error executing command: {e}"
|
131
113
|
|
132
114
|
# --- Model Instantiation Helper --- (Standard helper)
|
133
115
|
def _get_model_instance(self, profile_name: str) -> Model:
|
@@ -179,34 +161,128 @@ You are a helpful and friendly chatbot. Respond directly to the user's input in
|
|
179
161
|
name="Chatbot",
|
180
162
|
model=model_instance,
|
181
163
|
instructions=chatbot_instructions,
|
182
|
-
tools=[self.
|
164
|
+
tools=[self.read_file, self.write_file, self.list_files, self.execute_shell_command],
|
183
165
|
mcp_servers=mcp_servers # Pass along, though likely unused
|
184
166
|
)
|
185
167
|
|
186
168
|
logger.debug("Chatbot agent created.")
|
187
169
|
return chatbot_agent
|
188
170
|
|
189
|
-
async def run(self, messages: List[Dict[str, Any]], **kwargs)
|
171
|
+
async def run(self, messages: List[Dict[str, Any]], **kwargs):
|
190
172
|
"""Main execution entry point for the Chatbot blueprint."""
|
191
173
|
logger.info("ChatbotBlueprint run method called.")
|
192
174
|
instruction = messages[-1].get("content", "") if messages else ""
|
193
|
-
async for chunk in self._run_non_interactive(instruction, **kwargs):
|
194
|
-
yield chunk
|
195
|
-
logger.info("ChatbotBlueprint run method finished.")
|
196
|
-
|
197
|
-
async def _run_non_interactive(self, instruction: str, **kwargs) -> Any:
|
198
|
-
mcp_servers = kwargs.get("mcp_servers", [])
|
199
|
-
agent = self.create_starting_agent(mcp_servers=mcp_servers)
|
200
175
|
from agents import Runner
|
201
|
-
|
202
|
-
|
176
|
+
spinner_idx = 0
|
177
|
+
start_time = time.time()
|
178
|
+
spinner_yield_interval = 1.0 # seconds
|
179
|
+
last_spinner_time = start_time
|
180
|
+
yielded_spinner = False
|
181
|
+
result_chunks = []
|
203
182
|
try:
|
204
|
-
|
205
|
-
|
183
|
+
runner_gen = Runner.run(self.create_starting_agent([]), instruction)
|
184
|
+
while True:
|
185
|
+
now = time.time()
|
186
|
+
try:
|
187
|
+
chunk = next(runner_gen)
|
188
|
+
result_chunks.append(chunk)
|
189
|
+
# If chunk is a final result, wrap and yield
|
190
|
+
if chunk and isinstance(chunk, dict) and "messages" in chunk:
|
191
|
+
content = chunk["messages"][0]["content"] if chunk["messages"] else ""
|
192
|
+
summary = self.ux.summary("Operation", len(result_chunks), {"instruction": instruction[:40]})
|
193
|
+
box = self.ux.ansi_emoji_box(
|
194
|
+
title="Chatbot Result",
|
195
|
+
content=content,
|
196
|
+
summary=summary,
|
197
|
+
params={"instruction": instruction[:40]},
|
198
|
+
result_count=len(result_chunks),
|
199
|
+
op_type="run",
|
200
|
+
status="success"
|
201
|
+
)
|
202
|
+
yield {"messages": [{"role": "assistant", "content": box}]}
|
203
|
+
else:
|
204
|
+
yield chunk
|
205
|
+
yielded_spinner = False
|
206
|
+
except StopIteration:
|
207
|
+
break
|
208
|
+
except Exception:
|
209
|
+
if now - last_spinner_time >= spinner_yield_interval:
|
210
|
+
taking_long = (now - start_time > 10)
|
211
|
+
spinner_msg = self.ux.spinner(spinner_idx, taking_long=taking_long)
|
212
|
+
yield {"messages": [{"role": "assistant", "content": spinner_msg}]}
|
213
|
+
spinner_idx += 1
|
214
|
+
last_spinner_time = now
|
215
|
+
yielded_spinner = True
|
216
|
+
if not result_chunks and not yielded_spinner:
|
217
|
+
yield {"messages": [{"role": "assistant", "content": self.ux.spinner(0)}]}
|
206
218
|
except Exception as e:
|
207
|
-
logger.error(f"Error during
|
219
|
+
logger.error(f"Error during Chatbot run: {e}", exc_info=True)
|
208
220
|
yield {"messages": [{"role": "assistant", "content": f"An error occurred: {e}"}]}
|
209
221
|
|
222
|
+
# --- Spinner and ANSI/emoji operation box for unified UX ---
|
223
|
+
from swarm.ux.ansi_box import ansi_box
|
224
|
+
from rich.console import Console
|
225
|
+
from rich.style import Style
|
226
|
+
from rich.text import Text
|
227
|
+
import threading
|
228
|
+
import time
|
229
|
+
|
230
|
+
class ChatbotSpinner:
|
231
|
+
FRAMES = [
|
232
|
+
"Generating.", "Generating..", "Generating...", "Running...",
|
233
|
+
"⠋ Generating...", "⠙ Generating...", "⠹ Generating...", "⠸ Generating...",
|
234
|
+
"⠼ Generating...", "⠴ Generating...", "⠦ Generating...", "⠧ Generating...",
|
235
|
+
"⠇ Generating...", "⠏ Generating...", "🤖 Generating...", "💡 Generating...", "✨ Generating..."
|
236
|
+
]
|
237
|
+
SLOW_FRAME = "⏳ Generating... Taking longer than expected"
|
238
|
+
INTERVAL = 0.12
|
239
|
+
SLOW_THRESHOLD = 10 # seconds
|
240
|
+
|
241
|
+
def __init__(self):
|
242
|
+
self._stop_event = threading.Event()
|
243
|
+
self._thread = None
|
244
|
+
self._start_time = None
|
245
|
+
self.console = Console()
|
246
|
+
|
247
|
+
def start(self):
|
248
|
+
self._stop_event.clear()
|
249
|
+
self._start_time = time.time()
|
250
|
+
self._thread = threading.Thread(target=self._spin, daemon=True)
|
251
|
+
self._thread.start()
|
252
|
+
|
253
|
+
def _spin(self):
|
254
|
+
idx = 0
|
255
|
+
while not self._stop_event.is_set():
|
256
|
+
elapsed = time.time() - self._start_time
|
257
|
+
if elapsed > self.SLOW_THRESHOLD:
|
258
|
+
txt = Text(self.SLOW_FRAME, style=Style(color="yellow", bold=True))
|
259
|
+
else:
|
260
|
+
frame = self.FRAMES[idx % len(self.FRAMES)]
|
261
|
+
txt = Text(frame, style=Style(color="cyan", bold=True))
|
262
|
+
self.console.print(txt, end="\r", soft_wrap=True, highlight=False)
|
263
|
+
time.sleep(self.INTERVAL)
|
264
|
+
idx += 1
|
265
|
+
self.console.print(" " * 40, end="\r") # Clear line
|
266
|
+
|
267
|
+
def stop(self, final_message="Done!"):
|
268
|
+
self._stop_event.set()
|
269
|
+
if self._thread:
|
270
|
+
self._thread.join()
|
271
|
+
self.console.print(Text(final_message, style=Style(color="green", bold=True)))
|
272
|
+
|
273
|
+
def print_operation_box(op_type, results, params=None, result_type="chat", taking_long=False):
|
274
|
+
emoji = "💬" if result_type == "chat" else "🔍"
|
275
|
+
style = 'success' if result_type == "chat" else 'default'
|
276
|
+
box_title = op_type if op_type else ("Chatbot Output" if result_type == "chat" else "Results")
|
277
|
+
summary_lines = []
|
278
|
+
count = len(results) if isinstance(results, list) else 0
|
279
|
+
summary_lines.append(f"Results: {count}")
|
280
|
+
if params:
|
281
|
+
for k, v in params.items():
|
282
|
+
summary_lines.append(f"{k.capitalize()}: {v}")
|
283
|
+
box_content = "\n".join(summary_lines + ["\n".join(map(str, results))])
|
284
|
+
ansi_box(box_title, box_content, count=count, params=params, style=style if not taking_long else 'warning', emoji=emoji)
|
285
|
+
|
210
286
|
# Standard Python entry point
|
211
287
|
if __name__ == "__main__":
|
212
288
|
import sys
|
@@ -225,8 +301,20 @@ if __name__ == "__main__":
|
|
225
301
|
|
226
302
|
blueprint = ChatbotBlueprint(blueprint_id="chatbot")
|
227
303
|
async def runner():
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
304
|
+
spinner = ChatbotSpinner()
|
305
|
+
spinner.start()
|
306
|
+
try:
|
307
|
+
all_results = []
|
308
|
+
async for chunk in blueprint._run_non_interactive(instruction):
|
309
|
+
msg = chunk["messages"][0]["content"]
|
310
|
+
if not msg.startswith("An error occurred:"):
|
311
|
+
all_results.append(msg)
|
312
|
+
finally:
|
313
|
+
spinner.stop()
|
314
|
+
print_operation_box(
|
315
|
+
op_type="Chatbot Output",
|
316
|
+
results=all_results,
|
317
|
+
params={"instruction": instruction},
|
318
|
+
result_type="chat"
|
319
|
+
)
|
232
320
|
asyncio.run(runner())
|