glaip-sdk 0.6.12__py3-none-any.whl → 0.6.14__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 (156) hide show
  1. glaip_sdk/__init__.py +42 -5
  2. {glaip_sdk-0.6.12.dist-info → glaip_sdk-0.6.14.dist-info}/METADATA +31 -37
  3. glaip_sdk-0.6.14.dist-info/RECORD +12 -0
  4. {glaip_sdk-0.6.12.dist-info → glaip_sdk-0.6.14.dist-info}/WHEEL +2 -1
  5. glaip_sdk-0.6.14.dist-info/entry_points.txt +2 -0
  6. glaip_sdk-0.6.14.dist-info/top_level.txt +1 -0
  7. glaip_sdk/agents/__init__.py +0 -27
  8. glaip_sdk/agents/base.py +0 -1191
  9. glaip_sdk/cli/__init__.py +0 -9
  10. glaip_sdk/cli/account_store.py +0 -540
  11. glaip_sdk/cli/agent_config.py +0 -78
  12. glaip_sdk/cli/auth.py +0 -699
  13. glaip_sdk/cli/commands/__init__.py +0 -5
  14. glaip_sdk/cli/commands/accounts.py +0 -746
  15. glaip_sdk/cli/commands/agents.py +0 -1509
  16. glaip_sdk/cli/commands/common_config.py +0 -101
  17. glaip_sdk/cli/commands/configure.py +0 -896
  18. glaip_sdk/cli/commands/mcps.py +0 -1356
  19. glaip_sdk/cli/commands/models.py +0 -69
  20. glaip_sdk/cli/commands/tools.py +0 -576
  21. glaip_sdk/cli/commands/transcripts.py +0 -755
  22. glaip_sdk/cli/commands/update.py +0 -61
  23. glaip_sdk/cli/config.py +0 -95
  24. glaip_sdk/cli/constants.py +0 -38
  25. glaip_sdk/cli/context.py +0 -150
  26. glaip_sdk/cli/core/__init__.py +0 -79
  27. glaip_sdk/cli/core/context.py +0 -124
  28. glaip_sdk/cli/core/output.py +0 -846
  29. glaip_sdk/cli/core/prompting.py +0 -649
  30. glaip_sdk/cli/core/rendering.py +0 -187
  31. glaip_sdk/cli/display.py +0 -355
  32. glaip_sdk/cli/hints.py +0 -57
  33. glaip_sdk/cli/io.py +0 -112
  34. glaip_sdk/cli/main.py +0 -604
  35. glaip_sdk/cli/masking.py +0 -136
  36. glaip_sdk/cli/mcp_validators.py +0 -287
  37. glaip_sdk/cli/pager.py +0 -266
  38. glaip_sdk/cli/parsers/__init__.py +0 -7
  39. glaip_sdk/cli/parsers/json_input.py +0 -177
  40. glaip_sdk/cli/resolution.py +0 -67
  41. glaip_sdk/cli/rich_helpers.py +0 -27
  42. glaip_sdk/cli/slash/__init__.py +0 -15
  43. glaip_sdk/cli/slash/accounts_controller.py +0 -578
  44. glaip_sdk/cli/slash/accounts_shared.py +0 -75
  45. glaip_sdk/cli/slash/agent_session.py +0 -285
  46. glaip_sdk/cli/slash/prompt.py +0 -256
  47. glaip_sdk/cli/slash/remote_runs_controller.py +0 -566
  48. glaip_sdk/cli/slash/session.py +0 -1708
  49. glaip_sdk/cli/slash/tui/__init__.py +0 -9
  50. glaip_sdk/cli/slash/tui/accounts_app.py +0 -876
  51. glaip_sdk/cli/slash/tui/background_tasks.py +0 -72
  52. glaip_sdk/cli/slash/tui/loading.py +0 -58
  53. glaip_sdk/cli/slash/tui/remote_runs_app.py +0 -628
  54. glaip_sdk/cli/transcript/__init__.py +0 -31
  55. glaip_sdk/cli/transcript/cache.py +0 -536
  56. glaip_sdk/cli/transcript/capture.py +0 -329
  57. glaip_sdk/cli/transcript/export.py +0 -38
  58. glaip_sdk/cli/transcript/history.py +0 -815
  59. glaip_sdk/cli/transcript/launcher.py +0 -77
  60. glaip_sdk/cli/transcript/viewer.py +0 -374
  61. glaip_sdk/cli/update_notifier.py +0 -290
  62. glaip_sdk/cli/utils.py +0 -263
  63. glaip_sdk/cli/validators.py +0 -238
  64. glaip_sdk/client/__init__.py +0 -11
  65. glaip_sdk/client/_agent_payloads.py +0 -520
  66. glaip_sdk/client/agent_runs.py +0 -147
  67. glaip_sdk/client/agents.py +0 -1335
  68. glaip_sdk/client/base.py +0 -502
  69. glaip_sdk/client/main.py +0 -249
  70. glaip_sdk/client/mcps.py +0 -370
  71. glaip_sdk/client/run_rendering.py +0 -700
  72. glaip_sdk/client/shared.py +0 -21
  73. glaip_sdk/client/tools.py +0 -661
  74. glaip_sdk/client/validators.py +0 -198
  75. glaip_sdk/config/constants.py +0 -52
  76. glaip_sdk/mcps/__init__.py +0 -21
  77. glaip_sdk/mcps/base.py +0 -345
  78. glaip_sdk/models/__init__.py +0 -90
  79. glaip_sdk/models/agent.py +0 -47
  80. glaip_sdk/models/agent_runs.py +0 -116
  81. glaip_sdk/models/common.py +0 -42
  82. glaip_sdk/models/mcp.py +0 -33
  83. glaip_sdk/models/tool.py +0 -33
  84. glaip_sdk/payload_schemas/__init__.py +0 -7
  85. glaip_sdk/payload_schemas/agent.py +0 -85
  86. glaip_sdk/registry/__init__.py +0 -55
  87. glaip_sdk/registry/agent.py +0 -164
  88. glaip_sdk/registry/base.py +0 -139
  89. glaip_sdk/registry/mcp.py +0 -253
  90. glaip_sdk/registry/tool.py +0 -232
  91. glaip_sdk/runner/__init__.py +0 -59
  92. glaip_sdk/runner/base.py +0 -84
  93. glaip_sdk/runner/deps.py +0 -115
  94. glaip_sdk/runner/langgraph.py +0 -782
  95. glaip_sdk/runner/mcp_adapter/__init__.py +0 -13
  96. glaip_sdk/runner/mcp_adapter/base_mcp_adapter.py +0 -43
  97. glaip_sdk/runner/mcp_adapter/langchain_mcp_adapter.py +0 -257
  98. glaip_sdk/runner/mcp_adapter/mcp_config_builder.py +0 -95
  99. glaip_sdk/runner/tool_adapter/__init__.py +0 -18
  100. glaip_sdk/runner/tool_adapter/base_tool_adapter.py +0 -44
  101. glaip_sdk/runner/tool_adapter/langchain_tool_adapter.py +0 -219
  102. glaip_sdk/tools/__init__.py +0 -22
  103. glaip_sdk/tools/base.py +0 -435
  104. glaip_sdk/utils/__init__.py +0 -86
  105. glaip_sdk/utils/a2a/__init__.py +0 -34
  106. glaip_sdk/utils/a2a/event_processor.py +0 -188
  107. glaip_sdk/utils/agent_config.py +0 -194
  108. glaip_sdk/utils/bundler.py +0 -267
  109. glaip_sdk/utils/client.py +0 -111
  110. glaip_sdk/utils/client_utils.py +0 -486
  111. glaip_sdk/utils/datetime_helpers.py +0 -58
  112. glaip_sdk/utils/discovery.py +0 -78
  113. glaip_sdk/utils/display.py +0 -135
  114. glaip_sdk/utils/export.py +0 -143
  115. glaip_sdk/utils/general.py +0 -61
  116. glaip_sdk/utils/import_export.py +0 -168
  117. glaip_sdk/utils/import_resolver.py +0 -492
  118. glaip_sdk/utils/instructions.py +0 -101
  119. glaip_sdk/utils/rendering/__init__.py +0 -115
  120. glaip_sdk/utils/rendering/formatting.py +0 -264
  121. glaip_sdk/utils/rendering/layout/__init__.py +0 -64
  122. glaip_sdk/utils/rendering/layout/panels.py +0 -156
  123. glaip_sdk/utils/rendering/layout/progress.py +0 -202
  124. glaip_sdk/utils/rendering/layout/summary.py +0 -74
  125. glaip_sdk/utils/rendering/layout/transcript.py +0 -606
  126. glaip_sdk/utils/rendering/models.py +0 -85
  127. glaip_sdk/utils/rendering/renderer/__init__.py +0 -55
  128. glaip_sdk/utils/rendering/renderer/base.py +0 -1024
  129. glaip_sdk/utils/rendering/renderer/config.py +0 -27
  130. glaip_sdk/utils/rendering/renderer/console.py +0 -55
  131. glaip_sdk/utils/rendering/renderer/debug.py +0 -178
  132. glaip_sdk/utils/rendering/renderer/factory.py +0 -138
  133. glaip_sdk/utils/rendering/renderer/stream.py +0 -202
  134. glaip_sdk/utils/rendering/renderer/summary_window.py +0 -79
  135. glaip_sdk/utils/rendering/renderer/thinking.py +0 -273
  136. glaip_sdk/utils/rendering/renderer/toggle.py +0 -182
  137. glaip_sdk/utils/rendering/renderer/tool_panels.py +0 -442
  138. glaip_sdk/utils/rendering/renderer/transcript_mode.py +0 -162
  139. glaip_sdk/utils/rendering/state.py +0 -204
  140. glaip_sdk/utils/rendering/step_tree_state.py +0 -100
  141. glaip_sdk/utils/rendering/steps/__init__.py +0 -34
  142. glaip_sdk/utils/rendering/steps/event_processor.py +0 -778
  143. glaip_sdk/utils/rendering/steps/format.py +0 -176
  144. glaip_sdk/utils/rendering/steps/manager.py +0 -387
  145. glaip_sdk/utils/rendering/timing.py +0 -36
  146. glaip_sdk/utils/rendering/viewer/__init__.py +0 -21
  147. glaip_sdk/utils/rendering/viewer/presenter.py +0 -184
  148. glaip_sdk/utils/resource_refs.py +0 -195
  149. glaip_sdk/utils/run_renderer.py +0 -41
  150. glaip_sdk/utils/runtime_config.py +0 -425
  151. glaip_sdk/utils/serialization.py +0 -424
  152. glaip_sdk/utils/sync.py +0 -142
  153. glaip_sdk/utils/tool_detection.py +0 -33
  154. glaip_sdk/utils/validation.py +0 -264
  155. glaip_sdk-0.6.12.dist-info/RECORD +0 -159
  156. glaip_sdk-0.6.12.dist-info/entry_points.txt +0 -3
