glaip-sdk 0.0.4__py3-none-any.whl → 0.0.5b1__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 (48) hide show
  1. glaip_sdk/__init__.py +5 -5
  2. glaip_sdk/branding.py +18 -17
  3. glaip_sdk/cli/__init__.py +1 -1
  4. glaip_sdk/cli/agent_config.py +82 -0
  5. glaip_sdk/cli/commands/__init__.py +3 -3
  6. glaip_sdk/cli/commands/agents.py +570 -673
  7. glaip_sdk/cli/commands/configure.py +2 -2
  8. glaip_sdk/cli/commands/mcps.py +148 -143
  9. glaip_sdk/cli/commands/models.py +1 -1
  10. glaip_sdk/cli/commands/tools.py +250 -179
  11. glaip_sdk/cli/display.py +244 -0
  12. glaip_sdk/cli/io.py +106 -0
  13. glaip_sdk/cli/main.py +14 -18
  14. glaip_sdk/cli/resolution.py +59 -0
  15. glaip_sdk/cli/utils.py +305 -264
  16. glaip_sdk/cli/validators.py +235 -0
  17. glaip_sdk/client/__init__.py +3 -224
  18. glaip_sdk/client/agents.py +631 -191
  19. glaip_sdk/client/base.py +66 -4
  20. glaip_sdk/client/main.py +226 -0
  21. glaip_sdk/client/mcps.py +143 -18
  22. glaip_sdk/client/tools.py +146 -11
  23. glaip_sdk/config/constants.py +10 -1
  24. glaip_sdk/models.py +42 -2
  25. glaip_sdk/rich_components.py +29 -0
  26. glaip_sdk/utils/__init__.py +18 -171
  27. glaip_sdk/utils/agent_config.py +181 -0
  28. glaip_sdk/utils/client_utils.py +159 -79
  29. glaip_sdk/utils/display.py +100 -0
  30. glaip_sdk/utils/general.py +94 -0
  31. glaip_sdk/utils/import_export.py +140 -0
  32. glaip_sdk/utils/rendering/formatting.py +6 -1
  33. glaip_sdk/utils/rendering/renderer/__init__.py +67 -8
  34. glaip_sdk/utils/rendering/renderer/base.py +340 -247
  35. glaip_sdk/utils/rendering/renderer/debug.py +3 -2
  36. glaip_sdk/utils/rendering/renderer/panels.py +11 -10
  37. glaip_sdk/utils/rendering/steps.py +1 -1
  38. glaip_sdk/utils/resource_refs.py +192 -0
  39. glaip_sdk/utils/rich_utils.py +29 -0
  40. glaip_sdk/utils/serialization.py +285 -0
  41. glaip_sdk/utils/validation.py +273 -0
  42. {glaip_sdk-0.0.4.dist-info → glaip_sdk-0.0.5b1.dist-info}/METADATA +22 -21
  43. glaip_sdk-0.0.5b1.dist-info/RECORD +55 -0
  44. {glaip_sdk-0.0.4.dist-info → glaip_sdk-0.0.5b1.dist-info}/WHEEL +1 -1
  45. glaip_sdk-0.0.5b1.dist-info/entry_points.txt +3 -0
  46. glaip_sdk/cli/commands/init.py +0 -93
  47. glaip_sdk-0.0.4.dist-info/RECORD +0 -41
  48. glaip_sdk-0.0.4.dist-info/entry_points.txt +0 -2
glaip_sdk/__init__.py CHANGED
@@ -1,12 +1,12 @@
1
- """AIP SDK - Python SDK for AI Agent Platform.
1
+ """GL AIP SDK - Python SDK for GDP Labs AI Agent Package.
2
2
 
3
3
  Authors:
4
4
  Raymond Christopher (raymond.christopher@gdplabs.id)
