kubiya-control-plane-api 0.3.0__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.

Potentially problematic release.


This version of kubiya-control-plane-api might be problematic. Click here for more details.

Files changed (146) hide show
  1. kubiya_control_plane_api-0.3.0/MANIFEST.in +42 -0
  2. kubiya_control_plane_api-0.3.0/PKG-INFO +202 -0
  3. kubiya_control_plane_api-0.3.0/README_PYPI.md +138 -0
  4. kubiya_control_plane_api-0.3.0/control_plane_api/LICENSE +22 -0
  5. kubiya_control_plane_api-0.3.0/control_plane_api/README.md +266 -0
  6. kubiya_control_plane_api-0.3.0/control_plane_api/__init__.py +0 -0
  7. kubiya_control_plane_api-0.3.0/control_plane_api/__version__.py +1 -0
  8. kubiya_control_plane_api-0.3.0/control_plane_api/alembic/README +1 -0
  9. kubiya_control_plane_api-0.3.0/control_plane_api/alembic/env.py +98 -0
  10. kubiya_control_plane_api-0.3.0/control_plane_api/alembic/script.py.mako +28 -0
  11. kubiya_control_plane_api-0.3.0/control_plane_api/alembic/versions/1382bec74309_initial_migration_with_all_models.py +251 -0
  12. kubiya_control_plane_api-0.3.0/control_plane_api/alembic.ini +148 -0
  13. kubiya_control_plane_api-0.3.0/control_plane_api/api/index.py +12 -0
  14. kubiya_control_plane_api-0.3.0/control_plane_api/app/__init__.py +11 -0
  15. kubiya_control_plane_api-0.3.0/control_plane_api/app/activities/__init__.py +20 -0
  16. kubiya_control_plane_api-0.3.0/control_plane_api/app/activities/agent_activities.py +379 -0
  17. kubiya_control_plane_api-0.3.0/control_plane_api/app/activities/team_activities.py +410 -0
  18. kubiya_control_plane_api-0.3.0/control_plane_api/app/activities/temporal_cloud_activities.py +577 -0
  19. kubiya_control_plane_api-0.3.0/control_plane_api/app/config.py +95 -0
  20. kubiya_control_plane_api-0.3.0/control_plane_api/app/database.py +135 -0
  21. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/__init__.py +11 -0
  22. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/kubiya_client.py +205 -0
  23. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/litellm_pricing.py +166 -0
  24. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/planning_tools/__init__.py +22 -0
  25. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/planning_tools/agents.py +155 -0
  26. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/planning_tools/base.py +189 -0
  27. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/planning_tools/environments.py +214 -0
  28. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/planning_tools/resources.py +240 -0
  29. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/planning_tools/teams.py +198 -0
  30. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/policy_enforcer_client.py +939 -0
  31. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/redis_client.py +436 -0
  32. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/supabase.py +71 -0
  33. kubiya_control_plane_api-0.3.0/control_plane_api/app/lib/temporal_client.py +138 -0
  34. kubiya_control_plane_api-0.3.0/control_plane_api/app/main.py +126 -0
  35. kubiya_control_plane_api-0.3.0/control_plane_api/app/middleware/__init__.py +8 -0
  36. kubiya_control_plane_api-0.3.0/control_plane_api/app/middleware/auth.py +509 -0
  37. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/__init__.py +23 -0
  38. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/agent.py +79 -0
  39. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/associations.py +81 -0
  40. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/environment.py +63 -0
  41. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/execution.py +72 -0
  42. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/presence.py +49 -0
  43. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/project.py +47 -0
  44. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/session.py +38 -0
  45. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/team.py +56 -0
  46. kubiya_control_plane_api-0.3.0/control_plane_api/app/models/workflow.py +55 -0
  47. kubiya_control_plane_api-0.3.0/control_plane_api/app/policies/README.md +121 -0
  48. kubiya_control_plane_api-0.3.0/control_plane_api/app/policies/approved_users.rego +62 -0
  49. kubiya_control_plane_api-0.3.0/control_plane_api/app/policies/business_hours.rego +51 -0
  50. kubiya_control_plane_api-0.3.0/control_plane_api/app/policies/rate_limiting.rego +100 -0
  51. kubiya_control_plane_api-0.3.0/control_plane_api/app/policies/tool_restrictions.rego +86 -0
  52. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/__init__.py +4 -0
  53. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/agents.py +364 -0
  54. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/agents_v2.py +1201 -0
  55. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/context_manager.py +562 -0
  56. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/environment_context.py +270 -0
  57. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/environments.py +715 -0
  58. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/execution_environment.py +517 -0
  59. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/executions.py +1911 -0
  60. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/health.py +92 -0
  61. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/integrations.py +274 -0
  62. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/models.py +82 -0
  63. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/policies.py +639 -0
  64. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/presence.py +234 -0
  65. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/projects.py +902 -0
  66. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/runners.py +49 -0
  67. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/runtimes.py +56 -0
  68. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/secrets.py +155 -0
  69. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/task_planning.py +1256 -0
  70. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/task_queues.py +654 -0
  71. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/team_context.py +270 -0
  72. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/teams.py +1399 -0
  73. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/toolsets.py +714 -0
  74. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/toolsets_definitions.py +140 -0
  75. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/worker_queues.py +1472 -0
  76. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/workers.py +935 -0
  77. kubiya_control_plane_api-0.3.0/control_plane_api/app/routers/workflows.py +204 -0
  78. kubiya_control_plane_api-0.3.0/control_plane_api/app/services/__init__.py +1 -0
  79. kubiya_control_plane_api-0.3.0/control_plane_api/app/services/agno_service.py +619 -0
  80. kubiya_control_plane_api-0.3.0/control_plane_api/app/services/litellm_service.py +189 -0
  81. kubiya_control_plane_api-0.3.0/control_plane_api/app/services/policy_service.py +525 -0
  82. kubiya_control_plane_api-0.3.0/control_plane_api/app/services/temporal_cloud_provisioning.py +150 -0
  83. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/README.md +301 -0
  84. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/__init__.py +40 -0
  85. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/base.py +141 -0
  86. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/business_intelligence.py +189 -0
  87. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/data_visualization.py +154 -0
  88. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/docker.py +94 -0
  89. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/file_generation.py +94 -0
  90. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/file_system.py +110 -0
  91. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/python.py +92 -0
  92. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/registry.py +65 -0
  93. kubiya_control_plane_api-0.3.0/control_plane_api/app/toolsets/shell.py +102 -0
  94. kubiya_control_plane_api-0.3.0/control_plane_api/app/workflows/__init__.py +11 -0
  95. kubiya_control_plane_api-0.3.0/control_plane_api/app/workflows/agent_execution.py +504 -0
  96. kubiya_control_plane_api-0.3.0/control_plane_api/app/workflows/agent_execution_with_toolsets.py +222 -0
  97. kubiya_control_plane_api-0.3.0/control_plane_api/app/workflows/namespace_provisioning.py +326 -0
  98. kubiya_control_plane_api-0.3.0/control_plane_api/app/workflows/team_execution.py +399 -0
  99. kubiya_control_plane_api-0.3.0/control_plane_api/worker/__init__.py +0 -0
  100. kubiya_control_plane_api-0.3.0/control_plane_api/worker/activities/__init__.py +0 -0
  101. kubiya_control_plane_api-0.3.0/control_plane_api/worker/activities/agent_activities.py +1138 -0
  102. kubiya_control_plane_api-0.3.0/control_plane_api/worker/activities/approval_activities.py +234 -0
  103. kubiya_control_plane_api-0.3.0/control_plane_api/worker/activities/team_activities.py +1217 -0
  104. kubiya_control_plane_api-0.3.0/control_plane_api/worker/activities/toolset_activities.py +267 -0
  105. kubiya_control_plane_api-0.3.0/control_plane_api/worker/control_plane_client.py +460 -0
  106. kubiya_control_plane_api-0.3.0/control_plane_api/worker/models/__init__.py +1 -0
  107. kubiya_control_plane_api-0.3.0/control_plane_api/worker/models/inputs.py +89 -0
  108. kubiya_control_plane_api-0.3.0/control_plane_api/worker/runtimes/__init__.py +27 -0
  109. kubiya_control_plane_api-0.3.0/control_plane_api/worker/runtimes/base.py +233 -0
  110. kubiya_control_plane_api-0.3.0/control_plane_api/worker/runtimes/claude_code_runtime.py +431 -0
  111. kubiya_control_plane_api-0.3.0/control_plane_api/worker/runtimes/default_runtime.py +509 -0
  112. kubiya_control_plane_api-0.3.0/control_plane_api/worker/runtimes/factory.py +162 -0
  113. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/__init__.py +1 -0
  114. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/agent_executor.py +422 -0
  115. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/agent_executor_v2.py +370 -0
  116. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/approval_tools.py +310 -0
  117. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/approval_tools_agno.py +207 -0
  118. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/cancellation_manager.py +177 -0
  119. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/data_visualization.py +827 -0
  120. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/jira_tools.py +257 -0
  121. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/session_service.py +194 -0
  122. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/team_executor.py +574 -0
  123. kubiya_control_plane_api-0.3.0/control_plane_api/worker/services/toolset_factory.py +105 -0
  124. kubiya_control_plane_api-0.3.0/control_plane_api/worker/tests/__init__.py +1 -0
  125. kubiya_control_plane_api-0.3.0/control_plane_api/worker/tests/e2e/__init__.py +0 -0
  126. kubiya_control_plane_api-0.3.0/control_plane_api/worker/tests/e2e/test_execution_flow.py +571 -0
  127. kubiya_control_plane_api-0.3.0/control_plane_api/worker/tests/integration/__init__.py +0 -0
  128. kubiya_control_plane_api-0.3.0/control_plane_api/worker/tests/integration/test_control_plane_integration.py +308 -0
  129. kubiya_control_plane_api-0.3.0/control_plane_api/worker/tests/unit/__init__.py +0 -0
  130. kubiya_control_plane_api-0.3.0/control_plane_api/worker/tests/unit/test_control_plane_client.py +401 -0
  131. kubiya_control_plane_api-0.3.0/control_plane_api/worker/utils/__init__.py +1 -0
  132. kubiya_control_plane_api-0.3.0/control_plane_api/worker/utils/retry_utils.py +60 -0
  133. kubiya_control_plane_api-0.3.0/control_plane_api/worker/utils/streaming_utils.py +357 -0
  134. kubiya_control_plane_api-0.3.0/control_plane_api/worker/worker.py +741 -0
  135. kubiya_control_plane_api-0.3.0/control_plane_api/worker/workflows/__init__.py +0 -0
  136. kubiya_control_plane_api-0.3.0/control_plane_api/worker/workflows/agent_execution.py +472 -0
  137. kubiya_control_plane_api-0.3.0/control_plane_api/worker/workflows/team_execution.py +429 -0
  138. kubiya_control_plane_api-0.3.0/kubiya_control_plane_api.egg-info/PKG-INFO +202 -0
  139. kubiya_control_plane_api-0.3.0/kubiya_control_plane_api.egg-info/SOURCES.txt +144 -0
  140. kubiya_control_plane_api-0.3.0/kubiya_control_plane_api.egg-info/dependency_links.txt +1 -0
  141. kubiya_control_plane_api-0.3.0/kubiya_control_plane_api.egg-info/entry_points.txt +2 -0
  142. kubiya_control_plane_api-0.3.0/kubiya_control_plane_api.egg-info/requires.txt +47 -0
  143. kubiya_control_plane_api-0.3.0/kubiya_control_plane_api.egg-info/top_level.txt +1 -0
  144. kubiya_control_plane_api-0.3.0/pyproject.toml +183 -0
  145. kubiya_control_plane_api-0.3.0/setup.cfg +4 -0
  146. kubiya_control_plane_api-0.3.0/setup.py +15 -0
