codexed 0.1.5__tar.gz → 1.1.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.5 → codexed-1.1.0}/PKG-INFO +1 -1
- {codexed-0.1.5 → codexed-1.1.0}/pyproject.toml +4 -4
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/README.md +7 -9
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/__init__.py +73 -87
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/client/__init__.py +2 -1
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/client/client.py +84 -381
- codexed-1.1.0/src/codexed/client/realtime.py +174 -0
- codexed-1.1.0/src/codexed/client/session.py +482 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/__init__.py +398 -433
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/codex_types.py +1 -85
- codexed-1.1.0/src/codexed/models/event_data.py +68 -0
- codexed-1.1.0/src/codexed/models/events.py +318 -0
- codexed-1.1.0/src/codexed/models/misc.py +255 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/request_params.py +43 -259
- codexed-1.1.0/src/codexed/models/response_item.py +99 -0
- codexed-1.1.0/src/codexed/models/responses.py +175 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/thread_item.py +13 -62
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/user_input.py +1 -20
- codexed-1.1.0/src/codexed/models/v2_protocol.py +5179 -0
- codexed-0.1.5/src/codexed/client/session.py +0 -238
- codexed-0.1.5/src/codexed/models/command_action.py +0 -48
- codexed-0.1.5/src/codexed/models/event_data.py +0 -394
- codexed-0.1.5/src/codexed/models/events.py +0 -716
- codexed-0.1.5/src/codexed/models/fuzzy_search.py +0 -106
- codexed-0.1.5/src/codexed/models/hooks.py +0 -88
- codexed-0.1.5/src/codexed/models/misc.py +0 -572
- codexed-0.1.5/src/codexed/models/realtime.py +0 -135
- codexed-0.1.5/src/codexed/models/response_item.py +0 -295
- codexed-0.1.5/src/codexed/models/responses.py +0 -381
- codexed-0.1.5/src/codexed/models/terminal.py +0 -84
- codexed-0.1.5/src/codexed/models/thread_status.py +0 -38
- codexed-0.1.5/src/codexed/models/token_usage.py +0 -31
- codexed-0.1.5/src/codexed/models/web_search.py +0 -42
- {codexed-0.1.5 → codexed-1.1.0}/LICENSE +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/README.md +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/client/dispatch.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/client/fs.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/exceptions.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/helpers.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/log.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/base.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/mcp_server.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/models/tool_config.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/py.typed +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/request_handlers.py +0 -0
- {codexed-0.1.5 → codexed-1.1.0}/src/codexed/transport.py +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[project]
|
|
4
4
|
name = "codexed"
|
|
5
|
-
version = "
|
|
5
|
+
version = "1.1.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
|
|
@@ -34,112 +34,104 @@ from codexed.exceptions import (
|
|
|
34
34
|
is_retryable_error,
|
|
35
35
|
)
|
|
36
36
|
from codexed.models import (
|
|
37
|
-
|
|
37
|
+
AgentMessageDeltaNotification,
|
|
38
38
|
AppInfo,
|
|
39
|
-
|
|
39
|
+
AppListUpdatedNotification,
|
|
40
40
|
CommandExecResponse,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
EventData,
|
|
41
|
+
CommandExecutionOutputDeltaNotification,
|
|
42
|
+
ConfigWarningNotification,
|
|
44
43
|
ExperimentalFeature,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
Model,
|
|
45
|
+
ModelReroutedNotification,
|
|
46
|
+
PlanDeltaNotification,
|
|
47
|
+
ReasoningTextDeltaNotification,
|
|
49
48
|
ReviewStartResponse,
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
SkillMetadata,
|
|
50
|
+
ThreadArchivedNotification,
|
|
52
51
|
Thread,
|
|
53
52
|
ThreadListResponse,
|
|
54
|
-
|
|
53
|
+
ThreadNameUpdatedNotification,
|
|
55
54
|
ThreadReadResponse,
|
|
56
55
|
ThreadResponse,
|
|
57
56
|
ThreadRollbackResponse,
|
|
58
57
|
ThreadStartedData,
|
|
59
|
-
|
|
58
|
+
ThreadStatusChangedNotification,
|
|
60
59
|
ThreadTokenUsage,
|
|
61
|
-
|
|
60
|
+
ThreadUnarchiveParams,
|
|
62
61
|
ThreadUnarchiveResponse,
|
|
63
62
|
TokenUsageBreakdown,
|
|
64
63
|
TurnCompletedData,
|
|
65
64
|
TurnErrorData,
|
|
66
65
|
TurnStartedData,
|
|
67
66
|
TurnSteerResponse,
|
|
68
|
-
Usage,
|
|
69
67
|
UserInput,
|
|
70
68
|
UserInputImage,
|
|
71
69
|
UserInputLocalImage,
|
|
72
70
|
UserInputMention,
|
|
73
71
|
UserInputSkill,
|
|
74
72
|
UserInputText,
|
|
75
|
-
)
|
|
76
|
-
from codexed.models.codex_types import (
|
|
77
73
|
ApprovalPolicy,
|
|
78
74
|
AskForApproval,
|
|
79
|
-
CollabAgentStatus,
|
|
80
|
-
CollabAgentTool,
|
|
81
75
|
CollaborationMode,
|
|
82
|
-
|
|
83
|
-
CommandExecutionSource,
|
|
84
|
-
CommandExecutionStatus,
|
|
76
|
+
Settings,
|
|
85
77
|
DangerFullAccessSandboxPolicy,
|
|
86
78
|
ExternalSandboxPolicy,
|
|
87
79
|
ApprovalDecision,
|
|
88
|
-
InputModality,
|
|
89
80
|
ItemStatus,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
81
|
+
CollabAgentStatus,
|
|
82
|
+
CollabAgentTool,
|
|
83
|
+
CommandExecutionSource,
|
|
84
|
+
CommandExecutionStatus,
|
|
85
|
+
McpAuthStatus,
|
|
86
|
+
InputModality,
|
|
87
|
+
ModelRerouteReason,
|
|
88
|
+
PatchApplyStatus,
|
|
93
89
|
MessagePhase,
|
|
90
|
+
ReviewDelivery,
|
|
91
|
+
SandboxMode,
|
|
92
|
+
SkillScope,
|
|
94
93
|
ModeKind,
|
|
95
|
-
ModelProvider,
|
|
96
|
-
ModelRerouteReason,
|
|
97
94
|
NetworkAccess,
|
|
98
|
-
PatchApplyStatus,
|
|
99
95
|
Personality,
|
|
100
96
|
ReadOnlySandboxPolicy,
|
|
101
97
|
ReasoningEffort,
|
|
102
98
|
ReasoningSummary,
|
|
103
99
|
RejectApprovalPolicy,
|
|
104
100
|
RejectConfig,
|
|
105
|
-
ReviewDelivery,
|
|
106
|
-
SandboxMode,
|
|
107
101
|
SandboxPolicy,
|
|
108
102
|
SessionSource,
|
|
109
103
|
SkillApprovalDecision,
|
|
110
|
-
SkillScope,
|
|
111
104
|
ThreadActiveFlag,
|
|
112
105
|
ThreadSortKey,
|
|
113
106
|
ThreadSourceKind,
|
|
114
107
|
TurnStatus,
|
|
115
108
|
WorkspaceWriteSandboxPolicy,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
AgentMessageDeltaEvent,
|
|
119
|
-
AppListUpdatedEvent,
|
|
109
|
+
ItemAgentMessageDeltaNotification,
|
|
110
|
+
AppListUpdatedMessage,
|
|
120
111
|
CodexEvent,
|
|
121
|
-
|
|
122
|
-
|
|
112
|
+
ItemCommandExecutionOutputDeltaNotification,
|
|
113
|
+
ConfigWarningMessage,
|
|
123
114
|
EventType,
|
|
124
|
-
|
|
125
|
-
|
|
115
|
+
ItemFileChangeOutputDeltaNotification,
|
|
116
|
+
FsChangedMessage,
|
|
126
117
|
ItemCompletedEvent,
|
|
127
118
|
ItemStartedEvent,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
119
|
+
ModelReroutedMessage,
|
|
120
|
+
ItemPlanDeltaNotification,
|
|
121
|
+
ItemReasoningTextDeltaNotification,
|
|
122
|
+
ThreadArchivedMessage,
|
|
123
|
+
ThreadCompactedMessage,
|
|
124
|
+
ThreadNameUpdatedMessage,
|
|
134
125
|
ThreadStartedEvent,
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
ThreadStatusChangedMessage,
|
|
127
|
+
ThreadUnarchivedMessage,
|
|
137
128
|
TurnCompletedEvent,
|
|
138
|
-
|
|
139
|
-
TurnPlanUpdatedEvent,
|
|
129
|
+
TurnPlanUpdatedMessage,
|
|
140
130
|
TurnStartedEvent,
|
|
131
|
+
HttpMcpServer,
|
|
132
|
+
McpServerConfig,
|
|
133
|
+
StdioMcpServer,
|
|
141
134
|
)
|
|
142
|
-
from codexed.models.mcp_server import HttpMcpServer, McpServerConfig, StdioMcpServer
|
|
143
135
|
from codexed.transport import StdioTransport, WebSocketTransport
|
|
144
136
|
from codexed.models.tool_config import BuiltinToolsConfig, ToolConfig, tools_to_config_dict
|
|
145
137
|
from codexed.request_handlers import (
|
|
@@ -153,11 +145,10 @@ from codexed.request_handlers import (
|
|
|
153
145
|
|
|
154
146
|
|
|
155
147
|
__all__ = [
|
|
156
|
-
"
|
|
157
|
-
"AgentMessageDeltaEvent",
|
|
148
|
+
"AgentMessageDeltaNotification",
|
|
158
149
|
"AppInfo",
|
|
159
|
-
"
|
|
160
|
-
"
|
|
150
|
+
"AppListUpdatedMessage",
|
|
151
|
+
"AppListUpdatedNotification",
|
|
161
152
|
"ApprovalDecision",
|
|
162
153
|
"ApprovalHandler",
|
|
163
154
|
"ApprovalParams",
|
|
@@ -173,53 +164,50 @@ __all__ = [
|
|
|
173
164
|
"CollabAgentStatus",
|
|
174
165
|
"CollabAgentTool",
|
|
175
166
|
"CollaborationMode",
|
|
176
|
-
"CollaborationModeSettings",
|
|
177
167
|
"CommandExecResponse",
|
|
178
|
-
"
|
|
179
|
-
"CommandExecutionOutputDeltaEvent",
|
|
168
|
+
"CommandExecutionOutputDeltaNotification",
|
|
180
169
|
"CommandExecutionSource",
|
|
181
170
|
"CommandExecutionStatus",
|
|
182
|
-
"
|
|
183
|
-
"
|
|
171
|
+
"ConfigWarningMessage",
|
|
172
|
+
"ConfigWarningNotification",
|
|
184
173
|
"DangerFullAccessSandboxPolicy",
|
|
185
174
|
"DynamicToolCallHandler",
|
|
186
|
-
"EventData",
|
|
187
175
|
"EventType",
|
|
188
176
|
"ExperimentalFeature",
|
|
189
177
|
"ExternalSandboxPolicy",
|
|
190
|
-
"
|
|
191
|
-
"FsChangedEvent",
|
|
178
|
+
"FsChangedMessage",
|
|
192
179
|
"HttpMcpServer",
|
|
193
180
|
"InputModality",
|
|
194
181
|
"InternalRpcError",
|
|
195
182
|
"InvalidParamsError",
|
|
196
183
|
"InvalidRequestError",
|
|
184
|
+
"ItemAgentMessageDeltaNotification",
|
|
185
|
+
"ItemCommandExecutionOutputDeltaNotification",
|
|
197
186
|
"ItemCompletedEvent",
|
|
187
|
+
"ItemFileChangeOutputDeltaNotification",
|
|
188
|
+
"ItemPlanDeltaNotification",
|
|
189
|
+
"ItemReasoningTextDeltaNotification",
|
|
198
190
|
"ItemStartedEvent",
|
|
199
191
|
"ItemStatus",
|
|
200
|
-
"
|
|
201
|
-
"McpAuthStatusValue",
|
|
192
|
+
"McpAuthStatus",
|
|
202
193
|
"McpElicitationHandler",
|
|
203
194
|
"McpServerConfig",
|
|
204
195
|
"MessagePhase",
|
|
205
196
|
"MethodNotFoundError",
|
|
206
197
|
"ModeKind",
|
|
207
|
-
"
|
|
208
|
-
"ModelProvider",
|
|
198
|
+
"Model",
|
|
209
199
|
"ModelRerouteReason",
|
|
210
|
-
"
|
|
211
|
-
"
|
|
200
|
+
"ModelReroutedMessage",
|
|
201
|
+
"ModelReroutedNotification",
|
|
212
202
|
"NetworkAccess",
|
|
213
203
|
"ParseError",
|
|
214
204
|
"PatchApplyStatus",
|
|
215
205
|
"Personality",
|
|
216
|
-
"
|
|
217
|
-
"PlanDeltaEvent",
|
|
206
|
+
"PlanDeltaNotification",
|
|
218
207
|
"ReadOnlySandboxPolicy",
|
|
219
208
|
"ReasoningEffort",
|
|
220
209
|
"ReasoningSummary",
|
|
221
|
-
"
|
|
222
|
-
"ReasoningTextDeltaEvent",
|
|
210
|
+
"ReasoningTextDeltaNotification",
|
|
223
211
|
"RejectApprovalPolicy",
|
|
224
212
|
"RejectConfig",
|
|
225
213
|
"RetryLimitExceededError",
|
|
@@ -230,19 +218,20 @@ __all__ = [
|
|
|
230
218
|
"ServerBusyError",
|
|
231
219
|
"Session",
|
|
232
220
|
"SessionSource",
|
|
221
|
+
"Settings",
|
|
233
222
|
"SkillApprovalDecision",
|
|
234
|
-
"
|
|
223
|
+
"SkillMetadata",
|
|
235
224
|
"SkillScope",
|
|
236
225
|
"StdioMcpServer",
|
|
237
226
|
"StdioTransport",
|
|
238
227
|
"Thread",
|
|
239
228
|
"ThreadActiveFlag",
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"
|
|
229
|
+
"ThreadArchivedMessage",
|
|
230
|
+
"ThreadArchivedNotification",
|
|
231
|
+
"ThreadCompactedMessage",
|
|
243
232
|
"ThreadListResponse",
|
|
244
|
-
"
|
|
245
|
-
"
|
|
233
|
+
"ThreadNameUpdatedMessage",
|
|
234
|
+
"ThreadNameUpdatedNotification",
|
|
246
235
|
"ThreadReadResponse",
|
|
247
236
|
"ThreadResponse",
|
|
248
237
|
"ThreadRollbackResponse",
|
|
@@ -250,27 +239,24 @@ __all__ = [
|
|
|
250
239
|
"ThreadSourceKind",
|
|
251
240
|
"ThreadStartedData",
|
|
252
241
|
"ThreadStartedEvent",
|
|
253
|
-
"
|
|
254
|
-
"
|
|
242
|
+
"ThreadStatusChangedMessage",
|
|
243
|
+
"ThreadStatusChangedNotification",
|
|
255
244
|
"ThreadTokenUsage",
|
|
245
|
+
"ThreadUnarchiveParams",
|
|
256
246
|
"ThreadUnarchiveResponse",
|
|
257
|
-
"
|
|
258
|
-
"ThreadUnarchivedEvent",
|
|
247
|
+
"ThreadUnarchivedMessage",
|
|
259
248
|
"TokenUsageBreakdown",
|
|
260
|
-
"ToolCallStatus",
|
|
261
249
|
"ToolConfig",
|
|
262
250
|
"TransportClosedError",
|
|
263
251
|
"TurnCompletedData",
|
|
264
252
|
"TurnCompletedEvent",
|
|
265
253
|
"TurnErrorData",
|
|
266
|
-
"TurnErrorEvent",
|
|
267
254
|
"TurnFailedError",
|
|
268
|
-
"
|
|
255
|
+
"TurnPlanUpdatedMessage",
|
|
269
256
|
"TurnStartedData",
|
|
270
257
|
"TurnStartedEvent",
|
|
271
258
|
"TurnStatus",
|
|
272
259
|
"TurnSteerResponse",
|
|
273
|
-
"Usage",
|
|
274
260
|
"UserInput",
|
|
275
261
|
"UserInputHandler",
|
|
276
262
|
"UserInputImage",
|