5
5
  """
6
6
 
7
- from ._version import __version__
8
- from .client import Client
9
- from .exceptions import AIPError
10
- from .models import MCP, Agent, Tool
7
+ from glaip_sdk._version import __version__
8
+ from glaip_sdk.client import Client
9
+ from glaip_sdk.exceptions import AIPError
10
+ from glaip_sdk.models import MCP, Agent, Tool
11
11
 
12
12
  __all__ = ["Client", "Agent", "Tool", "MCP", "AIPError", "__version__"]
glaip_sdk/branding.py CHANGED
@@ -1,8 +1,8 @@
1
1
  """AIP SDK Branding and Visual Identity.
2
2
 
3
- Simple, friendly CLI branding for the AI Agent Platform (AIP) SDK.
3
+ Simple, friendly CLI branding for the GL AIP (GDP Labs AI Agent Package) SDK.
4
4
 
5
- - Platform name: AIP (AI Agent Platform)
5
+ - Package name: GL AIP (GDP Labs AI Agent Package)
6
6
  - Version: auto-detected (AIP_VERSION env or importlib.metadata), or passed in
7
7
  - Colors: blue / bright_blue, with NO_COLOR/AIP_NO_COLOR fallbacks
8
8
 
@@ -17,7 +17,8 @@ import platform
17
17
  import sys
18
18
 
19
19
  from rich.console import Console
20
- from rich.panel import Panel
20
+
21
+ from glaip_sdk.rich_components import AIPPanel
21
22
 
22
23
  try:
23
24
  # Python 3.8+ standard way to read installed package version
@@ -28,25 +29,25 @@ except Exception: # pragma: no cover
28
29
  PackageNotFoundError = Exception
29
30
 
30
31
 
31
- # ---- minimal, readable styles (blue-forward) ---------------------------------
32
- PRIMARY = "bright_blue"
33
- BORDER = PRIMARY
32
+ # ---- minimal, readable styles (light blue + white theme) -----------------
33
+ PRIMARY = "bright_blue" # Light blue for main elements
34
+ BORDER = "bright_blue" # Light blue borders
34
35
  TITLE_STYLE = f"bold {PRIMARY}"
35
36
  LABEL = "bold"
36
37
 
37
38
 
38
39
  class AIPBranding:
39
- """AIP SDK branding utilities with ASCII banner and version display."""
40
+ """GL AIP SDK branding utilities with ASCII banner and version display."""
40
41
 
41
- # AIP ASCII art - pixelated style
42
+ # GL AIP ASCII art - Modern block style with enhanced visibility
42
43
  AIP_LOGO = r"""
43
- █████╗ ██╗██████╗
44
- ██╔══██╗██║██╔══██╗
45
- ███████║██║██████╔╝
46
- ██╔══██║██║██╔═══╝
47
- ██║ ██║██║██║
48
- ╚═╝ ╚═╝╚═╝╚═╝
49
- AI Agent Platform
44
+ ██████╗ ██╗ █████╗ ██╗██████╗
45
+ ██╔════╝ ██║ ██╔══██╗██║██╔══██╗
46
+ ██║ ███╗██║ ███████║██║██████╔╝
47
+ ██║ ██║██║ ██╔══██║██║██╔═══╝
48
+ ╚██████╔╝███████╗ ██║ ██║██║██║
49
+ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝╚═╝╚═╝
50
+ GDP Labs AI Agents Package
50
51
  """.strip("\n")
51
52
 
