supervaizer 0.9.8__py3-none-any.whl → 0.10.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. supervaizer/__init__.py +11 -2
  2. supervaizer/__version__.py +1 -1
  3. supervaizer/account.py +4 -0
  4. supervaizer/account_service.py +7 -1
  5. supervaizer/admin/routes.py +24 -8
  6. supervaizer/admin/templates/agents.html +74 -0
  7. supervaizer/admin/templates/agents_grid.html +5 -3
  8. supervaizer/admin/templates/navigation.html +11 -1
  9. supervaizer/admin/templates/supervaize_instructions.html +212 -0
  10. supervaizer/agent.py +28 -6
  11. supervaizer/case.py +46 -14
  12. supervaizer/cli.py +247 -7
  13. supervaizer/common.py +45 -4
  14. supervaizer/deploy/__init__.py +16 -0
  15. supervaizer/deploy/cli.py +296 -0
  16. supervaizer/deploy/commands/__init__.py +9 -0
  17. supervaizer/deploy/commands/clean.py +294 -0
  18. supervaizer/deploy/commands/down.py +119 -0
  19. supervaizer/deploy/commands/local.py +460 -0
  20. supervaizer/deploy/commands/plan.py +167 -0
  21. supervaizer/deploy/commands/status.py +169 -0
  22. supervaizer/deploy/commands/up.py +281 -0
  23. supervaizer/deploy/docker.py +378 -0
  24. supervaizer/deploy/driver_factory.py +42 -0
  25. supervaizer/deploy/drivers/__init__.py +39 -0
  26. supervaizer/deploy/drivers/aws_app_runner.py +607 -0
  27. supervaizer/deploy/drivers/base.py +196 -0
  28. supervaizer/deploy/drivers/cloud_run.py +570 -0
  29. supervaizer/deploy/drivers/do_app_platform.py +504 -0
  30. supervaizer/deploy/health.py +404 -0
  31. supervaizer/deploy/state.py +210 -0
  32. supervaizer/deploy/templates/Dockerfile.template +44 -0
  33. supervaizer/deploy/templates/debug_env.py +69 -0
  34. supervaizer/deploy/templates/docker-compose.yml.template +37 -0
  35. supervaizer/deploy/templates/dockerignore.template +66 -0
  36. supervaizer/deploy/templates/entrypoint.sh +20 -0
  37. supervaizer/deploy/utils.py +52 -0
  38. supervaizer/examples/controller_template.py +1 -1
  39. supervaizer/job.py +18 -5
  40. supervaizer/job_service.py +6 -5
  41. supervaizer/parameter.py +13 -1
  42. supervaizer/protocol/__init__.py +2 -2
  43. supervaizer/protocol/a2a/routes.py +1 -1
  44. supervaizer/routes.py +141 -17
  45. supervaizer/server.py +5 -11
  46. supervaizer/utils/__init__.py +16 -0
  47. supervaizer/utils/version_check.py +56 -0
  48. {supervaizer-0.9.8.dist-info → supervaizer-0.10.1.dist-info}/METADATA +105 -34
  49. supervaizer-0.10.1.dist-info/RECORD +76 -0
  50. {supervaizer-0.9.8.dist-info → supervaizer-0.10.1.dist-info}/WHEEL +1 -1
  51. supervaizer/protocol/acp/__init__.py +0 -21
  52. supervaizer/protocol/acp/model.py +0 -198
  53. supervaizer/protocol/acp/routes.py +0 -74
  54. supervaizer-0.9.8.dist-info/RECORD +0 -52
  55. {supervaizer-0.9.8.dist-info → supervaizer-0.10.1.dist-info}/entry_points.txt +0 -0
  56. {supervaizer-0.9.8.dist-info → supervaizer-0.10.1.dist-info}/licenses/LICENSE.md +0 -0
