opencode-py 0.2.0__py3-none-any.whl → 0.2.1__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.
- opencode/__main__.py +3 -2
- opencode/_errors.py +94 -94
- opencode/_response_models.py +242 -242
- {opencode_py-0.2.0.dist-info → opencode_py-0.2.1.dist-info}/METADATA +1 -1
- {opencode_py-0.2.0.dist-info → opencode_py-0.2.1.dist-info}/RECORD +8 -8
- opencode_py-0.2.1.dist-info/entry_points.txt +2 -0
- opencode_py-0.2.0.dist-info/entry_points.txt +0 -2
- {opencode_py-0.2.0.dist-info → opencode_py-0.2.1.dist-info}/WHEEL +0 -0
- {opencode_py-0.2.0.dist-info → opencode_py-0.2.1.dist-info}/licenses/LICENSE +0 -0
opencode/__main__.py
CHANGED
|
@@ -8,8 +8,9 @@ from opencode import opencode
|
|
|
8
8
|
def main() -> None:
|
|
9
9
|
args = sys.argv[1:]
|
|
10
10
|
if not args:
|
|
11
|
-
print("Usage:
|
|
12
|
-
print(" or:
|
|
11
|
+
print("Usage: opencode-py <prompt>")
|
|
12
|
+
print(" or: python -m opencode <prompt>")
|
|
13
|
+
print(" or: echo 'question' | opencode-py")
|
|
13
14
|
sys.exit(1)
|
|
14
15
|
prompt = " ".join(args)
|
|
15
16
|
result = opencode(prompt)
|
opencode/_errors.py
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class OpencodeError(Exception):
|
|
7
|
-
"""Base exception for all opencode SDK errors."""
|
|
8
|
-
|
|
9
|
-
def __init__(
|
|
10
|
-
self,
|
|
11
|
-
message: str = "",
|
|
12
|
-
*,
|
|
13
|
-
status: int | None = None,
|
|
14
|
-
body: object = None,
|
|
15
|
-
):
|
|
16
|
-
self.status = status
|
|
17
|
-
self.body = body
|
|
18
|
-
super().__init__(message)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class APIError(OpencodeError):
|
|
22
|
-
"""Base class for all API-related errors."""
|
|
23
|
-
|
|
24
|
-
def __init__(
|
|
25
|
-
self,
|
|
26
|
-
message: str = "",
|
|
27
|
-
*,
|
|
28
|
-
request: Any = None,
|
|
29
|
-
response: Any = None,
|
|
30
|
-
body: object = None,
|
|
31
|
-
status_code: int | None = None,
|
|
32
|
-
):
|
|
33
|
-
self.request = request
|
|
34
|
-
self.response = response
|
|
35
|
-
super().__init__(message, status=status_code, body=body)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class APIResponseValidationError(APIError):
|
|
39
|
-
"""Response data did not match the expected schema."""
|
|
40
|
-
|
|
41
|
-
def __init__(self, message: str = "", *, response: Any = None, body: object = None):
|
|
42
|
-
super().__init__(message, response=response, body=body)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class APIStatusError(APIError):
|
|
46
|
-
"""Base class for errors with an HTTP status code."""
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class BadRequestError(APIStatusError):
|
|
50
|
-
"""HTTP 400"""
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class AuthenticationError(APIStatusError):
|
|
54
|
-
"""HTTP 401"""
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class PermissionDeniedError(APIStatusError):
|
|
58
|
-
"""HTTP 403"""
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
class NotFoundError(APIStatusError):
|
|
62
|
-
"""HTTP 404"""
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class ConflictError(APIStatusError):
|
|
66
|
-
"""HTTP 409"""
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class UnprocessableEntityError(APIStatusError):
|
|
70
|
-
"""HTTP 422"""
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
class RateLimitError(APIStatusError):
|
|
74
|
-
"""HTTP 429"""
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class InternalServerError(APIStatusError):
|
|
78
|
-
"""HTTP 5xx"""
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class APIConnectionError(APIError):
|
|
82
|
-
"""Connection or transport error."""
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class APITimeoutError(APIConnectionError):
|
|
86
|
-
"""Request timed out."""
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
class BinaryNotFoundError(OpencodeError):
|
|
90
|
-
"""Opencode binary not found on the system."""
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class ServerStartupTimeoutError(OpencodeError):
|
|
94
|
-
"""Server did not start within the expected timeout."""
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class OpencodeError(Exception):
|
|
7
|
+
"""Base exception for all opencode SDK errors."""
|
|
8
|
+
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
message: str = "",
|
|
12
|
+
*,
|
|
13
|
+
status: int | None = None,
|
|
14
|
+
body: object = None,
|
|
15
|
+
):
|
|
16
|
+
self.status = status
|
|
17
|
+
self.body = body
|
|
18
|
+
super().__init__(message)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class APIError(OpencodeError):
|
|
22
|
+
"""Base class for all API-related errors."""
|
|
23
|
+
|
|
24
|
+
def __init__(
|
|
25
|
+
self,
|
|
26
|
+
message: str = "",
|
|
27
|
+
*,
|
|
28
|
+
request: Any = None,
|
|
29
|
+
response: Any = None,
|
|
30
|
+
body: object = None,
|
|
31
|
+
status_code: int | None = None,
|
|
32
|
+
):
|
|
33
|
+
self.request = request
|
|
34
|
+
self.response = response
|
|
35
|
+
super().__init__(message, status=status_code, body=body)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class APIResponseValidationError(APIError):
|
|
39
|
+
"""Response data did not match the expected schema."""
|
|
40
|
+
|
|
41
|
+
def __init__(self, message: str = "", *, response: Any = None, body: object = None):
|
|
42
|
+
super().__init__(message, response=response, body=body)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class APIStatusError(APIError):
|
|
46
|
+
"""Base class for errors with an HTTP status code."""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class BadRequestError(APIStatusError):
|
|
50
|
+
"""HTTP 400"""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class AuthenticationError(APIStatusError):
|
|
54
|
+
"""HTTP 401"""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class PermissionDeniedError(APIStatusError):
|
|
58
|
+
"""HTTP 403"""
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class NotFoundError(APIStatusError):
|
|
62
|
+
"""HTTP 404"""
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class ConflictError(APIStatusError):
|
|
66
|
+
"""HTTP 409"""
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class UnprocessableEntityError(APIStatusError):
|
|
70
|
+
"""HTTP 422"""
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class RateLimitError(APIStatusError):
|
|
74
|
+
"""HTTP 429"""
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class InternalServerError(APIStatusError):
|
|
78
|
+
"""HTTP 5xx"""
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class APIConnectionError(APIError):
|
|
82
|
+
"""Connection or transport error."""
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class APITimeoutError(APIConnectionError):
|
|
86
|
+
"""Request timed out."""
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class BinaryNotFoundError(OpencodeError):
|
|
90
|
+
"""Opencode binary not found on the system."""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class ServerStartupTimeoutError(OpencodeError):
|
|
94
|
+
"""Server did not start within the expected timeout."""
|
opencode/_response_models.py
CHANGED
|
@@ -1,242 +1,242 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel, ConfigDict
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class OpencodeBaseModel(BaseModel):
|
|
9
|
-
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# ---------------------------------------------------------------------------
|
|
13
|
-
# Health
|
|
14
|
-
# ---------------------------------------------------------------------------
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class HealthResponse(OpencodeBaseModel):
|
|
18
|
-
ok: bool = True
|
|
19
|
-
version: str | None = None
|
|
20
|
-
healthy: bool | None = None
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# ---------------------------------------------------------------------------
|
|
24
|
-
# Session
|
|
25
|
-
# ---------------------------------------------------------------------------
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class SessionResponse(OpencodeBaseModel):
|
|
29
|
-
id: str
|
|
30
|
-
agent: str | None = None
|
|
31
|
-
model: str | None = None
|
|
32
|
-
title: str | None = None
|
|
33
|
-
created: float | None = None
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class SessionListResponse(OpencodeBaseModel):
|
|
37
|
-
"""Wrapper for session list endpoint."""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
# ---------------------------------------------------------------------------
|
|
41
|
-
# V2 Session / Message parts
|
|
42
|
-
# ---------------------------------------------------------------------------
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class MessageInfo(OpencodeBaseModel):
|
|
46
|
-
id: str = ""
|
|
47
|
-
model: dict[str, str] | None = None
|
|
48
|
-
time: dict[str, float] | None = None
|
|
49
|
-
structured: Any = None
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class MessagePart(OpencodeBaseModel):
|
|
53
|
-
type: str
|
|
54
|
-
text: str | None = None
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class V1SessionResponse(OpencodeBaseModel):
|
|
58
|
-
"""Response from POST /session/:id/message (V1)."""
|
|
59
|
-
parts: list[dict[str, Any]] = []
|
|
60
|
-
info: dict[str, Any] = {}
|
|
61
|
-
structured: Any = None
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
# ---------------------------------------------------------------------------
|
|
65
|
-
# V2 Model / Provider
|
|
66
|
-
# ---------------------------------------------------------------------------
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class ModelResponse(OpencodeBaseModel):
|
|
70
|
-
id: str
|
|
71
|
-
provider: str | None = None
|
|
72
|
-
name: str | None = None
|
|
73
|
-
description: str | None = None
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
class ProviderResponse(OpencodeBaseModel):
|
|
77
|
-
id: str
|
|
78
|
-
name: str | None = None
|
|
79
|
-
description: str | None = None
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
# ---------------------------------------------------------------------------
|
|
83
|
-
# File
|
|
84
|
-
# ---------------------------------------------------------------------------
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class FileContentResponse(OpencodeBaseModel):
|
|
88
|
-
content: str = ""
|
|
89
|
-
uri: str | None = None
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# ---------------------------------------------------------------------------
|
|
93
|
-
# VCS
|
|
94
|
-
# ---------------------------------------------------------------------------
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class VCSGetResponse(OpencodeBaseModel):
|
|
98
|
-
"""Response from GET /vcs."""
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
class VCSStatusResponse(OpencodeBaseModel):
|
|
102
|
-
"""Response from GET /vcs/status."""
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class VCSDiffResponse(OpencodeBaseModel):
|
|
106
|
-
"""Response from GET /vcs/diff."""
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
# ---------------------------------------------------------------------------
|
|
110
|
-
# Config
|
|
111
|
-
# ---------------------------------------------------------------------------
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class ConfigResponse(OpencodeBaseModel):
|
|
115
|
-
"""Response from GET /config."""
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class ConfigProviderResponse(OpencodeBaseModel):
|
|
119
|
-
"""Response from GET /config/providers."""
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
# ---------------------------------------------------------------------------
|
|
123
|
-
# Workspace
|
|
124
|
-
# ---------------------------------------------------------------------------
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
class WorkspaceResponse(OpencodeBaseModel):
|
|
128
|
-
id: str | None = None
|
|
129
|
-
name: str | None = None
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
# ---------------------------------------------------------------------------
|
|
133
|
-
# PTY
|
|
134
|
-
# ---------------------------------------------------------------------------
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
class PTYResponse(OpencodeBaseModel):
|
|
138
|
-
id: str | None = None
|
|
139
|
-
program: str | None = None
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
# ---------------------------------------------------------------------------
|
|
143
|
-
# Permission
|
|
144
|
-
# ---------------------------------------------------------------------------
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
class PermissionResponse(OpencodeBaseModel):
|
|
148
|
-
id: str | None = None
|
|
149
|
-
tool: str | None = None
|
|
150
|
-
description: str | None = None
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
# ---------------------------------------------------------------------------
|
|
154
|
-
# Question
|
|
155
|
-
# ---------------------------------------------------------------------------
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
class QuestionResponse(OpencodeBaseModel):
|
|
159
|
-
id: str | None = None
|
|
160
|
-
question: str | None = None
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
# ---------------------------------------------------------------------------
|
|
164
|
-
# MCP
|
|
165
|
-
# ---------------------------------------------------------------------------
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
class MCPStatusResponse(OpencodeBaseModel):
|
|
169
|
-
"""Response from GET /mcp/status."""
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
# ---------------------------------------------------------------------------
|
|
173
|
-
# LSP / Formatter
|
|
174
|
-
# ---------------------------------------------------------------------------
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
class LSPStatusResponse(OpencodeBaseModel):
|
|
178
|
-
"""Response from GET /lsp."""
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
class FormatterStatusResponse(OpencodeBaseModel):
|
|
182
|
-
"""Response from GET /formatter."""
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
# ---------------------------------------------------------------------------
|
|
186
|
-
# Project
|
|
187
|
-
# ---------------------------------------------------------------------------
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
class ProjectResponse(OpencodeBaseModel):
|
|
191
|
-
id: str | None = None
|
|
192
|
-
name: str | None = None
|
|
193
|
-
directory: str | None = None
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
# ---------------------------------------------------------------------------
|
|
197
|
-
# Worktree
|
|
198
|
-
# ---------------------------------------------------------------------------
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
class WorktreeResponse(OpencodeBaseModel):
|
|
202
|
-
id: str | None = None
|
|
203
|
-
path: str | None = None
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
# ---------------------------------------------------------------------------
|
|
207
|
-
# Tool
|
|
208
|
-
# ---------------------------------------------------------------------------
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
class ToolResponse(OpencodeBaseModel):
|
|
212
|
-
id: str | None = None
|
|
213
|
-
name: str | None = None
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
# ---------------------------------------------------------------------------
|
|
217
|
-
# App / Agent
|
|
218
|
-
# ---------------------------------------------------------------------------
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
class AgentResponse(OpencodeBaseModel):
|
|
222
|
-
id: str | None = None
|
|
223
|
-
name: str | None = None
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
# ---------------------------------------------------------------------------
|
|
227
|
-
# Sync
|
|
228
|
-
# ---------------------------------------------------------------------------
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
class SyncHistoryResponse(OpencodeBaseModel):
|
|
232
|
-
"""Response from GET /experimental/sync/history/:id."""
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
# ---------------------------------------------------------------------------
|
|
236
|
-
# Command
|
|
237
|
-
# ---------------------------------------------------------------------------
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
class CommandResponse(OpencodeBaseModel):
|
|
241
|
-
id: str | None = None
|
|
242
|
-
command: str | None = None
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class OpencodeBaseModel(BaseModel):
|
|
9
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# ---------------------------------------------------------------------------
|
|
13
|
+
# Health
|
|
14
|
+
# ---------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class HealthResponse(OpencodeBaseModel):
|
|
18
|
+
ok: bool = True
|
|
19
|
+
version: str | None = None
|
|
20
|
+
healthy: bool | None = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# ---------------------------------------------------------------------------
|
|
24
|
+
# Session
|
|
25
|
+
# ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SessionResponse(OpencodeBaseModel):
|
|
29
|
+
id: str
|
|
30
|
+
agent: str | None = None
|
|
31
|
+
model: str | None = None
|
|
32
|
+
title: str | None = None
|
|
33
|
+
created: float | None = None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class SessionListResponse(OpencodeBaseModel):
|
|
37
|
+
"""Wrapper for session list endpoint."""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# ---------------------------------------------------------------------------
|
|
41
|
+
# V2 Session / Message parts
|
|
42
|
+
# ---------------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class MessageInfo(OpencodeBaseModel):
|
|
46
|
+
id: str = ""
|
|
47
|
+
model: dict[str, str] | None = None
|
|
48
|
+
time: dict[str, float] | None = None
|
|
49
|
+
structured: Any = None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class MessagePart(OpencodeBaseModel):
|
|
53
|
+
type: str
|
|
54
|
+
text: str | None = None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class V1SessionResponse(OpencodeBaseModel):
|
|
58
|
+
"""Response from POST /session/:id/message (V1)."""
|
|
59
|
+
parts: list[dict[str, Any]] = []
|
|
60
|
+
info: dict[str, Any] = {}
|
|
61
|
+
structured: Any = None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
# ---------------------------------------------------------------------------
|
|
65
|
+
# V2 Model / Provider
|
|
66
|
+
# ---------------------------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class ModelResponse(OpencodeBaseModel):
|
|
70
|
+
id: str
|
|
71
|
+
provider: str | None = None
|
|
72
|
+
name: str | None = None
|
|
73
|
+
description: str | None = None
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class ProviderResponse(OpencodeBaseModel):
|
|
77
|
+
id: str
|
|
78
|
+
name: str | None = None
|
|
79
|
+
description: str | None = None
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# ---------------------------------------------------------------------------
|
|
83
|
+
# File
|
|
84
|
+
# ---------------------------------------------------------------------------
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class FileContentResponse(OpencodeBaseModel):
|
|
88
|
+
content: str = ""
|
|
89
|
+
uri: str | None = None
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# ---------------------------------------------------------------------------
|
|
93
|
+
# VCS
|
|
94
|
+
# ---------------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class VCSGetResponse(OpencodeBaseModel):
|
|
98
|
+
"""Response from GET /vcs."""
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class VCSStatusResponse(OpencodeBaseModel):
|
|
102
|
+
"""Response from GET /vcs/status."""
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class VCSDiffResponse(OpencodeBaseModel):
|
|
106
|
+
"""Response from GET /vcs/diff."""
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# ---------------------------------------------------------------------------
|
|
110
|
+
# Config
|
|
111
|
+
# ---------------------------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class ConfigResponse(OpencodeBaseModel):
|
|
115
|
+
"""Response from GET /config."""
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class ConfigProviderResponse(OpencodeBaseModel):
|
|
119
|
+
"""Response from GET /config/providers."""
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
# ---------------------------------------------------------------------------
|
|
123
|
+
# Workspace
|
|
124
|
+
# ---------------------------------------------------------------------------
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class WorkspaceResponse(OpencodeBaseModel):
|
|
128
|
+
id: str | None = None
|
|
129
|
+
name: str | None = None
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# ---------------------------------------------------------------------------
|
|
133
|
+
# PTY
|
|
134
|
+
# ---------------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class PTYResponse(OpencodeBaseModel):
|
|
138
|
+
id: str | None = None
|
|
139
|
+
program: str | None = None
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
# ---------------------------------------------------------------------------
|
|
143
|
+
# Permission
|
|
144
|
+
# ---------------------------------------------------------------------------
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
class PermissionResponse(OpencodeBaseModel):
|
|
148
|
+
id: str | None = None
|
|
149
|
+
tool: str | None = None
|
|
150
|
+
description: str | None = None
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
# ---------------------------------------------------------------------------
|
|
154
|
+
# Question
|
|
155
|
+
# ---------------------------------------------------------------------------
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class QuestionResponse(OpencodeBaseModel):
|
|
159
|
+
id: str | None = None
|
|
160
|
+
question: str | None = None
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# ---------------------------------------------------------------------------
|
|
164
|
+
# MCP
|
|
165
|
+
# ---------------------------------------------------------------------------
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class MCPStatusResponse(OpencodeBaseModel):
|
|
169
|
+
"""Response from GET /mcp/status."""
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
# ---------------------------------------------------------------------------
|
|
173
|
+
# LSP / Formatter
|
|
174
|
+
# ---------------------------------------------------------------------------
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
class LSPStatusResponse(OpencodeBaseModel):
|
|
178
|
+
"""Response from GET /lsp."""
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class FormatterStatusResponse(OpencodeBaseModel):
|
|
182
|
+
"""Response from GET /formatter."""
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
# ---------------------------------------------------------------------------
|
|
186
|
+
# Project
|
|
187
|
+
# ---------------------------------------------------------------------------
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class ProjectResponse(OpencodeBaseModel):
|
|
191
|
+
id: str | None = None
|
|
192
|
+
name: str | None = None
|
|
193
|
+
directory: str | None = None
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
# ---------------------------------------------------------------------------
|
|
197
|
+
# Worktree
|
|
198
|
+
# ---------------------------------------------------------------------------
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
class WorktreeResponse(OpencodeBaseModel):
|
|
202
|
+
id: str | None = None
|
|
203
|
+
path: str | None = None
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
# ---------------------------------------------------------------------------
|
|
207
|
+
# Tool
|
|
208
|
+
# ---------------------------------------------------------------------------
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class ToolResponse(OpencodeBaseModel):
|
|
212
|
+
id: str | None = None
|
|
213
|
+
name: str | None = None
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# ---------------------------------------------------------------------------
|
|
217
|
+
# App / Agent
|
|
218
|
+
# ---------------------------------------------------------------------------
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class AgentResponse(OpencodeBaseModel):
|
|
222
|
+
id: str | None = None
|
|
223
|
+
name: str | None = None
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
# ---------------------------------------------------------------------------
|
|
227
|
+
# Sync
|
|
228
|
+
# ---------------------------------------------------------------------------
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
class SyncHistoryResponse(OpencodeBaseModel):
|
|
232
|
+
"""Response from GET /experimental/sync/history/:id."""
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
# ---------------------------------------------------------------------------
|
|
236
|
+
# Command
|
|
237
|
+
# ---------------------------------------------------------------------------
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
class CommandResponse(OpencodeBaseModel):
|
|
241
|
+
id: str | None = None
|
|
242
|
+
command: str | None = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencode-py
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Python SDK for Opencode — the open source AI coding agent
|
|
5
5
|
Project-URL: Homepage, https://github.com/skislyakow/opencode-py
|
|
6
6
|
Project-URL: Repository, https://github.com/skislyakow/opencode-py
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
opencode/__init__.py,sha256=bkLrLx5pWuUlzc9Bd1DOBsa1uKE8eA07sFg5AyD2hIA,2046
|
|
2
|
-
opencode/__main__.py,sha256=
|
|
2
|
+
opencode/__main__.py,sha256=g_nwI5F3ocdGVZJWGzApc6j2_Lj5grXBJQ_r0Rg1uBg,428
|
|
3
3
|
opencode/_async_client.py,sha256=FZdmZ9X1261Y9Xljt0dOa1LI950RAoRHhtAmK4EfbxI,33481
|
|
4
4
|
opencode/_async_opencode.py,sha256=HvQ9yzPvSEZt3pxxZMZlMsyl8XKtYsrwupdoFFKREjQ,8355
|
|
5
5
|
opencode/_async_session.py,sha256=UXfSnWKgi13SOSLgqEY7L0EwDVcnx-shmCLgcA_Auv4,6333
|
|
6
6
|
opencode/_binary.py,sha256=QqrHqqdi0y20PzLL_6G-Fbb0OdHY8LHORfrPyHmiCsg,3807
|
|
7
7
|
opencode/_client.py,sha256=GO1Rxg18iT9M1Z18e7PxaV_AVU8ZhPsKnO00asK48Y4,31547
|
|
8
|
-
opencode/_errors.py,sha256=
|
|
8
|
+
opencode/_errors.py,sha256=JmqHr9flnmVU4mij7kXiJofzBZBhnsfslFD4eeP5NYk,2095
|
|
9
9
|
opencode/_logs.py,sha256=7hDviWEKYS40jmT0aX6r00L857ZrkUVuruPQGZsGQ0s,779
|
|
10
10
|
opencode/_models.py,sha256=_W8IShFQNSbODYMJ1IiEA7tQ7D7xxL8CgeYuAJYcVmM,2471
|
|
11
11
|
opencode/_opencode.py,sha256=0k4yYswoLjYVlkWOnwJvH7rTK6FJgj0fTJa03Q79qos,9374
|
|
12
12
|
opencode/_process.py,sha256=xHw6ggAeQtLiBKXJDsSd6PV3RaYPtWtmOTvO-dEpL60,553
|
|
13
|
-
opencode/_response_models.py,sha256=
|
|
13
|
+
opencode/_response_models.py,sha256=ZNFnAiTazdx_iUQxl8C98Sjxa49yuTUEdtT_EL18yNE,6624
|
|
14
14
|
opencode/_server.py,sha256=CQW3IJqub4UEkcL5y_0AjQCayNkCHBkOgo7VRyQsgvc,2608
|
|
15
15
|
opencode/_session.py,sha256=WA9O36a9jIQPVWbiRa_Qq--Q2_sQgfZY-qriFYuIEUk,6273
|
|
16
16
|
opencode/_tools.py,sha256=pXIcGiuBLHZJrhFoIr02PD5rXRZ_kmEfH_yCDL-4kCw,6186
|
|
17
17
|
opencode/_types.py,sha256=abvR9AgIDy1Ao4udciG4bm5EVrS1a7iI8UjTnfp_4F0,513
|
|
18
18
|
opencode/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
19
|
-
opencode_py-0.2.
|
|
20
|
-
opencode_py-0.2.
|
|
21
|
-
opencode_py-0.2.
|
|
22
|
-
opencode_py-0.2.
|
|
23
|
-
opencode_py-0.2.
|
|
19
|
+
opencode_py-0.2.1.dist-info/METADATA,sha256=hJyLnVo-OF9lrRu1bpxIeDKKObPwjou23-9fjauUZ70,6642
|
|
20
|
+
opencode_py-0.2.1.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
21
|
+
opencode_py-0.2.1.dist-info/entry_points.txt,sha256=uFnHHKDTlnLNw7YZ7oV7aAOQZKKmhet5DMAkGKkoSU4,55
|
|
22
|
+
opencode_py-0.2.1.dist-info/licenses/LICENSE,sha256=ELTf0xrIX83aTz71tsvSJmHlanAsDLGOc3trjTn1exA,1073
|
|
23
|
+
opencode_py-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|