52
53
  def __init__(
@@ -108,7 +109,7 @@ AI Agent Platform
108
109
 
109
110
  def display_welcome_panel(self, title: str = "Welcome to AIP") -> None:
110
111
  banner = self.get_welcome_banner()
111
- panel = Panel(
112
+ panel = AIPPanel(
112
113
  banner,
113
114
  title=f"[{TITLE_STYLE}]{title}[/{TITLE_STYLE}]",
114
115
  border_style=BORDER,
@@ -125,7 +126,7 @@ AI Agent Platform
125
126
  f"[{LABEL}]Platform:[/] {v['platform']}\n"
126
127
  f"[{LABEL}]Architecture:[/] {v['architecture']}"
127
128
  )
128
- panel = Panel(
129
+ panel = AIPPanel(
129
130
  version_text,
130
131
  title=f"[{TITLE_STYLE}]Version Details[/{TITLE_STYLE}]",
131
132
  border_style=BORDER,
glaip_sdk/cli/__init__.py CHANGED
@@ -4,6 +4,6 @@ Authors:
4
4
  Raymond Christopher (raymond.christopher@gdplabs.id)
5
5
  """
6
6
 
7
- from .main import main
7
+ from glaip_sdk.cli.main import main
8
8
 
9
9
  __all__ = ["main"]
@@ -0,0 +1,82 @@
1
+ """CLI-specific agent configuration utilities.
2
+
3
+ This module provides CLI-only affordances for agent configuration,
4
+ such as merging CLI flags over imported data.
5
+
6
+ Authors:
7
+ Raymond Christopher (raymond.christopher@gdplabs.id)
8
+ """
9
+
10
+ from typing import Any
11
+
12
+ from glaip_sdk.utils.agent_config import (
13
+ resolve_language_model_selection,
14
+ sanitize_agent_config,
15
+ )
16
+ from glaip_sdk.utils.import_export import merge_import_with_cli_args
17
+
18
+
19
+ def merge_agent_config_with_cli_args(
20
+ import_data: dict[str, Any], cli_args: dict[str, Any]
21
+ ) -> dict[str, Any]:
22
+ """Merge imported agent data with CLI arguments, preferring CLI args.
23
+
24
+ This is a CLI-specific wrapper that handles agent-specific merging logic.
25
+
26
+ Args:
27
+ import_data: Data loaded from import file
28
+ cli_args: Arguments passed via CLI
29
+
30
+ Returns:
31
+ Merged data dictionary
32
+
33
+ Notes:
34
+ - CLI arguments take precedence over imported data
35
+ - Handles agent-specific fields like tools and agents arrays
36
+ - Preserves agent configuration structure
37
+ """
38
+ return merge_import_with_cli_args(
39
+ import_data, cli_args, array_fields=["tools", "agents"]
40
+ )
41
+
42
+
43
+ def resolve_agent_language_model_selection(
44
+ merged_data: dict[str, Any], cli_model: str | None
45
+ ) -> tuple[dict[str, Any], bool]:
46
+ """Resolve language model selection for agent creation/update.
47
+
48
+ This is a CLI-specific wrapper around the core LM selection logic.
49
+
50
+ Args:
51
+ merged_data: Merged import data and CLI args
52
+ cli_model: Model specified via CLI --model flag
53
+
54
+ Returns:
55
+ Tuple of (lm_selection_dict, should_strip_lm_identity)
56
+ """
57
+ return resolve_language_model_selection(merged_data, cli_model)
58
+
59
+
60
+ def sanitize_agent_config_for_cli(
61
+ agent_config: dict | None,
62
+ *,
63
+ strip_credentials: bool = True,
64
+ strip_lm_identity: bool = False,
65
+ ) -> dict:
66
+ """Sanitize agent_config for CLI operations.
67
+
68
+ This is a CLI-specific wrapper around the core sanitization logic.
69
+
70
+ Args:
71
+ agent_config: The agent configuration to sanitize
72
+ strip_credentials: Always drop lm_credentials (default: True)
73
+ strip_lm_identity: Also drop lm_provider/lm_name/lm_base_url when True
74
+
75
+ Returns:
76
+ Sanitized agent configuration
77
+ """
78
+ return sanitize_agent_config(
79
+ agent_config,
80
+ strip_credentials=strip_credentials,
81
+ strip_lm_identity=strip_lm_identity,
82
+ )
@@ -1,5 +1,5 @@
1
- """CLI commands package."""
1
+ """CLI commands package exports."""
2
2
 
3
- from . import agents, init, mcps, models, tools
3
+ from glaip_sdk.cli.commands import agents, configure, mcps, models, tools
4
4
 
5
- __all__ = ["agents", "tools", "mcps", "models", "init"]
5
+ __all__ = ["agents", "tools", "mcps", "models", "configure"]