@@ -0,0 +1,42 @@
1
+ # Include documentation
2
+ include README_PYPI.md
3
+ include control_plane_api/README.md
4
+ include control_plane_api/LICENSE
5
+
6
+ # Include configuration files
7
+ include pyproject.toml
8
+ include control_plane_api/alembic.ini
9
+ include control_plane_api/pytest.ini
10
+
11
+ # Include executable scripts
12
+ include run_server.py
13
+ include control_plane_api/worker.py
14
+ include build.sh
15
+
16
+ # Include policy files
17
+ recursive-include control_plane_api/app/policies *.rego
18
+ recursive-include control_plane_api/app/policies *.md
19
+
20
+ # Include toolset documentation
21
+ recursive-include control_plane_api/app/toolsets *.md
22
+
23
+ # Include alembic migrations
24
+ recursive-include control_plane_api/alembic *.py
25
+ recursive-include control_plane_api/alembic *.mako
26
+ include control_plane_api/alembic/README
27
+
28
+ # Exclude compiled Python files
29
+ global-exclude *.py[cod]
30
+ global-exclude __pycache__
31
+ global-exclude *.so
32
+
33
+ # Exclude test and development files
34
+ recursive-exclude control_plane_api/tests *
35
+ exclude .gitignore
36
+ exclude .dockerignore
37
+ exclude Dockerfile
38
+ exclude docker-compose.yml
39
+ exclude vercel.json
40
+
41
+
42
+
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: kubiya-control-plane-api
3
+ Version: 0.3.0
4
+ Summary: Agent Control Plane API - Multi-tenant AI agent orchestration and management platform
5
+ Author-email: Kubiya <support@kubiya.ai>
6
+ License-Expression: MIT
7
+ Keywords: ai,agents,orchestration,temporal,fastapi,multi-tenant,workflow,automation
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Framework :: FastAPI
16
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
17
+ Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
18
+ Requires-Python: <4.0.0,>=3.10
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: fastapi<1.0.0,>=0.109.0
21
+ Requires-Dist: uvicorn[standard]<1.0.0,>=0.27.0
22
+ Requires-Dist: sqlalchemy<3.0.0,>=2.0.25
23
+ Requires-Dist: psycopg2-binary<3.0.0,>=2.9.9
24
+ Requires-Dist: pydantic<3.0.0,>=2.5.3
25
+ Requires-Dist: pydantic-settings<3.0.0,>=2.1.0
26
+ Requires-Dist: alembic<2.0.0,>=1.13.1
27
+ Requires-Dist: httpx<1.0.0,>=0.26.0
28
+ Requires-Dist: python-multipart<1.0.0,>=0.0.6
29
+ Requires-Dist: python-jose[cryptography]<4.0.0,>=3.3.0
30
+ Requires-Dist: PyJWT<3.0.0,>=2.8.0
31
+ Requires-Dist: passlib[bcrypt]<2.0.0,>=1.7.4
32
+ Requires-Dist: litellm<2.0.0,>=1.30.0
33
+ Requires-Dist: agno<3.0.0,>=2.0.10
34
+ Requires-Dist: supabase<3.0.0,>=2.3.0
35
+ Requires-Dist: temporalio<2.0.0,>=1.5.0
36
+ Requires-Dist: structlog<25.0.0,>=24.1.0
37
+ Requires-Dist: mangum<1.0.0,>=0.17.0
38
+ Requires-Dist: mcp<2.0.0,>=1.0.0
39
+ Requires-Dist: nest-asyncio<2.0.0,>=1.5.0
40
+ Requires-Dist: docker<8.0.0,>=7.0.0
41
+ Requires-Dist: redis<6.0.0,>=5.0.0
42
+ Requires-Dist: psutil<6.0.0,>=5.9.0
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest<9.0.0,>=7.4.0; extra == "dev"
45
+ Requires-Dist: pytest-asyncio<1.0.0,>=0.21.0; extra == "dev"
46
+ Requires-Dist: pytest-cov<6.0.0,>=4.1.0; extra == "dev"
47
+ Requires-Dist: pytest-mock<4.0.0,>=3.11.0; extra == "dev"
48
+ Requires-Dist: pytest-xdist<4.0.0,>=3.5.0; extra == "dev"
49
+ Requires-Dist: fakeredis<3.0.0,>=2.20.0; extra == "dev"
50
+ Requires-Dist: respx<1.0.0,>=0.20.0; extra == "dev"
51
+ Requires-Dist: black<25.0.0,>=23.0.0; extra == "dev"
52
+ Requires-Dist: ruff<1.0.0,>=0.1.0; extra == "dev"
53
+ Requires-Dist: mypy<2.0.0,>=1.0.0; extra == "dev"
54
+ Provides-Extra: test
55
+ Requires-Dist: pytest<9.0.0,>=7.4.0; extra == "test"
56
+ Requires-Dist: pytest-asyncio<1.0.0,>=0.21.0; extra == "test"
57
+ Requires-Dist: pytest-cov<6.0.0,>=4.1.0; extra == "test"
58
+ Requires-Dist: pytest-mock<4.0.0,>=3.11.0; extra == "test"
59
+ Requires-Dist: pytest-xdist<4.0.0,>=3.5.0; extra == "test"
60
+ Requires-Dist: fakeredis<3.0.0,>=2.20.0; extra == "test"
61
+ Requires-Dist: respx<1.0.0,>=0.20.0; extra == "test"
62
+ Provides-Extra: all
63
+ Requires-Dist: kubiya-control-plane-api[dev,test]; extra == "all"
64
+
65
+ # Kubiya Control Plane API
66
+
67
+ Multi-tenant AI agent orchestration and management platform powered by Temporal workflows.
68
+
69
+ ## Installation
70
+
71
+ ### Basic Installation
72
+
73
+ ```bash
74
+ pip install kubiya-control-plane-api
75
+ ```
76
+
77
+ ### Installation with Extras
78
+
79
+ Install with development dependencies:
80
+
81
+ ```bash
82
+ pip install "kubiya-control-plane-api[dev]"
83
+ ```
84
+
85
+ Install with test dependencies:
86
+
87
+ ```bash
88
+ pip install "kubiya-control-plane-api[test]"
89
+ ```
90
+
91
+ Install with all optional dependencies:
92
+
93
+ ```bash
94
+ pip install "kubiya-control-plane-api[all]"
95
+ ```
96
+
97
+ ## Running for Development
98
+
99
+ ### 1. Clone the repository
100
+
101
+ ```bash
102
+ git clone https://github.com/kubiyabot/agent-control-plane.git
103
+ cd agent-control-plane
104
+ ```
105
+
106
+ ### 2. Set up environment variables
107
+
108
+ Create a `.env` file with the required variables (see below).
109
+
110
+ ### 3. Build an image and run.
111
+
112
+ ```bash
113
+ make build
114
+
115
+ make up
116
+ ```
117
+
118
+ The API will be available at `http://localhost:7777/api/docs`
119
+
120
+ ## Running the Worker
121
+
122
+ The worker processes Temporal workflows for agent execution.
123
+
124
+ ### Using the CLI command
125
+
126
+ After installing the package, run:
127
+
128
+ ```bash
129
+ kubiya-control-plane-worker
130
+ ```
131
+
132
+ ### Using Python module
133
+
134
+ ```bash
135
+ python -m control_plane_api.worker
136
+ ```
137
+
138
+ ## Required Environment Variables
139
+
140
+ The following environment variables **must** be set to run the worker:
141
+
142
+ ### Temporal Configuration (Required)
143
+
144
+ ```bash
145
+ TEMPORAL_HOST=localhost:7233
146
+ TEMPORAL_NAMESPACE=default
147
+ ```
148
+
149
+ - `TEMPORAL_HOST`: Address of your Temporal server
150
+ - `TEMPORAL_NAMESPACE`: Temporal namespace to use
151
+
152
+ ### Database Configuration (Required)
153
+
154
+ **Option 1: Direct PostgreSQL**
155
+
156
+ ```bash
157
+ DATABASE_URL=postgresql://user:password@localhost:5432/control_plane
158
+ ```
159
+
160
+ **Option 2: Supabase**
161
+
162
+ ```bash
163
+ SUPABASE_URL=https://your-project.supabase.co
164
+ SUPABASE_SERVICE_KEY=your-service-role-key
165
+ SUPABASE_POSTGRES_URL=postgresql://user:password@host:5432/database
166
+ ```
167
+
168
+ You need **either** `DATABASE_URL` **or** all three Supabase variables.
169
+
170
+ ### Temporal Cloud Authentication (If using Temporal Cloud)
171
+
172
+ If connecting to Temporal Cloud instead of a self-hosted server, you also need **one** of:
173
+
174
+ **Option A: API Key**
175
+
176
+ ```bash
177
+ TEMPORAL_API_KEY=your-temporal-cloud-api-key
178
+ ```
179
+
180
+ **Option B: mTLS Certificates**
181
+
182
+ ```bash
183
+ TEMPORAL_CLIENT_CERT_PATH=/path/to/cert.pem
184
+ TEMPORAL_CLIENT_KEY_PATH=/path/to/key.pem
185
+ ```
186
+
187
+ ### Quick Start Example
188
+
189
+ ```bash
190
+ # 1. Install the package
191
+ pip install kubiya-control-plane-api
192
+
193
+ # 2. Set required environment variables
194
+ export TEMPORAL_HOST=localhost:7233
195
+ export TEMPORAL_NAMESPACE=default
196
+ export DATABASE_URL=postgresql://user:password@localhost:5432/control_plane
197
+
198
+ # 3. Run the worker
199
+ kubiya-control-plane-worker
200
+ ```
201
+
202
+ The worker will connect to Temporal and start processing agent execution workflows.
@@ -0,0 +1,138 @@
1
+ # Kubiya Control Plane API
2
+
3
+ Multi-tenant AI agent orchestration and management platform powered by Temporal workflows.
4
+
5
+ ## Installation
6
+
7
+ ### Basic Installation
8
+
9
+ ```bash
10
+ pip install kubiya-control-plane-api
11
+ ```
12
+
13
+ ### Installation with Extras
14
+
15
+ Install with development dependencies:
16
+
17
+ ```bash
18
+ pip install "kubiya-control-plane-api[dev]"
19
+ ```
20
+
21
+ Install with test dependencies:
22
+
23
+ ```bash
24
+ pip install "kubiya-control-plane-api[test]"
25
+ ```
26
+
27
+ Install with all optional dependencies:
28
+
29
+ ```bash
30
+ pip install "kubiya-control-plane-api[all]"
31
+ ```
32
+
33
+ ## Running for Development
34
+
35
+ ### 1. Clone the repository
36
+
37
+ ```bash
38
+ git clone https://github.com/kubiyabot/agent-control-plane.git
39
+ cd agent-control-plane
40
+ ```
41
+
42
+ ### 2. Set up environment variables
43
+
44
+ Create a `.env` file with the required variables (see below).
45
+
46
+ ### 3. Build an image and run.
47
+
48
+ ```bash
49
+ make build
50
+
51
+ make up
52
+ ```
53
+
54
+ The API will be available at `http://localhost:7777/api/docs`
55
+
56
+ ## Running the Worker
57
+
58
+ The worker processes Temporal workflows for agent execution.
59
+
60
+ ### Using the CLI command
61
+
62
+ After installing the package, run:
63
+
64
+ ```bash
65
+ kubiya-control-plane-worker
66
+ ```
67
+
68
+ ### Using Python module
69
+
70
+ ```bash
71
+ python -m control_plane_api.worker
72
+ ```
73
+
74
+ ## Required Environment Variables
75
+
76
+ The following environment variables **must** be set to run the worker:
77
+
78
+ ### Temporal Configuration (Required)
79
+
80
+ ```bash
81
+ TEMPORAL_HOST=localhost:7233
82
+ TEMPORAL_NAMESPACE=default
83
+ ```
84
+
85
+ - `TEMPORAL_HOST`: Address of your Temporal server
86
+ - `TEMPORAL_NAMESPACE`: Temporal namespace to use
87
+
88
+ ### Database Configuration (Required)
89
+
90
+ **Option 1: Direct PostgreSQL**
91
+
92
+ ```bash
93
+ DATABASE_URL=postgresql://user:password@localhost:5432/control_plane
94
+ ```
95
+
96
+ **Option 2: Supabase**
97
+
98
+ ```bash
99
+ SUPABASE_URL=https://your-project.supabase.co
100
+ SUPABASE_SERVICE_KEY=your-service-role-key
101
+ SUPABASE_POSTGRES_URL=postgresql://user:password@host:5432/database
102
+ ```
103
+
104
+ You need **either** `DATABASE_URL` **or** all three Supabase variables.
105
+
106
+ ### Temporal Cloud Authentication (If using Temporal Cloud)
107
+
108
+ If connecting to Temporal Cloud instead of a self-hosted server, you also need **one** of:
109
+
110
+ **Option A: API Key**
111
+
112
+ ```bash
113
+ TEMPORAL_API_KEY=your-temporal-cloud-api-key
114
+ ```
115
+
116
+ **Option B: mTLS Certificates**
117
+
118
+ ```bash
119
+ TEMPORAL_CLIENT_CERT_PATH=/path/to/cert.pem
120
+ TEMPORAL_CLIENT_KEY_PATH=/path/to/key.pem
121
+ ```
122
+
123
+ ### Quick Start Example
124
+
125
+ ```bash
126
+ # 1. Install the package
127
+ pip install kubiya-control-plane-api
128
+
129
+ # 2. Set required environment variables
130
+ export TEMPORAL_HOST=localhost:7233
131
+ export TEMPORAL_NAMESPACE=default
132
+ export DATABASE_URL=postgresql://user:password@localhost:5432/control_plane
133
+
134
+ # 3. Run the worker
135
+ kubiya-control-plane-worker
136
+ ```
137
+
138
+ The worker will connect to Temporal and start processing agent execution workflows.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kubiya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,266 @@
1
+ # Kubiya Control Plane API
2
+
3
+ A multi-tenant AI agent orchestration and management platform built with FastAPI, Temporal, and PostgreSQL.
4
+
5
+ ## Features
6
+
7
+ - **Multi-tenant Architecture**: Manage multiple projects, teams, and agents
8
+ - **Workflow Orchestration**: Temporal-based workflow execution
9
+ - **Flexible Agent Runtime**: Support for multiple agent types and toolsets
10
+ - **Policy Enforcement**: OPA-based policy engine for agent governance
11
+ - **Scalable Workers**: Distributed worker architecture for agent execution
12
+ - **Context Management**: Environment and team-specific context handling
13
+ - **LLM Integration**: Support for multiple LLM providers via LiteLLM
14
+ - **Comprehensive APIs**: RESTful APIs for all platform features
15
+
16
+ ## Installation
17
+
18
+ ### Using pip
19
+
20
+ ```bash
21
+ pip install kubiya-control_plane_api
22
+ ```
23
+
24
+ ### From source
25
+
26
+ ```bash
27
+ git clone https://github.com/kubiyabot/agent-control-plane.git
28
+ cd agent-control-plane/control_plane_api
29
+ pip install -e .
30
+ ```
31
+
32
+ ### With development dependencies
33
+
34
+ ```bash
35
+ pip install kubiya-control_plane_api[dev]
36
+ ```
37
+
38
+ ## Quick Start
39
+
40
+ ### 1. Set up environment variables
41
+
42
+ Create a `.env` file or set the following environment variables:
43
+
44
+ ```bash
45
+ # Database Configuration
46
+ DATABASE_URL=postgresql://user:password@localhost:5432/control_plane
47
+
48
+ # Supabase (for serverless deployments)
49
+ SUPABASE_URL=your-supabase-url
50
+ SUPABASE_KEY=your-supabase-key
51
+
52
+ # Temporal Configuration
53
+ TEMPORAL_HOST=localhost:7233
54
+ TEMPORAL_NAMESPACE=default
55
+
56
+ # API Configuration
57
+ API_TITLE="Agent Control Plane"
58
+ API_VERSION="1.0.0"
59
+ ENVIRONMENT=development
60
+ LOG_LEVEL=info
61
+
62
+ # Security
63
+ SECRET_KEY=your-secret-key-here
64
+
65
+ # Optional: Kubiya Integration
66
+ KUBIYA_API_KEY=your-kubiya-api-key
67
+ KUBIYA_API_URL=https://api.kubiya.ai
68
+ ```
69
+
70
+ ### 2. Run database migrations
71
+
72
+ ```bash
73
+ alembic upgrade head
74
+ ```
75
+
76
+ ### 3. Start the API server
77
+
78
+ ```bash
79
+ uvicorn app.main:app --host 0.0.0.0 --port 7777 --reload
80
+ ```
81
+
82
+ The API will be available at `http://localhost:7777`
83
+
84
+ ### 4. Access the API documentation
85
+
86
+ Open your browser and navigate to:
87
+ - Swagger UI: `http://localhost:7777/api/docs`
88
+ - ReDoc: `http://localhost:7777/api/redoc`
89
+
90
+ ### 5. Start a worker (optional)
91
+
92
+ To process agent execution workflows:
93
+
94
+ ```bash
95
+ python worker.py
96
+ ```
97
+
98
+ ## Package Structure
99
+
100
+ ```
101
+ app/
102
+ ├── activities/ # Temporal activities
103
+ ├── lib/ # Client libraries (Kubiya, Redis, Temporal, etc.)
104
+ ├── middleware/ # FastAPI middleware (auth, etc.)
105
+ ├── models/ # SQLAlchemy models
106
+ ├── policies/ # OPA policy files (.rego)
107
+ ├── routers/ # FastAPI route handlers
108
+ ├── services/ # Business logic services
109
+ ├── toolsets/ # Agent toolsets
110
+ ├── workflows/ # Temporal workflows
111
+ ├── config.py # Configuration management
112
+ ├── database.py # Database connection
113
+ └── main.py # FastAPI application entry point
114
+ ```
115
+
116
+ ## API Endpoints
117
+
118
+ ### Core Resources
119
+
120
+ - **Projects**: `/api/v1/projects` - Multi-project management
121
+ - **Environments**: `/api/v1/environments` - Environment configuration
122
+ - **Agents**: `/api/v1/agents` - Agent management
123
+ - **Teams**: `/api/v1/teams` - Team management
124
+ - **Workflows**: `/api/v1/workflows` - Workflow definitions
125
+ - **Executions**: `/api/v1/executions` - Execution tracking
126
+ - **Workers**: `/api/v1/workers` - Worker registration and management
127
+
128
+ ### Toolsets and Policies
129
+
130
+ - **Toolsets**: `/api/v1/toolsets` - Tool sets and definitions
131
+ - **Policies**: `/api/v1/policies` - Policy management and enforcement
132
+
133
+ ### Integration
134
+
135
+ - **Secrets**: `/api/v1/secrets` - Secrets management (proxies to Kubiya)
136
+ - **Integrations**: `/api/v1/integrations` - Third-party integrations
137
+ - **Models**: `/api/v1/models` - LLM model configuration
138
+
139
+ ### Utilities
140
+
141
+ - **Health**: `/api/health` - Health check endpoint
142
+ - **Task Planning**: `/api/v1/task-planning` - AI-powered task planning
143
+
144
+ ## Configuration
145
+
146
+ The application uses Pydantic Settings for configuration management. All settings can be configured via environment variables or a `.env` file.
147
+
148
+ ### Key Configuration Options
149
+
150
+ - `DATABASE_URL`: PostgreSQL connection string
151
+ - `SUPABASE_URL`, `SUPABASE_KEY`: Supabase configuration for serverless
152
+ - `TEMPORAL_HOST`: Temporal server address
153
+ - `KUBIYA_API_KEY`: Kubiya platform API key
154
+ - `SECRET_KEY`: Secret key for JWT token signing
155
+ - `LOG_LEVEL`: Logging level (debug, info, warning, error)
156
+ - `ENVIRONMENT`: Deployment environment (development, staging, production)
157
+
158
+ ## Development
159
+
160
+ ### Install development dependencies
161
+
162
+ ```bash
163
+ pip install -e ".[dev]"
164
+ ```
165
+
166
+ ### Run tests
167
+
168
+ ```bash
169
+ # All tests
170
+ pytest
171
+
172
+ # Unit tests only
173
+ pytest -m unit
174
+
175
+ # Integration tests
176
+ pytest -m integration
177
+
178
+ # With coverage
179
+ pytest --cov=app --cov-report=html
180
+ ```
181
+
182
+ ### Code formatting
183
+
184
+ ```bash
185
+ # Format code with black
186
+ black .
187
+
188
+ # Lint with ruff
189
+ ruff check .
190
+ ```
191
+
192
+ ### Database migrations
193
+
194
+ ```bash
195
+ # Create a new migration
196
+ alembic revision --autogenerate -m "Description of changes"
197
+
198
+ # Apply migrations
199
+ alembic upgrade head
200
+
201
+ # Rollback migration
202
+ alembic downgrade -1
203
+ ```
204
+
205
+ ## Deployment
206
+
207
+ ### Docker
208
+
209
+ ```bash
210
+ docker build -t control_plane_api .
211
+ docker run -p 7777:7777 --env-file .env control_plane_api
212
+ ```
213
+
214
+ ### Vercel (Serverless)
215
+
216
+ The API is configured for Vercel deployment with `vercel.json` and the Mangum adapter.
217
+
218
+ ```bash
219
+ vercel deploy
220
+ ```
221
+
222
+ ## Architecture
223
+
224
+ ### Workflow Orchestration
225
+
226
+ The platform uses Temporal for reliable workflow execution:
227
+ - Durable execution with automatic retries
228
+ - Activity-based task decomposition
229
+ - Support for long-running workflows
230
+ - Built-in observability and monitoring
231
+
232
+ ### Multi-tenancy
233
+
234
+ - **Projects**: Top-level isolation boundary
235
+ - **Environments**: Isolated execution contexts within projects
236
+ - **Teams**: Collaborative agent groups
237
+ - **Agents**: Individual agent instances
238
+
239
+ ### Worker Architecture
240
+
241
+ Workers pull tasks from environment-specific queues and execute agent workflows using Temporal.
242
+
243
+ ## Contributing
244
+
245
+ 1. Fork the repository
246
+ 2. Create a feature branch
247
+ 3. Make your changes
248
+ 4. Run tests and linting
249
+ 5. Submit a pull request
250
+
251
+ ## License
252
+
253
+ MIT License - see LICENSE file for details
254
+
255
+ ## Support
256
+
257
+ For issues and questions:
258
+ - GitHub Issues: https://github.com/kubiyabot/agent-control-plane/issues
259
+ - Email: support@kubiya.ai
260
+
261
+ ## Links
262
+
263
+ - [Documentation](https://github.com/kubiyabot/agent-control-plane/blob/main/README.md)
264
+ - [GitHub Repository](https://github.com/kubiyabot/agent-control-plane)
265
+ - [Kubiya Platform](https://kubiya.ai)
266
+
@@ -0,0 +1 @@
1
+ __version__ = "v0.3.0"
@@ -0,0 +1 @@
1
+ Generic single-database configuration.