@@ -1,177 +0,0 @@
1
- """JSON input parser for CLI options.
2
-
3
- Handles both inline JSON strings and @file references.
4
-
5
- Authors:
6
- Putu Ravindra Wiguna (putu.r.wiguna@gdplabs.id)
7
- """
8
-
9
- import json
10
- import os
11
- from pathlib import Path
12
- from typing import Any
13
-
14
- import click
15
- import yaml
16
-
17
-
18
- def _looks_like_file_path(value: str) -> bool:
19
- """Check if string looks like a file reference.
20
-
21
- Args:
22
- value: String to check for file-like patterns
23
-
24
- Returns:
25
- True if the string appears to be a file path
26
- """
27
- return (
28
- value.lower().endswith((".json", ".yaml", ".yml"))
29
- or "/" in value
30
- or "\\" in value # Path separators
31
- or value.startswith(("./", "../")) # Relative paths
32
- or value.count(".") > 1 # Likely a filename with extension
33
- )
34
-
35
-
36
- def _format_file_error(prefix: str, file_path_str: str, resolved_path: Path, *, detail: str | None = None) -> str:
37
- r"""Format a file-related error message with path context.
38
-
39
- Args:
40
- prefix: Main error message
41
- file_path_str: Original file path string provided by user
42
- resolved_path: Resolved absolute path
43
- detail: Optional additional detail to append
44
-
45
- Returns:
46
- Formatted error message string with file path context
47
-
48
- Examples:
49
- >>> from pathlib import Path
50
- >>> _format_file_error("File not found", "config.json", Path("/abs/config.json"))
51
- 'File not found: config.json\nResolved path: /abs/config.json'
52
- """
53
- parts = [f"{prefix}: {file_path_str}", f"Resolved path: {resolved_path}"]
54
- if detail:
55
- parts.append(detail)
56
- return "\n".join(parts)
57
-
58
-
59
- def _parse_json_from_file(file_path_str: str) -> Any:
60
- """Parse JSON or YAML from a file path.
61
-
62
- Args:
63
- file_path_str: Path to the JSON or YAML file (without @ prefix).
64
-
65
- Returns:
66
- Parsed dictionary from file.
67
-
68
- Raises:
69
- click.ClickException: If file not found, not readable, empty, or invalid format.
70
- """
71
- # Resolve relative paths against CWD
72
- file_path = Path(file_path_str)
73
- if not file_path.is_absolute():
74
- file_path = Path.cwd() / file_path
75
-
76
- # Check if file exists and is a regular file
77
- if not file_path.is_file():
78
- raise click.ClickException(_format_file_error("File not found or not a file", file_path_str, file_path))
79
-
80
- # Check if file is readable
81
- if not os.access(file_path, os.R_OK):
82
- raise click.ClickException(
83
- _format_file_error("File not readable (permission denied)", file_path_str, file_path)
84
- )
85
-
86
- # Read file content
87
- try:
88
- content = file_path.read_text(encoding="utf-8")
89
- except Exception as e:
90
- raise click.ClickException(
91
- _format_file_error("Error reading file", file_path_str, file_path, detail=f"Error: {e}")
92
- ) from e
93
-
94
- # Check for empty content
95
- if not content.strip():
96
- raise click.ClickException(_format_file_error("File is empty", file_path_str, file_path))
97
-
98
- # Determine file format and parse accordingly
99
- file_ext = file_path.suffix.lower()
100
-
101
- if file_ext in [".yaml", ".yml"]:
102
- # Parse YAML from file content
103
- try:
104
- return yaml.safe_load(content)
105
- except yaml.YAMLError as e:
106
- raise click.ClickException(
107
- _format_file_error(
108
- "Invalid YAML in file",
109
- file_path_str,
110
- file_path,
111
- detail=f"Error: {e}",
112
- )
113
- ) from e
114
- else:
115
- # Default to JSON parsing
116
- try:
117
- return json.loads(content)
118
- except json.JSONDecodeError as e:
119
- raise click.ClickException(
120
- _format_file_error(
121
- "Invalid JSON in file",
122
- file_path_str,
123
- file_path,
124
- detail=f"Error: {e.msg} at line {e.lineno}, column {e.colno}",
125
- )
126
- ) from e
127
-
128
-
129
- def parse_json_input(value: str | None) -> Any:
130
- """Parse JSON input from inline string or file reference.
131
-
132
- Args:
133
- value: JSON string or @file reference. If None, returns None.
134
-
135
- Returns:
136
- Parsed JSON value (dict, list, str, int, float, bool, None) or None if value is None.
137
-
138
- Raises:
139
- click.ClickException: If file not found, not readable, empty, or invalid JSON.
140
-
141
- Examples:
142
- >>> parse_json_input('{"key": "value"}')
143
- {'key': 'value'}
144
-
145
- >>> parse_json_input('@/path/to/config.json')
146
- # Returns content of config.json parsed as JSON
147
-
148
- >>> parse_json_input('/path/to/config.json')
149
- # Fallback: treats as file path if JSON parsing fails
150
-
151
- >>> parse_json_input(None)
152
- None
153
- """
154
- if value is None:
155
- return None
156
-
157
- # Check if value is a file reference (strip whitespace first)
158
- trimmed = value.strip()
159
- if trimmed.startswith("@"):
160
- return _parse_json_from_file(trimmed[1:])
161
-
162
- # Parse inline JSON
163
- try:
164
- return json.loads(value)
165
- except json.JSONDecodeError as e:
166
- # Check if the value looks like a file path and provide helpful hint
167
- if _looks_like_file_path(trimmed):
168
- raise click.ClickException(
169
- f"Invalid JSON in inline value\n"
170
- f"Error: {e.msg} at line {e.lineno}, column {e.colno}\n"
171
- f"\n💡 Did you mean to load this from a file? "
172
- f"File-based config values should start with @ (e.g., @{trimmed})"
173
- ) from e
174
-
175
- raise click.ClickException(
176
- f"Invalid JSON in inline value\nError: {e.msg} at line {e.lineno}, column {e.colno}"
177
- ) from e
@@ -1,67 +0,0 @@
1
- """CLI resource resolution utilities for handling ID/name references.
2
-
3
- This module provides CLI-specific resource resolution functionality,
4
- including interactive pickers and ambiguity handling.
5
-
6
- Authors:
7
- Raymond Christopher (raymond.christopher@gdplabs.id)
8
- """
9
-
10
- from collections.abc import Callable
11
- from typing import Any
12
-
13
- import click
14
-
15
- from glaip_sdk.branding import ACCENT_STYLE
16
- from glaip_sdk.cli.utils import resolve_resource, spinner_context
17
-
18
-
19
- def resolve_resource_reference(
20
- ctx: Any,
21
- _client: Any,
22
- reference: str,
23
- resource_type: str,
24
- get_by_id_func: Callable,
25
- find_by_name_func: Callable,
26
- label: str,
27
- select: int | None = None,
28
- interface_preference: str | None = None,
29
- spinner_message: str | None = None,
30
- ) -> Any | None:
31
- """Resolve resource reference (ID or name) with ambiguity handling.
32
-
33
- This is a common pattern used across all resource types.
34
-
35
- Args:
36
- ctx: Click context for CLI operations.
37
- _client: API client instance for backend operations.
38
- reference: Resource ID or name to resolve.
39
- resource_type: Type of resource being resolved.
40
- get_by_id_func: Function to get resource by ID.
41
- find_by_name_func: Function to find resources by name.
42
- label: Label for error messages and user feedback.
43
- select: Selection index for ambiguous matches in non-interactive mode.
44
- interface_preference: Interface preference for user interaction ("fuzzy" or "questionary").
45
- spinner_message: Custom message to show during resolution process.
46
-
47
- Returns:
48
- Resolved resource object or None if not found.
49
-
50
- Raises:
51
- click.ClickException: If resolution fails.
52
- """
53
- try:
54
- message = spinner_message if spinner_message is not None else f"[bold blue]Fetching {label}…[/bold blue]"
55
- with spinner_context(ctx, message, spinner_style=ACCENT_STYLE) as status_indicator:
56
- return resolve_resource(
57
- ctx,
58
- reference,
59
- get_by_id=get_by_id_func,
60
- find_by_name=find_by_name_func,
61
- label=label,
62
- select=select,
63
- interface_preference=interface_preference,
64
- status_indicator=status_indicator,
65
- )
66
- except Exception as e:
67
- raise click.ClickException(f"Failed to resolve {resource_type.lower()}: {e}") from e
@@ -1,27 +0,0 @@
1
- """Shared helpers for creating and printing Rich markup content.
2
-
3
- Authors:
4
- Raymond Christopher (raymond.christopher@gdplabs.id)
5
- """
6
-
7
- from __future__ import annotations
8
-
9
- from typing import Any
10
-
11
- from rich.console import Console
12
- from rich.markup import MarkupError
13
- from rich.text import Text
14
-
15
-
16
- def markup_text(message: str, **kwargs: Any) -> Text:
17
- """Create a Rich Text instance from markup with graceful fallback."""
18
- try:
19
- return Text.from_markup(message, **kwargs)
20
- except MarkupError:
21
- return Text(message, **kwargs)
22
-
23
-
24
- def print_markup(message: str, *, console: Console | None = None, **kwargs: Any) -> None:
25
- """Print markup-aware text to the provided console (default: new Console)."""
26
- target_console = console or Console()
27
- target_console.print(markup_text(message, **kwargs))
@@ -1,15 +0,0 @@
1
- """Slash command palette entrypoints.
2
-
3
- Authors:
4
- Raymond Christopher (raymond.christopher@gdplabs.id)
5
- """
6
-
7
- from glaip_sdk.cli.commands.agents import get as agents_get_command
8
- from glaip_sdk.cli.commands.agents import run as agents_run_command
9
- from glaip_sdk.cli.slash.session import SlashSession
10
-
11
- __all__ = [
12
- "SlashSession",
13
- "agents_get_command",
14
- "agents_run_command",
15
- ]