glaip-sdk 0.0.4__py3-none-any.whl → 0.0.5__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 (47) 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.5.dist-info}/METADATA +6 -5
  43. glaip_sdk-0.0.5.dist-info/RECORD +55 -0
  44. glaip_sdk/cli/commands/init.py +0 -93
  45. glaip_sdk-0.0.4.dist-info/RECORD +0 -41
  46. {glaip_sdk-0.0.4.dist-info → glaip_sdk-0.0.5.dist-info}/WHEEL +0 -0
  47. {glaip_sdk-0.0.4.dist-info → glaip_sdk-0.0.5.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,273 @@
1
+ """Validation utilities for resource names, timeouts, and other constraints.
2
+
3
+ This module provides pure validation functions that raise ValueError for invalid
4
+ inputs. CLI layer wraps these with click.ClickException for user-friendly errors.
5
+
6
+ Authors:
7
+ Raymond Christopher (raymond.christopher@gdplabs.id)
8
+ """
9
+
10
+ import re
11
+ from pathlib import Path
12
+ from typing import Any
13
+
14
+ from glaip_sdk.utils.resource_refs import validate_name_format
15
+
16
+ # Constants for validation
17
+ RESERVED_NAMES = ["admin", "root", "system", "api", "test", "demo"]
18
+
19
+
20
+ def validate_agent_name(name: str) -> str:
21
+ """Validate agent name and return cleaned version.
22
+
23
+ Args:
24
+ name: Agent name to validate
25
+
26
+ Returns:
27
+ Cleaned agent name
28
+
29
+ Raises:
30
+ ValueError: If name is invalid
31
+ """
32
+ cleaned_name = validate_name_format(name, "agent")
33
+
34
+ # Check for reserved names
35
+ if cleaned_name.lower() in RESERVED_NAMES:
36
+ raise ValueError(f"'{cleaned_name}' is a reserved name and cannot be used")
37
+
38
+ return cleaned_name
39
+
40
+
41
+ def validate_agent_instruction(instruction: str) -> str:
42
+ """Validate agent instruction and return cleaned version.
43
+
44
+ Args:
45
+ instruction: Agent instruction to validate
46
+
47
+ Returns:
48
+ Cleaned agent instruction
49
+
50
+ Raises:
51
+ ValueError: If instruction is invalid
52
+ """
53
+ if not instruction or not instruction.strip():
54
+ raise ValueError("Agent instruction cannot be empty or whitespace")
55
+
56
+ cleaned_instruction = instruction.strip()
57
+
58
+ if len(cleaned_instruction) > 10000:
59
+ raise ValueError("Agent instruction cannot be longer than 10,000 characters")
60
+
61
+ return cleaned_instruction
62
+
63
+
64
+ def validate_tool_name(name: str) -> str:
65
+ """Validate tool name and return cleaned version.
66
+
67
+ Args:
68
+ name: Tool name to validate
69
+
70
+ Returns:
71
+ Cleaned tool name
72
+
73
+ Raises:
74
+ ValueError: If name is invalid
75
+ """
76
+ cleaned_name = validate_name_format(name, "tool")
77
+
78
+ # Check for reserved names
79
+ if cleaned_name.lower() in RESERVED_NAMES:
80
+ raise ValueError(f"'{cleaned_name}' is a reserved name and cannot be used")
81
+
82
+ return cleaned_name
83
+
84
+
85
+ def validate_mcp_name(name: str) -> str:
86
+ """Validate MCP name and return cleaned version.
87
+
88
+ Args:
89
+ name: MCP name to validate
90
+
91
+ Returns:
92
+ Cleaned MCP name
93
+
94
+ Raises:
95
+ ValueError: If name is invalid
96
+ """
97
+ cleaned_name = validate_name_format(name, "mcp")
98
+
99
+ # Check for reserved names
100
+ if cleaned_name.lower() in RESERVED_NAMES:
101
+ raise ValueError(f"'{cleaned_name}' is a reserved name and cannot be used")
102
+
103
+ return cleaned_name
104
+
105
+
106
+ def validate_timeout(timeout: int) -> int:
107
+ """Validate timeout value.
108
+
109
+ Args:
110
+ timeout: Timeout value in seconds
111
+
112
+ Returns:
113
+ Validated timeout value
114
+
115
+ Raises:
116
+ ValueError: If timeout is invalid
117
+ """
118
+ if timeout < 1:
119
+ raise ValueError("Timeout must be at least 1 second")
120
+
121
+ if timeout > 3600: # 1 hour max
122
+ raise ValueError("Timeout cannot be longer than 1 hour (3600 seconds)")
123
+
124
+ return timeout
125
+
126
+
127
+ def coerce_timeout(value: Any) -> int:
128
+ """Coerce timeout value to integer, handling various input types.
129
+
130
+ Args:
131
+ value: The timeout value to coerce (int, float, str, etc.)
132
+
133
+ Returns:
134
+ Integer timeout value
135
+
136
+ Raises:
137
+ ValueError: If value cannot be coerced to valid timeout
138
+
139
+ Examples:
140
+ coerce_timeout(300) -> 300
141
+ coerce_timeout(300.0) -> 300
142
+ coerce_timeout("300") -> 300
143
+ coerce_timeout(None) -> 300 # Uses DEFAULT_AGENT_RUN_TIMEOUT
144
+ """
145
+ from glaip_sdk.config.constants import DEFAULT_AGENT_RUN_TIMEOUT
146
+
147
+ if value is None:
148
+ return DEFAULT_AGENT_RUN_TIMEOUT
149
+ elif isinstance(value, int):
150
+ return validate_timeout(value)
151
+ elif isinstance(value, float):
152
+ if value.is_integer():
153
+ return validate_timeout(int(value))
154
+ return validate_timeout(int(value)) # Truncate if not integer
155
+ elif isinstance(value, str):
156
+ try:
157
+ fval = float(value)
158
+ return validate_timeout(int(fval))
159
+ except ValueError:
160
+ raise ValueError(f"Invalid timeout value: {value}")
161
+ else:
162
+ try:
163
+ return validate_timeout(int(value))
164
+ except (TypeError, ValueError):
165
+ raise ValueError(f"Invalid timeout value: {value}")
166
+
167
+
168
+ def validate_file_path(file_path: str | Path, must_exist: bool = True) -> Path:
169
+ """Validate file path.
170
+
171
+ Args:
172
+ file_path: File path to validate
173
+ must_exist: Whether file must exist
174
+
175
+ Returns:
176
+ Path object
177
+
178
+ Raises:
179
+ ValueError: If file path is invalid
180
+ """
181
+ path = Path(file_path)
182
+
183
+ if must_exist and not path.exists():
184
+ raise ValueError(f"File does not exist: {file_path}")
185
+
186
+ if must_exist and not path.is_file():
187
+ raise ValueError(f"Path is not a file: {file_path}")
188
+
189
+ return path
190
+
191
+
192
+ def validate_directory_path(dir_path: str | Path, must_exist: bool = True) -> Path:
193
+ """Validate directory path.
194
+
195
+ Args:
196
+ dir_path: Directory path to validate
197
+ must_exist: Whether directory must exist
198
+
199
+ Returns:
200
+ Path object
201
+
202
+ Raises:
203
+ ValueError: If directory path is invalid
204
+ """
205
+ path = Path(dir_path)
206
+
207
+ if must_exist and not path.exists():
208
+ raise ValueError(f"Directory does not exist: {dir_path}")
209
+
210
+ if must_exist and not path.is_dir():
211
+ raise ValueError(f"Path is not a directory: {dir_path}")
212
+
213
+ return path
214
+
215
+
216
+ def validate_url(url: str) -> str:
217
+ """Validate URL format.
218
+
219
+ Args:
220
+ url: URL to validate
221
+
222
+ Returns:
223
+ Validated URL
224
+
225
+ Raises:
226
+ ValueError: If URL is invalid
227
+ """
228
+ url_pattern = re.compile(
229
+ r"^https?://" # http:// or https://
230
+ r"(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?|" # domain...
231
+ r"localhost|" # localhost...
232
+ r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" # ...or ip
233
+ r"(?::\d+)?" # optional port
234
+ r"(?:/?|[/?]\S+)$",
235
+ re.IGNORECASE,
236
+ )
237
+
238
+ if not url_pattern.match(url):
239
+ raise ValueError(f"Invalid URL format: {url}")
240
+
241
+ return url
242
+
243
+
244
+ def validate_api_key(api_key: str) -> str:
245
+ """Validate API key format.
246
+
247
+ Args:
248
+ api_key: API key to validate
249
+
250
+ Returns:
251
+ Validated API key
252
+
253
+ Raises:
254
+ ValueError: If API key is invalid
255
+ """
256
+ if not api_key or not api_key.strip():
257
+ raise ValueError("API key cannot be empty")
258
+
259
+ cleaned_key = api_key.strip()
260
+
261
+ if len(cleaned_key) < 10:
262
+ raise ValueError("API key appears to be too short")
263
+
264
+ if len(cleaned_key) > 200:
265
+ raise ValueError("API key appears to be too long")
266
+
267
+ # Check for potentially invalid characters
268
+ if not re.match(r"^[a-zA-Z0-9_-]+$", cleaned_key):
269
+ raise ValueError(
270
+ "API key contains invalid characters. Only letters, numbers, hyphens, and underscores are allowed."
271
+ )
272
+
273
+ return cleaned_key
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: glaip-sdk
3
- Version: 0.0.4
4
- Summary: Python SDK for AI Agent Platform - Simplified CLI Design
3
+ Version: 0.0.5
4
+ Summary: Python SDK for GL AIP (GDP Labs AI Agent Package) - Simplified CLI Design
5
5
  Author-email: Raymond Christopher <raymond.christopher@gdplabs.id>
6
6
  License: MIT
7
7
  Requires-Python: >=3.10
@@ -15,13 +15,14 @@ Requires-Dist: readchar<5.0.0,>=4.2.1
15
15
  Requires-Dist: rich>=13.0.0
16
16
  Provides-Extra: dev
17
17
  Requires-Dist: pre-commit>=4.3.0; extra == 'dev'
18
+ Requires-Dist: pytest-asyncio>=0.23.6; extra == 'dev'
18
19
  Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
19
20
  Requires-Dist: pytest-dotenv>=0.5.2; extra == 'dev'
20
21
  Requires-Dist: pytest-xdist>=3.8.0; extra == 'dev'
21
22
  Requires-Dist: pytest>=7.0.0; extra == 'dev'
22
23
  Description-Content-Type: text/markdown
23
24
 
24
- # AIP SDK — Enterprise AI Agent Platform (Python)
25
+ # GL AIP SDK — Enterprise AI Agent Package (Python)
25
26
 
26
27
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
27
28
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -230,7 +231,7 @@ agent.delete()
230
231
  **CLI:**
231
232
  ```bash
232
233
  # Configure and create your first agent
233
- aip init
234
+ aip configure
234
235
  aip agents create --name "hello" --instruction "You are a helpful assistant"
235
236
  aip agents run <AGENT_ID> --input "Hello! What can you do?"
236
237
  aip agents delete <AGENT_ID>
@@ -431,7 +432,7 @@ tool.delete()
431
432
 
432
433
  ```bash
433
434
  # Configure
434
- aip init
435
+ aip configure
435
436
 
436
437
  # Agents
437
438
  aip agents create --name "helper" --instruction "You are helpful"
@@ -0,0 +1,55 @@
1
+ glaip_sdk/__init__.py,sha256=AmY3ggfFTMzWNiHc6RYkdr-IgDqU6CZvU7PGdoyVULg,370
2
+ glaip_sdk/_version.py,sha256=Rb9YLDvK1DXCVFrjlLDbtucpwKh_PyCnmZ-ia9VX3Cc,1650
3
+ glaip_sdk/branding.py,sha256=TLx2j4q3QJrmsbQsvtbd9Ta99rQkX8HzYIDwy-D8tz4,5301
4
+ glaip_sdk/exceptions.py,sha256=QTVtwxRHMN4e8gGn0icXphZvdugiRvcSrlMYylwGsDc,1993
5
+ glaip_sdk/models.py,sha256=d8VSE1lm8jR0p_ep8cNaPZ6h2FfKudeAtCZlTxrw_wc,8729
6
+ glaip_sdk/rich_components.py,sha256=pmJd-81OQE8bC9UOXtga5rsax4zphKlzCZ1JoWbbQzQ,803
7
+ glaip_sdk/cli/__init__.py,sha256=xCCfuF1Yc7mpCDcfhHZTX0vizvtrDSLeT8MJ3V7m5A0,156
8
+ glaip_sdk/cli/agent_config.py,sha256=VHjebw68wAdhGUzYdPH8qz10oADZPRgUQcPW6F7iHIU,2421
9
+ glaip_sdk/cli/display.py,sha256=wFYReJQ0VTiQYepWd6uFLvHdYkpAj321o8e7P2zSvfY,8058
10
+ glaip_sdk/cli/io.py,sha256=9DxJsuJyl_kDkxXCt661mZIpBxnfT7rvJ6Xq2a1ie5M,3326
11
+ glaip_sdk/cli/main.py,sha256=U13On-zpLZLTDbruWHDhkgo6HYbcxrc5SL9ttiXsnlw,10414
12
+ glaip_sdk/cli/resolution.py,sha256=FlWEg7Frtw2jwdLLfed58mTXsUv73loI677CezDp4KM,1619
13
+ glaip_sdk/cli/utils.py,sha256=dwiZ6P6j75fcE_hDmLmV2IfrIlXsVdFWR4EI_1LMhqU,29653
14
+ glaip_sdk/cli/validators.py,sha256=0VXG91hVlFVGYMfk5gm1XpiRqDKS_3wWfmfjPZmWPYw,5446
15
+ glaip_sdk/cli/commands/__init__.py,sha256=ZAzgT9y68_BbSpuIClPoZureIxEM8gqmG9qL3iFkCyQ,173
16
+ glaip_sdk/cli/commands/agents.py,sha256=xd8zFF8J7Qdes5ywFGhqSpEpe9UhB9oLJfrhT3kbr-I,33989
17
+ glaip_sdk/cli/commands/configure.py,sha256=5Rr_gGc7j53CipCC9shE4uyvpX-06Sif0p2YpbAz33s,7306
18
+ glaip_sdk/cli/commands/mcps.py,sha256=HK3XCnVajjnU02eFHzVtqCEJK5X39ozt9ag-fe32tRM,12476
19
+ glaip_sdk/cli/commands/models.py,sha256=JhVhH-c5V-VkxJu4jXvm2hmaeU7LXuT9KOH9XWcpubg,1417
20
+ glaip_sdk/cli/commands/tools.py,sha256=1Qm-FrWkxF-pjsU0jP9MSW4L1gfzqIYDiZdDy7qhQRg,17475
21
+ glaip_sdk/client/__init__.py,sha256=nYLXfBVTTWwKjP0e63iumPYO4k5FifwWaELQPaPIKIg,188
22
+ glaip_sdk/client/agents.py,sha256=j6MljkfVIDAL5sAa0fcIre_ZjQ_1co9pGhqFphBPT8c,30702
23
+ glaip_sdk/client/base.py,sha256=NcxiM2oGKXktNi4zubljO5OhD3DCEP-X0KfuJ9QY4xg,12098
24
+ glaip_sdk/client/main.py,sha256=LlvYHP7-Hy7Eq1ep1kfk337K-Oue5SdKWJpqYfX9eXY,7993
25
+ glaip_sdk/client/mcps.py,sha256=yxwrAtztElYDEGhp2EHRpeYUxNsOlTLTqtw9jSKJmcI,8936
26
+ glaip_sdk/client/tools.py,sha256=ZvRRbXHvd33XUKqmKAIFSvz_IO-1glTvJNyxOeivK9Q,15962
27
+ glaip_sdk/client/validators.py,sha256=3MtOt11IivEwQAgzmdRGWUBzP223ytECOLU_a77x7IU,7101
28
+ glaip_sdk/config/constants.py,sha256=mOH2conxcj8t-bGhwgP_iFX4NMkNEm-9k5QN2F8yqyY,925
29
+ glaip_sdk/utils/__init__.py,sha256=9Y4eCjXx9_t_29CfnH-ChCf2b0YsYCLSJN9s9_HnzLo,926
30
+ glaip_sdk/utils/agent_config.py,sha256=b7_J5DELyk0b_XEoi7tsxbS3wqzAKbMa-3_C-65pPIY,6791
31
+ glaip_sdk/utils/client_utils.py,sha256=JdmP2OolXy83lzXxKDvswRw3bCorh2c3Gm5uy-sDeXQ,11839
32
+ glaip_sdk/utils/display.py,sha256=BHVD194MS1vEWm5oaLfEx_vxGoUyHGMGcQJDnKLh2AI,3071
33
+ glaip_sdk/utils/general.py,sha256=YolKDCs1wNcefQ9fOk5wd9prSxJZe1-PHsZSH1a8wDQ,2186
34
+ glaip_sdk/utils/import_export.py,sha256=-XX21D0emPyC6EWpBsxySU1-lb3dkY1jJEjx11oLa6I,4503
35
+ glaip_sdk/utils/resource_refs.py,sha256=0YzblJNfRhz9xhpaKE9aE68XEV-6_ssr0fIkiMVOka0,5489
36
+ glaip_sdk/utils/rich_utils.py,sha256=8jPG8HsDTr6nj2vh4_be5ULCGxG1ZSinJqHZT6pdXsY,755
37
+ glaip_sdk/utils/run_renderer.py,sha256=JGQzXymsptgr927-F49H1AOT5bzqErDXZMF2pOxqbfw,1365
38
+ glaip_sdk/utils/serialization.py,sha256=eqbxPOBxuJ88NpES_rGWs1m7QJcs00IwhFOk1GHoZyE,7803
39
+ glaip_sdk/utils/validation.py,sha256=QjBRsYFrP8MLl-xMq68Sk-Gyev-EGLGiY2l5t0ALySc,6990
40
+ glaip_sdk/utils/rendering/__init__.py,sha256=vXjwk5rPhhfPyD8S0DnV4GFFEtPJp4HCCg1Um9SXfs0,70
41
+ glaip_sdk/utils/rendering/formatting.py,sha256=zTF5E7BcswaIHHGFMjy1ylo6kJfpLQmeeAgFYITthcU,7165
42
+ glaip_sdk/utils/rendering/models.py,sha256=ffPMv4XrKY4V2-THL69KONZf1NL7msIa-jVZAVuz2Js,1559
43
+ glaip_sdk/utils/rendering/steps.py,sha256=SPImcV6f-TY_ITLyi4mSTeTu4SJxlMN7fWEKfDLL3Z8,5862
44
+ glaip_sdk/utils/rendering/renderer/__init__.py,sha256=EXwVBmGkSYcype4ocAXo69Z1kXu0gpNXmhH5LW0_B7A,2939
45
+ glaip_sdk/utils/rendering/renderer/base.py,sha256=LjtJmEs_pAw4uux1XgfZRJGA-myPzCCpwmYbBg0io98,34067
46
+ glaip_sdk/utils/rendering/renderer/config.py,sha256=E4ER8TJJbqr1hcWjkwG7XROqLuccQy4EL99CbuLvSXE,783
47
+ glaip_sdk/utils/rendering/renderer/console.py,sha256=ibQU07rmrWw-MMX6n3J2ewxuOEY-Z6RnKEfzMH2-IrA,1744
48
+ glaip_sdk/utils/rendering/renderer/debug.py,sha256=VqpQAmBA3DtHVIqIeWJSgrycmzORUBk1kJ5m6b3tz4s,2884
49
+ glaip_sdk/utils/rendering/renderer/panels.py,sha256=_KJohKOsyOBkqKzlC-hOSwZt1SGsJRhQwizlrRgWMis,3040
50
+ glaip_sdk/utils/rendering/renderer/progress.py,sha256=i4HG_iNwtK4c3Gf2sviLCiOJ-5ydX4t-YE5dgtLOxNI,3438
51
+ glaip_sdk/utils/rendering/renderer/stream.py,sha256=ZKitYkt_7OirNeERu3cc_NybQ8mWUMoEstg9UL1S090,7323
52
+ glaip_sdk-0.0.5.dist-info/METADATA,sha256=GQzSBnzl6crtUAyodylGBwhWEDLQrS2BUvM93CGHSjA,19584
53
+ glaip_sdk-0.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
54
+ glaip_sdk-0.0.5.dist-info/entry_points.txt,sha256=65vNPUggyYnVGhuw7RhNJ8Fp2jygTcX0yxJBcBY3iLU,48
55
+ glaip_sdk-0.0.5.dist-info/RECORD,,
@@ -1,93 +0,0 @@
1
- """CLI initialization command.
2
-
3
- Authors:
4
- Raymond Christopher (raymond.christopher@gdplabs.id)
5
- """
6
-
7
- import getpass
8
- import os
9
- from pathlib import Path
10
-
11
- import click
12
- import yaml
13
- from rich.console import Console
14
- from rich.text import Text
15
-
16
- from glaip_sdk import Client
17
- from glaip_sdk._version import __version__ as _SDK_VERSION
18
- from glaip_sdk.branding import AIPBranding
19
-
20
- console = Console()
21
-
22
-
23
- @click.command()
24
- def init_command():
25
- """Initialize AIP project configuration."""
26
- # Display AIP welcome banner
27
- branding = AIPBranding.create_from_sdk(
28
- sdk_version=_SDK_VERSION, package_name="glaip-sdk"
29
- )
30
- branding.display_welcome_panel(title="🚀 AIP Initialization")
31
-
32
- # Get configuration
33
- console.print("\n[bold]API Configuration[/bold]")
34
- console.print("─" * 50)
35
-
36
- console.print(
37
- "\n[cyan]AIP API URL[/cyan] (default: https://your-aip-instance.com):"
38
- )
39
- api_url = input("> ").strip()
40
- if not api_url:
41
- api_url = "https://your-aip-instance.com"
42
-
43
- console.print("\n[cyan]AIP API Key[/cyan]:")
44
- api_key = getpass.getpass("> ")
45
-
46
- # Create config directory
47
- config_dir = Path.home() / ".aip"
48
- try:
49
- config_dir.mkdir(exist_ok=True)
50
- except Exception as e:
51
- console.print(Text(f"⚠️ Warning: Could not create config directory: {e}"))
52
- return
53
-
54
- # Save configuration
55
- config = {"api_url": api_url, "api_key": api_key}
56
- config_file = config_dir / "config.yaml"
57
- try:
58
- with open(config_file, "w") as f:
59
- yaml.dump(config, f, default_flow_style=False)
60
- except Exception as e:
61
- console.print(Text(f"⚠️ Warning: Could not save configuration: {e}"))
62
- return
63
-
64
- # Set secure file permissions (0600) - best effort on all platforms
65
- try:
66
- os.chmod(config_file, 0o600)
67
- except Exception:
68
- pass # Ignore permission errors
69
-
70
- console.print(Text(f"\n✅ Configuration saved to: {config_file}"))
71
-
72
- # Test the new configuration
73
- console.print("\n🔌 Testing connection...")
74
- try:
75
- # Set environment variables
76
- os.environ["AIP_API_URL"] = api_url
77
- os.environ["AIP_API_KEY"] = api_key
78
-
79
- client = Client()
80
- agents = client.list_agents()
81
- console.print(Text(f"✅ Connection successful! Found {len(agents)} agents"))
82
- except Exception as e:
83
- console.print(Text(f"⚠️ Connection established but API call failed: {e}"))
84
- console.print(
85
- Text(" You may need to check your API permissions or network access")
86
- )
87
-
88
- console.print("\n🎉 [bold green]AIP initialization complete![/bold green]")
89
- console.print(f"📁 Configuration: {config_file}")
90
- console.print("💡 Next steps:")
91
- console.print(" • Run 'aip agents list' to see your agents")
92
- console.print(" • Run 'aip tools list' to see your tools")
93
- console.print(" • Run 'aip status' to check connection")
@@ -1,41 +0,0 @@
1
- glaip_sdk/__init__.py,sha256=UGBsYHHSgSc1HGCTsA9bbz2ARJJ1g49cTieXEINHtAk,323
2
- glaip_sdk/_version.py,sha256=Rb9YLDvK1DXCVFrjlLDbtucpwKh_PyCnmZ-ia9VX3Cc,1650
3
- glaip_sdk/branding.py,sha256=Iwm9qsPoRNCiv7IS_pet_vno8ltdVR4UwyEHoYH7qp0,4891
4
- glaip_sdk/exceptions.py,sha256=QTVtwxRHMN4e8gGn0icXphZvdugiRvcSrlMYylwGsDc,1993
5
- glaip_sdk/models.py,sha256=kkuH66cj5Oyrma3bLldPpheeXR4H9xZa_z32bpLd3DU,7229
6
- glaip_sdk/cli/__init__.py,sha256=cPI-uOOBww_ESiH6NQBdJiTg8CUVNigFOU3kl0tgTuI,143
7
- glaip_sdk/cli/main.py,sha256=jiZmj9smpFYkdToJip_JMBNoBEIqOrt1cTaTQrNmN7w,10557
8
- glaip_sdk/cli/utils.py,sha256=UBIrLIKLi4UZjwEa8J1AiOyGJe8o6eVhYBCwjx51CxQ,29182
9
- glaip_sdk/cli/commands/__init__.py,sha256=WShiuYqHcbuexPboibDJ_Q2jOPIWp-TgsyUAO2-T20I,134
10
- glaip_sdk/cli/commands/agents.py,sha256=yNrlOooe9vx_A_frycdJ9U4aibXAHV4aYwVYn54RbSY,38515
11
- glaip_sdk/cli/commands/configure.py,sha256=SNaWPO0bgI6bztlKgoqGr0qh2KSSDztyubKhrw_HLEI,7285
12
- glaip_sdk/cli/commands/init.py,sha256=W4z5TBlfSn9fmHpH1W92llgqfF0OvhgJSdny-P61Y_4,2934
13
- glaip_sdk/cli/commands/mcps.py,sha256=4Ny54ApHYFCkJCXORD7zslVnrNdKs981adIbJNaYAMQ,12099
14
- glaip_sdk/cli/commands/models.py,sha256=j8VqQ2edSEvD-sQXWm8ifUco9gX8J-OBib6OvzthpqU,1405
15
- glaip_sdk/cli/commands/tools.py,sha256=-xPMOKD-shI2ly9Tl-IwhKQR2kEekEs63bw7EEXNoAU,14508
16
- glaip_sdk/client/__init__.py,sha256=jnsD3HCiOGiuL_4aqJiVnBsF8HNFS-s_aNLfg26gJqs,7530
17
- glaip_sdk/client/agents.py,sha256=k3QthlIu82KeXV_W29LuFTGZVzyGL11ZY5OA4P4a2Ug,15041
18
- glaip_sdk/client/base.py,sha256=3Ri5GVYrZ4cZ5lex1pyG0nvEmGxeXwAY194MxSH1_cY,9463
19
- glaip_sdk/client/mcps.py,sha256=UEwgFbl4ogeozfJGcUbQQ7JGfwYliN9i5V6fTvkbOZ0,4311
20
- glaip_sdk/client/tools.py,sha256=v5jxHPgoGHwB2PXzlm0yywvqKaYLcrm6dJz9aT1SxuM,10954
21
- glaip_sdk/client/validators.py,sha256=3MtOt11IivEwQAgzmdRGWUBzP223ytECOLU_a77x7IU,7101
22
- glaip_sdk/config/constants.py,sha256=Pm0tGYiJ9VdW9XXz0CG36l8-sAhnlFPTKbHKKleUgik,705
23
- glaip_sdk/utils/__init__.py,sha256=5pOPBTjJ4hzvMNYjLnTut_ovwU8QJ39kARKx9-qr5Qs,5101
24
- glaip_sdk/utils/client_utils.py,sha256=O44OlbQD4X0cMo_3E_Ysb_XyfEG20v0wecl5SlM9kxo,9407
25
- glaip_sdk/utils/run_renderer.py,sha256=JGQzXymsptgr927-F49H1AOT5bzqErDXZMF2pOxqbfw,1365
26
- glaip_sdk/utils/rendering/__init__.py,sha256=vXjwk5rPhhfPyD8S0DnV4GFFEtPJp4HCCg1Um9SXfs0,70
27
- glaip_sdk/utils/rendering/formatting.py,sha256=HPCBcpWP3EpSXsIgfm-uWm6Fjo6VWzqxrnhEc137wjA,6941
28
- glaip_sdk/utils/rendering/models.py,sha256=ffPMv4XrKY4V2-THL69KONZf1NL7msIa-jVZAVuz2Js,1559
29
- glaip_sdk/utils/rendering/steps.py,sha256=qx6aNhfYYAbcXaHws-zdHOc4Yw3me3Cd19SZkZluJvg,5837
30
- glaip_sdk/utils/rendering/renderer/__init__.py,sha256=kZwCYRcQdK-9sfZPxAAqLB--A2icLbSKq7AW1_NIIGQ,987
31
- glaip_sdk/utils/rendering/renderer/base.py,sha256=IRQMNW4WHPRpBFXfXuHSo8oOWi4-Tn1_hF9a9x0_q3c,32288
32
- glaip_sdk/utils/rendering/renderer/config.py,sha256=E4ER8TJJbqr1hcWjkwG7XROqLuccQy4EL99CbuLvSXE,783
33
- glaip_sdk/utils/rendering/renderer/console.py,sha256=ibQU07rmrWw-MMX6n3J2ewxuOEY-Z6RnKEfzMH2-IrA,1744
34
- glaip_sdk/utils/rendering/renderer/debug.py,sha256=2XP6A4w3EIjVVY_M-BDPvHf05QQSz0TDTo-dRPf1fSc,2862
35
- glaip_sdk/utils/rendering/renderer/panels.py,sha256=iTDJoRBaa73pX9z9nTcb6aKhfXe1Mds0RzCuhwtvkdc,2994
36
- glaip_sdk/utils/rendering/renderer/progress.py,sha256=i4HG_iNwtK4c3Gf2sviLCiOJ-5ydX4t-YE5dgtLOxNI,3438
37
- glaip_sdk/utils/rendering/renderer/stream.py,sha256=ZKitYkt_7OirNeERu3cc_NybQ8mWUMoEstg9UL1S090,7323
38
- glaip_sdk-0.0.4.dist-info/METADATA,sha256=H5uB6CuucGboUl_Z9LhzJHOIc7PS_a0pgHcqNX7-ANE,19501
39
- glaip_sdk-0.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
40
- glaip_sdk-0.0.4.dist-info/entry_points.txt,sha256=65vNPUggyYnVGhuw7RhNJ8Fp2jygTcX0yxJBcBY3iLU,48
41
- glaip_sdk-0.0.4.dist-info/RECORD,,