jarviscore-framework 0.3.0__tar.gz → 0.3.1__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.
Files changed (158) hide show
  1. {jarviscore_framework-0.3.0/jarviscore_framework.egg-info → jarviscore_framework-0.3.1}/PKG-INFO +61 -46
  2. jarviscore_framework-0.3.1/README.md +147 -0
  3. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/cloud_deployment_example.py +3 -3
  4. jarviscore_framework-0.3.0/jarviscore/data/examples/listeneragent_cognitive_discovery_example.py → jarviscore_framework-0.3.1/examples/customagent_cognitive_discovery_example.py +6 -6
  5. {jarviscore_framework-0.3.0/jarviscore/data → jarviscore_framework-0.3.1}/examples/fastapi_integration_example.py +4 -4
  6. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/__init__.py +8 -11
  7. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/cli/smoketest.py +1 -1
  8. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/core/mesh.py +9 -0
  9. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/examples/cloud_deployment_example.py +3 -3
  10. jarviscore_framework-0.3.1/jarviscore/data/examples/custom_profile_decorator.py +134 -0
  11. jarviscore_framework-0.3.1/jarviscore/data/examples/custom_profile_wrap.py +168 -0
  12. jarviscore_framework-0.3.0/examples/listeneragent_cognitive_discovery_example.py → jarviscore_framework-0.3.1/jarviscore/data/examples/customagent_cognitive_discovery_example.py +6 -6
  13. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1/jarviscore/data}/examples/fastapi_integration_example.py +4 -4
  14. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/docs/API_REFERENCE.md +32 -45
  15. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/docs/CHANGELOG.md +42 -0
  16. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/docs/CONFIGURATION.md +1 -1
  17. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/docs/CUSTOMAGENT_GUIDE.md +246 -153
  18. jarviscore_framework-0.3.1/jarviscore/docs/GETTING_STARTED.md +657 -0
  19. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/docs/TROUBLESHOOTING.md +1 -1
  20. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/docs/USER_GUIDE.md +8 -9
  21. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/integrations/fastapi.py +4 -4
  22. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/peer_client.py +29 -2
  23. jarviscore_framework-0.3.1/jarviscore/profiles/__init__.py +12 -0
  24. jarviscore_framework-0.3.0/jarviscore/profiles/listeneragent.py → jarviscore_framework-0.3.1/jarviscore/profiles/customagent.py +358 -292
  25. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1/jarviscore_framework.egg-info}/PKG-INFO +61 -46
  26. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/SOURCES.txt +4 -3
  27. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/requires.txt +2 -0
  28. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/pyproject.toml +3 -1
  29. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_13_dx_improvements.py +37 -37
  30. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_15_llm_cognitive_discovery.py +18 -18
  31. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_16_unified_dx_flow.py +3 -3
  32. jarviscore_framework-0.3.0/README.md +0 -134
  33. jarviscore_framework-0.3.0/jarviscore/docs/GETTING_STARTED.md +0 -800
  34. jarviscore_framework-0.3.0/jarviscore/profiles/__init__.py +0 -14
  35. jarviscore_framework-0.3.0/jarviscore/profiles/customagent.py +0 -137
  36. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/.env.example +0 -0
  37. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/LICENSE +0 -0
  38. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/MANIFEST.in +0 -0
  39. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/autoagent_distributed_example.py +0 -0
  40. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/calculator_agent_example.py +0 -0
  41. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/custom_profile_decorator.py +0 -0
  42. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/custom_profile_wrap.py +0 -0
  43. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/customagent_distributed_example.py +0 -0
  44. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/customagent_p2p_example.py +0 -0
  45. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/multi_agent_workflow.py +0 -0
  46. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/examples/research_agent_example.py +0 -0
  47. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/adapter/__init__.py +0 -0
  48. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/adapter/decorator.py +0 -0
  49. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/adapter/wrapper.py +0 -0
  50. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/cli/__init__.py +0 -0
  51. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/cli/__main__.py +0 -0
  52. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/cli/check.py +0 -0
  53. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/cli/scaffold.py +0 -0
  54. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/config/__init__.py +0 -0
  55. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/config/settings.py +0 -0
  56. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/context/__init__.py +0 -0
  57. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/context/dependency.py +0 -0
  58. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/context/jarvis_context.py +0 -0
  59. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/context/memory.py +0 -0
  60. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/core/__init__.py +0 -0
  61. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/core/agent.py +0 -0
  62. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/core/profile.py +0 -0
  63. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/.env.example +0 -0
  64. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/__init__.py +0 -0
  65. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/examples/autoagent_distributed_example.py +0 -0
  66. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/examples/calculator_agent_example.py +0 -0
  67. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/examples/customagent_distributed_example.py +0 -0
  68. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/examples/customagent_p2p_example.py +0 -0
  69. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/examples/multi_agent_workflow.py +0 -0
  70. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/data/examples/research_agent_example.py +0 -0
  71. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/docs/AUTOAGENT_GUIDE.md +0 -0
  72. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/__init__.py +0 -0
  73. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/code_registry.py +0 -0
  74. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/generator.py +0 -0
  75. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/llm.py +0 -0
  76. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/repair.py +0 -0
  77. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/result_handler.py +0 -0
  78. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/sandbox.py +0 -0
  79. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/execution/search.py +0 -0
  80. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/integrations/__init__.py +0 -0
  81. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/orchestration/__init__.py +0 -0
  82. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/orchestration/claimer.py +0 -0
  83. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/orchestration/dependency.py +0 -0
  84. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/orchestration/engine.py +0 -0
  85. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/orchestration/status.py +0 -0
  86. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/__init__.py +0 -0
  87. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/broadcaster.py +0 -0
  88. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/coordinator.py +0 -0
  89. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/keepalive.py +0 -0
  90. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/messages.py +0 -0
  91. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/peer_tool.py +0 -0
  92. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/p2p/swim_manager.py +0 -0
  93. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore/profiles/autoagent.py +0 -0
  94. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/dependency_links.txt +0 -0
  95. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/top_level.txt +0 -0
  96. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/setup.cfg +0 -0
  97. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-558779ed_560ebc37.py +0 -0
  98. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-5ed3609e_560ebc37.py +0 -0
  99. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-66da0356_43970bb9.py +0 -0
  100. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-7a2fac83_583709d9.py +0 -0
  101. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-888b670f_aa235863.py +0 -0
  102. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-9ca5f642_aa235863.py +0 -0
  103. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-bfd90775_560ebc37.py +0 -0
  104. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-e95d2f7d_aa235863.py +0 -0
  105. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-f60ca8a2_327eb8c2.py +0 -0
  106. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-02adf9ee_958658d9.py +0 -0
  107. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-0706fb57_5df13441.py +0 -0
  108. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-153c9c4a_ba59c918.py +0 -0
  109. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-287e61c0_41daa793.py +0 -0
  110. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-2967af5a_863c2cc6.py +0 -0
  111. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-303ca6d6_5df13441.py +0 -0
  112. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-308a4afd_cbf5064d.py +0 -0
  113. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-353f16e2_0968bcf5.py +0 -0
  114. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-3c22475a_41daa793.py +0 -0
  115. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-5bac1029_0968bcf5.py +0 -0
  116. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-640f76b2_9198780b.py +0 -0
  117. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-752fa7ea_863c2cc6.py +0 -0
  118. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-baf9ef39_0968bcf5.py +0 -0
  119. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-bc8b2a2f_5df13441.py +0 -0
  120. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-c31e4686_41daa793.py +0 -0
  121. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-cc84c84c_863c2cc6.py +0 -0
  122. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-dd7c7144_9198780b.py +0 -0
  123. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-e671c256_41ea4487.py +0 -0
  124. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-1a878fcc_18d44bdc.py +0 -0
  125. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-25c1c331_cea57d0d.py +0 -0
  126. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-37552117_e711c2b9.py +0 -0
  127. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-bc662768_e711c2b9.py +0 -0
  128. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-d6c0e76b_5e7722ec.py +0 -0
  129. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-f270fb02_680529c3.py +0 -0
  130. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-11393b14_4370d3ed.py +0 -0
  131. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-7d02dfc3_d3b569be.py +0 -0
  132. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-8adb5e32_9168c5fe.py +0 -0
  133. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-c58ffc19_78b4ceac.py +0 -0
  134. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-cd5977b1_9168c5fe.py +0 -0
  135. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-ec1c8773_9168c5fe.py +0 -0
  136. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/conftest.py +0 -0
  137. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_01_analyst_standalone.py +0 -0
  138. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_02_assistant_standalone.py +0 -0
  139. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_03_analyst_with_framework.py +0 -0
  140. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_04_assistant_with_framework.py +0 -0
  141. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_05_integration.py +0 -0
  142. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_06_real_llm_integration.py +0 -0
  143. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_07_distributed_single_node.py +0 -0
  144. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_08_distributed_multi_node.py +0 -0
  145. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_09_distributed_autoagent.py +0 -0
  146. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_10_distributed_customagent.py +0 -0
  147. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_14_cloud_deployment.py +0 -0
  148. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_agent.py +0 -0
  149. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_autoagent.py +0 -0
  150. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_autoagent_day4.py +0 -0
  151. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_context.py +0 -0
  152. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_customagent.py +0 -0
  153. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_decorator.py +0 -0
  154. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_integration.py +0 -0
  155. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_llm_fallback.py +0 -0
  156. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_mesh.py +0 -0
  157. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_p2p_integration.py +0 -0
  158. {jarviscore_framework-0.3.0 → jarviscore_framework-0.3.1}/tests/test_remote_sandbox.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jarviscore-framework
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Build autonomous AI agents in 3 lines of code. Production-ready orchestration with P2P mesh networking.
5
5
  Author-email: Ruth Mutua <mutuandinda82@gmail.com>, Muyukani Kizito <muyukani@prescottdata.io>
