jarviscore-framework 0.2.1__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.
- {jarviscore_framework-0.2.1/jarviscore_framework.egg-info → jarviscore_framework-0.3.1}/PKG-INFO +66 -18
- jarviscore_framework-0.3.1/README.md +147 -0
- jarviscore_framework-0.3.1/examples/cloud_deployment_example.py +162 -0
- jarviscore_framework-0.3.1/examples/customagent_cognitive_discovery_example.py +343 -0
- jarviscore_framework-0.3.1/examples/fastapi_integration_example.py +570 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/__init__.py +19 -5
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/cli/smoketest.py +8 -4
- jarviscore_framework-0.3.1/jarviscore/core/agent.py +433 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/core/mesh.py +9 -0
- jarviscore_framework-0.3.1/jarviscore/data/examples/cloud_deployment_example.py +162 -0
- jarviscore_framework-0.3.1/jarviscore/data/examples/custom_profile_decorator.py +134 -0
- jarviscore_framework-0.3.1/jarviscore/data/examples/custom_profile_wrap.py +168 -0
- jarviscore_framework-0.3.1/jarviscore/data/examples/customagent_cognitive_discovery_example.py +343 -0
- jarviscore_framework-0.3.1/jarviscore/data/examples/fastapi_integration_example.py +570 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/docs/API_REFERENCE.md +283 -3
- jarviscore_framework-0.3.1/jarviscore/docs/CHANGELOG.md +139 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/docs/CONFIGURATION.md +1 -1
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/docs/CUSTOMAGENT_GUIDE.md +997 -85
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/docs/GETTING_STARTED.md +228 -267
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/docs/TROUBLESHOOTING.md +1 -1
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/docs/USER_GUIDE.md +153 -8
- jarviscore_framework-0.3.1/jarviscore/integrations/__init__.py +16 -0
- jarviscore_framework-0.3.1/jarviscore/integrations/fastapi.py +247 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/broadcaster.py +10 -3
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/coordinator.py +310 -14
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/keepalive.py +45 -23
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/peer_client.py +311 -12
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/swim_manager.py +9 -4
- jarviscore_framework-0.3.1/jarviscore/profiles/__init__.py +12 -0
- jarviscore_framework-0.3.1/jarviscore/profiles/customagent.py +358 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1/jarviscore_framework.egg-info}/PKG-INFO +66 -18
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/SOURCES.txt +15 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/requires.txt +2 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/pyproject.toml +3 -1
- jarviscore_framework-0.3.1/tests/test_13_dx_improvements.py +554 -0
- jarviscore_framework-0.3.1/tests/test_14_cloud_deployment.py +403 -0
- jarviscore_framework-0.3.1/tests/test_15_llm_cognitive_discovery.py +684 -0
- jarviscore_framework-0.3.1/tests/test_16_unified_dx_flow.py +947 -0
- jarviscore_framework-0.2.1/README.md +0 -101
- jarviscore_framework-0.2.1/jarviscore/core/agent.py +0 -206
- jarviscore_framework-0.2.1/jarviscore/profiles/__init__.py +0 -6
- jarviscore_framework-0.2.1/jarviscore/profiles/customagent.py +0 -137
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/.env.example +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/LICENSE +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/MANIFEST.in +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/autoagent_distributed_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/calculator_agent_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/custom_profile_decorator.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/custom_profile_wrap.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/customagent_distributed_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/customagent_p2p_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/multi_agent_workflow.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/examples/research_agent_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/adapter/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/adapter/decorator.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/adapter/wrapper.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/cli/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/cli/__main__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/cli/check.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/cli/scaffold.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/config/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/config/settings.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/context/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/context/dependency.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/context/jarvis_context.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/context/memory.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/core/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/core/profile.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/.env.example +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/examples/autoagent_distributed_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/examples/calculator_agent_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/examples/customagent_distributed_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/examples/customagent_p2p_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/examples/multi_agent_workflow.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/data/examples/research_agent_example.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/docs/AUTOAGENT_GUIDE.md +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/code_registry.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/generator.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/llm.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/repair.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/result_handler.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/sandbox.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/execution/search.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/orchestration/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/orchestration/claimer.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/orchestration/dependency.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/orchestration/engine.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/orchestration/status.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/__init__.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/messages.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/p2p/peer_tool.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore/profiles/autoagent.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/dependency_links.txt +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/jarviscore_framework.egg-info/top_level.txt +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/setup.cfg +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-558779ed_560ebc37.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-5ed3609e_560ebc37.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-66da0356_43970bb9.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-7a2fac83_583709d9.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-888b670f_aa235863.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-9ca5f642_aa235863.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-bfd90775_560ebc37.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-e95d2f7d_aa235863.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/data_generator-f60ca8a2_327eb8c2.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-02adf9ee_958658d9.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-0706fb57_5df13441.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-153c9c4a_ba59c918.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-287e61c0_41daa793.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-2967af5a_863c2cc6.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-303ca6d6_5df13441.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-308a4afd_cbf5064d.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-353f16e2_0968bcf5.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-3c22475a_41daa793.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-5bac1029_0968bcf5.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-640f76b2_9198780b.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-752fa7ea_863c2cc6.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-baf9ef39_0968bcf5.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-bc8b2a2f_5df13441.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-c31e4686_41daa793.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-cc84c84c_863c2cc6.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-dd7c7144_9198780b.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/mathematician-e671c256_41ea4487.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-1a878fcc_18d44bdc.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-25c1c331_cea57d0d.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-37552117_e711c2b9.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-bc662768_e711c2b9.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-d6c0e76b_5e7722ec.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/report_generator-f270fb02_680529c3.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-11393b14_4370d3ed.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-7d02dfc3_d3b569be.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-8adb5e32_9168c5fe.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-c58ffc19_78b4ceac.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-cd5977b1_9168c5fe.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/test_logs/code_registry/functions/text_processor-ec1c8773_9168c5fe.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/conftest.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_01_analyst_standalone.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_02_assistant_standalone.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_03_analyst_with_framework.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_04_assistant_with_framework.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_05_integration.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_06_real_llm_integration.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_07_distributed_single_node.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_08_distributed_multi_node.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_09_distributed_autoagent.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_10_distributed_customagent.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_agent.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_autoagent.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_autoagent_day4.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_context.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_customagent.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_decorator.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_integration.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_llm_fallback.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_mesh.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_p2p_integration.py +0 -0
- {jarviscore_framework-0.2.1 → jarviscore_framework-0.3.1}/tests/test_remote_sandbox.py +0 -0
{jarviscore_framework-0.2.1/jarviscore_framework.egg-info → jarviscore_framework-0.3.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jarviscore-framework
|
|
3
|
-
Version: 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,10 +49,13 @@ Dynamic: license-file
|
|
|
47
49
|
|
|
48
50
|
## Features
|
|
49
51
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
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
|
|
54
59
|
|
|
55
60
|
## Installation
|
|
56
61
|
|
|
@@ -94,7 +99,26 @@ results = await mesh.workflow("calc", [
|
|
|
94
99
|
print(results[0]["output"]) # 3628800
|
|
95
100
|
```
|
|
96
101
|
|
|
97
|
-
### CustomAgent (
|
|
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)
|
|
98
122
|
|
|
99
123
|
```python
|
|
100
124
|
from jarviscore import Mesh
|
|
@@ -118,26 +142,50 @@ results = await mesh.workflow("demo", [
|
|
|
118
142
|
print(results[0]["output"]) # [2, 4, 6]
|
|
119
143
|
```
|
|
120
144
|
|
|
145
|
+
## Profiles
|
|
146
|
+
|
|
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 |
|
|
151
|
+
|
|
121
152
|
## Execution Modes
|
|
122
153
|
|
|
123
|
-
| Mode |
|
|
124
|
-
|
|
125
|
-
| `autonomous` |
|
|
126
|
-
| `p2p` |
|
|
127
|
-
| `distributed` |
|
|
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) |
|
|
159
|
+
|
|
160
|
+
## Framework Integration
|
|
161
|
+
|
|
162
|
+
JarvisCore is **async-first**. Best experience with async frameworks.
|
|
163
|
+
|
|
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) |
|
|
128
169
|
|
|
129
170
|
## Documentation
|
|
130
171
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
137
185
|
|
|
138
186
|
## Version
|
|
139
187
|
|
|
140
|
-
**0.
|
|
188
|
+
**0.4.0**
|
|
141
189
|
|
|
142
190
|
## License
|
|
143
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
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Cloud Deployment Example (v0.3.0)
|
|
3
|
+
|
|
4
|
+
Demonstrates agent self-registration with join_mesh() and leave_mesh().
|
|
5
|
+
Agents join an existing mesh independently - no central orchestrator needed.
|
|
6
|
+
|
|
7
|
+
This is the pattern for:
|
|
8
|
+
- Docker containers where each container runs one agent
|
|
9
|
+
- Kubernetes pods with auto-scaling
|
|
10
|
+
- Cloud Functions / Lambda
|
|
11
|
+
- Any distributed deployment where agents start independently
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
# Terminal 1: Start a mesh (or use an existing one)
|
|
15
|
+
python examples/customagent_p2p_example.py
|
|
16
|
+
|
|
17
|
+
# Terminal 2: Run standalone agent that joins the mesh
|
|
18
|
+
JARVISCORE_SEED_NODES=127.0.0.1:7946 python examples/cloud_deployment_example.py
|
|
19
|
+
|
|
20
|
+
Environment Variables:
|
|
21
|
+
JARVISCORE_SEED_NODES: Comma-separated seed nodes (e.g., "host1:7946,host2:7946")
|
|
22
|
+
JARVISCORE_MESH_ENDPOINT: Single mesh endpoint (alternative to seed_nodes)
|
|
23
|
+
"""
|
|
24
|
+
import asyncio
|
|
25
|
+
import os
|
|
26
|
+
import signal
|
|
27
|
+
import sys
|
|
28
|
+
|
|
29
|
+
sys.path.insert(0, '.')
|
|
30
|
+
|
|
31
|
+
from jarviscore.profiles import CustomAgent
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class StandaloneProcessor(CustomAgent):
|
|
35
|
+
"""
|
|
36
|
+
Example standalone agent that joins mesh independently.
|
|
37
|
+
|
|
38
|
+
This agent:
|
|
39
|
+
- Self-registers with the mesh on startup
|
|
40
|
+
- Listens for peer requests
|
|
41
|
+
- Shows its view of the mesh (cognitive context)
|
|
42
|
+
- Gracefully leaves mesh on shutdown
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
role = "standalone_processor"
|
|
46
|
+
capabilities = ["standalone", "processing", "example"]
|
|
47
|
+
description = "Processes requests from other mesh agents (standalone deployment)"
|
|
48
|
+
|
|
49
|
+
async def on_peer_request(self, msg):
|
|
50
|
+
"""Handle incoming requests from other agents."""
|
|
51
|
+
print(f"\n[{self.role}] Received request from {msg.sender}:")
|
|
52
|
+
print(f" Data: {msg.data}")
|
|
53
|
+
|
|
54
|
+
# Process the request
|
|
55
|
+
task = msg.data.get("task", "")
|
|
56
|
+
result = {
|
|
57
|
+
"status": "success",
|
|
58
|
+
"output": f"Processed: {task}",
|
|
59
|
+
"agent_id": self.agent_id,
|
|
60
|
+
"processed_by": self.role
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
print(f"[{self.role}] Sending response: {result}")
|
|
64
|
+
return result
|
|
65
|
+
|
|
66
|
+
async def on_peer_notify(self, msg):
|
|
67
|
+
"""Handle incoming notifications from other agents."""
|
|
68
|
+
print(f"\n[{self.role}] Received notification from {msg.sender}:")
|
|
69
|
+
print(f" Event: {msg.data.get('event', 'unknown')}")
|
|
70
|
+
print(f" Data: {msg.data}")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
async def main():
|
|
74
|
+
print("=" * 60)
|
|
75
|
+
print("Standalone Agent Example - Cloud Deployment Pattern")
|
|
76
|
+
print("=" * 60)
|
|
77
|
+
|
|
78
|
+
# Check for mesh connection info
|
|
79
|
+
endpoint = os.environ.get("JARVISCORE_MESH_ENDPOINT")
|
|
80
|
+
seed_nodes = os.environ.get("JARVISCORE_SEED_NODES")
|
|
81
|
+
|
|
82
|
+
if not endpoint and not seed_nodes:
|
|
83
|
+
print("\nNo mesh endpoint configured!")
|
|
84
|
+
print("\nSet one of:")
|
|
85
|
+
print(" - JARVISCORE_MESH_ENDPOINT (single endpoint)")
|
|
86
|
+
print(" - JARVISCORE_SEED_NODES (comma-separated list)")
|
|
87
|
+
print("\nExample:")
|
|
88
|
+
print(" JARVISCORE_SEED_NODES=127.0.0.1:7946 python cloud_deployment_example.py")
|
|
89
|
+
print("\nTo start a mesh first, run:")
|
|
90
|
+
print(" python examples/customagent_p2p_example.py")
|
|
91
|
+
return
|
|
92
|
+
|
|
93
|
+
print(f"\nConnecting to mesh via: {endpoint or seed_nodes}")
|
|
94
|
+
|
|
95
|
+
# Create agent
|
|
96
|
+
agent = StandaloneProcessor()
|
|
97
|
+
|
|
98
|
+
# Join the mesh
|
|
99
|
+
print(f"\nJoining mesh...")
|
|
100
|
+
try:
|
|
101
|
+
await agent.join_mesh()
|
|
102
|
+
except Exception as e:
|
|
103
|
+
print(f"Failed to join mesh: {e}")
|
|
104
|
+
return
|
|
105
|
+
|
|
106
|
+
print(f"\nSuccessfully joined mesh!")
|
|
107
|
+
print(f" Agent ID: {agent.agent_id}")
|
|
108
|
+
print(f" Role: {agent.role}")
|
|
109
|
+
print(f" Capabilities: {agent.capabilities}")
|
|
110
|
+
|
|
111
|
+
# Show discovered peers
|
|
112
|
+
print(f"\n--- Discovered Peers ---")
|
|
113
|
+
peers = agent.peers.list_peers()
|
|
114
|
+
if peers:
|
|
115
|
+
for p in peers:
|
|
116
|
+
location = f" ({p.get('location', 'unknown')})" if 'location' in p else ""
|
|
117
|
+
print(f" - {p['role']}: {p['capabilities']}{location}")
|
|
118
|
+
else:
|
|
119
|
+
print(" No other peers discovered yet")
|
|
120
|
+
|
|
121
|
+
# Show cognitive context (what an LLM would see)
|
|
122
|
+
print(f"\n--- Cognitive Context for LLM ---")
|
|
123
|
+
print(agent.peers.get_cognitive_context())
|
|
124
|
+
|
|
125
|
+
# Setup graceful shutdown
|
|
126
|
+
shutdown_event = asyncio.Event()
|
|
127
|
+
|
|
128
|
+
def signal_handler():
|
|
129
|
+
print("\n\nShutdown requested (Ctrl+C)...")
|
|
130
|
+
agent.request_shutdown()
|
|
131
|
+
shutdown_event.set()
|
|
132
|
+
|
|
133
|
+
# Register signal handlers
|
|
134
|
+
loop = asyncio.get_event_loop()
|
|
135
|
+
for sig in (signal.SIGINT, signal.SIGTERM):
|
|
136
|
+
try:
|
|
137
|
+
loop.add_signal_handler(sig, signal_handler)
|
|
138
|
+
except NotImplementedError:
|
|
139
|
+
# Windows doesn't support add_signal_handler
|
|
140
|
+
pass
|
|
141
|
+
|
|
142
|
+
print(f"\n--- Agent Running ---")
|
|
143
|
+
print("Listening for peer requests...")
|
|
144
|
+
print("Press Ctrl+C to stop.\n")
|
|
145
|
+
|
|
146
|
+
# Run agent (CustomAgent's run() handles the message loop)
|
|
147
|
+
try:
|
|
148
|
+
await agent.run()
|
|
149
|
+
except asyncio.CancelledError:
|
|
150
|
+
pass
|
|
151
|
+
|
|
152
|
+
# Leave mesh gracefully
|
|
153
|
+
print("\nLeaving mesh...")
|
|
154
|
+
await agent.leave_mesh()
|
|
155
|
+
print("Goodbye!")
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
if __name__ == "__main__":
|
|
159
|
+
try:
|
|
160
|
+
asyncio.run(main())
|
|
161
|
+
except KeyboardInterrupt:
|
|
162
|
+
print("\nInterrupted.")
|