glaip-sdk 0.0.0b99__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 (207) hide show
  1. glaip_sdk/__init__.py +52 -0
  2. glaip_sdk/_version.py +81 -0
  3. glaip_sdk/agents/__init__.py +27 -0
  4. glaip_sdk/agents/base.py +1227 -0
  5. glaip_sdk/branding.py +211 -0
  6. glaip_sdk/cli/__init__.py +9 -0
  7. glaip_sdk/cli/account_store.py +540 -0
  8. glaip_sdk/cli/agent_config.py +78 -0
  9. glaip_sdk/cli/auth.py +705 -0
  10. glaip_sdk/cli/commands/__init__.py +5 -0
  11. glaip_sdk/cli/commands/accounts.py +746 -0
  12. glaip_sdk/cli/commands/agents/__init__.py +119 -0
  13. glaip_sdk/cli/commands/agents/_common.py +561 -0
  14. glaip_sdk/cli/commands/agents/create.py +151 -0
  15. glaip_sdk/cli/commands/agents/delete.py +64 -0
  16. glaip_sdk/cli/commands/agents/get.py +89 -0
  17. glaip_sdk/cli/commands/agents/list.py +129 -0
  18. glaip_sdk/cli/commands/agents/run.py +264 -0
  19. glaip_sdk/cli/commands/agents/sync_langflow.py +72 -0
  20. glaip_sdk/cli/commands/agents/update.py +112 -0
  21. glaip_sdk/cli/commands/common_config.py +104 -0
  22. glaip_sdk/cli/commands/configure.py +895 -0
  23. glaip_sdk/cli/commands/mcps/__init__.py +94 -0
  24. glaip_sdk/cli/commands/mcps/_common.py +459 -0
  25. glaip_sdk/cli/commands/mcps/connect.py +82 -0
  26. glaip_sdk/cli/commands/mcps/create.py +152 -0
  27. glaip_sdk/cli/commands/mcps/delete.py +73 -0
  28. glaip_sdk/cli/commands/mcps/get.py +212 -0
  29. glaip_sdk/cli/commands/mcps/list.py +69 -0
  30. glaip_sdk/cli/commands/mcps/tools.py +235 -0
  31. glaip_sdk/cli/commands/mcps/update.py +190 -0
  32. glaip_sdk/cli/commands/models.py +67 -0
  33. glaip_sdk/cli/commands/shared/__init__.py +21 -0
  34. glaip_sdk/cli/commands/shared/formatters.py +91 -0
  35. glaip_sdk/cli/commands/tools/__init__.py +69 -0
  36. glaip_sdk/cli/commands/tools/_common.py +80 -0
  37. glaip_sdk/cli/commands/tools/create.py +228 -0
  38. glaip_sdk/cli/commands/tools/delete.py +61 -0
  39. glaip_sdk/cli/commands/tools/get.py +103 -0
  40. glaip_sdk/cli/commands/tools/list.py +69 -0
  41. glaip_sdk/cli/commands/tools/script.py +49 -0
  42. glaip_sdk/cli/commands/tools/update.py +102 -0
  43. glaip_sdk/cli/commands/transcripts/__init__.py +90 -0
  44. glaip_sdk/cli/commands/transcripts/_common.py +9 -0
  45. glaip_sdk/cli/commands/transcripts/clear.py +5 -0
  46. glaip_sdk/cli/commands/transcripts/detail.py +5 -0
  47. glaip_sdk/cli/commands/transcripts_original.py +756 -0
  48. glaip_sdk/cli/commands/update.py +192 -0
  49. glaip_sdk/cli/config.py +95 -0
  50. glaip_sdk/cli/constants.py +38 -0
  51. glaip_sdk/cli/context.py +150 -0
  52. glaip_sdk/cli/core/__init__.py +79 -0
  53. glaip_sdk/cli/core/context.py +124 -0
  54. glaip_sdk/cli/core/output.py +851 -0
  55. glaip_sdk/cli/core/prompting.py +649 -0
  56. glaip_sdk/cli/core/rendering.py +187 -0
  57. glaip_sdk/cli/display.py +355 -0
  58. glaip_sdk/cli/hints.py +57 -0
  59. glaip_sdk/cli/io.py +112 -0
  60. glaip_sdk/cli/main.py +686 -0
  61. glaip_sdk/cli/masking.py +136 -0
  62. glaip_sdk/cli/mcp_validators.py +287 -0
  63. glaip_sdk/cli/pager.py +266 -0
  64. glaip_sdk/cli/parsers/__init__.py +7 -0
  65. glaip_sdk/cli/parsers/json_input.py +177 -0
  66. glaip_sdk/cli/resolution.py +68 -0
  67. glaip_sdk/cli/rich_helpers.py +27 -0
  68. glaip_sdk/cli/slash/__init__.py +15 -0
  69. glaip_sdk/cli/slash/accounts_controller.py +580 -0
  70. glaip_sdk/cli/slash/accounts_shared.py +75 -0
  71. glaip_sdk/cli/slash/agent_session.py +285 -0
  72. glaip_sdk/cli/slash/prompt.py +256 -0
  73. glaip_sdk/cli/slash/remote_runs_controller.py +566 -0
  74. glaip_sdk/cli/slash/session.py +1724 -0
  75. glaip_sdk/cli/slash/tui/__init__.py +34 -0
  76. glaip_sdk/cli/slash/tui/accounts.tcss +88 -0
  77. glaip_sdk/cli/slash/tui/accounts_app.py +933 -0
  78. glaip_sdk/cli/slash/tui/background_tasks.py +72 -0
  79. glaip_sdk/cli/slash/tui/clipboard.py +147 -0
  80. glaip_sdk/cli/slash/tui/context.py +59 -0
  81. glaip_sdk/cli/slash/tui/keybind_registry.py +235 -0
  82. glaip_sdk/cli/slash/tui/loading.py +58 -0
  83. glaip_sdk/cli/slash/tui/remote_runs_app.py +628 -0
  84. glaip_sdk/cli/slash/tui/terminal.py +402 -0
  85. glaip_sdk/cli/slash/tui/theme/__init__.py +15 -0
  86. glaip_sdk/cli/slash/tui/theme/catalog.py +79 -0
  87. glaip_sdk/cli/slash/tui/theme/manager.py +86 -0
  88. glaip_sdk/cli/slash/tui/theme/tokens.py +55 -0
  89. glaip_sdk/cli/slash/tui/toast.py +123 -0
  90. glaip_sdk/cli/transcript/__init__.py +31 -0
  91. glaip_sdk/cli/transcript/cache.py +536 -0
  92. glaip_sdk/cli/transcript/capture.py +329 -0
  93. glaip_sdk/cli/transcript/export.py +38 -0
  94. glaip_sdk/cli/transcript/history.py +815 -0
  95. glaip_sdk/cli/transcript/launcher.py +77 -0
  96. glaip_sdk/cli/transcript/viewer.py +374 -0
  97. glaip_sdk/cli/update_notifier.py +369 -0
  98. glaip_sdk/cli/validators.py +238 -0
  99. glaip_sdk/client/__init__.py +12 -0
  100. glaip_sdk/client/_schedule_payloads.py +89 -0
  101. glaip_sdk/client/agent_runs.py +147 -0
  102. glaip_sdk/client/agents.py +1353 -0
  103. glaip_sdk/client/base.py +502 -0
  104. glaip_sdk/client/main.py +253 -0
  105. glaip_sdk/client/mcps.py +401 -0
  106. glaip_sdk/client/payloads/agent/__init__.py +23 -0
  107. glaip_sdk/client/payloads/agent/requests.py +495 -0
  108. glaip_sdk/client/payloads/agent/responses.py +43 -0
  109. glaip_sdk/client/run_rendering.py +747 -0
  110. glaip_sdk/client/schedules.py +439 -0
  111. glaip_sdk/client/shared.py +21 -0
  112. glaip_sdk/client/tools.py +690 -0
  113. glaip_sdk/client/validators.py +198 -0
  114. glaip_sdk/config/constants.py +52 -0
  115. glaip_sdk/exceptions.py +113 -0
  116. glaip_sdk/hitl/__init__.py +15 -0
  117. glaip_sdk/hitl/local.py +151 -0
  118. glaip_sdk/icons.py +25 -0
  119. glaip_sdk/mcps/__init__.py +21 -0
  120. glaip_sdk/mcps/base.py +345 -0
  121. glaip_sdk/models/__init__.py +107 -0
  122. glaip_sdk/models/agent.py +47 -0
  123. glaip_sdk/models/agent_runs.py +117 -0
  124. glaip_sdk/models/common.py +42 -0
  125. glaip_sdk/models/mcp.py +33 -0
  126. glaip_sdk/models/schedule.py +224 -0
  127. glaip_sdk/models/tool.py +33 -0
  128. glaip_sdk/payload_schemas/__init__.py +7 -0
  129. glaip_sdk/payload_schemas/agent.py +85 -0
  130. glaip_sdk/registry/__init__.py +55 -0
  131. glaip_sdk/registry/agent.py +164 -0
  132. glaip_sdk/registry/base.py +139 -0
  133. glaip_sdk/registry/mcp.py +253 -0
  134. glaip_sdk/registry/tool.py +393 -0
  135. glaip_sdk/rich_components.py +125 -0
  136. glaip_sdk/runner/__init__.py +59 -0
  137. glaip_sdk/runner/base.py +84 -0
  138. glaip_sdk/runner/deps.py +112 -0
  139. glaip_sdk/runner/langgraph.py +870 -0
  140. glaip_sdk/runner/mcp_adapter/__init__.py +13 -0
  141. glaip_sdk/runner/mcp_adapter/base_mcp_adapter.py +43 -0
  142. glaip_sdk/runner/mcp_adapter/langchain_mcp_adapter.py +257 -0
  143. glaip_sdk/runner/mcp_adapter/mcp_config_builder.py +95 -0
  144. glaip_sdk/runner/tool_adapter/__init__.py +18 -0
  145. glaip_sdk/runner/tool_adapter/base_tool_adapter.py +44 -0
  146. glaip_sdk/runner/tool_adapter/langchain_tool_adapter.py +219 -0
  147. glaip_sdk/schedules/__init__.py +22 -0
  148. glaip_sdk/schedules/base.py +291 -0
  149. glaip_sdk/tools/__init__.py +22 -0
  150. glaip_sdk/tools/base.py +466 -0
  151. glaip_sdk/utils/__init__.py +86 -0
  152. glaip_sdk/utils/a2a/__init__.py +34 -0
  153. glaip_sdk/utils/a2a/event_processor.py +188 -0
  154. glaip_sdk/utils/agent_config.py +194 -0
  155. glaip_sdk/utils/bundler.py +267 -0
  156. glaip_sdk/utils/client.py +111 -0
  157. glaip_sdk/utils/client_utils.py +486 -0
  158. glaip_sdk/utils/datetime_helpers.py +58 -0
  159. glaip_sdk/utils/discovery.py +78 -0
  160. glaip_sdk/utils/display.py +135 -0
  161. glaip_sdk/utils/export.py +143 -0
  162. glaip_sdk/utils/general.py +61 -0
  163. glaip_sdk/utils/import_export.py +168 -0
  164. glaip_sdk/utils/import_resolver.py +530 -0
  165. glaip_sdk/utils/instructions.py +101 -0
  166. glaip_sdk/utils/rendering/__init__.py +115 -0
  167. glaip_sdk/utils/rendering/formatting.py +264 -0
  168. glaip_sdk/utils/rendering/layout/__init__.py +64 -0
  169. glaip_sdk/utils/rendering/layout/panels.py +156 -0
  170. glaip_sdk/utils/rendering/layout/progress.py +202 -0
  171. glaip_sdk/utils/rendering/layout/summary.py +74 -0
  172. glaip_sdk/utils/rendering/layout/transcript.py +606 -0
  173. glaip_sdk/utils/rendering/models.py +85 -0
  174. glaip_sdk/utils/rendering/renderer/__init__.py +55 -0
  175. glaip_sdk/utils/rendering/renderer/base.py +1082 -0
  176. glaip_sdk/utils/rendering/renderer/config.py +27 -0
  177. glaip_sdk/utils/rendering/renderer/console.py +55 -0
  178. glaip_sdk/utils/rendering/renderer/debug.py +178 -0
  179. glaip_sdk/utils/rendering/renderer/factory.py +138 -0
  180. glaip_sdk/utils/rendering/renderer/stream.py +202 -0
  181. glaip_sdk/utils/rendering/renderer/summary_window.py +79 -0
  182. glaip_sdk/utils/rendering/renderer/thinking.py +273 -0
  183. glaip_sdk/utils/rendering/renderer/toggle.py +182 -0
  184. glaip_sdk/utils/rendering/renderer/tool_panels.py +442 -0
  185. glaip_sdk/utils/rendering/renderer/transcript_mode.py +162 -0
  186. glaip_sdk/utils/rendering/state.py +204 -0
  187. glaip_sdk/utils/rendering/step_tree_state.py +100 -0
  188. glaip_sdk/utils/rendering/steps/__init__.py +34 -0
  189. glaip_sdk/utils/rendering/steps/event_processor.py +778 -0
  190. glaip_sdk/utils/rendering/steps/format.py +176 -0
  191. glaip_sdk/utils/rendering/steps/manager.py +387 -0
  192. glaip_sdk/utils/rendering/timing.py +36 -0
  193. glaip_sdk/utils/rendering/viewer/__init__.py +21 -0
  194. glaip_sdk/utils/rendering/viewer/presenter.py +184 -0
  195. glaip_sdk/utils/resource_refs.py +195 -0
  196. glaip_sdk/utils/run_renderer.py +41 -0
  197. glaip_sdk/utils/runtime_config.py +425 -0
  198. glaip_sdk/utils/serialization.py +424 -0
  199. glaip_sdk/utils/sync.py +142 -0
  200. glaip_sdk/utils/tool_detection.py +33 -0
  201. glaip_sdk/utils/tool_storage_provider.py +140 -0
  202. glaip_sdk/utils/validation.py +264 -0
  203. glaip_sdk-0.0.0b99.dist-info/METADATA +239 -0
  204. glaip_sdk-0.0.0b99.dist-info/RECORD +207 -0
  205. glaip_sdk-0.0.0b99.dist-info/WHEEL +5 -0
  206. glaip_sdk-0.0.0b99.dist-info/entry_points.txt +2 -0
  207. glaip_sdk-0.0.0b99.dist-info/top_level.txt +1 -0
