stkai 0.3.0__tar.gz → 0.3.2__tar.gz
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.
- {stkai-0.3.0/src/stkai.egg-info → stkai-0.3.2}/PKG-INFO +1 -1
- {stkai-0.3.0 → stkai-0.3.2}/pyproject.toml +1 -1
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/__init__.py +2 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/_config.py +57 -2
- {stkai-0.3.0 → stkai-0.3.2/src/stkai.egg-info}/PKG-INFO +1 -1
- {stkai-0.3.0 → stkai-0.3.2}/LICENSE +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/README.md +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/setup.cfg +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/_auth.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/_cli.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/_http.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/_utils.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/agents/__init__.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/agents/_agent.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/agents/_models.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/rqc/__init__.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/rqc/_event_listeners.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/rqc/_handlers.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/rqc/_models.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai/rqc/_remote_quick_command.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai.egg-info/SOURCES.txt +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai.egg-info/dependency_links.txt +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai.egg-info/requires.txt +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/src/stkai.egg-info/top_level.txt +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/tests/test_auth.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/tests/test_cli.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/tests/test_config.py +0 -0
- {stkai-0.3.0 → stkai-0.3.2}/tests/test_http.py +0 -0
|
@@ -84,6 +84,7 @@ from stkai._config import (
|
|
|
84
84
|
RateLimitConfig,
|
|
85
85
|
RateLimitStrategy,
|
|
86
86
|
RqcConfig,
|
|
87
|
+
SdkConfig,
|
|
87
88
|
STKAIConfig,
|
|
88
89
|
)
|
|
89
90
|
from stkai._http import (
|
|
@@ -114,6 +115,7 @@ __all__ = [
|
|
|
114
115
|
# Configuration
|
|
115
116
|
"STKAI",
|
|
116
117
|
"STKAIConfig",
|
|
118
|
+
"SdkConfig",
|
|
117
119
|
"ConfigEntry",
|
|
118
120
|
"AuthConfig",
|
|
119
121
|
"RqcConfig",
|
|
@@ -103,6 +103,46 @@ class OverridableConfig:
|
|
|
103
103
|
# =============================================================================
|
|
104
104
|
|
|
105
105
|
|
|
106
|
+
@dataclass(frozen=True)
|
|
107
|
+
class SdkConfig:
|
|
108
|
+
"""
|
|
109
|
+
SDK metadata (read-only, not configurable).
|
|
110
|
+
|
|
111
|
+
Provides information about the SDK version and runtime environment.
|
|
112
|
+
These values are automatically detected and cannot be overridden.
|
|
113
|
+
|
|
114
|
+
Attributes:
|
|
115
|
+
version: The installed SDK version.
|
|
116
|
+
cli_mode: Whether StackSpot CLI (oscli) is available.
|
|
117
|
+
|
|
118
|
+
Example:
|
|
119
|
+
>>> from stkai import STKAI
|
|
120
|
+
>>> STKAI.config.sdk.version
|
|
121
|
+
'0.2.8'
|
|
122
|
+
>>> STKAI.config.sdk.cli_mode
|
|
123
|
+
True
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
version: str
|
|
127
|
+
cli_mode: bool
|
|
128
|
+
|
|
129
|
+
@classmethod
|
|
130
|
+
def detect(cls) -> SdkConfig:
|
|
131
|
+
"""
|
|
132
|
+
Detect SDK metadata from the runtime environment.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
SdkConfig with version and cli_mode auto-detected.
|
|
136
|
+
"""
|
|
137
|
+
from stkai import __version__
|
|
138
|
+
from stkai._cli import StkCLI
|
|
139
|
+
|
|
140
|
+
return cls(
|
|
141
|
+
version=__version__,
|
|
142
|
+
cli_mode=StkCLI.is_available(),
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
106
146
|
@dataclass(frozen=True)
|
|
107
147
|
class AuthConfig(OverridableConfig):
|
|
108
148
|
"""
|
|
@@ -566,10 +606,11 @@ class STKAIConfig:
|
|
|
566
606
|
"""
|
|
567
607
|
Global configuration for the stkai SDK.
|
|
568
608
|
|
|
569
|
-
Aggregates all configuration sections: auth, rqc, agent, and rate_limit.
|
|
609
|
+
Aggregates all configuration sections: sdk, auth, rqc, agent, and rate_limit.
|
|
570
610
|
Access via the global `STKAI.config` property.
|
|
571
611
|
|
|
572
612
|
Attributes:
|
|
613
|
+
sdk: SDK metadata (version, cli_mode). Read-only.
|
|
573
614
|
auth: Authentication configuration.
|
|
574
615
|
rqc: RemoteQuickCommand configuration.
|
|
575
616
|
agent: Agent configuration.
|
|
@@ -577,6 +618,10 @@ class STKAIConfig:
|
|
|
577
618
|
|
|
578
619
|
Example:
|
|
579
620
|
>>> from stkai import STKAI
|
|
621
|
+
>>> STKAI.config.sdk.version
|
|
622
|
+
'0.2.8'
|
|
623
|
+
>>> STKAI.config.sdk.cli_mode
|
|
624
|
+
True
|
|
580
625
|
>>> STKAI.config.rqc.request_timeout
|
|
581
626
|
30
|
|
582
627
|
>>> STKAI.config.auth.has_credentials()
|
|
@@ -585,6 +630,7 @@ class STKAIConfig:
|
|
|
585
630
|
False
|
|
586
631
|
"""
|
|
587
632
|
|
|
633
|
+
sdk: SdkConfig = field(default_factory=SdkConfig.detect)
|
|
588
634
|
auth: AuthConfig = field(default_factory=AuthConfig)
|
|
589
635
|
rqc: RqcConfig = field(default_factory=RqcConfig)
|
|
590
636
|
agent: AgentConfig = field(default_factory=AgentConfig)
|
|
@@ -609,6 +655,7 @@ class STKAIConfig:
|
|
|
609
655
|
>>> final = custom.with_env_vars()
|
|
610
656
|
"""
|
|
611
657
|
return STKAIConfig(
|
|
658
|
+
sdk=self.sdk,
|
|
612
659
|
auth=self.auth.with_overrides(_get_auth_from_env()),
|
|
613
660
|
rqc=self.rqc.with_overrides(_get_rqc_from_env()),
|
|
614
661
|
agent=self.agent.with_overrides(_get_agent_from_env()),
|
|
@@ -637,6 +684,7 @@ class STKAIConfig:
|
|
|
637
684
|
cli_rqc_overrides["base_url"] = cli_base_url
|
|
638
685
|
|
|
639
686
|
return STKAIConfig(
|
|
687
|
+
sdk=self.sdk,
|
|
640
688
|
auth=self.auth,
|
|
641
689
|
rqc=self.rqc.with_overrides(cli_rqc_overrides),
|
|
642
690
|
agent=self.agent,
|
|
@@ -675,6 +723,7 @@ class STKAIConfig:
|
|
|
675
723
|
... )
|
|
676
724
|
"""
|
|
677
725
|
return STKAIConfig(
|
|
726
|
+
sdk=self.sdk,
|
|
678
727
|
auth=self.auth.with_overrides(auth or {}),
|
|
679
728
|
rqc=self.rqc.with_overrides(rqc or {}),
|
|
680
729
|
agent=self.agent.with_overrides(agent or {}),
|
|
@@ -701,6 +750,12 @@ class STKAIConfig:
|
|
|
701
750
|
"""
|
|
702
751
|
result: dict[str, list[ConfigEntry]] = {}
|
|
703
752
|
|
|
753
|
+
# SDK section (read-only, not tracked)
|
|
754
|
+
result["sdk"] = [
|
|
755
|
+
ConfigEntry(name=f.name, value=getattr(self.sdk, f.name), source="-")
|
|
756
|
+
for f in fields(self.sdk)
|
|
757
|
+
]
|
|
758
|
+
|
|
704
759
|
for section_name in ("auth", "rqc", "agent", "rate_limit"):
|
|
705
760
|
section_config = getattr(self, section_name)
|
|
706
761
|
section_sources = self._tracker.sources.get(section_name, {})
|
|
@@ -970,7 +1025,7 @@ class _STKAI:
|
|
|
970
1025
|
for entry in entries:
|
|
971
1026
|
dots = "." * (name_width - len(entry.name))
|
|
972
1027
|
value_padded = entry.formatted_value.ljust(value_width)
|
|
973
|
-
marker = "✎" if entry.source
|
|
1028
|
+
marker = "✎" if entry.source not in ("default", "-") else " "
|
|
974
1029
|
output(f" {entry.name} {dots} {value_padded} {marker} {entry.source}")
|
|
975
1030
|
|
|
976
1031
|
output("=" * total_width)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|