6
6
  Maintainer-email: Prescott Data <info@prescottdata.io>
@@ -26,6 +26,8 @@ Requires-Dist: pyzmq
26
26
  Requires-Dist: python-dotenv>=1.0.0
27
27
  Requires-Dist: aiohttp>=3.9.0
28
28
  Requires-Dist: beautifulsoup4>=4.12.0
29
+ Requires-Dist: fastapi>=0.104.0
30
+ Requires-Dist: uvicorn>=0.29.0
29
31
  Requires-Dist: anthropic>=0.18.0
30
32
  Requires-Dist: openai>=1.0.0
31
33
  Requires-Dist: google-genai>=1.0.0
@@ -47,13 +49,13 @@ Dynamic: license-file
47
49
 
48
50
  ## Features
49
51
 
50
- - **AutoAgent** - LLM generates and executes code from natural language
51
- - **CustomAgent** - Bring your own logic (LangChain, CrewAI, etc.)
52
- - **ListenerAgent** - API-first agents with background P2P (just implement handlers)
53
- - **P2P Mesh** - Agent discovery and communication via SWIM protocol
54
- - **Workflow Orchestration** - Dependencies, context passing, multi-step pipelines
55
- - **FastAPI Integration** - 3-line setup with JarvisLifespan
56
- - **Cloud Deployment** - Self-registering agents for Docker/K8s
52
+ - **AutoAgent** - LLM generates and executes code from natural language
53
+ - **CustomAgent** - Bring your own logic with P2P message handlers
54
+ - **P2P Mesh** - Agent discovery and communication via SWIM protocol
55
+ - **Workflow Orchestration** - Dependencies, context passing, multi-step pipelines
56
+ - **FastAPI Integration** - 3-line setup with JarvisLifespan
57
+ - **Cognitive Discovery** - LLM-ready peer descriptions for autonomous delegation
58
+ - **Cloud Deployment** - Self-registering agents for Docker/K8s
57
59
 
