testzeus-cli 0.0.27__tar.gz → 0.0.28__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/PKG-INFO +2 -2
  2. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/pyproject.toml +2 -2
  3. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/agent_harness.py +104 -5
  4. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/LICENSE +0 -0
  5. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/README.md +0 -0
  6. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/__init__.py +0 -0
  7. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/auth.py +0 -0
  8. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/cli.py +0 -0
  9. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/__init__.py +0 -0
  10. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/connected_environments.py +0 -0
  11. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/daemon.py +0 -0
  12. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/device_pool.py +0 -0
  13. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/environments.py +0 -0
  14. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/extensions.py +0 -0
  15. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/hypermind_code_blocks.py +0 -0
  16. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/knowledge_bases.py +0 -0
  17. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/notification_channels.py +0 -0
  18. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/tags.py +0 -0
  19. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_data.py +0 -0
  20. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_report_runs.py +0 -0
  21. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_report_schedules.py +0 -0
  22. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_run_groups.py +0 -0
  23. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_runs.py +0 -0
  24. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_suite_node_runs.py +0 -0
  25. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_suite_runs.py +0 -0
  26. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_suite_schedules.py +0 -0
  27. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/test_suites.py +0 -0
  28. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/tests.py +0 -0
  29. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/tests_ai_generator.py +0 -0
  30. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/tests_authoring.py +0 -0
  31. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/commands/user_integrations.py +0 -0
  32. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/config.py +0 -0
  33. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/__init__.py +0 -0
  34. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/auth.py +0 -0
  35. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/client.py +0 -0
  36. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/files.py +0 -0
  37. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/formatters.py +0 -0
  38. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/links.py +0 -0
  39. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/profile.py +0 -0
  40. {testzeus_cli-0.0.27 → testzeus_cli-0.0.28}/testzeus_cli/utils/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testzeus-cli
3
- Version: 0.0.27
3
+ Version: 0.0.28
4
4
  Summary: Command-line interface for TestZeus testing platform
5
5
  License-File: LICENSE
6
6
  Author: Shriyansh Agnihotri
@@ -22,7 +22,7 @@ Requires-Dist: pocketbase (>=0.15.0,<0.16.0)
22
22
  Requires-Dist: pydantic (>=2.0.0,<3.0.0)
23
23
  Requires-Dist: pyyaml (>=6.0,<7.0)
24
24
  Requires-Dist: rich (>=13.3.1,<14.0.0)
25
- Requires-Dist: testzeus-sdk (>=0.0.24,<0.1.0)
25
+ Requires-Dist: testzeus-sdk (>=0.0.25,<0.1.0)
26
26
  Requires-Dist: toml (>=0.10.2,<0.11.0)
27
27
  Project-URL: Repository, https://github.com/test-zeus-ai/testzeus-cli
28
28
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "testzeus-cli"
7
- version = "0.0.27"
7
+ version = "0.0.28"
8
8
  description = "Command-line interface for TestZeus testing platform"
9
9
  authors = ["Shriyansh Agnihotri <shriyansh@testzeus.com>"]
10
10
  readme = "README.md"
@@ -22,7 +22,7 @@ pydantic = "^2.0.0"
22
22
  pyyaml = "^6.0"
23
23
  keyring = "^24.0.0"
24
24
  ipdb = "^0.13.13"
25
- testzeus-sdk = ">=0.0.24,<0.1.0"
25
+ testzeus-sdk = ">=0.0.25,<0.1.0"
26
26
  pocketbase = "^0.15.0"
27
27
  toml = "^0.10.2"
28
28
  aiohttp = "^3.14.1"
@@ -25,20 +25,40 @@ def _pathway_row(data: Dict[str, Any]) -> Dict[str, Any]:
25
25
 
26
26
  Dumping the raw record lets the generic 6-column table fill up with noise
27
27
  (tenant/created_by/modified_by) and hide the useful fields, so project to
