agentsystems-sdk 0.3.5__py3-none-any.whl → 0.4.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.
agentsystems_sdk/cli.py CHANGED
@@ -24,6 +24,8 @@ from agentsystems_sdk.commands import (
24
24
  artifacts_path_command,
25
25
  clean_command,
26
26
  update_command,
27
+ version_command,
28
+ versions_command,
27
29
  )
28
30
 
29
31
  # Load .env before Typer parses env-var options
@@ -87,6 +89,8 @@ app.command(name="run")(run_command)
87
89
  app.command(name="artifacts-path")(artifacts_path_command)
88
90
  app.command(name="clean")(clean_command)
89
91
  app.command(name="update")(update_command)
92
+ app.command(name="version")(version_command)
93
+ app.command(name="versions")(versions_command)
90
94
 
91
95
 
92
96
  if __name__ == "__main__":
@@ -10,6 +10,7 @@ from .run import run_command
10
10
  from .artifacts import artifacts_path_command
11
11
  from .clean import clean_command
12
12
  from .update import update_command
13
+ from .version import version_command, versions_command
13
14
 
14
15
  __all__ = [
15
16
  "init_command",
@@ -22,4 +23,6 @@ __all__ = [
22
23
  "artifacts_path_command",
23
24
  "clean_command",
24
25
  "update_command",
26
+ "version_command",
27
+ "versions_command",
25
28
  ]
@@ -358,6 +358,18 @@ def up_command(
358
358
  dir_okay=False,
359
359
  resolve_path=True,
360
360
  ),
361
+ agent_control_plane_version: Optional[str] = typer.Option(
362
+ None,
363
+ "--agent-control-plane",
364
+ "--acp",
365
+ help="Pin agent-control-plane to specific version (e.g., 0.3.17)",
366
+ ),
367
+ agentsystems_ui_version: Optional[str] = typer.Option(
368
+ None,
369
+ "--agentsystems-ui",
370
+ "--ui",
371
+ help="Pin agentsystems-ui to specific version (e.g., 0.1.5)",
372
+ ),
361
373
  ) -> None:
