supervaizer 0.10.17__py3-none-any.whl → 0.10.18__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.
- supervaizer/__version__.py +1 -1
- supervaizer/admin/routes.py +32 -28
- supervaizer/admin/templates/index.html +7 -2
- supervaizer/deploy/templates/index.html +2 -2
- supervaizer/examples/controller_template.py +22 -20
- supervaizer/server.py +50 -21
- {supervaizer-0.10.17.dist-info → supervaizer-0.10.18.dist-info}/METADATA +1 -1
- {supervaizer-0.10.17.dist-info → supervaizer-0.10.18.dist-info}/RECORD +11 -11
- {supervaizer-0.10.17.dist-info → supervaizer-0.10.18.dist-info}/WHEEL +0 -0
- {supervaizer-0.10.17.dist-info → supervaizer-0.10.18.dist-info}/entry_points.txt +0 -0
- {supervaizer-0.10.17.dist-info → supervaizer-0.10.18.dist-info}/licenses/LICENSE.md +0 -0
supervaizer/__version__.py
CHANGED
supervaizer/admin/routes.py
CHANGED
|
@@ -931,24 +931,28 @@ def create_admin_routes() -> APIRouter:
|
|
|
931
931
|
# Combine and sort by created_at
|
|
932
932
|
activities = []
|
|
933
933
|
for job in recent_jobs:
|
|
934
|
-
activities.append(
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
934
|
+
activities.append(
|
|
935
|
+
{
|
|
936
|
+
"type": "job",
|
|
937
|
+
"id": job.get("id"),
|
|
938
|
+
"name": job.get("name"),
|
|
939
|
+
"status": job.get("status"),
|
|
940
|
+
"created_at": job.get("created_at"),
|
|
941
|
+
"agent_name": job.get("agent_name"),
|
|
942
|
+
}
|
|
943
|
+
)
|
|
942
944
|
|
|
943
945
|
for case in recent_cases:
|
|
944
|
-
activities.append(
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
946
|
+
activities.append(
|
|
947
|
+
{
|
|
948
|
+
"type": "case",
|
|
949
|
+
"id": case.get("id"),
|
|
950
|
+
"name": case.get("name"),
|
|
951
|
+
"status": case.get("status"),
|
|
952
|
+
"created_at": case.get("created_at"),
|
|
953
|
+
"job_id": case.get("job_id"),
|
|
954
|
+
}
|
|
955
|
+
)
|
|
952
956
|
|
|
953
957
|
# Sort by created_at descending
|
|
954
958
|
activities.sort(key=lambda x: str(x.get("created_at", "")), reverse=True)
|
|
@@ -1205,23 +1209,23 @@ def get_dashboard_stats(storage: StorageManager) -> AdminStats:
|
|
|
1205
1209
|
|
|
1206
1210
|
# Calculate job stats
|
|
1207
1211
|
job_total = len(all_jobs)
|
|
1208
|
-
job_running = len(
|
|
1209
|
-
j for j in all_jobs if j.get("status") in ["in_progress", "awaiting"]
|
|
1210
|
-
|
|
1212
|
+
job_running = len(
|
|
1213
|
+
[j for j in all_jobs if j.get("status") in ["in_progress", "awaiting"]]
|
|
1214
|
+
)
|
|
1211
1215
|
job_completed = len([j for j in all_jobs if j.get("status") == "completed"])
|
|
1212
|
-
job_failed = len(
|
|
1213
|
-
j for j in all_jobs if j.get("status") in ["failed", "cancelled"]
|
|
1214
|
-
|
|
1216
|
+
job_failed = len(
|
|
1217
|
+
[j for j in all_jobs if j.get("status") in ["failed", "cancelled"]]
|
|
1218
|
+
)
|
|
1215
1219
|
|
|
1216
1220
|
# Calculate case stats
|
|
1217
1221
|
case_total = len(all_cases)
|
|
1218
|
-
case_running = len(
|
|
1219
|
-
c for c in all_cases if c.get("status") in ["in_progress", "awaiting"]
|
|
1220
|
-
|
|
1222
|
+
case_running = len(
|
|
1223
|
+
[c for c in all_cases if c.get("status") in ["in_progress", "awaiting"]]
|
|
1224
|
+
)
|
|
1221
1225
|
case_completed = len([c for c in all_cases if c.get("status") == "completed"])
|
|
1222
|
-
case_failed = len(
|
|
1223
|
-
c for c in all_cases if c.get("status") in ["failed", "cancelled"]
|
|
1224
|
-
|
|
1226
|
+
case_failed = len(
|
|
1227
|
+
[c for c in all_cases if c.get("status") in ["failed", "cancelled"]]
|
|
1228
|
+
)
|
|
1225
1229
|
|
|
1226
1230
|
# TinyDB collections count (tables)
|
|
1227
1231
|
collections_count = len(storage._db.tables())
|
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
</p>
|
|
19
19
|
<p class="mt-1 text-xs text-gray-400 font-mono">Server ID: {{ server_id }}</p>
|
|
20
20
|
|
|
21
|
+
<div class="mt-6 p-4 rounded-lg bg-amber-50 border border-amber-200 text-amber-800">
|
|
22
|
+
<p class="font-semibold">⚠️ Do not use in production with network access enabled.</p>
|
|
23
|
+
<p class="mt-1 text-sm">This interface is for development and local use only. Exposing it over the network in production may allow unauthorized access.</p>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
21
26
|
<div class="mt-8">
|
|
22
27
|
<h2 class="text-lg font-medium text-gray-900 mb-4">Links</h2>
|
|
23
28
|
<ul class="space-y-2">
|
|
@@ -36,14 +41,14 @@
|
|
|
36
41
|
OpenAPI
|
|
37
42
|
</a>
|
|
38
43
|
</li>
|
|
39
|
-
<li><strong>BASE:</strong> {{ base }}
|
|
44
|
+
<li><strong>BASE:</strong> {{ base }}
|
|
40
45
|
<br>
|
|
41
46
|
<strong>PUBLIC_URL:</strong> {{ public_url }}
|
|
42
47
|
<br>
|
|
43
48
|
<strong>FULL_URL:</strong> {{ full_url }}
|
|
44
49
|
<br>
|
|
45
50
|
</li>
|
|
46
|
-
|
|
51
|
+
|
|
47
52
|
{% if show_admin %}
|
|
48
53
|
<li>
|
|
49
54
|
<a href="{{ base }}/admin" class="text-blue-600 hover:text-blue-800 font-medium">
|
|
@@ -34,26 +34,28 @@ DEV_PUBLIC_URL = "https://myagent-dev.loca.lt"
|
|
|
34
34
|
PROD_PUBLIC_URL = "https://myagent.cloud-hosting.net:8001"
|
|
35
35
|
|
|
36
36
|
# Define the parameters and secrets expected by the agent
|
|
37
|
-
agent_parameters: ParametersSetup | None = ParametersSetup.from_list(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
agent_parameters: ParametersSetup | None = ParametersSetup.from_list(
|
|
38
|
+
[
|
|
39
|
+
Parameter(
|
|
40
|
+
name="OPEN_API_KEY",
|
|
41
|
+
description="OpenAPI Key",
|
|
42
|
+
is_environment=True,
|
|
43
|
+
is_secret=True,
|
|
44
|
+
),
|
|
45
|
+
Parameter(
|
|
46
|
+
name="SERPER_API",
|
|
47
|
+
description="Server API key updated",
|
|
48
|
+
is_environment=True,
|
|
49
|
+
is_secret=True,
|
|
50
|
+
),
|
|
51
|
+
Parameter(
|
|
52
|
+
name="COMPETITOR_SUMMARY_URL",
|
|
53
|
+
description="Competitor Summary URL",
|
|
54
|
+
is_environment=True,
|
|
55
|
+
is_secret=False,
|
|
56
|
+
),
|
|
57
|
+
]
|
|
58
|
+
)
|
|
57
59
|
|
|
58
60
|
# Define the method used to start a job
|
|
59
61
|
job_start_method: AgentMethod = AgentMethod(
|
supervaizer/server.py
CHANGED
|
@@ -65,6 +65,35 @@ def _get_or_create_server_id() -> str:
|
|
|
65
65
|
return new_id
|
|
66
66
|
|
|
67
67
|
|
|
68
|
+
def _get_or_create_private_key() -> RSAPrivateKey:
|
|
69
|
+
"""Use SUPERVAIZER_PRIVATE_KEY from env if set; else create key and set env."""
|
|
70
|
+
pem = os.getenv("SUPERVAIZER_PRIVATE_KEY")
|
|
71
|
+
if pem:
|
|
72
|
+
try:
|
|
73
|
+
return serialization.load_pem_private_key(
|
|
74
|
+
pem.encode("utf-8"),
|
|
75
|
+
password=None,
|
|
76
|
+
backend=default_backend(),
|
|
77
|
+
)
|
|
78
|
+
except Exception as e:
|
|
79
|
+
log.warning(
|
|
80
|
+
f"[Server] Invalid SUPERVAIZER_PRIVATE_KEY, generating new key: {e}"
|
|
81
|
+
)
|
|
82
|
+
private_key = rsa.generate_private_key(
|
|
83
|
+
public_exponent=65537,
|
|
84
|
+
key_size=2048,
|
|
85
|
+
backend=default_backend(),
|
|
86
|
+
)
|
|
87
|
+
pem_bytes = private_key.private_bytes(
|
|
88
|
+
encoding=serialization.Encoding.PEM,
|
|
89
|
+
format=serialization.PrivateFormat.PKCS8,
|
|
90
|
+
encryption_algorithm=serialization.NoEncryption(),
|
|
91
|
+
)
|
|
92
|
+
os.environ["SUPERVAIZER_PRIVATE_KEY"] = pem_bytes.decode("utf-8")
|
|
93
|
+
log.info("[Server] Generated new RSA private key and set SUPERVAIZER_PRIVATE_KEY")
|
|
94
|
+
return private_key
|
|
95
|
+
|
|
96
|
+
|
|
68
97
|
class ServerInfo(BaseModel):
|
|
69
98
|
"""Complete server information for storage."""
|
|
70
99
|
|
|
@@ -88,14 +117,16 @@ def save_server_info_to_storage(server_instance: "Server") -> None:
|
|
|
88
117
|
agents = []
|
|
89
118
|
if hasattr(server_instance, "agents") and server_instance.agents:
|
|
90
119
|
for agent in server_instance.agents:
|
|
91
|
-
agents.append(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
agents.append(
|
|
121
|
+
{
|
|
122
|
+
"name": agent.name,
|
|
123
|
+
"description": agent.description,
|
|
124
|
+
"version": agent.version,
|
|
125
|
+
"api_path": agent.path,
|
|
126
|
+
"slug": agent.slug,
|
|
127
|
+
"instructions_path": agent.instructions_path,
|
|
128
|
+
}
|
|
129
|
+
)
|
|
99
130
|
|
|
100
131
|
# Create server info
|
|
101
132
|
server_info = ServerInfo(
|
|
@@ -136,14 +167,16 @@ def get_server_info_from_live(server_instance: "Server") -> ServerInfo:
|
|
|
136
167
|
agents = []
|
|
137
168
|
if hasattr(server_instance, "agents") and server_instance.agents:
|
|
138
169
|
for agent in server_instance.agents:
|
|
139
|
-
agents.append(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
170
|
+
agents.append(
|
|
171
|
+
{
|
|
172
|
+
"name": agent.name,
|
|
173
|
+
"description": agent.description,
|
|
174
|
+
"version": agent.version,
|
|
175
|
+
"api_path": agent.path,
|
|
176
|
+
"slug": agent.slug,
|
|
177
|
+
"instructions_path": agent.instructions_path,
|
|
178
|
+
}
|
|
179
|
+
)
|
|
147
180
|
start_time = getattr(server_instance, "_start_time", time.time())
|
|
148
181
|
return ServerInfo(
|
|
149
182
|
host=getattr(server_instance, "host", "N/A"),
|
|
@@ -317,11 +350,7 @@ class Server(ServerAbstract):
|
|
|
317
350
|
)
|
|
318
351
|
|
|
319
352
|
if private_key is None:
|
|
320
|
-
private_key =
|
|
321
|
-
public_exponent=65537,
|
|
322
|
-
key_size=2048,
|
|
323
|
-
backend=default_backend(),
|
|
324
|
-
)
|
|
353
|
+
private_key = _get_or_create_private_key()
|
|
325
354
|
|
|
326
355
|
public_key = private_key.public_key()
|
|
327
356
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
supervaizer/__init__.py,sha256=UNFcgJT-2708tLRFXohWr3320LVAzh3_WZZhrU9j1Iw,2427
|
|
2
|
-
supervaizer/__version__.py,sha256=
|
|
2
|
+
supervaizer/__version__.py,sha256=D0KrBIZiU16SrrMfCmshO4cP5W7rih9BZsck9wg8f8k,349
|
|
3
3
|
supervaizer/account.py,sha256=POChw9c2ZjBNvesz6JmvBzYmMD40M5oxtz5IupuMqsw,11683
|
|
4
4
|
supervaizer/account_service.py,sha256=ZgZ0fhsbSVA076c-35ZZoYJBrQZsAwfFS7namVeoD3s,3459
|
|
5
5
|
supervaizer/agent.py,sha256=EtmqBH9fsO4k8YcHnjj55_4uOmb5URZwLlIIJReWg7A,36516
|
|
@@ -13,11 +13,11 @@ supervaizer/job_service.py,sha256=22Qe7Z5_u3R28tcNH_21YMIYciWFtJaM7I-MXtIhBMU,46
|
|
|
13
13
|
supervaizer/lifecycle.py,sha256=5CunJN7MsM5blyNiFMJMLFDUBmTmmAsPE24QC-gSbYA,13958
|
|
14
14
|
supervaizer/parameter.py,sha256=sYDuGof_w6mlix0oxjB6odV0sO0QSBL1KwFZa3Y2cOA,8157
|
|
15
15
|
supervaizer/routes.py,sha256=o3u7pGGLE0MQzWtQNdd5xk1M0G9Y_BR_JiLVmCFtdC4,34319
|
|
16
|
-
supervaizer/server.py,sha256=
|
|
16
|
+
supervaizer/server.py,sha256=GuDvL4hBt7RXHD1rohnsRVisZHXsf0xqcjbkIbIm0DM,24590
|
|
17
17
|
supervaizer/server_utils.py,sha256=FMglpADQBJynkR2v-pfwANu6obsaPvR9j0BQc5Otpac,1590
|
|
18
18
|
supervaizer/storage.py,sha256=WLX8ggwt1AGF07DrfD1K6PyP2-N45c_Ep4CL0iPLVbI,15332
|
|
19
19
|
supervaizer/telemetry.py,sha256=XSYw8ZwoY8W6C7mhwHU67t7trJzWd7CBkkSNdsDT_HA,2596
|
|
20
|
-
supervaizer/admin/routes.py,sha256=
|
|
20
|
+
supervaizer/admin/routes.py,sha256=Ua6jtPyzwVqyxsMLfUeOoyNeO6RR6cfg4INAp7I_PtM,48119
|
|
21
21
|
supervaizer/admin/static/favicon.ico,sha256=wFyXw96AplZoEcW45dJBeC1pHTcPSH07HGWbtrc49mI,5558
|
|
22
22
|
supervaizer/admin/static/js/job-start-form.js,sha256=s--AGVYzgc9mE20POYeM0BNm0Wy41aBZVv99tc0cSPU,11938
|
|
23
23
|
supervaizer/admin/templates/agent_detail.html,sha256=DFOGfjuQNC39FOLYUW_jD0A01WpBY1umatGCslyJ0_c,7581
|
|
@@ -29,7 +29,7 @@ supervaizer/admin/templates/cases_list.html,sha256=UV4SfULzxNiOpG8aNddablpwf6hVN
|
|
|
29
29
|
supervaizer/admin/templates/cases_table.html,sha256=VyL5mEF003FTNHym1UYBD8JkvhA9wR328ciTKNKxdb8,6619
|
|
30
30
|
supervaizer/admin/templates/console.html,sha256=tLGGf8vHjGK77Il6SYlgparoU_xz3nbvNpGVQRkVNCc,13966
|
|
31
31
|
supervaizer/admin/templates/dashboard.html,sha256=3Pu5bR78QUcPNp5MyXkyibfp-wxYdJyyf77v3O_f_hU,7873
|
|
32
|
-
supervaizer/admin/templates/index.html,sha256=
|
|
32
|
+
supervaizer/admin/templates/index.html,sha256=DsPsVPRd9_XBd6VvjZpFfxkEYT2pZMdBblHuwlPrseQ,2879
|
|
33
33
|
supervaizer/admin/templates/job_detail.html,sha256=LDTMWLURyVCp7SMTxQ4M8AFqNpbbUVUx253negp9JNA,10790
|
|
34
34
|
supervaizer/admin/templates/job_start_test.html,sha256=eAogAit0JfuMU4N5YR7N03w0nD_Bi9mtiX8uJ7dHLPg,4270
|
|
35
35
|
supervaizer/admin/templates/jobs_list.html,sha256=VJ2VYe62dHXvjQQgUAVyKcn58rO5919UuP3VKgxLVhM,9136
|
|
@@ -63,8 +63,8 @@ supervaizer/deploy/templates/debug_env.py,sha256=WFlxfiCAlkxM1NybNvtmmG5zJnoSvjW
|
|
|
63
63
|
supervaizer/deploy/templates/docker-compose.yml.template,sha256=ZcW8WyhmqMElaxBpokuZG12n0tFJL8BY7k7Tvdz6tdw,1100
|
|
64
64
|
supervaizer/deploy/templates/dockerignore.template,sha256=bYFRn6QGsjtRDH-Y7vzWk3-u3jIp90FajV2Ed94ah5M,515
|
|
65
65
|
supervaizer/deploy/templates/entrypoint.sh,sha256=z079VUotu6DJX92fJiBB3eVwCEgcP6B9D9Fvwv_FL9w,463
|
|
66
|
-
supervaizer/deploy/templates/index.html,sha256=
|
|
67
|
-
supervaizer/examples/controller_template.py,sha256=
|
|
66
|
+
supervaizer/deploy/templates/index.html,sha256=eJbH1dLS_BTJ3YbvUAEHuvuycP38tyEu_RlIqpH9ke4,2156
|
|
67
|
+
supervaizer/examples/controller_template.py,sha256=q7FS7aleSm_F707raq27UgBgq2d6rvmHAf-F8XzpaDQ,6419
|
|
68
68
|
supervaizer/protocol/__init__.py,sha256=00GHbUsLNsf0a1rQrUPpVN2Uy-7rDz72Ps6TUVD91tE,389
|
|
69
69
|
supervaizer/protocol/a2a/__init__.py,sha256=1ACfPGLzS6XdZPiFxn1nVamvbasqtJJ7U1BBbSmT-nI,625
|
|
70
70
|
supervaizer/protocol/a2a/model.py,sha256=sWzatlA_fcva_fdtM8Yh4cioRq0KbwV5AXpNCnsOtQo,7198
|
|
@@ -72,8 +72,8 @@ supervaizer/protocol/a2a/routes.py,sha256=rkQTNBD1NTYimKCb8iOk4bVf9ldDP1LqHfOsyh
|
|
|
72
72
|
supervaizer/utils/__init__.py,sha256=fd0NFwN_cen3QPms2SOnuz4jcetay3f_31dit2As7EA,458
|
|
73
73
|
supervaizer/utils/version_check.py,sha256=-tsOURpHVh0LNTbpQsyJDJENKszC-NzXDSO_EToEQPE,1893
|
|
74
74
|
supervaizer/py.typed,sha256=bHhvLx7c6MqrzXVPbdK3qAOcSxzp4wDtTx4QifMC2EY,74
|
|
75
|
-
supervaizer-0.10.
|
|
76
|
-
supervaizer-0.10.
|
|
77
|
-
supervaizer-0.10.
|
|
78
|
-
supervaizer-0.10.
|
|
79
|
-
supervaizer-0.10.
|
|
75
|
+
supervaizer-0.10.18.dist-info/METADATA,sha256=JnZWcZm6qFTxIdJQVE29eHTbGqLfqqx0J-qAEH8xXuA,12648
|
|
76
|
+
supervaizer-0.10.18.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
77
|
+
supervaizer-0.10.18.dist-info/entry_points.txt,sha256=vL_IBR_AeEI2u2-6YL4PY9k2Mar4-gprG8-UxERWjmg,52
|
|
78
|
+
supervaizer-0.10.18.dist-info/licenses/LICENSE.md,sha256=dmdnt1vfpxNPr8Lt0BnxKE5uzUwK3CWTthTUStgOXjY,15327
|
|
79
|
+
supervaizer-0.10.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|