28
- name/risk_level/objective/status explicitly.
28
+ risk_level/objective/status explicitly. `name` is skipped: the generation
29
+ workflow only fills `objective`, so generated pathways all have name=null
30
+ and the column renders as a useless "None" for every row.
29
31
  """
30
32
  objective = data.get("objective") or ""
31
33
  if len(objective) > 80:
32
34
  objective = objective[:77] + "..."
33
35
  return {
34
36
  "id": data.get("id"),
35
- "name": data.get("name"),
36
37
  "risk_level": data.get("risk_level"),
37
38
  "objective": objective,
38
39
  "status": data.get("status"),
39
40
  }
40
41
 
41
42
 
43
+ def _simulation_row(data: Dict[str, Any]) -> Dict[str, Any]:
44
+ """Trim a simulation record to the columns worth showing in a list.
45
+
46
+ Same idea as ``_pathway_row``: the generic 6-column table picker would bury
47
+ verdict/simulation_score under base fields, so project explicitly. Names are
48
+ workflow-generated and long, so truncate them.
49
+ """
50
+ name = data.get("name") or ""
51
+ if len(name) > 40:
52
+ name = name[:37] + "..."
53
+ return {
54
+ "id": data.get("id"),
55
+ "name": name,
56
+ "status": data.get("status"),
57
+ "verdict": data.get("verdict"),
58
+ "simulation_score": data.get("simulation_score"),
59
+ }
60
+
61
+
42
62
  def _client(ctx):
43
63
  """Build the config + client tuple used by every command."""
44
64
  config, token, tenant_id, user_id = get_client_config(ctx.obj["PROFILE"], api_url=ctx.obj.get("API_URL"))
@@ -104,9 +124,14 @@ def list_pathways(ctx, agent_id, page, per_page):
104
124
  await _auth(client, token, tenant_id)
105
125
  agent = validate_id(agent_id, "agent")
106
126
  res = await client.agent_harness.list_pathways(agent_id=agent, page=page, per_page=per_page)
107
- # get_list returns AdversaryPathways models; project to the useful
108
- # columns (name/risk/objective/status) so they aren't crowded out.
109
- res["items"] = [_pathway_row(p.data) for p in res.get("items", [])]
127
+ # get_list returns AdversaryPathways models. For the table, project to
128
+ # the useful columns (risk/objective/status) so they aren't crowded
129
+ # out; keep full records for json/yaml so machine-readable output
130
+ # stays lossless.
131
+ items = [p.data for p in res.get("items", [])]
132
+ if ctx.obj["FORMAT"] == "table":
133
+ items = [_pathway_row(d) for d in items]
134
+ res["items"] = items
110
135
  return res
111
136
 
112
137
  try:
@@ -269,6 +294,80 @@ def get_agent(ctx, agent_id):
269
294
  raise click.Abort()
270
295
 
271
296
 
297
+ @agent_harness_group.command(name="get-pathway")
298
+ @click.argument("pathway_id")
299
+ @click.pass_context
300
+ def get_pathway(ctx, pathway_id):
301
+ """Get full detail for a single adversarial pathway"""
302
+
303
+ async def _run():
304
+ client, token, tenant_id, _ = _client(ctx)
305
+ async with client:
306
+ await _auth(client, token, tenant_id)
307
+ # The facade has no get_pathway method; adversary_pathways is a plain
308
+ # PocketBase collection, so go through the sub-manager's get_one.
309
+ return await client.agent_harness.pathways.get_one(validate_id(pathway_id, "pathway"))
310
+
311
+ try:
312
+ print_platform_link(ctx, "agent-harness")
313
+ result = asyncio.run(_run())
314
+ format_output(result.data, ctx.obj["FORMAT"])
315
+ except Exception as e:
316
+ print_message(f"[red]Error getting pathway: {str(e)}[/red]", ctx.obj["FORMAT"])
317
+ raise click.Abort()
318
+
319
+
320
+ @agent_harness_group.command(name="list-simulations")
321
+ @click.argument("group_id")
322
+ @click.option("--page", default=1, help="Page number")
323
+ @click.option("--per-page", default=50, help="Results per page")
324
+ @click.pass_context
325
+ def list_simulations(ctx, group_id, page, per_page):
326
+ """List the simulations of a run group"""
327
+
328
+ async def _run():
329
+ client, token, tenant_id, _ = _client(ctx)
330
+ async with client:
331
+ await _auth(client, token, tenant_id)
332
+ group = validate_id(group_id, "group")
333
+ res = await client.agent_harness.list_simulations(group_id=group, page=page, per_page=per_page)
334
+ # Same format-aware projection as list-pathways: useful columns for
335
+ # the table, full records for json/yaml.
336
+ items = [s.data for s in res.get("items", [])]
337
+ if ctx.obj["FORMAT"] == "table":
338
+ items = [_simulation_row(d) for d in items]
339
+ res["items"] = items
340
+ return res
341
+
342
+ try:
343
+ print_platform_link(ctx, "agent-harness")
344
+ format_output(asyncio.run(_run()), ctx.obj["FORMAT"])
345
+ except Exception as e:
346
+ print_message(f"[red]Error listing simulations: {str(e)}[/red]", ctx.obj["FORMAT"])
347
+ raise click.Abort()
348
+
349
+
350
+ @agent_harness_group.command(name="get-simulation")
351
+ @click.argument("simulation_id")
352
+ @click.pass_context
353
+ def get_simulation(ctx, simulation_id):
354
+ """Get full detail for a single simulation"""
355
+
356
+ async def _run():
357
+ client, token, tenant_id, _ = _client(ctx)
358
+ async with client:
359
+ await _auth(client, token, tenant_id)
360
+ return await client.agent_harness.get_simulation(validate_id(simulation_id, "simulation"))
361
+
362
+ try:
363
+ print_platform_link(ctx, "agent-harness")
364
+ result = asyncio.run(_run())
365
+ format_output(result.data, ctx.obj["FORMAT"])
366
+ except Exception as e:
367
+ print_message(f"[red]Error getting simulation: {str(e)}[/red]", ctx.obj["FORMAT"])
368
+ raise click.Abort()
369
+
370
+
272
371
  @agent_harness_group.command(name="delete-pathway")
273
372
  @click.argument("pathway_id")
274
373
  @click.pass_context
File without changes
File without changes