58
60
  ## Installation
59
61
 
@@ -97,7 +99,26 @@ results = await mesh.workflow("calc", [
97
99
  print(results[0]["output"]) # 3628800
98
100
  ```
99
101
 
100
- ### CustomAgent (Your Code)
102
+ ### CustomAgent + FastAPI (Recommended)
103
+
104
+ ```python
105
+ from fastapi import FastAPI
106
+ from jarviscore.profiles import CustomAgent
107
+ from jarviscore.integrations.fastapi import JarvisLifespan
108
+
109
+ class ProcessorAgent(CustomAgent):
110
+ role = "processor"
111
+ capabilities = ["processing"]
112
+
113
+ async def on_peer_request(self, msg):
114
+ # Handle requests from other agents
115
+ return {"result": msg.data.get("task", "").upper()}
116
+
117
+ # 3 lines to integrate with FastAPI
118
+ app = FastAPI(lifespan=JarvisLifespan(ProcessorAgent(), mode="p2p"))
119
+ ```
120
+
121
+ ### CustomAgent (Workflow Mode)
101
122
 
102
123
  ```python
103
124
  from jarviscore import Mesh
@@ -121,56 +142,50 @@ results = await mesh.workflow("demo", [
121
142
  print(results[0]["output"]) # [2, 4, 6]
122
143
  ```
123
144
 
124
- ### ListenerAgent + FastAPI (API-First)
145
+ ## Profiles
125
146
 
126
- ```python
127
- from fastapi import FastAPI
128
- from jarviscore.profiles import ListenerAgent
129
- from jarviscore.integrations.fastapi import JarvisLifespan
130
-
131
- class ProcessorAgent(ListenerAgent):
132
- role = "processor"
133
- capabilities = ["processing"]
134
-
135
- async def on_peer_request(self, msg):
136
- # Handle requests from other agents
137
- return {"result": msg.data.get("task", "").upper()}
138
-
139
- # That's it - 3 lines to integrate with FastAPI
140
- app = FastAPI(lifespan=JarvisLifespan(ProcessorAgent(), mode="p2p"))
141
- ```
147
+ | Profile | You Write | JarvisCore Handles |
148
+ |---------|-----------|-------------------|
149
+ | **AutoAgent** | System prompt | LLM code generation, sandboxed execution |
150
+ | **CustomAgent** | `on_peer_request()` and/or `execute_task()` | Mesh, discovery, routing, lifecycle |
142
151
 
143
152
  ## Execution Modes
144
153
 
145
- | Mode | Profile | Use Case |
146
- |------|---------|----------|
147
- | `autonomous` | AutoAgent | Single machine, LLM code generation |
148
- | `p2p` | CustomAgent, ListenerAgent | Agent-to-agent communication, swarms |
149
- | `distributed` | CustomAgent, ListenerAgent | Multi-node workflows + P2P |
154
+ | Mode | Use Case |
155
+ |------|----------|
156
+ | `autonomous` | Single machine, LLM code generation (AutoAgent) |
157
+ | `p2p` | Agent-to-agent communication, swarms (CustomAgent) |
158
+ | `distributed` | Multi-node workflows + P2P (CustomAgent) |
150
159
 
151
- ## What's New in 0.3.0
160
+ ## Framework Integration
152
161
 
153
- **Developer Experience Improvements:**
154
- - **ListenerAgent** - No more writing `run()` loops. Just implement `on_peer_request()` and `on_peer_notify()` handlers.
155
- - **JarvisLifespan** - FastAPI integration reduced from ~100 lines to 3 lines.
156
- - **Cognitive Discovery** - `peers.get_cognitive_context()` generates LLM-ready peer descriptions. No more hardcoded agent names in prompts.
162
+ JarvisCore is **async-first**. Best experience with async frameworks.
157
163
 
158
- **Cloud Deployment:**
159
- - **Self-Registration** - `agent.join_mesh()` lets agents join existing meshes without central orchestrator.
160
- - **Remote Visibility** - Agents on different nodes are automatically discovered and callable.
164
+ | Framework | Integration |
165
+ |-----------|-------------|
166
+ | **FastAPI** | `JarvisLifespan` (3 lines) |
167
+ | **aiohttp, Quart, Tornado** | Manual lifecycle (see docs) |
168
+ | **Flask, Django** | Background thread pattern (see docs) |
161
169
 
162
170
  ## Documentation
163
171
 
164
- - [User Guide](jarviscore/docs/USER_GUIDE.md) - Complete documentation
165
- - [Getting Started](jarviscore/docs/GETTING_STARTED.md) - 5-minute quickstart
166
- - [AutoAgent Guide](jarviscore/docs/AUTOAGENT_GUIDE.md) - LLM-powered agents
167
- - [CustomAgent Guide](jarviscore/docs/CUSTOMAGENT_GUIDE.md) - Bring your own code
168
- - [API Reference](jarviscore/docs/API_REFERENCE.md) - Detailed API docs
169
- - [Configuration](jarviscore/docs/CONFIGURATION.md) - Settings reference
172
+ Documentation is included with the package:
173
+
174
+ ```bash
175
+ python -c "import jarviscore; print(jarviscore.__path__[0] + '/docs')"
176
+ ```
177
+
178
+ **Available guides:**
179
+ - `GETTING_STARTED.md` - 5-minute quickstart
180
+ - `CUSTOMAGENT_GUIDE.md` - CustomAgent patterns and framework integration
181
+ - `AUTOAGENT_GUIDE.md` - LLM-powered agents
182
+ - `USER_GUIDE.md` - Complete documentation
183
+ - `API_REFERENCE.md` - Detailed API docs
184
+ - `CONFIGURATION.md` - Settings reference
170
185
 
171
186
  ## Version
172
187
 
173
- **0.3.0**
188
+ **0.4.0**
174
189
 
175
190
  ## License
176
191
 
@@ -0,0 +1,147 @@
1
+ # JarvisCore Framework
2
+
3
+ **Build autonomous AI agents with P2P mesh networking.**
4
+
5
+ ## Features
6
+
7
+ - **AutoAgent** - LLM generates and executes code from natural language
8
+ - **CustomAgent** - Bring your own logic with P2P message handlers
9
+ - **P2P Mesh** - Agent discovery and communication via SWIM protocol
10
+ - **Workflow Orchestration** - Dependencies, context passing, multi-step pipelines
11
+ - **FastAPI Integration** - 3-line setup with JarvisLifespan
12
+ - **Cognitive Discovery** - LLM-ready peer descriptions for autonomous delegation
13
+ - **Cloud Deployment** - Self-registering agents for Docker/K8s
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ pip install jarviscore-framework
19
+ ```
20
+
21
+ ## Setup
22
+
23
+ ```bash
24
+ # Initialize project
25
+ python -m jarviscore.cli.scaffold --examples
26
+ cp .env.example .env
27
+ # Add your LLM API key to .env
28
+
29
+ # Validate
30
+ python -m jarviscore.cli.check --validate-llm
31
+ python -m jarviscore.cli.smoketest
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ### AutoAgent (LLM-Powered)
37
+
38
+ ```python
39
+ from jarviscore import Mesh
40
+ from jarviscore.profiles import AutoAgent
41
+
42
+ class CalculatorAgent(AutoAgent):
43
+ role = "calculator"
44
+ capabilities = ["math"]
45
+ system_prompt = "You are a math expert. Store result in 'result'."
46
+
47
+ mesh = Mesh(mode="autonomous")
48
+ mesh.add(CalculatorAgent)
49
+ await mesh.start()
50
+
51
+ results = await mesh.workflow("calc", [
52
+ {"agent": "calculator", "task": "Calculate factorial of 10"}
53
+ ])
54
+ print(results[0]["output"]) # 3628800
55
+ ```
56
+
57
+ ### CustomAgent + FastAPI (Recommended)
58
+
59
+ ```python
60
+ from fastapi import FastAPI
61
+ from jarviscore.profiles import CustomAgent
62
+ from jarviscore.integrations.fastapi import JarvisLifespan
63
+
64
+ class ProcessorAgent(CustomAgent):
65
+ role = "processor"
66
+ capabilities = ["processing"]
67
+
68
+ async def on_peer_request(self, msg):
69
+ # Handle requests from other agents
70
+ return {"result": msg.data.get("task", "").upper()}
71
+
72
+ # 3 lines to integrate with FastAPI
73
+ app = FastAPI(lifespan=JarvisLifespan(ProcessorAgent(), mode="p2p"))
74
+ ```
75
+
76
+ ### CustomAgent (Workflow Mode)
77
+
78
+ ```python
79
+ from jarviscore import Mesh
80
+ from jarviscore.profiles import CustomAgent
81
+
82
+ class ProcessorAgent(CustomAgent):
83
+ role = "processor"
84
+ capabilities = ["processing"]
85
+
86
+ async def execute_task(self, task):
87
+ data = task.get("params", {}).get("data", [])
88
+ return {"status": "success", "output": [x * 2 for x in data]}
89
+
90
+ mesh = Mesh(mode="distributed", config={'bind_port': 7950})
91
+ mesh.add(ProcessorAgent)
92
+ await mesh.start()
93
+
94
+ results = await mesh.workflow("demo", [
95
+ {"agent": "processor", "task": "Process", "params": {"data": [1, 2, 3]}}
96
+ ])
97
+ print(results[0]["output"]) # [2, 4, 6]
98
+ ```
99
+
100
+ ## Profiles
101
+
102
+ | Profile | You Write | JarvisCore Handles |
103
+ |---------|-----------|-------------------|
104
+ | **AutoAgent** | System prompt | LLM code generation, sandboxed execution |
105
+ | **CustomAgent** | `on_peer_request()` and/or `execute_task()` | Mesh, discovery, routing, lifecycle |
106
+
107
+ ## Execution Modes
108
+
109
+ | Mode | Use Case |
110
+ |------|----------|
111
+ | `autonomous` | Single machine, LLM code generation (AutoAgent) |
112
+ | `p2p` | Agent-to-agent communication, swarms (CustomAgent) |
113
+ | `distributed` | Multi-node workflows + P2P (CustomAgent) |
114
+
115
+ ## Framework Integration
116
+
117
+ JarvisCore is **async-first**. Best experience with async frameworks.
118
+
119
+ | Framework | Integration |
120
+ |-----------|-------------|
121
+ | **FastAPI** | `JarvisLifespan` (3 lines) |
122
+ | **aiohttp, Quart, Tornado** | Manual lifecycle (see docs) |
123
+ | **Flask, Django** | Background thread pattern (see docs) |
124
+
125
+ ## Documentation
126
+
127
+ Documentation is included with the package:
128
+
129
+ ```bash
130
+ python -c "import jarviscore; print(jarviscore.__path__[0] + '/docs')"
131
+ ```
132
+
133
+ **Available guides:**
134
+ - `GETTING_STARTED.md` - 5-minute quickstart
135
+ - `CUSTOMAGENT_GUIDE.md` - CustomAgent patterns and framework integration
136
+ - `AUTOAGENT_GUIDE.md` - LLM-powered agents
137
+ - `USER_GUIDE.md` - Complete documentation
138
+ - `API_REFERENCE.md` - Detailed API docs
139
+ - `CONFIGURATION.md` - Settings reference
140
+
141
+ ## Version
142
+
143
+ **0.4.0**
144
+
145
+ ## License
146
+
147
+ MIT License
@@ -28,10 +28,10 @@ import sys
28
28
 
29
29
  sys.path.insert(0, '.')
30
30
 
31
- from jarviscore.profiles import ListenerAgent
31
+ from jarviscore.profiles import CustomAgent
32
32
 
33
33
 
34
- class StandaloneProcessor(ListenerAgent):
34
+ class StandaloneProcessor(CustomAgent):
35
35
  """
36
36
  Example standalone agent that joins mesh independently.
37
37
 
@@ -143,7 +143,7 @@ async def main():
143
143
  print("Listening for peer requests...")
144
144
  print("Press Ctrl+C to stop.\n")
145
145
 
146
- # Run agent (ListenerAgent's run() handles the message loop)
146
+ # Run agent (CustomAgent's run() handles the message loop)
147
147
  try:
148
148
  await agent.run()
149
149
  except asyncio.CancelledError:
@@ -1,9 +1,9 @@
1
1
  """
2
- ListenerAgent + Cognitive Discovery Example
2
+ CustomAgent + Cognitive Discovery Example
3
3
 
4
4
  Demonstrates two v0.3.0 features:
5
5
 
6
- 1. ListenerAgent - Handler-based P2P agents (no run() loop needed)
6
+ 1. CustomAgent - Handler-based P2P agents (no run() loop needed)
7
7
  - on_peer_request() handles incoming requests
8
8
  - on_peer_notify() handles broadcast notifications
9
9
 
@@ -25,18 +25,18 @@ from pathlib import Path
25
25
  sys.path.insert(0, str(Path(__file__).parent.parent))
26
26
 
27
27
  from jarviscore import Mesh
28
- from jarviscore.profiles import ListenerAgent
28
+ from jarviscore.profiles import CustomAgent
29
29
 
30
30
 
31
31
  # ═══════════════════════════════════════════════════════════════════════════════
32
32
  # SPECIALIST AGENT - Responds to requests from other agents
33
33
  # ═══════════════════════════════════════════════════════════════════════════════
34
34
 
35
- class AnalystAgent(ListenerAgent):
35
+ class AnalystAgent(CustomAgent):
36
36
  """
37
37
  Specialist agent that handles analysis requests.
38
38
 
39
- Uses ListenerAgent profile - just implement handlers, no run() loop needed.
39
+ Uses CustomAgent profile - just implement handlers, no run() loop needed.
40
40
  """
41
41
  role = "analyst"
42
42
  capabilities = ["data_analysis", "statistics", "insights"]
@@ -62,7 +62,7 @@ class AnalystAgent(ListenerAgent):
62
62
  # COORDINATOR AGENT - Uses LLM with cognitive discovery
63
63
  # ═══════════════════════════════════════════════════════════════════════════════
64
64
 
65
- class CoordinatorAgent(ListenerAgent):
65
+ class CoordinatorAgent(CustomAgent):
66
66
  """
67
67
  Coordinator agent that uses LLM with dynamic peer discovery.
68
68
 
@@ -5,7 +5,7 @@ Demonstrates JarvisLifespan for 3-line FastAPI integration with autonomous agent
5
5
 
6
6
  Features shown:
7
7
  1. JarvisLifespan - Automatic agent lifecycle management
8
- 2. ListenerAgent - API-first agents with on_peer_request handlers
8
+ 2. CustomAgent - API-first agents with on_peer_request handlers
9
9
  3. Cognitive Discovery - get_cognitive_context() for LLM awareness
10
10
  4. Autonomous Agents - Each agent has MESH as a TOOL, LLM decides when to delegate
11
11
 
@@ -45,14 +45,14 @@ except ImportError:
45
45
  FASTAPI_AVAILABLE = False
46
46
  print("FastAPI not installed. Run: pip install fastapi uvicorn")
47
47
 
48
- from jarviscore.profiles import ListenerAgent
48
+ from jarviscore.profiles import CustomAgent
49
49
 
50
50
 
51
51
  # ═══════════════════════════════════════════════════════════════════════════════
52
52
  # LLM-POWERED AGENT BASE - Each agent can discover and delegate
53
53
  # ═══════════════════════════════════════════════════════════════════════════════
54
54
 
55
- class LLMAgent(ListenerAgent):
55
+ class LLMAgent(CustomAgent):
56
56
  """
57
57
  Base for LLM-powered agents that can discover and delegate to peers.
58
58
 
@@ -544,7 +544,7 @@ def main():
544
544
  print("=" * 60)
545
545
  print("\n - FastAPI Integration:")
546
546
  print(" - JarvisLifespan for one-line integration")
547
- print(" - ListenerAgent with on_peer_request handlers")
547
+ print(" - CustomAgent with on_peer_request handlers")
548
548
  print(" - Cognitive discovery via get_cognitive_context()")
549
549
  print("\n - Cloud Deployment:")
550
550
  print(" - Each agent has MESH as a TOOL")
@@ -4,16 +4,15 @@ JarvisCore - P2P Distributed Agent Framework
4
4
  A production-grade framework for building autonomous agent systems with:
5
5
  - P2P coordination via SWIM protocol
6
6
  - Workflow orchestration with dependencies
7
- - Three agent profiles: AutoAgent, CustomAgent, and ListenerAgent
7
+ - Two agent profiles: AutoAgent and CustomAgent
8
8
 
9
9
  Profiles:
10
- AutoAgent - LLM generates and executes code from prompts (autonomous mode)
11
- CustomAgent - You provide execute_task() or run() (p2p/distributed modes)
12
- ListenerAgent - API-first agents with background P2P (just implement handlers)
10
+ AutoAgent - LLM generates and executes code from prompts (autonomous mode)
11
+ CustomAgent - You provide handlers or execute_task() (p2p/distributed modes)
13
12
 
14
13
  Modes:
15
14
  autonomous - Workflow engine only (AutoAgent)
16
- p2p - P2P coordinator only (CustomAgent/ListenerAgent with run() loops)
15
+ p2p - P2P coordinator only (CustomAgent with run() loop)
17
16
  distributed - Both workflow + P2P (CustomAgent with execute_task())
18
17
 
19
18
  Quick Start (AutoAgent - autonomous mode):
@@ -30,12 +29,12 @@ Quick Start (AutoAgent - autonomous mode):
30
29
  await mesh.start()
31
30
  results = await mesh.workflow("calc", [{"agent": "calculator", "task": "Calculate 10!"}])
32
31
 
33
- Quick Start (ListenerAgent + FastAPI):
32
+ Quick Start (CustomAgent + FastAPI):
34
33
  from fastapi import FastAPI
35
- from jarviscore.profiles import ListenerAgent
34
+ from jarviscore.profiles import CustomAgent
36
35
  from jarviscore.integrations.fastapi import JarvisLifespan
37
36
 
38
- class MyAgent(ListenerAgent):
37
+ class MyAgent(CustomAgent):
39
38
  role = "processor"
40
39
  capabilities = ["processing"]
41
40
 
@@ -61,7 +60,7 @@ Quick Start (CustomAgent - distributed mode):
61
60
  results = await mesh.workflow("demo", [{"agent": "processor", "task": "hello"}])
62
61
  """
63
62
 
64
- __version__ = "0.3.0"
63
+ __version__ = "0.3.1"
65
64
  __author__ = "JarvisCore Contributors"
66
65
  __license__ = "MIT"
67
66
 
@@ -73,7 +72,6 @@ from jarviscore.core.mesh import Mesh, MeshMode
73
72
  # Execution profiles
74
73
  from jarviscore.profiles.autoagent import AutoAgent
75
74
  from jarviscore.profiles.customagent import CustomAgent
76
- from jarviscore.profiles.listeneragent import ListenerAgent
77
75
 
78
76
  # Custom Profile: Decorator, Wrapper, and Context
79
77
  from jarviscore.adapter import jarvis_agent, wrap
@@ -99,7 +97,6 @@ __all__ = [
99
97
  # Profiles
100
98
  "AutoAgent",
101
99
  "CustomAgent",
102
- "ListenerAgent",
103
100
 
104
101
  # Custom Profile (decorator and wrapper)
105
102
  "jarvis_agent",
@@ -313,7 +313,7 @@ class SmokeTest:
313
313
  print("\nJarvisCore is working correctly. Next steps:")
314
314
  print(" 1. AutoAgent example: python examples/calculator_agent_example.py")
315
315
  print(" 2. CustomAgent P2P: python examples/customagent_p2p_example.py")
316
- print(" 3. ListenerAgent (v0.3): python examples/listeneragent_cognitive_discovery_example.py")
316
+ print(" 3. Cognitive Discovery: python examples/customagent_cognitive_discovery_example.py")
317
317
  print(" 4. FastAPI (v0.3): python examples/fastapi_integration_example.py")
318
318
  print(" 5. Cloud deploy (v0.3): python examples/cloud_deployment_example.py")
319
319
  print("\nDocumentation:")
@@ -256,9 +256,18 @@ class Mesh:
256
256
  await self._p2p_coordinator.start()
257
257
  self._logger.info("✓ P2P coordinator started")
258
258
 
259
+ # Wait for mesh to stabilize before announcing
260
+ # Increased delay to ensure SWIM fully connects all nodes
261
+ await asyncio.sleep(5)
262
+ self._logger.info("Waited for mesh stabilization")
263
+
259
264
  # Announce capabilities to network
260
265
  await self._p2p_coordinator.announce_capabilities()
261
266
  self._logger.info("✓ Capabilities announced to mesh")
267
+
268
+ # Request capabilities from existing peers (for late-joiners)
269
+ await self._p2p_coordinator.request_peer_capabilities()
270
+ self._logger.info("✓ Requested capabilities from existing peers")
262
271
 
263
272
  # Inject PeerClients for p2p mode
264
273
  if self.mode == MeshMode.P2P:
@@ -28,10 +28,10 @@ import sys
28
28
 
29
29
  sys.path.insert(0, '.')
30
30
 
31
- from jarviscore.profiles import ListenerAgent
31
+ from jarviscore.profiles import CustomAgent
32
32
 
33
33
 
34
- class StandaloneProcessor(ListenerAgent):
34
+ class StandaloneProcessor(CustomAgent):
35
35
  """
36
36
  Example standalone agent that joins mesh independently.
37
37
 
@@ -143,7 +143,7 @@ async def main():
143
143
  print("Listening for peer requests...")
144
144
  print("Press Ctrl+C to stop.\n")
145
145
 
146
- # Run agent (ListenerAgent's run() handles the message loop)
146
+ # Run agent (CustomAgent's run() handles the message loop)
147
147
  try:
148
148
  await agent.run()
149
149
  except asyncio.CancelledError:
@@ -0,0 +1,134 @@
1
+ """
2
+ Custom Profile Example: Using @jarvis_agent Decorator
3
+
4
+ This example shows how to use the @jarvis_agent decorator to convert
5
+ any Python class into a JarvisCore agent without modifying the class.
6
+
7
+ Use Case: You have existing Python classes/agents and want JarvisCore
8
+ to handle orchestration (data handoff, dependencies, shared memory).
9
+ """
10
+ import asyncio
11
+ from jarviscore import Mesh, jarvis_agent, JarvisContext
12
+
13
+
14
+ # Example 1: Simple decorator (no context needed)
15
+ @jarvis_agent(role="processor", capabilities=["data_processing"])
16
+ class DataProcessor:
17
+ """Simple data processor - doubles input values."""
18
+
19
+ def run(self, data):
20
+ """Process data by doubling values."""
21
+ if isinstance(data, list):
22
+ return {"processed": [x * 2 for x in data]}
23
+ return {"processed": data * 2}
24
+
25
+
26
+ # Example 2: Decorator with context access
27
+ @jarvis_agent(role="aggregator", capabilities=["aggregation"])
28
+ class Aggregator:
29
+ """Aggregates results from previous steps using JarvisContext."""
30
+
31
+ def run(self, task, ctx: JarvisContext):
32
+ """
33
+ Access previous step results via ctx.previous().
34
+
35
+ Args:
36
+ task: The task description
37
+ ctx: JarvisContext with memory and dependency access
38
+ """
39
+ # Get output from a specific previous step
40
+ processed = ctx.previous("step1")
41
+
42
+ if processed:
43
+ data = processed.get("processed", [])
44
+ return {
45
+ "sum": sum(data) if isinstance(data, list) else data,
46
+ "count": len(data) if isinstance(data, list) else 1,
47
+ "source_step": "step1"
48
+ }
49
+
50
+ return {"error": "No previous data found"}
51
+
52
+
53
+ # Example 3: Decorator with custom execute method
54
+ @jarvis_agent(role="validator", capabilities=["validation"], execute_method="validate")
55
+ class DataValidator:
56
+ """Validates data using a custom method name."""
57
+
58
+ def validate(self, data):
59
+ """Custom execute method - validates input data."""
60
+ if isinstance(data, list):
61
+ return {
62
+ "valid": all(isinstance(x, (int, float)) for x in data),
63
+ "count": len(data),
64
+ "type": "list"
65
+ }
66
+ return {
67
+ "valid": isinstance(data, (int, float)),
68
+ "type": type(data).__name__
69
+ }
70
+
71
+
72
+ async def main():
73
+ """Run a multi-step workflow with custom profile agents."""
74
+ print("=" * 60)
75
+ print(" Custom Profile Example: @jarvis_agent Decorator")
76
+ print("=" * 60)
77
+
78
+ # Create mesh in autonomous mode
79
+ mesh = Mesh(mode="autonomous")
80
+
81
+ # Add our decorated agents
82
+ mesh.add(DataProcessor)
83
+ mesh.add(Aggregator)
84
+ mesh.add(DataValidator)
85
+
86
+ # Start the mesh
87
+ await mesh.start()
88
+
89
+ try:
90
+ # Execute a multi-step workflow
91
+ print("\nExecuting workflow with 3 steps...\n")
92
+
93
+ results = await mesh.workflow("custom-profile-demo", [
94
+ {
95
+ "id": "step1",
96
+ "agent": "processor",
97
+ "task": "Process input data",
98
+ "params": {"data": [1, 2, 3, 4, 5]}
99
+ },
100
+ {
101
+ "id": "step2",
102
+ "agent": "aggregator",
103
+ "task": "Aggregate processed results",
104
+ "depends_on": ["step1"] # Wait for step1
105
+ },
106
+ {
107
+ "id": "step3",
108
+ "agent": "validator",
109
+ "task": "Validate original data",
110
+ "params": {"data": [1, 2, 3, 4, 5]}
111
+ }
112
+ ])
113
+
114
+ # Print results
115
+ print("Results:")
116
+ print("-" * 40)
117
+
118
+ for i, result in enumerate(results):
119
+ step_name = ["Processor", "Aggregator", "Validator"][i]
120
+ print(f"\n{step_name} (step{i+1}):")
121
+ print(f" Status: {result.get('status')}")
122
+ print(f" Output: {result.get('output')}")
123
+
124
+ print("\n" + "=" * 60)
125
+ print(" Workflow completed successfully!")
126
+ print("=" * 60)
127
+
128
+ finally:
129
+ # Stop the mesh
130
+ await mesh.stop()
131
+
132
+
133
+ if __name__ == "__main__":
134
+ asyncio.run(main())