codexed 1.1.5__tar.gz → 1.1.7__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-1.1.5 → codexed-1.1.7}/PKG-INFO +1 -1
- {codexed-1.1.5 → codexed-1.1.7}/pyproject.toml +1 -1
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/client/client.py +5 -2
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/__init__.py +5 -3
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/event_data.py +0 -9
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/events.py +2 -2
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/misc.py +4 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/request_params.py +5 -33
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/responses.py +10 -6
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/thread_item.py +41 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/transport.py +1 -1
- {codexed-1.1.5 → codexed-1.1.7}/LICENSE +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/README.md +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/README.md +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/__init__.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/client/__init__.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/client/dispatch.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/client/fs.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/client/realtime.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/client/session.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/client/skills.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/exceptions.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/helpers.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/log.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/base.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/codex_types.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/mcp_server.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/tool_config.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/user_input.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/models/v2_protocol.py +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/py.typed +0 -0
- {codexed-1.1.5 → codexed-1.1.7}/src/codexed/request_handlers.py +0 -0
|
@@ -190,11 +190,14 @@ class CodexClient:
|
|
|
190
190
|
async def __aenter__(self) -> Self:
|
|
191
191
|
"""Async context manager entry - starts the app-server."""
|
|
192
192
|
import codexed
|
|
193
|
-
from codexed.models import ClientInfo, InitializeParams
|
|
193
|
+
from codexed.models import ClientInfo, InitializeCapabilities, InitializeParams
|
|
194
194
|
|
|
195
195
|
await self.dispatch.start()
|
|
196
196
|
version = codexed.__version__
|
|
197
|
-
init_params = InitializeParams(
|
|
197
|
+
init_params = InitializeParams(
|
|
198
|
+
client_info=ClientInfo(name="codexed", version=version),
|
|
199
|
+
capabilities=InitializeCapabilities(experimental_api=True),
|
|
200
|
+
)
|
|
198
201
|
await self.dispatch.send_request("initialize", init_params)
|
|
199
202
|
return self
|
|
200
203
|
|
|
@@ -20,7 +20,6 @@ from codexed.models.codex_types import (
|
|
|
20
20
|
from codexed.models.event_data import (
|
|
21
21
|
ItemCompletedData,
|
|
22
22
|
ItemStartedData,
|
|
23
|
-
RawResponseItemCompletedData,
|
|
24
23
|
ThreadStartedData,
|
|
25
24
|
TurnStartedData,
|
|
26
25
|
TurnCompletedData,
|
|
@@ -66,7 +65,6 @@ from codexed.models.request_params import (
|
|
|
66
65
|
ProductSurface,
|
|
67
66
|
CommandExecutionRequestApprovalParams,
|
|
68
67
|
DynamicToolCallParams,
|
|
69
|
-
ThreadResumeParams,
|
|
70
68
|
FileChangeRequestApprovalParams,
|
|
71
69
|
McpElicitationFormParams,
|
|
72
70
|
McpElicitationUrlParams,
|
|
@@ -153,6 +151,9 @@ from codexed.models.user_input import (
|
|
|
153
151
|
)
|
|
154
152
|
from codexed.models.v2_protocol import (
|
|
155
153
|
ByteRange,
|
|
154
|
+
InitializeCapabilities,
|
|
155
|
+
ThreadResumeParams,
|
|
156
|
+
RawResponseItemCompletedNotification,
|
|
156
157
|
ExternalAgentConfigImportParams,
|
|
157
158
|
InitializeParams,
|
|
158
159
|
CommandExecParams,
|
|
@@ -623,6 +624,7 @@ __all__ = [
|
|
|
623
624
|
"ImageGenerationCallResponseItem",
|
|
624
625
|
"ImageGenerationToolConfig",
|
|
625
626
|
"ImageUserInput",
|
|
627
|
+
"InitializeCapabilities",
|
|
626
628
|
"InitializeParams",
|
|
627
629
|
"InputModality",
|
|
628
630
|
"ItemAgentMessageDeltaNotification",
|
|
@@ -704,8 +706,8 @@ __all__ = [
|
|
|
704
706
|
"ProductSurface",
|
|
705
707
|
"RateLimitSnapshot",
|
|
706
708
|
"RateLimitWindow",
|
|
707
|
-
"RawResponseItemCompletedData",
|
|
708
709
|
"RawResponseItemCompletedEvent",
|
|
710
|
+
"RawResponseItemCompletedNotification",
|
|
709
711
|
"ReadCommandAction",
|
|
710
712
|
"ReadFileToolConfig",
|
|
711
713
|
"ReadOnlyAccess",
|
|
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|
|
3
3
|
from codexed.models.base import CodexBaseModel
|
|
4
4
|
from codexed.models.misc import Thread, Turn
|
|
5
5
|
from codexed.models.thread_item import ThreadItem
|
|
6
|
-
from codexed.models.v2_protocol import ResponseItem
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
# Item lifecycle notifications
|
|
@@ -25,14 +24,6 @@ class ItemCompletedData(CodexBaseModel):
|
|
|
25
24
|
item: ThreadItem
|
|
26
25
|
|
|
27
26
|
|
|
28
|
-
class RawResponseItemCompletedData(CodexBaseModel):
|
|
29
|
-
"""Payload for rawResponseItem/completed notification."""
|
|
30
|
-
|
|
31
|
-
thread_id: str
|
|
32
|
-
turn_id: str
|
|
33
|
-
item: ResponseItem
|
|
34
|
-
|
|
35
|
-
|
|
36
27
|
class ThreadStartedData(CodexBaseModel):
|
|
37
28
|
"""Payload for thread/started notification (V2 protocol)."""
|
|
38
29
|
|
|
@@ -14,7 +14,6 @@ from codexed.models.base import CodexBaseModel
|
|
|
14
14
|
from codexed.models.event_data import (
|
|
15
15
|
ItemCompletedData,
|
|
16
16
|
ItemStartedData,
|
|
17
|
-
RawResponseItemCompletedData,
|
|
18
17
|
ThreadStartedData,
|
|
19
18
|
TurnCompletedData,
|
|
20
19
|
TurnStartedData,
|
|
@@ -45,6 +44,7 @@ from codexed.models.v2_protocol import (
|
|
|
45
44
|
McpServerOauthLoginCompletedMessage,
|
|
46
45
|
McpServerStartupStatusUpdatedNotification,
|
|
47
46
|
ModelReroutedMessage,
|
|
47
|
+
RawResponseItemCompletedNotification,
|
|
48
48
|
ServerRequestResolvedMessage,
|
|
49
49
|
ThreadArchivedMessage,
|
|
50
50
|
ThreadCompactedMessage,
|
|
@@ -144,7 +144,7 @@ class RawResponseItemCompletedEvent(CodexBaseModel):
|
|
|
144
144
|
"""Raw response item completed event."""
|
|
145
145
|
|
|
146
146
|
method: Literal["rawResponseItem/completed"] = "rawResponseItem/completed"
|
|
147
|
-
params:
|
|
147
|
+
params: RawResponseItemCompletedNotification
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
# ============================================================================
|
|
@@ -179,6 +179,7 @@ class McpTool(CodexBaseModel):
|
|
|
179
179
|
output_schema: dict[str, Any] | None = None
|
|
180
180
|
annotations: ToolAnnotations | None = None
|
|
181
181
|
icons: list[Icon] | None = None
|
|
182
|
+
field_meta: dict[str, Any] | None = None
|
|
182
183
|
|
|
183
184
|
def to_mcp_tool(self) -> Tool:
|
|
184
185
|
from mcp.types import Tool
|
|
@@ -191,6 +192,7 @@ class McpTool(CodexBaseModel):
|
|
|
191
192
|
outputSchema=self.output_schema,
|
|
192
193
|
annotations=self.annotations,
|
|
193
194
|
icons=self.icons,
|
|
195
|
+
_meta=self.field_meta,
|
|
194
196
|
)
|
|
195
197
|
|
|
196
198
|
|
|
@@ -205,6 +207,7 @@ class McpResource(CodexBaseModel):
|
|
|
205
207
|
size: int | None = None
|
|
206
208
|
annotations: Annotations | None = None
|
|
207
209
|
icons: list[Icon] | None = None
|
|
210
|
+
field_meta: dict[str, Any] | None = None
|
|
208
211
|
|
|
209
212
|
def to_mcp_resource(self) -> Resource:
|
|
210
213
|
from mcp.types import Resource
|
|
@@ -218,6 +221,7 @@ class McpResource(CodexBaseModel):
|
|
|
218
221
|
size=self.size,
|
|
219
222
|
annotations=self.annotations,
|
|
220
223
|
icons=self.icons,
|
|
224
|
+
_meta=self.field_meta,
|
|
221
225
|
)
|
|
222
226
|
|
|
223
227
|
|
|
@@ -12,15 +12,7 @@ from codexed.models.misc import (
|
|
|
12
12
|
NetworkPolicyAmendment,
|
|
13
13
|
ToolRequestUserInputQuestion,
|
|
14
14
|
)
|
|
15
|
-
from codexed.models.v2_protocol import
|
|
16
|
-
ApprovalsReviewer,
|
|
17
|
-
AskForApproval,
|
|
18
|
-
CommandAction,
|
|
19
|
-
Personality,
|
|
20
|
-
ResponseItem,
|
|
21
|
-
SandboxMode,
|
|
22
|
-
ServiceTier,
|
|
23
|
-
)
|
|
15
|
+
from codexed.models.v2_protocol import CommandAction
|
|
24
16
|
|
|
25
17
|
|
|
26
18
|
if TYPE_CHECKING:
|
|
@@ -32,26 +24,6 @@ ProductSurface = Literal["chatgpt", "codex", "api", "atlas"]
|
|
|
32
24
|
PersistOption = Literal["session", "always"]
|
|
33
25
|
|
|
34
26
|
|
|
35
|
-
class ThreadResumeParams(CodexBaseModel):
|
|
36
|
-
"""Parameters for thread/resume request."""
|
|
37
|
-
|
|
38
|
-
thread_id: str
|
|
39
|
-
history: list[ResponseItem] | None = None
|
|
40
|
-
path: str | None = None
|
|
41
|
-
cwd: str | None = None
|
|
42
|
-
model: str | None = None
|
|
43
|
-
model_provider: str | None = None
|
|
44
|
-
base_instructions: str | None = None
|
|
45
|
-
developer_instructions: str | None = None
|
|
46
|
-
approval_policy: AskForApproval | None = None
|
|
47
|
-
approvals_reviewer: ApprovalsReviewer | None = None
|
|
48
|
-
sandbox: SandboxMode | None = None
|
|
49
|
-
config: dict[str, Any] | None = None
|
|
50
|
-
service_tier: ServiceTier | None = None
|
|
51
|
-
personality: Personality | None = None
|
|
52
|
-
persist_extended_history: bool = False
|
|
53
|
-
|
|
54
|
-
|
|
55
27
|
class SkillsRemoteListParams(CodexBaseModel):
|
|
56
28
|
"""Parameters for skills/remote/list request."""
|
|
57
29
|
|
|
@@ -166,12 +138,12 @@ class McpElicitationFormParams(_McpElicitationBase):
|
|
|
166
138
|
requested_schema: dict[str, Any]
|
|
167
139
|
|
|
168
140
|
def to_mcp(self) -> ElicitRequestFormParams:
|
|
169
|
-
from mcp.types import ElicitRequestFormParams
|
|
141
|
+
from mcp.types import ElicitRequestFormParams
|
|
170
142
|
|
|
171
143
|
return ElicitRequestFormParams(
|
|
172
144
|
message=self.message,
|
|
173
145
|
requestedSchema=self.requested_schema,
|
|
174
|
-
_meta=
|
|
146
|
+
_meta=ElicitRequestFormParams.Meta(**self.meta) if self.meta else None, # pyright: ignore[reportArgumentType]
|
|
175
147
|
)
|
|
176
148
|
|
|
177
149
|
@classmethod
|
|
@@ -201,13 +173,13 @@ class McpElicitationUrlParams(_McpElicitationBase):
|
|
|
201
173
|
elicitation_id: str
|
|
202
174
|
|
|
203
175
|
def to_mcp(self) -> ElicitRequestURLParams:
|
|
204
|
-
from mcp.types import ElicitRequestURLParams
|
|
176
|
+
from mcp.types import ElicitRequestURLParams
|
|
205
177
|
|
|
206
178
|
return ElicitRequestURLParams(
|
|
207
179
|
message=self.message,
|
|
208
180
|
url=self.url,
|
|
209
181
|
elicitationId=self.elicitation_id,
|
|
210
|
-
_meta=
|
|
182
|
+
_meta=ElicitRequestURLParams.Meta(**self.meta) if self.meta else None, # pyright: ignore[reportArgumentType]
|
|
211
183
|
)
|
|
212
184
|
|
|
213
185
|
@classmethod
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
import mcp.types
|
|
3
|
+
from typing import TYPE_CHECKING, Any
|
|
6
4
|
|
|
7
5
|
from codexed.models.base import CodexBaseModel
|
|
8
6
|
from codexed.models.codex_types import ApprovalDecision, ElicitationAction
|
|
@@ -23,6 +21,10 @@ from codexed.models.v2_protocol import (
|
|
|
23
21
|
)
|
|
24
22
|
|
|
25
23
|
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from mcp.types import ElicitResult
|
|
26
|
+
|
|
27
|
+
|
|
26
28
|
class CommandExecutionRequestApprovalResponse(CodexBaseModel):
|
|
27
29
|
"""Response for item/commandExecution/requestApproval server request."""
|
|
28
30
|
|
|
@@ -63,11 +65,13 @@ class McpServerElicitationResponse(CodexBaseModel):
|
|
|
63
65
|
Must be one of the options listed in the request's ``meta.persist``.
|
|
64
66
|
"""
|
|
65
67
|
|
|
66
|
-
def to_mcp(self) ->
|
|
67
|
-
|
|
68
|
+
def to_mcp(self) -> ElicitResult:
|
|
69
|
+
from mcp.types import ElicitResult
|
|
70
|
+
|
|
71
|
+
return ElicitResult(action=self.action, content=self.content, _meta=self.meta)
|
|
68
72
|
|
|
69
73
|
@classmethod
|
|
70
|
-
def from_mcp(cls, result:
|
|
74
|
+
def from_mcp(cls, result: ElicitResult) -> McpServerElicitationResponse:
|
|
71
75
|
"""Create from MCP ElicitResult."""
|
|
72
76
|
return cls(action=result.action, content=result.content, meta=result.meta)
|
|
73
77
|
|
|
@@ -51,6 +51,14 @@ class BaseThreadItem(CodexBaseModel):
|
|
|
51
51
|
|
|
52
52
|
id: str
|
|
53
53
|
|
|
54
|
+
@property
|
|
55
|
+
def inferred_arguments(self) -> dict[str, Any] | None:
|
|
56
|
+
"""Best-effort reconstruction of tool-call-like arguments.
|
|
57
|
+
|
|
58
|
+
Returns a dict for tool-like items, None for non-tool items.
|
|
59
|
+
"""
|
|
60
|
+
return None
|
|
61
|
+
|
|
54
62
|
|
|
55
63
|
class ThreadItemUserMessage(BaseThreadItem):
|
|
56
64
|
"""User message item."""
|
|
@@ -96,6 +104,10 @@ class ThreadItemCommandExecution(BaseThreadItem):
|
|
|
96
104
|
exit_code: int | None = None
|
|
97
105
|
duration_ms: int | None = None
|
|
98
106
|
|
|
107
|
+
@property
|
|
108
|
+
def inferred_arguments(self) -> dict[str, Any]:
|
|
109
|
+
return {"command": self.command, "cwd": self.cwd}
|
|
110
|
+
|
|
99
111
|
@property
|
|
100
112
|
def item_summary(self) -> str:
|
|
101
113
|
"""Human-readable summary of this command execution."""
|
|
@@ -113,6 +125,10 @@ class ThreadItemFileChange(BaseThreadItem):
|
|
|
113
125
|
changes: list[FileUpdateChange]
|
|
114
126
|
status: PatchApplyStatus
|
|
115
127
|
|
|
128
|
+
@property
|
|
129
|
+
def inferred_arguments(self) -> dict[str, Any]:
|
|
130
|
+
return {"changes": [c.model_dump() for c in self.changes]}
|
|
131
|
+
|
|
116
132
|
@property
|
|
117
133
|
def item_summary(self) -> str:
|
|
118
134
|
"""Human-readable summary of file changes."""
|
|
@@ -134,6 +150,10 @@ class ThreadItemMcpToolCall(BaseThreadItem):
|
|
|
134
150
|
error: McpToolCallError | None = None
|
|
135
151
|
duration_ms: int | None = None
|
|
136
152
|
|
|
153
|
+
@property
|
|
154
|
+
def inferred_arguments(self) -> dict[str, Any] | None:
|
|
155
|
+
return self.arguments
|
|
156
|
+
|
|
137
157
|
@property
|
|
138
158
|
def item_summary(self) -> str:
|
|
139
159
|
"""Human-readable summary of this MCP tool call."""
|
|
@@ -155,6 +175,10 @@ class ThreadItemDynamicToolCall(BaseThreadItem):
|
|
|
155
175
|
success: bool | None = None
|
|
156
176
|
duration_ms: int | None = None
|
|
157
177
|
|
|
178
|
+
@property
|
|
179
|
+
def inferred_arguments(self) -> dict[str, Any] | None:
|
|
180
|
+
return self.arguments
|
|
181
|
+
|
|
158
182
|
|
|
159
183
|
class ThreadItemWebSearch(BaseThreadItem):
|
|
160
184
|
"""Web search item."""
|
|
@@ -163,6 +187,10 @@ class ThreadItemWebSearch(BaseThreadItem):
|
|
|
163
187
|
query: str
|
|
164
188
|
action: WebSearchAction | None = None
|
|
165
189
|
|
|
190
|
+
@property
|
|
191
|
+
def inferred_arguments(self) -> dict[str, Any]:
|
|
192
|
+
return {"query": self.query}
|
|
193
|
+
|
|
166
194
|
@property
|
|
167
195
|
def item_summary(self) -> str:
|
|
168
196
|
"""Human-readable summary of this web search."""
|
|
@@ -175,6 +203,10 @@ class ThreadItemImageView(BaseThreadItem):
|
|
|
175
203
|
type: Literal["imageView"] = "imageView"
|
|
176
204
|
path: str
|
|
177
205
|
|
|
206
|
+
@property
|
|
207
|
+
def inferred_arguments(self) -> dict[str, Any]:
|
|
208
|
+
return {"path": self.path}
|
|
209
|
+
|
|
178
210
|
@property
|
|
179
211
|
def item_summary(self) -> str:
|
|
180
212
|
"""Human-readable summary of this image view."""
|
|
@@ -222,6 +254,15 @@ class ThreadItemCollabAgentToolCall(BaseThreadItem):
|
|
|
222
254
|
prompt: str | None = None
|
|
223
255
|
agents_states: dict[str, CollabAgentState] = Field(default_factory=dict)
|
|
224
256
|
|
|
257
|
+
@property
|
|
258
|
+
def inferred_arguments(self) -> dict[str, Any]:
|
|
259
|
+
args: dict[str, Any] = {"tool": self.tool}
|
|
260
|
+
if self.prompt is not None:
|
|
261
|
+
args["prompt"] = self.prompt
|
|
262
|
+
if self.receiver_thread_ids:
|
|
263
|
+
args["receiver_thread_ids"] = self.receiver_thread_ids
|
|
264
|
+
return args
|
|
265
|
+
|
|
225
266
|
@property
|
|
226
267
|
def item_summary(self) -> str:
|
|
227
268
|
"""Human-readable summary of this collab agent tool call."""
|
|
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
|