@@ -0,0 +1,76 @@
1
+ supervaizer/__init__.py,sha256=eBbGjduMBH-FDjcGlSqeR4Kf4uo60Cf1DrRur8VGkJo,2341
2
+ supervaizer/__version__.py,sha256=2PlxuvWcWSJzHgfBHs6FLM9v9mf7WLcwSudbg3ovsHQ,348
3
+ supervaizer/account.py,sha256=-K1pd590Lp2TncZ2jn442kBLxnm482G3WnQavVFxZ1s,11102
4
+ supervaizer/account_service.py,sha256=z4lw8qp8XvCrU6Ndf4VHRnQwY_071410ts5_7E8YDAs,3046
5
+ supervaizer/agent.py,sha256=Clenvdr_v-lV7_v6YCcevp8dj5JUNvpTWrBZBYM82lg,36509
6
+ supervaizer/case.py,sha256=dOgRujyf4MFcZ-937zxJbqLIPduKg6ZspHuhnWiq13Q,14385
7
+ supervaizer/cli.py,sha256=L9ZKQygBnpY-3qH_9YAbQEu0j7heSD4NGApM8mrpPH4,13525
8
+ supervaizer/common.py,sha256=6ygNS1YxliP-e6OEVX7vDuC8YAaT2rYhjqQ_8txnWlg,10066
9
+ supervaizer/event.py,sha256=2aupUV1HkF0-nBFVmO5ddvj9jb4MiWr2MCxEamHFhx4,5516
10
+ supervaizer/instructions.py,sha256=L0uoZXg8N4PnLxJiqBgD4Pbce-hHTDUx1yImRbtNZNg,4146
11
+ supervaizer/job.py,sha256=sHDic0q-Eujei7GNb64VO7rRsBd88optrWC8Z3iMZ5Q,13554
12
+ supervaizer/job_service.py,sha256=22Qe7Z5_u3R28tcNH_21YMIYciWFtJaM7I-MXtIhBMU,4681
13
+ supervaizer/lifecycle.py,sha256=5CunJN7MsM5blyNiFMJMLFDUBmTmmAsPE24QC-gSbYA,13958
14
+ supervaizer/parameter.py,sha256=sYDuGof_w6mlix0oxjB6odV0sO0QSBL1KwFZa3Y2cOA,8157
15
+ supervaizer/routes.py,sha256=o3u7pGGLE0MQzWtQNdd5xk1M0G9Y_BR_JiLVmCFtdC4,34319
16
+ supervaizer/server.py,sha256=cXwB2XfIBQJ6zFaUde4OTCPgHpb_tpsUy9cRkkXqA-Q,20805
17
+ supervaizer/server_utils.py,sha256=FMglpADQBJynkR2v-pfwANu6obsaPvR9j0BQc5Otpac,1590
18
+ supervaizer/storage.py,sha256=JO2pczuuJkQtk9o14_7z8yRV_q3bEir3Dtl6ejPIixY,14276
19
+ supervaizer/telemetry.py,sha256=XSYw8ZwoY8W6C7mhwHU67t7trJzWd7CBkkSNdsDT_HA,2596
20
+ supervaizer/admin/routes.py,sha256=r9hucWtNiTGQHgv9DsRkVpwnLbyLFaqrbse1orl-oTA,45627
21
+ supervaizer/admin/static/js/job-start-form.js,sha256=s--AGVYzgc9mE20POYeM0BNm0Wy41aBZVv99tc0cSPU,11938
22
+ supervaizer/admin/templates/agent_detail.html,sha256=DFOGfjuQNC39FOLYUW_jD0A01WpBY1umatGCslyJ0_c,7581
23
+ supervaizer/admin/templates/agents.html,sha256=orB_z1iMFE2MKhFm9XejwZjmzMC1PVT69oB-F9YZPHQ,12678
24
+ supervaizer/admin/templates/agents_grid.html,sha256=Hqgmgc4RhtnR-resuMZ8rj4uPJl6mHBOBTtZ5rLG90A,6106
25
+ supervaizer/admin/templates/base.html,sha256=ZGS-6IxGRYK41E5Jp3MVrGSwCugg8AVHtW21kKCBDvo,10405
26
+ supervaizer/admin/templates/case_detail.html,sha256=cJ4TUJI3ix3a-veb4g0Tp0AY-uJr0SducK70MZPFsZQ,13848
27
+ supervaizer/admin/templates/cases_list.html,sha256=UV4SfULzxNiOpG8aNddablpwf6hVNpRbAc6dgTmp6_E,9324
28
+ supervaizer/admin/templates/cases_table.html,sha256=VyL5mEF003FTNHym1UYBD8JkvhA9wR328ciTKNKxdb8,6619
29
+ supervaizer/admin/templates/console.html,sha256=tLGGf8vHjGK77Il6SYlgparoU_xz3nbvNpGVQRkVNCc,13966
30
+ supervaizer/admin/templates/dashboard.html,sha256=3Pu5bR78QUcPNp5MyXkyibfp-wxYdJyyf77v3O_f_hU,7873
31
+ supervaizer/admin/templates/job_detail.html,sha256=LDTMWLURyVCp7SMTxQ4M8AFqNpbbUVUx253negp9JNA,10790
32
+ supervaizer/admin/templates/job_start_test.html,sha256=eAogAit0JfuMU4N5YR7N03w0nD_Bi9mtiX8uJ7dHLPg,4270
33
+ supervaizer/admin/templates/jobs_list.html,sha256=VJ2VYe62dHXvjQQgUAVyKcn58rO5919UuP3VKgxLVhM,9136
34
+ supervaizer/admin/templates/jobs_table.html,sha256=BCOI_7QlxJ5XOra7WKou48a2lNwQYASCMFTtgzHNotw,5974
35
+ supervaizer/admin/templates/navigation.html,sha256=Ci_CMLqBuIKRt3JCFtn9Vjz1AAkqC75WMT6IQUiByFI,11724
36
+ supervaizer/admin/templates/recent_activity.html,sha256=hL06GXF1a-C_tkj3pRLrDTTDqG0KplcWMZFengFMuEc,4843
37
+ supervaizer/admin/templates/server.html,sha256=m3qIQsEojogXQKTSD6ljKj4_lrwaLJTpTbMpfnWZHxU,5650
38
+ supervaizer/admin/templates/server_status_cards.html,sha256=yJ36hkfgQpscYkiaodFDQPnmJWeb2W7gey09Z3T6JsY,7882
39
+ supervaizer/admin/templates/supervaize_instructions.html,sha256=LTLla1xgIeLpFf7bond_lxH5qdQQ2ak52Fd7hqChi1I,10225
40
+ supervaizer/deploy/__init__.py,sha256=DvngGQu8tS_Yz5FU4kKCvPpod11IGCtZWkUNeB5aVHI,557
41
+ supervaizer/deploy/cli.py,sha256=pFsQjbALSkKiZ2_OGzNZJzX_vrshGyAzdf1jGShGztk,9841
42
+ supervaizer/deploy/docker.py,sha256=r1IplAWd7xWNlKZiLswLhlDdGO0SklOyC9YrNmntTGY,13828
43
+ supervaizer/deploy/driver_factory.py,sha256=Qm6DYVUfV3mlRHUglk5YlslGg6JYZ754uKeoiyxXw10,1487
44
+ supervaizer/deploy/health.py,sha256=vh4SMOxy43QXi1fanQjWfWqoGTy_z1VXwwfy4Fq2bHg,13764
45
+ supervaizer/deploy/state.py,sha256=DOpHOoU3IuaI2StE6G0LqzA1HiSDiqz2WDu2xexOYvc,7734
46
+ supervaizer/deploy/utils.py,sha256=YkhMz1bniTm0v3G4xpjMDgPr-n4keekz6wVesSRvTnU,1722
47
+ supervaizer/deploy/commands/__init__.py,sha256=uhdQpJ2Hly2YkkSBXKvGy77eyU0tIhNWD59C1x_6DPQ,365
48
+ supervaizer/deploy/commands/clean.py,sha256=zm76hmGTSSFAZdcQhVvn71secT4sE5IQqBM0zTDYC_g,9588
49
+ supervaizer/deploy/commands/down.py,sha256=Vo2Dw71BiTGSMCsjWNoq_oB_oecdV4oDnQ2LwIrv7oo,3929
50
+ supervaizer/deploy/commands/local.py,sha256=Ds2ECuyPeumA-G0OSoQmN0VM8iZ4CNqacWMSzy0r30k,16229
51
+ supervaizer/deploy/commands/plan.py,sha256=TjtEFGWlQrgyWvT4B7Ly8097jM--nQnkYCLaO65eNq0,5260
52
+ supervaizer/deploy/commands/status.py,sha256=sgHg0J8qJIuNYaCTlkMUggJ9Q4Cq1W5N-EvZXG9Iif0,5816
53
+ supervaizer/deploy/commands/up.py,sha256=5jmNB-n-TqLMVYRgs6KZ2VCt7DKGDwFukwzShtW3o2s,9292
54
+ supervaizer/deploy/drivers/__init__.py,sha256=NOHsmNYea7ARfuAhbuP4CC87BtMfKKDyC-Uz5sh2PHI,974
55
+ supervaizer/deploy/drivers/aws_app_runner.py,sha256=rABJOyjUSJUKFCOTWV92SNLaJK4oKpEmaljHcnQO3G0,22170
56
+ supervaizer/deploy/drivers/base.py,sha256=2MPsw6tgXBILCeHnYXuZtBYFQriwy41Iib8iQPLbDFQ,5267
57
+ supervaizer/deploy/drivers/cloud_run.py,sha256=wge26Egt0Qgbmi51Ttg_SZfGhDcwG_2UBb80pLUVHXQ,19912
58
+ supervaizer/deploy/drivers/do_app_platform.py,sha256=yWzJG4Y6Pn8BlX-plWB6kwbEKuV49P82ivc5Ovm7v1k,17328
59
+ supervaizer/deploy/templates/Dockerfile.template,sha256=VmR_znpKy0gR5aG1pIsZNxnNol65GSm79Fd5rFMzYf4,1261
60
+ supervaizer/deploy/templates/debug_env.py,sha256=WFlxfiCAlkxM1NybNvtmmG5zJnoSvjW9L8ATVjrg26E,2246
61
+ supervaizer/deploy/templates/docker-compose.yml.template,sha256=ZcW8WyhmqMElaxBpokuZG12n0tFJL8BY7k7Tvdz6tdw,1100
62
+ supervaizer/deploy/templates/dockerignore.template,sha256=bYFRn6QGsjtRDH-Y7vzWk3-u3jIp90FajV2Ed94ah5M,515
63
+ supervaizer/deploy/templates/entrypoint.sh,sha256=z079VUotu6DJX92fJiBB3eVwCEgcP6B9D9Fvwv_FL9w,463
64
+ supervaizer/examples/controller_template.py,sha256=gAmA3GnDTdYkDk3NpVe-6Adbsl4Oxs-iZKN6mrO3WEg,6419
65
+ supervaizer/protocol/__init__.py,sha256=00GHbUsLNsf0a1rQrUPpVN2Uy-7rDz72Ps6TUVD91tE,389
66
+ supervaizer/protocol/a2a/__init__.py,sha256=1ACfPGLzS6XdZPiFxn1nVamvbasqtJJ7U1BBbSmT-nI,625
67
+ supervaizer/protocol/a2a/model.py,sha256=sWzatlA_fcva_fdtM8Yh4cioRq0KbwV5AXpNCnsOtQo,7198
68
+ supervaizer/protocol/a2a/routes.py,sha256=rkQTNBD1NTYimKCb8iOk4bVf9ldDP1LqHfOsyhRNufw,3937
69
+ supervaizer/utils/__init__.py,sha256=fd0NFwN_cen3QPms2SOnuz4jcetay3f_31dit2As7EA,458
70
+ supervaizer/utils/version_check.py,sha256=-tsOURpHVh0LNTbpQsyJDJENKszC-NzXDSO_EToEQPE,1893
71
+ supervaizer/py.typed,sha256=bHhvLx7c6MqrzXVPbdK3qAOcSxzp4wDtTx4QifMC2EY,74
72
+ supervaizer-0.10.1.dist-info/METADATA,sha256=fGh4PQts-X8cPXVllIBRzkUwpebJ7i2b_qzZV6FiYtE,12605
73
+ supervaizer-0.10.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
74
+ supervaizer-0.10.1.dist-info/entry_points.txt,sha256=vL_IBR_AeEI2u2-6YL4PY9k2Mar4-gprG8-UxERWjmg,52
75
+ supervaizer-0.10.1.dist-info/licenses/LICENSE.md,sha256=dmdnt1vfpxNPr8Lt0BnxKE5uzUwK3CWTthTUStgOXjY,15327
76
+ supervaizer-0.10.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,21 +0,0 @@
1
- # Copyright (c) 2024-2025 Alain Prasquier - Supervaize.com. All rights reserved.
2
- #
3
- # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
- # If a copy of the MPL was not distributed with this file, you can obtain one at
5
- # https://mozilla.org/MPL/2.0/.
6
-
7
- """ACP protocol implementation for SUPERVAIZER."""
8
-
9
- from supervaizer.protocol.acp.model import (
10
- create_agent_detail,
11
- create_health_data,
12
- list_agents,
13
- )
14
- from supervaizer.protocol.acp.routes import create_routes
15
-
16
- __all__ = [
17
- "create_agent_detail",
18
- "list_agents",
19
- "create_health_data",
20
- "create_routes",
21
- ]
@@ -1,198 +0,0 @@
1
- # Copyright (c) 2024-2025 Alain Prasquier - Supervaize.com. All rights reserved.
2
- #
3
- # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
- # If a copy of the MPL was not distributed with this file, you can obtain one at
5
- # https://mozilla.org/MPL/2.0/.
6
-
7
- from datetime import datetime
8
- from typing import Any, Dict, List
9
-
10
- from supervaizer.agent import Agent
11
- from supervaizer.job import EntityStatus, Jobs
12
-
13
-
14
- def create_agent_detail(agent: Agent, base_url: str) -> Dict[str, Any]:
15
- """
16
- Create an ACP agent detail for the given agent.
17
-
18
- This follows the ACP protocol as defined in:
19
- https://docs.beeai.dev/acp/spec/concepts/discovery
20
-
21
- Args:
22
- agent: The Agent instance
23
- base_url: The base URL of the server
24
-
25
- Returns:
26
- A dictionary representing the agent detail in ACP format
27
- """
28
- # Build the interfaces object
29
- interfaces = {
30
- "input": "chat",
31
- "output": "chat",
32
- "awaits": [{"name": "user_response", "request": {}, "response": {}}],
33
- }
34
-
35
- # Build the metadata object
36
- metadata = {
37
- "documentation": agent.description or f"Documentation for {agent.name} agent",
38
- "license": "MPL-2.0",
39
- "programmingLanguage": "Python",
40
- "naturalLanguages": ["en"],
41
- "framework": "SUPERVAIZER",
42
- "useCases": [f"Agent services provided by {agent.name}"],
43
- "examples": [
44
- {
45
- "prompt": f"Example interaction with {agent.name}",
46
- "response": "Example response",
47
- }
48
- ],
49
- "tags": [agent.slug] + (agent.tags or []),
50
- "createdAt": datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ"),
51
- "updatedAt": datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ"),
52
- "author": {
53
- "name": agent.author or agent.developer or "SUPERVAIZER",
54
- "email": "info@supervaize.com",
55
- "url": "https://supervaize.com/",
56
- },
57
- "contributors": [
58
- {
59
- "name": agent.maintainer
60
- or agent.author
61
- or agent.developer
62
- or "SUPERVAIZER",
63
- "email": "info@supervaize.com",
64
- "url": "https://supervaize.com/",
65
- }
66
- ],
67
- "links": [
68
- {"type": "homepage", "url": f"{base_url}/agents/{agent.slug}"},
69
- {"type": "documentation", "url": f"{base_url}/docs"},
70
- {"type": "source-code", "url": "https://github.com/supervaize/supervaizer"},
71
- ],
72
- "dependencies": [{"type": "tool", "name": "supervaizer-core"}],
73
- "recommendedModels": ["gpt-4", "claude-3-opus"],
74
- }
75
-
76
- # Get job statistics for status data
77
- jobs_registry = Jobs()
78
- agent_jobs = jobs_registry.get_agent_jobs(agent.name)
79
-
80
- total_jobs = len(agent_jobs)
81
- completed_jobs = sum(
82
- 1 for j in agent_jobs.values() if j.status == EntityStatus.COMPLETED
83
- )
84
-
85
- # Calculate average runtime and success rate for status
86
- avg_run_time = 0.0
87
- if total_jobs > 0:
88
- success_rate = (completed_jobs / total_jobs) * 100
89
-
90
- # Calculate average runtime in seconds
91
- runtimes = []
92
- for job in agent_jobs.values():
93
- if (
94
- job.created_at
95
- and job.finished_at
96
- and job.status == EntityStatus.COMPLETED
97
- ):
98
- runtime = (job.finished_at - job.created_at).total_seconds()
99
- runtimes.append(runtime)
100
-
101
- if runtimes:
102
- avg_run_time = sum(runtimes) / len(runtimes)
103
- else:
104
- success_rate = 100 # If no jobs, assume 100% success rate
105
-
106
- # Build the status object
107
- status = {
108
- "avgRunTokens": 0, # Placeholder, actual token count if available
109
- "avgRunTimeSeconds": avg_run_time,
110
- "successRate": success_rate,
111
- }
112
-
113
- # Create the main agent detail
114
- agent_detail = {
115
- "name": agent.name,
116
- "description": agent.description,
117
- "interfaces": interfaces,
118
- "metadata": metadata,
119
- "status": status,
120
- }
121
-
122
- return agent_detail
123
-
124
-
125
- def list_agents(agents: List[Agent], base_url: str) -> List[Dict[str, Any]]:
126
- """
127
- Create a list of ACP agent details for all available agents.
128
-
129
- Args:
130
- agents: List of Agent instances
131
- base_url: The base URL of the server
132
-
133
- Returns:
134
- A list of dictionaries representing agent details in ACP format
135
- """
136
- return [create_agent_detail(agent, base_url) for agent in agents]
137
-
138
-
139
- def create_health_data(agents: List[Agent]) -> Dict[str, Any]:
140
- """
141
- Create health data for all agents according to ACP protocol.
142
-
143
- Args:
144
- agents: List of Agent instances
145
-
146
- Returns:
147
- A dictionary with health information for all agents
148
- """
149
- jobs_registry = Jobs()
150
-
151
- agents_health = {}
152
- for agent in agents:
153
- # Get agent jobs
154
- agent_jobs = jobs_registry.get_agent_jobs(agent.name)
155
-
156
- # Calculate job statistics
157
- total_jobs = len(agent_jobs)
158
- completed_jobs = sum(
159
- 1 for j in agent_jobs.values() if j.status == EntityStatus.COMPLETED
160
- )
161
- failed_jobs = sum(
162
- 1 for j in agent_jobs.values() if j.status == EntityStatus.FAILED
163
- )
164
- in_progress_jobs = sum(
165
- 1 for j in agent_jobs.values() if j.status == EntityStatus.IN_PROGRESS
166
- )
167
-
168
- # Set agent status based on health indicators
169
- if total_jobs == 0:
170
- status = "available"
171
- elif failed_jobs > total_jobs / 2: # If more than half are failing
172
- status = "degraded"
173
- elif in_progress_jobs > 0:
174
- status = "busy"
175
- else:
176
- status = "available"
177
-
178
- agents_health[agent.id] = {
179
- "agent_id": agent.id,
180
- "name": agent.name,
181
- "status": status,
182
- "version": agent.version,
183
- "statistics": {
184
- "total_jobs": total_jobs,
185
- "completed_jobs": completed_jobs,
186
- "failed_jobs": failed_jobs,
187
- "in_progress_jobs": in_progress_jobs,
188
- "success_rate": (completed_jobs / total_jobs * 100)
189
- if total_jobs > 0
190
- else 100,
191
- },
192
- }
193
-
194
- return {
195
- "status": "operational",
196
- "timestamp": str(datetime.now()),
197
- "agents": agents_health,
198
- }
@@ -1,74 +0,0 @@
1
- # Copyright (c) 2024-2025 Alain Prasquier - Supervaize.com. All rights reserved.
2
- #
3
- # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
- # If a copy of the MPL was not distributed with this file, you can obtain one at
5
- # https://mozilla.org/MPL/2.0/.
6
-
7
- from typing import TYPE_CHECKING, Any, Dict, List
8
-
9
- from fastapi import APIRouter
10
-
11
- from supervaizer.common import log
12
- from supervaizer.protocol.acp.model import (
13
- create_agent_detail,
14
- create_health_data,
15
- list_agents,
16
- )
17
- from supervaizer.routes import handle_route_errors
18
-
19
- if TYPE_CHECKING:
20
- from supervaizer.agent import Agent
21
- from supervaizer.server import Server
22
-
23
-
24
- def create_routes(server: "Server") -> APIRouter:
25
- """Create ACP protocol routes for the server."""
26
- router = APIRouter(prefix="/agents", tags=["Protocol ACP"])
27
- base_url = server.public_url or ""
28
-
29
- @router.get(
30
- "",
31
- summary="ACP Agents Discovery",
32
- description="Returns a list of all agents according to ACP protocol specification",
33
- response_model=List[Dict[str, Any]],
34
- )
35
- @handle_route_errors()
36
- async def get_acp_agents() -> List[Dict[str, Any]]:
37
- """Get a list of all available agents in ACP format."""
38
- log.info("[ACP] GET /agents [Agent discovery]")
39
- return list_agents(server.agents, base_url)
40
-
41
- # Create explicit routes for each agent
42
- for agent in server.agents:
43
-
44
- def create_agent_route(current_agent: "Agent") -> None:
45
- route_path = f"/{current_agent.slug}"
46
-
47
- @router.get(
48
- route_path,
49
- summary=f"ACP Agent Detail for {current_agent.name}",
50
- description=f"Returns details for agent {current_agent.name} according to ACP protocol specification",
51
- response_model=Dict[str, Any],
52
- )
53
- @handle_route_errors()
54
- async def get_agent_detail() -> Dict[str, Any]:
55
- """Get details for a specific agent in ACP format."""
56
- log.info(f"[ACP] GET /agents/{current_agent.slug} [Agent detail]")
57
- return create_agent_detail(current_agent, base_url)
58
-
59
- # Call the closure function with the current agent
60
- create_agent_route(agent)
61
-
62
- @router.get(
63
- "/health",
64
- summary="ACP Health Status",
65
- description="Returns health information about the server and agents",
66
- response_model=Dict[str, Any],
67
- )
68
- @handle_route_errors()
69
- async def get_acp_health() -> Dict[str, Any]:
70
- """Get health information for the server and all agents."""
71
- log.info("[ACP] GET /agents/health [Health status]")
72
- return create_health_data(server.agents)
73
-
74
- return router
@@ -1,52 +0,0 @@
1
- supervaizer/__init__.py,sha256=PpLbTZ8lvkdlCJclSpKRY-hd2BRzyRCkM6EakPvDotg,2258
2
- supervaizer/__version__.py,sha256=JEcf4VQo2Ao6XCd_7P3-5j-cDiypjFbmuaDDLuXRSpY,347
3
- supervaizer/account.py,sha256=O9Rz5MjvMBPw5oJ4yD2kXKnwgcl_QU73pO0jjhE-cHk,10880
4
- supervaizer/account_service.py,sha256=7iDnaTUwPApnNY_QnXwNxAWKABF2yPNekr4UGGxZdjg,2867
5
- supervaizer/agent.py,sha256=VMrS_4-skdccv3HFVjpuYurbAZ_a59KrhyxrctQ0JKw,35472
6
- supervaizer/case.py,sha256=hNmklwtXYr-c3CHpGAP8mKjhdvFboZYJKen-b587AjI,12887
7
- supervaizer/cli.py,sha256=EzUipXiFyk9nxEZvESO-D-xq2qoTyHDaCEz30CcO2EU,5066
8
- supervaizer/common.py,sha256=tKio7xDjfm2Vtqz1Ijb16OpiK0A44Cwge8xTLRXoMU8,8471
9
- supervaizer/event.py,sha256=2aupUV1HkF0-nBFVmO5ddvj9jb4MiWr2MCxEamHFhx4,5516
10
- supervaizer/instructions.py,sha256=L0uoZXg8N4PnLxJiqBgD4Pbce-hHTDUx1yImRbtNZNg,4146
11
- supervaizer/job.py,sha256=XGrKMar3Kzv_197ZcLD0iBOg-b7ZoEOMmm95W74Axgk,12814
12
- supervaizer/job_service.py,sha256=p7Dq_iy5G37Dj8l0MCLSWuYBbGg34vKq9T8jAegwi8g,4719
13
- supervaizer/lifecycle.py,sha256=5CunJN7MsM5blyNiFMJMLFDUBmTmmAsPE24QC-gSbYA,13958
14
- supervaizer/parameter.py,sha256=QV5mTa1XmqETshlFukfVY4ntSQs7FveVTDzcgGZ2B40,7753
15
- supervaizer/routes.py,sha256=kWBz7g1_9vOR2nIyrnQER1XoDFbDRslNFg5SZFXj570,29167
16
- supervaizer/server.py,sha256=3dvsNFONhjl3uGC-v37oYtz7dx7OB0cqw5Ys4rwej0w,21005
17
- supervaizer/server_utils.py,sha256=FMglpADQBJynkR2v-pfwANu6obsaPvR9j0BQc5Otpac,1590
18
- supervaizer/storage.py,sha256=JO2pczuuJkQtk9o14_7z8yRV_q3bEir3Dtl6ejPIixY,14276
19
- supervaizer/telemetry.py,sha256=XSYw8ZwoY8W6C7mhwHU67t7trJzWd7CBkkSNdsDT_HA,2596
20
- supervaizer/admin/routes.py,sha256=T2czOTj9UZKUhJfwOpEeCgt8yMMotzMnh2GZMrZFmNY,45270
21
- supervaizer/admin/static/js/job-start-form.js,sha256=s--AGVYzgc9mE20POYeM0BNm0Wy41aBZVv99tc0cSPU,11938
22
- supervaizer/admin/templates/agent_detail.html,sha256=DFOGfjuQNC39FOLYUW_jD0A01WpBY1umatGCslyJ0_c,7581
23
- supervaizer/admin/templates/agents.html,sha256=rOKot2CCCZp83dQINyjAFzjWHSiCUHBgyC2qtOjHs0I,9016
24
- supervaizer/admin/templates/agents_grid.html,sha256=qIrXwaOyn5mrlnqopP2HkpCTHkV2OvSTCoT-LCDXmsI,5727
25
- supervaizer/admin/templates/base.html,sha256=ZGS-6IxGRYK41E5Jp3MVrGSwCugg8AVHtW21kKCBDvo,10405
26
- supervaizer/admin/templates/case_detail.html,sha256=cJ4TUJI3ix3a-veb4g0Tp0AY-uJr0SducK70MZPFsZQ,13848
27
- supervaizer/admin/templates/cases_list.html,sha256=UV4SfULzxNiOpG8aNddablpwf6hVNpRbAc6dgTmp6_E,9324
28
- supervaizer/admin/templates/cases_table.html,sha256=VyL5mEF003FTNHym1UYBD8JkvhA9wR328ciTKNKxdb8,6619
29
- supervaizer/admin/templates/console.html,sha256=tLGGf8vHjGK77Il6SYlgparoU_xz3nbvNpGVQRkVNCc,13966
30
- supervaizer/admin/templates/dashboard.html,sha256=3Pu5bR78QUcPNp5MyXkyibfp-wxYdJyyf77v3O_f_hU,7873
31
- supervaizer/admin/templates/job_detail.html,sha256=LDTMWLURyVCp7SMTxQ4M8AFqNpbbUVUx253negp9JNA,10790
32
- supervaizer/admin/templates/job_start_test.html,sha256=eAogAit0JfuMU4N5YR7N03w0nD_Bi9mtiX8uJ7dHLPg,4270
33
- supervaizer/admin/templates/jobs_list.html,sha256=VJ2VYe62dHXvjQQgUAVyKcn58rO5919UuP3VKgxLVhM,9136
34
- supervaizer/admin/templates/jobs_table.html,sha256=BCOI_7QlxJ5XOra7WKou48a2lNwQYASCMFTtgzHNotw,5974
35
- supervaizer/admin/templates/navigation.html,sha256=bHzJ2FVjPCmtnFyfe8P58kGXv02KZvQhiBHDw5Sr-WQ,10523
36
- supervaizer/admin/templates/recent_activity.html,sha256=hL06GXF1a-C_tkj3pRLrDTTDqG0KplcWMZFengFMuEc,4843
37
- supervaizer/admin/templates/server.html,sha256=m3qIQsEojogXQKTSD6ljKj4_lrwaLJTpTbMpfnWZHxU,5650
38
- supervaizer/admin/templates/server_status_cards.html,sha256=yJ36hkfgQpscYkiaodFDQPnmJWeb2W7gey09Z3T6JsY,7882
39
- supervaizer/examples/controller_template.py,sha256=o8P4RMkfLmZ4D0s97P8MBky1lkkhcfjQKVIO6XWzm3o,6371
40
- supervaizer/protocol/__init__.py,sha256=6cwvhmXjJM8Slsdsgu0Hxsi1-fTdcxD4VXQo0DUpPwg,401
41
- supervaizer/protocol/a2a/__init__.py,sha256=1ACfPGLzS6XdZPiFxn1nVamvbasqtJJ7U1BBbSmT-nI,625
42
- supervaizer/protocol/a2a/model.py,sha256=sWzatlA_fcva_fdtM8Yh4cioRq0KbwV5AXpNCnsOtQo,7198
43
- supervaizer/protocol/a2a/routes.py,sha256=XcvA5ohszIh3Rz8Jw4AElozuLugKsWefwpDerp8wB54,3935
44
- supervaizer/protocol/acp/__init__.py,sha256=rcZDUP63T2zSWfwiDklYn1JuFOSkkO2fQVeyc8UKl4E,615
45
- supervaizer/protocol/acp/model.py,sha256=Ar4GViZyx5HNa7E3hBC_drkR43S3M70kq1K4C1cwCU0,6354
46
- supervaizer/protocol/acp/routes.py,sha256=GzjCZlpmvPddTwpvXOa7Nq5lx6lUmFEvONvx8sOzu8M,2719
47
- supervaizer/py.typed,sha256=bHhvLx7c6MqrzXVPbdK3qAOcSxzp4wDtTx4QifMC2EY,74
48
- supervaizer-0.9.8.dist-info/METADATA,sha256=FSx95yCnKrWiZYTGN8vBTBYW6DEEMihYbmqcD1L6Qss,9851
49
- supervaizer-0.9.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
- supervaizer-0.9.8.dist-info/entry_points.txt,sha256=vL_IBR_AeEI2u2-6YL4PY9k2Mar4-gprG8-UxERWjmg,52
51
- supervaizer-0.9.8.dist-info/licenses/LICENSE.md,sha256=dmdnt1vfpxNPr8Lt0BnxKE5uzUwK3CWTthTUStgOXjY,15327
52
- supervaizer-0.9.8.dist-info/RECORD,,