kotharcomputing 0.80.0__tar.gz → 0.81.0__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.
Files changed (36) hide show
  1. {kotharcomputing-0.80.0/src/kotharcomputing.egg-info → kotharcomputing-0.81.0}/PKG-INFO +1 -1
  2. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/pyproject.toml +1 -1
  3. kotharcomputing-0.81.0/src/kotharcomputing/__init__.py +238 -0
  4. kotharcomputing-0.81.0/src/kotharcomputing/aleph_language_server.py +80 -0
  5. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0/src/kotharcomputing.egg-info}/PKG-INFO +1 -1
  6. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing.egg-info/SOURCES.txt +1 -0
  7. kotharcomputing-0.81.0/tests/test_public_api.py +141 -0
  8. kotharcomputing-0.80.0/src/kotharcomputing/__init__.py +0 -16
  9. kotharcomputing-0.80.0/tests/test_public_api.py +0 -35
  10. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/LICENSE +0 -0
  11. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/README.md +0 -0
  12. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/setup.cfg +0 -0
  13. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/agents.py +0 -0
  14. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/ai.py +0 -0
  15. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/api_tokens.py +0 -0
  16. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/client.py +0 -0
  17. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/common.py +0 -0
  18. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/credits.py +0 -0
  19. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/errors.py +0 -0
  20. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/executions.py +0 -0
  21. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/fetch.py +0 -0
  22. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/files.py +0 -0
  23. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/jobs.py +0 -0
  24. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/py.typed +0 -0
  25. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/runtimes.py +0 -0
  26. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/service_prices.py +0 -0
  27. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/subscribe_user.py +0 -0
  28. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/subscribe_workspace.py +0 -0
  29. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/subscriptions.py +0 -0
  30. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/users.py +0 -0
  31. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing/workspaces.py +0 -0
  32. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing.egg-info/dependency_links.txt +0 -0
  33. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing.egg-info/requires.txt +0 -0
  34. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/src/kotharcomputing.egg-info/top_level.txt +0 -0
  35. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/tests/test_fetch_auth_headers.py +0 -0
  36. {kotharcomputing-0.80.0 → kotharcomputing-0.81.0}/tests/test_fetch_url_building.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kotharcomputing
3
- Version: 0.80.0
3
+ Version: 0.81.0
4
4
  Summary: Python SDK for the Kothar API
5
5
  Author: Kothar Computing
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "kotharcomputing"
7
- version = "0.80.0"
7
+ version = "0.81.0"
8
8
  description = "Python SDK for the Kothar API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -0,0 +1,238 @@