glaip_sdk/branding.py ADDED
@@ -0,0 +1,211 @@
1
+ """AIP SDK Branding and Visual Identity.
2
+
3
+ Simple, friendly CLI branding for the GL AIP (GDP Labs AI Agent Package) SDK.
4
+
5
+ - Package name: GL AIP (GDP Labs AI Agent Package)
6
+ - Version: auto-detected (AIP_VERSION env or importlib.metadata), or passed in
7
+ - Colors: GDP Labs brand palette with NO_COLOR/AIP_NO_COLOR fallbacks
8
+
9
+ Author:
10
+ Raymond Christopher (raymond.christopher@gdplabs.id)
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import os
16
+ import platform
17
+ import sys
18
+
19
+ from rich.console import Console
20
+
21
+ from glaip_sdk._version import __version__ as SDK_VERSION
22
+ from glaip_sdk.rich_components import AIPPanel
23
+
24
+ try:
25
+ # Python 3.8+ standard way to read installed package version
26
+ from importlib.metadata import PackageNotFoundError
27
+ from importlib.metadata import version as pkg_version
28
+ except Exception: # pragma: no cover
29
+ pkg_version = None
30
+ PackageNotFoundError = Exception
31
+
32
+
33
+ # ---- GDP Labs Brand Color Palette -----------------------------------------
34
+ PRIMARY = "#004987" # Primary brand blue (dark blue)
35
+ SECONDARY_DARK = "#003A5C" # Darkest variant for emphasis
36
+ SECONDARY_MEDIUM = "#005CB8" # Medium variant for UI elements
37
+ SECONDARY_LIGHT = "#40B4E5" # Light variant for highlights
38
+
39
+ # Neutral companion palette (optimized for dark terminals)
40
+ SUCCESS = "#7FA089" # Muted teal-green for success messaging
41
+ WARNING = "#C3A46F" # Soft amber for warnings
42
+ ERROR = "#C97B6C" # Tempered coral-red for errors
43
+ INFO = "#9CA3AF" # Cool grey for informational accents
44
+ NEUTRAL = "#D1D5DB" # Light grey for muted text and dividers
45
+
46
+ BORDER = PRIMARY # Keep borders aligned with primary brand tone
47
+ TITLE_STYLE = f"bold {PRIMARY}"
48
+ LABEL = "bold"
49
+ SUCCESS_STYLE = f"bold {SUCCESS}"
50
+ WARNING_STYLE = f"bold {WARNING}"
51
+ ERROR_STYLE = f"bold {ERROR}"
52
+ INFO_STYLE = f"bold {INFO}"
53
+ ACCENT_STYLE = INFO # For subdued inline highlights
54
+
55
+ # Hint styling (slash command helpers, tips, quick actions)
56
+ HINT_TITLE_STYLE = f"bold {SECONDARY_LIGHT}"
57
+ HINT_COMMAND_STYLE = f"bold {SECONDARY_LIGHT}"
58
+ HINT_DESCRIPTION_COLOR = NEUTRAL
59
+ HINT_PREFIX_STYLE = INFO_STYLE
60
+
61
+
62
+ class AIPBranding:
63
+ """GL AIP branding utilities with ASCII banner and version display."""
64
+
65
+ # GL AIP ASCII art - Modern block style with enhanced visibility
66
+ AIP_LOGO = r"""
67
+ ██████╗ ██╗ █████╗ ██╗██████╗
68
+ ██╔════╝ ██║ ██╔══██╗██║██╔══██╗
69
+ ██║ ███╗██║ ███████║██║██████╔╝
70
+ ██║ ██║██║ ██╔══██║██║██╔═══╝
71
+ ╚██████╔╝███████╗ ██║ ██║██║██║
72
+ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝╚═╝╚═╝
73
+ GDP Labs AI Agents Package
74
+ """.strip("\n")
75
+
76
+ def __init__(
77
+ self,
78
+ version: str | None = None,
79
+ package_name: str | None = None,
80
+ ) -> None:
81
+ """Initialize AIPBranding instance.
82
+
83
+ Args:
84
+ version: Explicit SDK version (overrides auto-detection).
85
+ package_name: If set, attempt to read version from installed package.
86
+ """
87
+ self.version = version or self._auto_version(package_name)
88
+ self.console = self._make_console()
89
+
90
+ # ---- small helpers --------------------------------------------------------
91
+ @staticmethod
92
+ def _auto_version(package_name: str | None) -> str:
93
+ """Auto-detect version from environment, package metadata, or fallback.
94
+
95
+ Args:
96
+ package_name: Optional package name to read version from installed metadata.
97
+
98
+ Returns:
99
+ Version string from AIP_VERSION env var, package metadata, or SDK_VERSION fallback.
100
+ """
101
+ # Priority: env → package metadata → fallback
102
+ env_version = os.getenv("AIP_VERSION")
103
+ if env_version:
104
+ return env_version
105
+ if package_name and pkg_version:
106
+ try:
107
+ return pkg_version(package_name)
108
+ except PackageNotFoundError:
109
+ pass
110
+ return SDK_VERSION
111
+
112
+ @staticmethod
113
+ def _make_console() -> Console:
114
+ """Create a Rich Console instance respecting NO_COLOR environment variables.
115
+
116
+ Returns:
117
+ Console instance with color system configured based on environment.
118
+ """
119
+ # Respect NO_COLOR/AIP_NO_COLOR environment variables
120
+ no_color_env = os.getenv("NO_COLOR") is not None or os.getenv("AIP_NO_COLOR") is not None
121
+ if no_color_env:
122
+ color_system = None
123
+ no_color = True
124
+ else:
125
+ color_system = "auto"
126
+ no_color = False
127
+ return Console(color_system=color_system, no_color=no_color, soft_wrap=True)
128
+
129
+ # ---- public API -----------------------------------------------------------
130
+ def get_welcome_banner(self) -> str:
131
+ """Get AIP banner with version info."""
132
+ banner = f"[{PRIMARY}]{self.AIP_LOGO}[/{PRIMARY}]"
133
+ line = f"Version: {self.version}"
134
+ banner = f"{banner}\n{line}"
135
+ return banner
136
+
137
+ def get_version_info(self) -> dict:
138
+ """Get comprehensive version information for the SDK.
139
+
140
+ Returns:
141
+ Dictionary containing version, Python version, platform, and architecture info
142
+ """
143
+ return {
144
+ "version": self.version,
145
+ "python_version": f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
146
+ "platform": platform.platform(),
147
+ "architecture": platform.architecture()[0],
148
+ }
149
+
150
+ def display_welcome_panel(
151
+ self,
152
+ title: str = "Welcome to AIP",
153
+ *,
154
+ console: Console | None = None,
155
+ ) -> None:
156
+ """Display a welcome panel with branding.
157
+
158
+ Args:
159
+ title: Custom title for the welcome panel
160
+ console: Optional console instance to print to. If None, uses self.console
161
+ """
162
+ banner = self.get_welcome_banner()
163
+ panel = AIPPanel(
164
+ banner,
165
+ title=f"[{TITLE_STYLE}]{title}[/{TITLE_STYLE}]",
166
+ border_style=BORDER,
167
+ padding=(1, 2),
168
+ )
169
+ target_console = console or self.console
170
+ target_console.print(panel)
171
+
172
+ def display_version_panel(self) -> None:
173
+ """Display a panel with comprehensive version information."""
174
+ v = self.get_version_info()
175
+ version_text = (
176
+ f"[{TITLE_STYLE}]AIP SDK Version Information[/{TITLE_STYLE}]\n\n"
177
+ f"[{LABEL}]Version:[/] {v['version']}\n"
178
+ f"[{LABEL}]Python:[/] {v['python_version']}\n"
179
+ f"[{LABEL}]Platform:[/] {v['platform']}\n"
180
+ f"[{LABEL}]Architecture:[/] {v['architecture']}"
181
+ )
182
+ panel = AIPPanel(
183
+ version_text,
184
+ title=f"[{TITLE_STYLE}]Version Details[/{TITLE_STYLE}]",
185
+ border_style=BORDER,
186
+ padding=(1, 2),
187
+ )
188
+ self.console.print(panel)
189
+
190
+ def display_status_banner(self, status: str = "ready") -> None:
191
+ """Display a status banner for the current state.
192
+
193
+ Args:
194
+ status: Current status to display
195
+ """
196
+ # Keep it simple (no emoji); easy to parse in logs/CI
197
+ banner = f"[{LABEL}]AIP[/{LABEL}] - {status.title()}"
198
+ self.console.print(banner)
199
+
200
+ @classmethod
201
+ def create_from_sdk(cls, sdk_version: str | None = None, package_name: str | None = None) -> AIPBranding:
202
+ """Create AIPBranding instance from SDK package information.
203
+
204
+ Args:
205
+ sdk_version: Explicit SDK version override
206
+ package_name: Package name to read version from
207
+
208
+ Returns:
209
+ AIPBranding instance
210
+ """
211
+ return cls(version=sdk_version, package_name=package_name)
@@ -0,0 +1,9 @@
1
+ """CLI package for AIP SDK.
2
+
3
+ Authors:
4
+ Raymond Christopher (raymond.christopher@gdplabs.id)
5
+ """
6
+
7
+ from glaip_sdk.cli.main import main
8
+
9
+ __all__ = ["main"]