codexed 0.1.4__tar.gz → 1.0.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.
- {codexed-0.1.4 → codexed-1.0.0}/PKG-INFO +1 -1
- {codexed-0.1.4 → codexed-1.0.0}/pyproject.toml +4 -4
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/README.md +7 -9
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/__init__.py +73 -89
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/client/client.py +150 -614
- codexed-1.0.0/src/codexed/client/dispatch.py +151 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/client/fs.py +9 -9
- codexed-1.0.0/src/codexed/client/session.py +465 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/__init__.py +398 -429
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/codex_types.py +2 -85
- codexed-1.0.0/src/codexed/models/event_data.py +68 -0
- codexed-1.0.0/src/codexed/models/events.py +318 -0
- codexed-1.0.0/src/codexed/models/misc.py +255 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/request_params.py +43 -259
- codexed-1.0.0/src/codexed/models/response_item.py +99 -0
- codexed-1.0.0/src/codexed/models/responses.py +175 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/thread_item.py +13 -62
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/user_input.py +1 -20
- codexed-1.0.0/src/codexed/models/v2_protocol.py +5179 -0
- codexed-0.1.4/src/codexed/client/session.py +0 -238
- codexed-0.1.4/src/codexed/models/command_action.py +0 -48
- codexed-0.1.4/src/codexed/models/event_data.py +0 -384
- codexed-0.1.4/src/codexed/models/events.py +0 -704
- codexed-0.1.4/src/codexed/models/fuzzy_search.py +0 -106
- codexed-0.1.4/src/codexed/models/hooks.py +0 -88
- codexed-0.1.4/src/codexed/models/misc.py +0 -572
- codexed-0.1.4/src/codexed/models/realtime.py +0 -135
- codexed-0.1.4/src/codexed/models/response_item.py +0 -295
- codexed-0.1.4/src/codexed/models/responses.py +0 -381
- codexed-0.1.4/src/codexed/models/terminal.py +0 -84
- codexed-0.1.4/src/codexed/models/thread_status.py +0 -38
- codexed-0.1.4/src/codexed/models/token_usage.py +0 -31
- codexed-0.1.4/src/codexed/models/web_search.py +0 -42
- {codexed-0.1.4 → codexed-1.0.0}/LICENSE +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/README.md +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/client/__init__.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/exceptions.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/helpers.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/log.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/base.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/mcp_server.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/models/tool_config.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/py.typed +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/request_handlers.py +0 -0
- {codexed-0.1.4 → codexed-1.0.0}/src/codexed/transport.py +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[project]
|
|
4
4
|
name = "codexed"
|
|
5
|
-
version = "0.
|
|
5
|
+
version = "1.0.0"
|
|
6
6
|
description = "Alternative codex app-server client"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
requires-python = ">=3.13"
|
|
@@ -96,7 +96,7 @@ python_version = "3.13"
|
|
|
96
96
|
disable_error_code = ["misc", "import"]
|
|
97
97
|
pretty = true
|
|
98
98
|
check_untyped_defs = true
|
|
99
|
-
exclude = ["venv/", ".venv/", "
|
|
99
|
+
exclude = ["venv/", ".venv/", "src/codexed/models/v2_protocol.py"]
|
|
100
100
|
plugins = ["pydantic.mypy"]
|
|
101
101
|
|
|
102
102
|
[tool.pyright]
|
|
@@ -128,7 +128,7 @@ asyncio_mode = "auto"
|
|
|
128
128
|
|
|
129
129
|
[tool.ruff]
|
|
130
130
|
line-length = 100
|
|
131
|
-
extend-exclude = ["docs", "
|
|
131
|
+
extend-exclude = ["docs", "src/codexed/models/v2_protocol.py"]
|
|
132
132
|
target-version = "py313"
|
|
133
133
|
|
|
134
134
|
[tool.ruff.lint]
|
|
@@ -271,7 +271,7 @@ max-complexity = 15
|
|
|
271
271
|
preview = true
|
|
272
272
|
|
|
273
273
|
[tool.ty.src]
|
|
274
|
-
exclude = ["
|
|
274
|
+
exclude = ["src/codexed/models/v2_protocol.py"]
|
|
275
275
|
|
|
276
276
|
[tool.ty.environment]
|
|
277
277
|
python-version = "3.13"
|
|
@@ -7,7 +7,7 @@ Python adapter for the [Codex](https://github.com/openai/codex) app-server JSON-
|
|
|
7
7
|
```python
|
|
8
8
|
import asyncio
|
|
9
9
|
from codexed import CodexClient
|
|
10
|
-
from codexed.models import
|
|
10
|
+
from codexed.models import ItemAgentMessageDeltaNotification, TurnCompletedEvent
|
|
11
11
|
|
|
12
12
|
async def main():
|
|
13
13
|
async with CodexClient() as client:
|
|
@@ -15,7 +15,7 @@ async def main():
|
|
|
15
15
|
|
|
16
16
|
async for event in session.turn_stream("Help me refactor this code"):
|
|
17
17
|
match event:
|
|
18
|
-
case
|
|
18
|
+
case ItemAgentMessageDeltaNotification(data=data):
|
|
19
19
|
print(data.delta, end="", flush=True)
|
|
20
20
|
case TurnCompletedEvent():
|
|
21
21
|
break
|
|
@@ -47,20 +47,18 @@ Events are a discriminated union. Use pattern matching or helper functions:
|
|
|
47
47
|
|
|
48
48
|
```python
|
|
49
49
|
from codexed.models import (
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
ItemAgentMessageDeltaNotification,
|
|
51
|
+
ItemCommandExecutionOutputDeltaNotification,
|
|
52
52
|
TurnCompletedEvent,
|
|
53
|
-
TurnErrorEvent,
|
|
54
53
|
)
|
|
55
54
|
|
|
56
|
-
async for event in
|
|
55
|
+
async for event in session.turn_stream(message):
|
|
57
56
|
match event:
|
|
58
|
-
case
|
|
57
|
+
case ItemAgentMessageDeltaNotification(data=data) | ItemCommandExecutionOutputDeltaNotification(data=data):
|
|
59
58
|
print(data.delta, end="")
|
|
60
59
|
case TurnCompletedEvent():
|
|
61
60
|
break
|
|
62
|
-
|
|
63
|
-
print(f"Error: {data.error}")
|
|
61
|
+
|
|
64
62
|
```
|
|
65
63
|
|
|
66
64
|
## See Also
|
|
@@ -32,115 +32,106 @@ from codexed.exceptions import (
|
|
|
32
32
|
TransportClosedError,
|
|
33
33
|
TurnFailedError,
|
|
34
34
|
is_retryable_error,
|
|
35
|
-
map_jsonrpc_error,
|
|
36
35
|
)
|
|
37
36
|
from codexed.models import (
|
|
38
|
-
|
|
37
|
+
AgentMessageDeltaNotification,
|
|
39
38
|
AppInfo,
|
|
40
|
-
|
|
39
|
+
AppListUpdatedNotification,
|
|
41
40
|
CommandExecResponse,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
EventData,
|
|
41
|
+
CommandExecutionOutputDeltaNotification,
|
|
42
|
+
ConfigWarningNotification,
|
|
45
43
|
ExperimentalFeature,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
Model,
|
|
45
|
+
ModelReroutedNotification,
|
|
46
|
+
PlanDeltaNotification,
|
|
47
|
+
ReasoningTextDeltaNotification,
|
|
50
48
|
ReviewStartResponse,
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
SkillMetadata,
|
|
50
|
+
ThreadArchivedNotification,
|
|
53
51
|
Thread,
|
|
54
52
|
ThreadListResponse,
|
|
55
|
-
|
|
53
|
+
ThreadNameUpdatedNotification,
|
|
56
54
|
ThreadReadResponse,
|
|
57
55
|
ThreadResponse,
|
|
58
56
|
ThreadRollbackResponse,
|
|
59
57
|
ThreadStartedData,
|
|
60
|
-
|
|
58
|
+
ThreadStatusChangedNotification,
|
|
61
59
|
ThreadTokenUsage,
|
|
62
|
-
|
|
60
|
+
ThreadUnarchiveParams,
|
|
63
61
|
ThreadUnarchiveResponse,
|
|
64
62
|
TokenUsageBreakdown,
|
|
65
63
|
TurnCompletedData,
|
|
66
64
|
TurnErrorData,
|
|
67
65
|
TurnStartedData,
|
|
68
66
|
TurnSteerResponse,
|
|
69
|
-
Usage,
|
|
70
67
|
UserInput,
|
|
71
68
|
UserInputImage,
|
|
72
69
|
UserInputLocalImage,
|
|
73
70
|
UserInputMention,
|
|
74
71
|
UserInputSkill,
|
|
75
72
|
UserInputText,
|
|
76
|
-
)
|
|
77
|
-
from codexed.models.codex_types import (
|
|
78
73
|
ApprovalPolicy,
|
|
79
74
|
AskForApproval,
|
|
80
|
-
CollabAgentStatus,
|
|
81
|
-
CollabAgentTool,
|
|
82
75
|
CollaborationMode,
|
|
83
|
-
|
|
84
|
-
CommandExecutionSource,
|
|
85
|
-
CommandExecutionStatus,
|
|
76
|
+
Settings,
|
|
86
77
|
DangerFullAccessSandboxPolicy,
|
|
87
78
|
ExternalSandboxPolicy,
|
|
88
79
|
ApprovalDecision,
|
|
89
|
-
InputModality,
|
|
90
80
|
ItemStatus,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
CollabAgentStatus,
|
|
82
|
+
CollabAgentTool,
|
|
83
|
+
CommandExecutionSource,
|
|
84
|
+
CommandExecutionStatus,
|
|
85
|
+
McpAuthStatus,
|
|
86
|
+
InputModality,
|
|
87
|
+
ModelRerouteReason,
|
|
88
|
+
PatchApplyStatus,
|
|
94
89
|
MessagePhase,
|
|
90
|
+
ReviewDelivery,
|
|
91
|
+
SandboxMode,
|
|
92
|
+
SkillScope,
|
|
95
93
|
ModeKind,
|
|
96
|
-
ModelProvider,
|
|
97
|
-
ModelRerouteReason,
|
|
98
94
|
NetworkAccess,
|
|
99
|
-
PatchApplyStatus,
|
|
100
95
|
Personality,
|
|
101
96
|
ReadOnlySandboxPolicy,
|
|
102
97
|
ReasoningEffort,
|
|
103
98
|
ReasoningSummary,
|
|
104
99
|
RejectApprovalPolicy,
|
|
105
100
|
RejectConfig,
|
|
106
|
-
ReviewDelivery,
|
|
107
|
-
SandboxMode,
|
|
108
101
|
SandboxPolicy,
|
|
109
102
|
SessionSource,
|
|
110
103
|
SkillApprovalDecision,
|
|
111
|
-
SkillScope,
|
|
112
104
|
ThreadActiveFlag,
|
|
113
105
|
ThreadSortKey,
|
|
114
106
|
ThreadSourceKind,
|
|
115
107
|
TurnStatus,
|
|
116
108
|
WorkspaceWriteSandboxPolicy,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
AgentMessageDeltaEvent,
|
|
120
|
-
AppListUpdatedEvent,
|
|
109
|
+
ItemAgentMessageDeltaNotification,
|
|
110
|
+
AppListUpdatedMessage,
|
|
121
111
|
CodexEvent,
|
|
122
|
-
|
|
123
|
-
|
|
112
|
+
ItemCommandExecutionOutputDeltaNotification,
|
|
113
|
+
ConfigWarningMessage,
|
|
124
114
|
EventType,
|
|
125
|
-
|
|
126
|
-
|
|
115
|
+
ItemFileChangeOutputDeltaNotification,
|
|
116
|
+
FsChangedMessage,
|
|
127
117
|
ItemCompletedEvent,
|
|
128
118
|
ItemStartedEvent,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
119
|
+
ModelReroutedMessage,
|
|
120
|
+
ItemPlanDeltaNotification,
|
|
121
|
+
ItemReasoningTextDeltaNotification,
|
|
122
|
+
ThreadArchivedMessage,
|
|
123
|
+
ThreadCompactedMessage,
|
|
124
|
+
ThreadNameUpdatedMessage,
|
|
135
125
|
ThreadStartedEvent,
|
|
136
|
-
|
|
137
|
-
|
|
126
|
+
ThreadStatusChangedMessage,
|
|
127
|
+
ThreadUnarchivedMessage,
|
|
138
128
|
TurnCompletedEvent,
|
|
139
|
-
|
|
140
|
-
TurnPlanUpdatedEvent,
|
|
129
|
+
TurnPlanUpdatedMessage,
|
|
141
130
|
TurnStartedEvent,
|
|
131
|
+
HttpMcpServer,
|
|
132
|
+
McpServerConfig,
|
|
133
|
+
StdioMcpServer,
|
|
142
134
|
)
|
|
143
|
-
from codexed.models.mcp_server import HttpMcpServer, McpServerConfig, StdioMcpServer
|
|
144
135
|
from codexed.transport import StdioTransport, WebSocketTransport
|
|
145
136
|
from codexed.models.tool_config import BuiltinToolsConfig, ToolConfig, tools_to_config_dict
|
|
146
137
|
from codexed.request_handlers import (
|
|
@@ -154,11 +145,10 @@ from codexed.request_handlers import (
|
|
|
154
145
|
|
|
155
146
|
|
|
156
147
|
__all__ = [
|
|
157
|
-
"
|
|
158
|
-
"AgentMessageDeltaEvent",
|
|
148
|
+
"AgentMessageDeltaNotification",
|
|
159
149
|
"AppInfo",
|
|
160
|
-
"
|
|
161
|
-
"
|
|
150
|
+
"AppListUpdatedMessage",
|
|
151
|
+
"AppListUpdatedNotification",
|
|
162
152
|
"ApprovalDecision",
|
|
163
153
|
"ApprovalHandler",
|
|
164
154
|
"ApprovalParams",
|
|
@@ -174,53 +164,50 @@ __all__ = [
|
|
|
174
164
|
"CollabAgentStatus",
|
|
175
165
|
"CollabAgentTool",
|
|
176
166
|
"CollaborationMode",
|
|
177
|
-
"CollaborationModeSettings",
|
|
178
167
|
"CommandExecResponse",
|
|
179
|
-
"
|
|
180
|
-
"CommandExecutionOutputDeltaEvent",
|
|
168
|
+
"CommandExecutionOutputDeltaNotification",
|
|
181
169
|
"CommandExecutionSource",
|
|
182
170
|
"CommandExecutionStatus",
|
|
183
|
-
"
|
|
184
|
-
"
|
|
171
|
+
"ConfigWarningMessage",
|
|
172
|
+
"ConfigWarningNotification",
|
|
185
173
|
"DangerFullAccessSandboxPolicy",
|
|
186
174
|
"DynamicToolCallHandler",
|
|
187
|
-
"EventData",
|
|
188
175
|
"EventType",
|
|
189
176
|
"ExperimentalFeature",
|
|
190
177
|
"ExternalSandboxPolicy",
|
|
191
|
-
"
|
|
192
|
-
"FsChangedEvent",
|
|
178
|
+
"FsChangedMessage",
|
|
193
179
|
"HttpMcpServer",
|
|
194
180
|
"InputModality",
|
|
195
181
|
"InternalRpcError",
|
|
196
182
|
"InvalidParamsError",
|
|
197
183
|
"InvalidRequestError",
|
|
184
|
+
"ItemAgentMessageDeltaNotification",
|
|
185
|
+
"ItemCommandExecutionOutputDeltaNotification",
|
|
198
186
|
"ItemCompletedEvent",
|
|
187
|
+
"ItemFileChangeOutputDeltaNotification",
|
|
188
|
+
"ItemPlanDeltaNotification",
|
|
189
|
+
"ItemReasoningTextDeltaNotification",
|
|
199
190
|
"ItemStartedEvent",
|
|
200
191
|
"ItemStatus",
|
|
201
|
-
"
|
|
202
|
-
"McpAuthStatusValue",
|
|
192
|
+
"McpAuthStatus",
|
|
203
193
|
"McpElicitationHandler",
|
|
204
194
|
"McpServerConfig",
|
|
205
195
|
"MessagePhase",
|
|
206
196
|
"MethodNotFoundError",
|
|
207
197
|
"ModeKind",
|
|
208
|
-
"
|
|
209
|
-
"ModelProvider",
|
|
198
|
+
"Model",
|
|
210
199
|
"ModelRerouteReason",
|
|
211
|
-
"
|
|
212
|
-
"
|
|
200
|
+
"ModelReroutedMessage",
|
|
201
|
+
"ModelReroutedNotification",
|
|
213
202
|
"NetworkAccess",
|
|
214
203
|
"ParseError",
|
|
215
204
|
"PatchApplyStatus",
|
|
216
205
|
"Personality",
|
|
217
|
-
"
|
|
218
|
-
"PlanDeltaEvent",
|
|
206
|
+
"PlanDeltaNotification",
|
|
219
207
|
"ReadOnlySandboxPolicy",
|
|
220
208
|
"ReasoningEffort",
|
|
221
209
|
"ReasoningSummary",
|
|
222
|
-
"
|
|
223
|
-
"ReasoningTextDeltaEvent",
|
|
210
|
+
"ReasoningTextDeltaNotification",
|
|
224
211
|
"RejectApprovalPolicy",
|
|
225
212
|
"RejectConfig",
|
|
226
213
|
"RetryLimitExceededError",
|
|
@@ -231,19 +218,20 @@ __all__ = [
|
|
|
231
218
|
"ServerBusyError",
|
|
232
219
|
"Session",
|
|
233
220
|
"SessionSource",
|
|
221
|
+
"Settings",
|
|
234
222
|
"SkillApprovalDecision",
|
|
235
|
-
"
|
|
223
|
+
"SkillMetadata",
|
|
236
224
|
"SkillScope",
|
|
237
225
|
"StdioMcpServer",
|
|
238
226
|
"StdioTransport",
|
|
239
227
|
"Thread",
|
|
240
228
|
"ThreadActiveFlag",
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"
|
|
229
|
+
"ThreadArchivedMessage",
|
|
230
|
+
"ThreadArchivedNotification",
|
|
231
|
+
"ThreadCompactedMessage",
|
|
244
232
|
"ThreadListResponse",
|
|
245
|
-
"
|
|
246
|
-
"
|
|
233
|
+
"ThreadNameUpdatedMessage",
|
|
234
|
+
"ThreadNameUpdatedNotification",
|
|
247
235
|
"ThreadReadResponse",
|
|
248
236
|
"ThreadResponse",
|
|
249
237
|
"ThreadRollbackResponse",
|
|
@@ -251,27 +239,24 @@ __all__ = [
|
|
|
251
239
|
"ThreadSourceKind",
|
|
252
240
|
"ThreadStartedData",
|
|
253
241
|
"ThreadStartedEvent",
|
|
254
|
-
"
|
|
255
|
-
"
|
|
242
|
+
"ThreadStatusChangedMessage",
|
|
243
|
+
"ThreadStatusChangedNotification",
|
|
256
244
|
"ThreadTokenUsage",
|
|
245
|
+
"ThreadUnarchiveParams",
|
|
257
246
|
"ThreadUnarchiveResponse",
|
|
258
|
-
"
|
|
259
|
-
"ThreadUnarchivedEvent",
|
|
247
|
+
"ThreadUnarchivedMessage",
|
|
260
248
|
"TokenUsageBreakdown",
|
|
261
|
-
"ToolCallStatus",
|
|
262
249
|
"ToolConfig",
|
|
263
250
|
"TransportClosedError",
|
|
264
251
|
"TurnCompletedData",
|
|
265
252
|
"TurnCompletedEvent",
|
|
266
253
|
"TurnErrorData",
|
|
267
|
-
"TurnErrorEvent",
|
|
268
254
|
"TurnFailedError",
|
|
269
|
-
"
|
|
255
|
+
"TurnPlanUpdatedMessage",
|
|
270
256
|
"TurnStartedData",
|
|
271
257
|
"TurnStartedEvent",
|
|
272
258
|
"TurnStatus",
|
|
273
259
|
"TurnSteerResponse",
|
|
274
|
-
"Usage",
|
|
275
260
|
"UserInput",
|
|
276
261
|
"UserInputHandler",
|
|
277
262
|
"UserInputImage",
|
|
@@ -282,6 +267,5 @@ __all__ = [
|
|
|
282
267
|
"WebSocketTransport",
|
|
283
268
|
"WorkspaceWriteSandboxPolicy",
|
|
284
269
|
"is_retryable_error",
|
|
285
|
-
"map_jsonrpc_error",
|
|
286
270
|
"tools_to_config_dict",
|
|
287
271
|
]
|