1
+ from .aleph_language_server import (
2
+ AlephLanguageServerClient,
3
+ AlephLanguageServerClientOptions,
4
+ AnalyzeResult,
5
+ Diagnostic,
6
+ DiagnosticSeverity,
7
+ Position,
8
+ Range,
9
+ )
10
+ from .agents import (
11
+ Activity,
12
+ ActivityExecution,
13
+ ActivityJob,
14
+ Agent,
15
+ AgentCapabilities,
16
+ AgentCloud,
17
+ AgentKind,
18
+ AgentPersonal,
19
+ AgentStatus,
20
+ CreateAgentArgs,
21
+ CreateAgentResult,
22
+ DeleteAgentResult,
23
+ ResetAgentTokenResult,
24
+ WithAgent,
25
+ )
26
+ from .ai import (
27
+ AbbreviatedAIChat,
28
+ AIChat,
29
+ AIChatContentEditorContext,
30
+ AIChatContentEditorContextFile,
31
+ AIChatContentText,
32
+ AIChatFileLocation,
33
+ AIChatMessage,
34
+ AIChatMessageApi,
35
+ AIChatMessageAssistant,
36
+ AIChatMessageAssistantContent,
37
+ AIChatMessageAssistantDelta,
38
+ AIChatMessageError,
39
+ AIChatMessageTool,
40
+ AIChatMessageUser,
41
+ AIChatMessageUserAppend,
42
+ AIChatMessageUserContent,
43
+ AIChatMessageUserContentEdition,
44
+ AIChatMessageUserCreate,
45
+ AIChatMessageWithStreaming,
46
+ AIChatToolCall,
47
+ AIChatToolCallFunction,
48
+ AIChatToolDescription,
49
+ AIChatToolDescriptionFunction,
50
+ AIModelInfo,
51
+ )
52
+ from .api_tokens import (
53
+ ApiToken,
54
+ ApiTokenPermissionAction,
55
+ ApiTokenPermissions,
56
+ ApiTokenPermissionSubject,
57
+ CreateApiTokenArgs,
58
+ CreateApiTokenResult,
59
+ )
60
+ from .client import (
61
+ KotharClient,
62
+ KotharClientOptions,
63
+ RawResponse,
64
+ )
65
+ from .credits import (
66
+ CreditBalance,
67
+ CreditTransaction,
68
+ )
69
+ from .errors import KOTHAR_ERROR_TYPE_BASE_URL, KotharApiError
70
+ from .executions import (
71
+ ExecuteArgs,
72
+ ExecuteResult,
73
+ Execution,
74
+ ExecutionControl,
75
+ ExecutionEnded,
76
+ ExecutionError,
77
+ ExecutionMessage,
78
+ ExecutionOutput,
79
+ ExecutionScriptArgs,
80
+ ExecutionStarted,
81
+ SystemMetrics,
82
+ SystemMetricSample,
83
+ SystemMetricSeries,
84
+ )
85
+ from .files import (
86
+ FileContent,
87
+ FileHistoryEntry,
88
+ FileListItem,
89
+ FileSearchResultItem,
90
+ )
91
+ from .jobs import (
92
+ CreateJobArgs,
93
+ Job,
94
+ JobStatus,
95
+ UpdateJobArgs,
96
+ )
97
+ from .service_prices import ServicePrice
98
+ from .subscribe_user import (
99
+ KotharApiUserEvent,
100
+ KotharApiUserEventCreditBalancesUpdated,
101
+ )
102
+ from .subscribe_workspace import (
103
+ KotharApiWorkspaceEvent,
104
+ KotharApiWorkspaceFileCreatedEvent,
105
+ KotharApiWorkspaceFileDeletedEvent,
106
+ KotharApiWorkspaceFileMovedEvent,
107
+ KotharApiWorkspaceFileUpdatedEvent,
108
+ KotharApiWorkspaceJobUpdatedEvent,
109
+ )
110
+ from .subscriptions import (
111
+ Subscription,
112
+ SubscriptionInterval,
113
+ SubscriptionOption,
114
+ SubscriptionStatus,
115
+ )
116
+ from .users import (
117
+ UserProfile,
118
+ WithUser,
119
+ )
120
+ from .workspaces import (
121
+ Workspace,
122
+ WorkspaceStorageStats,
123
+ )
124
+
125
+ __all__ = [
126
+ # Aleph Language Server
127
+ "AlephLanguageServerClient",
128
+ "AlephLanguageServerClientOptions",
129
+ "AnalyzeResult",
130
+ "Diagnostic",
131
+ "DiagnosticSeverity",
132
+ "Position",
133
+ "Range",
134
+ # Agents
135
+ "Activity",
136
+ "ActivityExecution",
137
+ "ActivityJob",
138
+ "Agent",
139
+ "AgentCapabilities",
140
+ "AgentCloud",
141
+ "AgentKind",
142
+ "AgentPersonal",
143
+ "AgentStatus",
144
+ "CreateAgentArgs",
145
+ "CreateAgentResult",
146
+ "DeleteAgentResult",
147
+ "ResetAgentTokenResult",
148
+ "WithAgent",
149
+ # AI
150
+ "AbbreviatedAIChat",
151
+ "AIChat",
152
+ "AIChatContentEditorContext",
153
+ "AIChatContentEditorContextFile",
154
+ "AIChatContentText",
155
+ "AIChatFileLocation",
156
+ "AIChatMessage",
157
+ "AIChatMessageApi",
158
+ "AIChatMessageAssistant",
159
+ "AIChatMessageAssistantContent",
160
+ "AIChatMessageAssistantDelta",
161
+ "AIChatMessageError",
162
+ "AIChatMessageTool",
163
+ "AIChatMessageUser",
164
+ "AIChatMessageUserAppend",
165
+ "AIChatMessageUserContent",
166
+ "AIChatMessageUserContentEdition",
167
+ "AIChatMessageUserCreate",
168
+ "AIChatMessageWithStreaming",
169
+ "AIChatToolCall",
170
+ "AIChatToolCallFunction",
171
+ "AIChatToolDescription",
172
+ "AIChatToolDescriptionFunction",
173
+ "AIModelInfo",
174
+ # API Tokens
175
+ "ApiToken",
176
+ "ApiTokenPermissionAction",
177
+ "ApiTokenPermissions",
178
+ "ApiTokenPermissionSubject",
179
+ "CreateApiTokenArgs",
180
+ "CreateApiTokenResult",
181
+ # Client
182
+ "KotharClient",
183
+ "KotharClientOptions",
184
+ "RawResponse",
185
+ # Credits
186
+ "CreditBalance",
187
+ "CreditTransaction",
188
+ # Errors
189
+ "KOTHAR_ERROR_TYPE_BASE_URL",
190
+ "KotharApiError",
191
+ # Executions
192
+ "ExecuteArgs",
193
+ "ExecuteResult",
194
+ "Execution",
195
+ "ExecutionControl",
196
+ "ExecutionEnded",
197
+ "ExecutionError",
198
+ "ExecutionMessage",
199
+ "ExecutionOutput",
200
+ "ExecutionScriptArgs",
201
+ "ExecutionStarted",
202
+ "SystemMetrics",
203
+ "SystemMetricSample",
204
+ "SystemMetricSeries",
205
+ # Files
206
+ "FileContent",
207
+ "FileHistoryEntry",
208
+ "FileListItem",
209
+ "FileSearchResultItem",
210
+ # Jobs
211
+ "CreateJobArgs",
212
+ "Job",
213
+ "JobStatus",
214
+ "UpdateJobArgs",
215
+ # Service Prices
216
+ "ServicePrice",
217
+ # Subscribe User
218
+ "KotharApiUserEvent",
219
+ "KotharApiUserEventCreditBalancesUpdated",
220
+ # Subscribe Workspace
221
+ "KotharApiWorkspaceEvent",
222
+ "KotharApiWorkspaceFileCreatedEvent",
223
+ "KotharApiWorkspaceFileDeletedEvent",
224
+ "KotharApiWorkspaceFileMovedEvent",
225
+ "KotharApiWorkspaceFileUpdatedEvent",
226
+ "KotharApiWorkspaceJobUpdatedEvent",
227
+ # Subscriptions
228
+ "Subscription",
229
+ "SubscriptionInterval",
230
+ "SubscriptionOption",
231
+ "SubscriptionStatus",
232
+ # Users
233
+ "UserProfile",
234
+ "WithUser",
235
+ # Workspaces
236
+ "Workspace",
237
+ "WorkspaceStorageStats",
238
+ ]
@@ -0,0 +1,80 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from enum import IntEnum
5
+ from typing import NotRequired, TypedDict, cast
6
+
7
+ from .fetch import ApiTransport
8
+
9
+ DEFAULT_BASE_URL = "https://lsp.kotharcomputing.com"
10
+
11
+
12
+ @dataclass(slots=True)
13
+ class AlephLanguageServerClientOptions:
14
+ base_url: str = DEFAULT_BASE_URL
15
+ timeout: float = 30.0
16
+
17
+
18
+ class AlephLanguageServerClient:
19
+ def __init__(
20
+ self,
21
+ options: AlephLanguageServerClientOptions | None = None,
22
+ *,
23
+ base_url: str = DEFAULT_BASE_URL,
24
+ timeout: float = 30.0,
25
+ ) -> None:
26
+ if options is None:
27
+ options = AlephLanguageServerClientOptions(
28
+ base_url=base_url,
29
+ timeout=timeout,
30
+ )
31
+
32
+ self._transport = ApiTransport(
33
+ base_url=options.base_url,
34
+ access_token=None,
35
+ timeout=options.timeout,
36
+ )
37
+
38
+ def version(self) -> dict[str, str]:
39
+ return self._transport.get_json("version")
40
+
41
+ def analyze(self, code: str) -> AnalyzeResult:
42
+ response = self._transport.raw(
43
+ "post",
44
+ "analyze",
45
+ headers={"Content-Type": "application/x-aleph"},
46
+ body=code,
47
+ )
48
+ return cast(AnalyzeResult, response.json())
49
+
50
+
51
+ # -- LSP Diagnostic types (based on LSP 3.17 specification) --
52
+
53
+
54
+ class DiagnosticSeverity(IntEnum):
55
+ Error = 1
56
+ Warning = 2
57
+ Information = 3
58
+ Hint = 4
59
+
60
+
61
+ class Position(TypedDict):
62
+ line: int
63
+ character: int
64
+
65
+
66
+ class Range(TypedDict):
67
+ start: Position
68
+ end: Position
69
+
70
+
71
+ class Diagnostic(TypedDict):
72
+ range: Range
73
+ message: str
74
+ severity: NotRequired[DiagnosticSeverity]
75
+ code: NotRequired[str | int]
76
+ source: NotRequired[str]
77
+
78
+
79
+ class AnalyzeResult(TypedDict):
80
+ diagnostics: list[Diagnostic]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kotharcomputing
3
- Version: 0.80.0
3
+ Version: 0.81.0
4
4
  Summary: Python SDK for the Kothar API