362
374
  """Start the full AgentSystems platform via docker compose.
363
375
 
@@ -378,6 +390,64 @@ def up_command(
378
390
  env_base = os.environ.copy()
379
391
  env_base["DOCKER_CONFIG"] = isolated_cfg.name
380
392
 
393
+ # Validate and set version tags from CLI flags if provided
394
+ def _validate_version(version_str: str, min_version: str, component: str) -> bool:
395
+ """Validate that version meets minimum requirements for version management features."""
396
+ import re
397
+
398
+ # Skip validation for special tags
399
+ if version_str in ["latest", "main", "development"]:
400
+ return True
401
+
402
+ # Validate semantic version format
403
+ if not re.match(r"^\d+\.\d+\.\d+$", version_str):
404
+ console.print(
405
+ f"[red]❌ Error: {component} version must be semantic version (x.y.z format)[/red]"
406
+ )
407
+ console.print(f"[red] You provided: {version_str}[/red]")
408
+ console.print("[red] Valid examples: 0.4.0, 1.2.3[/red]")
409
+ return False
410
+
411
+ # Simple version comparison (works for our use case)
412
+ def version_tuple(v):
413
+ return tuple(map(int, v.split(".")))
414
+
415
+ try:
416
+ if version_tuple(version_str) < version_tuple(min_version):
417
+ console.print(
418
+ f"[red]❌ Error: {component} version {version_str} does not support version management[/red]"
419
+ )
420
+ console.print(
421
+ f"[red] Minimum required {component}: {min_version}[/red]"
422
+ )
423
+ console.print(
424
+ "[red] This version introduced /version and /component-versions endpoints[/red]"
425
+ )
426
+ return False
427
+ except Exception:
428
+ console.print(f"[red]❌ Error: Invalid version format: {version_str}[/red]")
429
+ return False
430
+
431
+ return True
432
+
433
+ if agent_control_plane_version:
434
+ if not _validate_version(
435
+ agent_control_plane_version, "0.4.0", "agent-control-plane"
436
+ ):
437
+ raise typer.Exit(1)
438
+ env_base["ACP_TAG"] = agent_control_plane_version
439
+ console.print(
440
+ f"[yellow]📌 Pinning agent-control-plane to version: {agent_control_plane_version}[/yellow]"
441
+ )
442
+
443
+ if agentsystems_ui_version:
444
+ if not _validate_version(agentsystems_ui_version, "0.2.0", "agentsystems-ui"):
445
+ raise typer.Exit(1)
446
+ env_base["UI_TAG"] = agentsystems_ui_version
447
+ console.print(
448
+ f"[yellow]📌 Pinning agentsystems-ui to version: {agentsystems_ui_version}[/yellow]"
449
+ )
450
+
381
451
  # .env gets loaded later – keep env_base in sync
382
452
  def _sync_env_base() -> None:
383
453
  env_base.update(os.environ)
@@ -0,0 +1,86 @@
1
+ """Version information command for AgentSystems SDK."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib.metadata
6
+ from rich.console import Console
7
+ from rich.table import Table
8
+
9
+ console = Console()
10
+
11
+
12
+ def version_command() -> None:
13
+ """Display SDK version information only.
14
+
15
+ For all component versions, use 'agentsystems versions'.
16
+ """
17
+ # Just show SDK version
18
+ try:
19
+ sdk_version = importlib.metadata.version("agentsystems-sdk")
20
+ except importlib.metadata.PackageNotFoundError:
21
+ sdk_version = "unknown (development mode)"
22
+ console.print(f"AgentSystems SDK: {sdk_version}")
23
+
24
+
25
+ def versions_command() -> None:
26
+ """Display version information for all AgentSystems components.
27
+
28
+ Queries the running deployment to show current versions and update status.
29
+ Only works when a deployment is running.
30
+ """
31
+ table = Table(title="AgentSystems Component Versions")
32
+ table.add_column("Component", style="cyan")
33
+ table.add_column("Version", style="green")
34
+ table.add_column("Status", style="yellow")
35
+
36
+ # SDK version
37
+ try:
38
+ sdk_version = importlib.metadata.version("agentsystems-sdk")
39
+ table.add_row("AgentSystems SDK", sdk_version, "✓ Installed")
40
+ except importlib.metadata.PackageNotFoundError:
41
+ table.add_row("AgentSystems SDK", "unknown", "⚠ Development mode")
42
+
43
+ # Try to query running deployment for gateway and UI versions
44
+ try:
45
+ import requests
46
+
47
+ resp = requests.get("http://localhost:18080/component-versions", timeout=5)
48
+ if resp.status_code == 200:
49
+ data = resp.json()
50
+ components = data.get("components", {})
51
+
52
+ # Agent Control Plane
53
+ acp = components.get("agent-control-plane", {})
54
+ acp_version = acp.get("current_version", "unknown")
55
+ acp_update = acp.get("update_available", False)
56
+ acp_status = "✓ Running" + (
57
+ " (update available)" if acp_update else " (latest)"
58
+ )
59
+ table.add_row("Agent Control Plane", acp_version, acp_status)
60
+
61
+ # AgentSystems UI
62
+ ui = components.get("agentsystems-ui", {})
63
+ ui_version = ui.get("current_version", "unknown")
64
+ ui_update = ui.get("update_available", False)
65
+ ui_status = "✓ Running" + (
66
+ " (update available)" if ui_update else " (latest)"
67
+ )
68
+ table.add_row("AgentSystems UI", ui_version, ui_status)
69
+
70
+ else:
71
+ table.add_row(
72
+ "Agent Control Plane", "unknown", "⚠ Deployment not accessible"
73
+ )
74
+ table.add_row("AgentSystems UI", "unknown", "⚠ Deployment not accessible")
75
+
76
+ except Exception:
77
+ # Deployment not running or not accessible
78
+ table.add_row("Agent Control Plane", "N/A", "⚠ Deployment not running")
79
+ table.add_row("AgentSystems UI", "N/A", "⚠ Deployment not running")
80
+
81
+ console.print(table)
82
+ # Note: Simple check since Rich table internals are complex
83
+ if "⚠" in str(table):
84
+ console.print(
85
+ "\n[dim]Note: Start deployment with 'agentsystems up' to check running versions[/dim]"
86
+ )
@@ -1,6 +1,6 @@
1
1
  This distribution orchestrates the following third-party components. Their source and full licence texts are available from the respective upstream projects.
2
2
 
3
- Langfuse – © 2023-2025 Langfuse UG – MIT
3
+ Copyright (c) 2023--2024 Langfuse GmbH
4
4
  • ClickHouse Server – © Altinity Inc – Apache-2.0
5
5
  • MinIO Server – © MinIO Inc – GNU AGPL v3
6
6
  • Redis – © Redis Ltd – BSD-3-Clause