5
5
  Author: Kothar Computing
6
6
  License-Expression: Apache-2.0
@@ -4,6 +4,7 @@ pyproject.toml
4
4
  src/kotharcomputing/__init__.py
5
5
  src/kotharcomputing/agents.py
6
6
  src/kotharcomputing/ai.py
7
+ src/kotharcomputing/aleph_language_server.py
7
8
  src/kotharcomputing/api_tokens.py
8
9
  src/kotharcomputing/client.py
9
10
  src/kotharcomputing/common.py
@@ -0,0 +1,141 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib
4
+ from pathlib import Path
5
+ import sys
6
+
7
+
8
+ SRC_DIR = Path(__file__).resolve().parents[1] / "src"
9
+ if str(SRC_DIR) not in sys.path:
10
+ sys.path.insert(0, str(SRC_DIR))
11
+
12
+
13
+ def test_package_import_and_public_exports() -> None:
14
+ module = importlib.import_module("kotharcomputing")
15
+
16
+ expected_exports = {
17
+ # Aleph Language Server
18
+ "AlephLanguageServerClient",
19
+ "AlephLanguageServerClientOptions",
20
+ "AnalyzeResult",
21
+ "Diagnostic",
22
+ "DiagnosticSeverity",
23
+ "Position",
24
+ "Range",
25
+ # Agents
26
+ "Activity",
27
+ "ActivityExecution",
28
+ "ActivityJob",
29
+ "Agent",
30
+ "AgentCapabilities",
31
+ "AgentCloud",
32
+ "AgentKind",
33
+ "AgentPersonal",
34
+ "AgentStatus",
35
+ "CreateAgentArgs",
36
+ "CreateAgentResult",
37
+ "DeleteAgentResult",
38
+ "ResetAgentTokenResult",
39
+ "WithAgent",
40
+ # AI
41
+ "AbbreviatedAIChat",
42
+ "AIChat",
43
+ "AIChatContentEditorContext",
44
+ "AIChatContentEditorContextFile",
45
+ "AIChatContentText",
46
+ "AIChatFileLocation",
47
+ "AIChatMessage",
48
+ "AIChatMessageApi",
49
+ "AIChatMessageAssistant",
50
+ "AIChatMessageAssistantContent",
51
+ "AIChatMessageAssistantDelta",
52
+ "AIChatMessageError",
53
+ "AIChatMessageTool",
54
+ "AIChatMessageUser",
55
+ "AIChatMessageUserAppend",
56
+ "AIChatMessageUserContent",
57
+ "AIChatMessageUserContentEdition",
58
+ "AIChatMessageUserCreate",
59
+ "AIChatMessageWithStreaming",
60
+ "AIChatToolCall",
61
+ "AIChatToolCallFunction",
62
+ "AIChatToolDescription",
63
+ "AIChatToolDescriptionFunction",
64
+ "AIModelInfo",
65
+ # API Tokens
66
+ "ApiToken",
67
+ "ApiTokenPermissionAction",
68
+ "ApiTokenPermissions",
69
+ "ApiTokenPermissionSubject",
70
+ "CreateApiTokenArgs",
71
+ "CreateApiTokenResult",
72
+ # Client
73
+ "KotharClient",
74
+ "KotharClientOptions",
75
+ "RawResponse",
76
+ # Credits
77
+ "CreditBalance",
78
+ "CreditTransaction",
79
+ # Errors
80
+ "KOTHAR_ERROR_TYPE_BASE_URL",
81
+ "KotharApiError",
82
+ # Executions
83
+ "ExecuteArgs",
84
+ "ExecuteResult",
85
+ "Execution",
86
+ "ExecutionControl",
87
+ "ExecutionEnded",
88
+ "ExecutionError",
89
+ "ExecutionMessage",
90
+ "ExecutionOutput",
91
+ "ExecutionScriptArgs",
92
+ "ExecutionStarted",
93
+ "SystemMetrics",
94
+ "SystemMetricSample",
95
+ "SystemMetricSeries",
96
+ # Files
97
+ "FileContent",
98
+ "FileHistoryEntry",
99
+ "FileListItem",
100
+ "FileSearchResultItem",
101
+ # Jobs
102
+ "CreateJobArgs",
103
+ "Job",
104
+ "JobStatus",
105
+ "UpdateJobArgs",
106
+ # Service Prices
107
+ "ServicePrice",
108
+ # Subscribe User
109
+ "KotharApiUserEvent",
110
+ "KotharApiUserEventCreditBalancesUpdated",
111
+ # Subscribe Workspace
112
+ "KotharApiWorkspaceEvent",
113
+ "KotharApiWorkspaceFileCreatedEvent",
114
+ "KotharApiWorkspaceFileDeletedEvent",
115
+ "KotharApiWorkspaceFileMovedEvent",
116
+ "KotharApiWorkspaceFileUpdatedEvent",
117
+ "KotharApiWorkspaceJobUpdatedEvent",
118
+ # Subscriptions
119
+ "Subscription",
120
+ "SubscriptionInterval",
121
+ "SubscriptionOption",
122
+ "SubscriptionStatus",
123
+ # Users
124
+ "UserProfile",
125
+ "WithUser",
126
+ # Workspaces
127
+ "Workspace",
128
+ "WorkspaceStorageStats",
129
+ }
130
+
131
+ assert set(module.__all__) == expected_exports
132
+ for name in expected_exports:
133
+ assert hasattr(module, name)
134
+
135
+
136
+ def test_kothar_client_uses_default_base_url() -> None:
137
+ module = importlib.import_module("kotharcomputing")
138
+
139
+ client = module.KotharClient()
140
+
141
+ assert client._transport.base_url == "https://api.kotharcomputing.com/"
@@ -1,16 +0,0 @@
1
- from .client import (
2
- KotharClient,
3
- KotharClientOptions,
4
- RawResponse,
5
- )
6
- from .executions import ExecuteResult
7
- from .errors import KOTHAR_ERROR_TYPE_BASE_URL, KotharApiError
8
-
9
- __all__ = [
10
- "KOTHAR_ERROR_TYPE_BASE_URL",
11
- "KotharApiError",
12
- "KotharClient",
13
- "KotharClientOptions",
14
- "RawResponse",
15
- "ExecuteResult",
16
- ]
@@ -1,35 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import importlib
4
- from pathlib import Path
5
- import sys
6
-
7
-
8
- SRC_DIR = Path(__file__).resolve().parents[1] / "src"
9
- if str(SRC_DIR) not in sys.path:
10
- sys.path.insert(0, str(SRC_DIR))
11
-
12
-
13
- def test_package_import_and_public_exports() -> None:
14
- module = importlib.import_module("kotharcomputing")
15
-
16
- expected_exports = {
17
- "KOTHAR_ERROR_TYPE_BASE_URL",
18
- "KotharApiError",
19
- "KotharClient",
20
- "KotharClientOptions",
21
- "RawResponse",
22
- "ExecuteResult",
23
- }
24
-
25
- assert set(module.__all__) == expected_exports
26
- for name in expected_exports:
27
- assert hasattr(module, name)
28
-
29
-
30
- def test_kothar_client_uses_default_base_url() -> None:
31
- module = importlib.import_module("kotharcomputing")
32
-
33
- client = module.KotharClient()
34
-
35
- assert client._transport.base_url == "https://api.kotharcomputing.com/"