codexed 1.1.1__tar.gz → 1.1.3__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.1 → codexed-1.1.3}/PKG-INFO +1 -1
- {codexed-1.1.1 → codexed-1.1.3}/pyproject.toml +1 -1
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/client/__init__.py +2 -1
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/client/client.py +9 -5
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/client/session.py +0 -3
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/codex_types.py +0 -1
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/request_params.py +5 -51
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/responses.py +10 -11
- codexed-1.1.3/src/codexed/models/user_input.py +43 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/v2_protocol.py +63 -3
- codexed-1.1.1/src/codexed/models/user_input.py +0 -58
- {codexed-1.1.1 → codexed-1.1.3}/LICENSE +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/README.md +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/README.md +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/__init__.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/client/dispatch.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/client/fs.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/client/realtime.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/client/skills.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/exceptions.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/helpers.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/log.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/__init__.py +3 -3
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/base.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/event_data.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/events.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/mcp_server.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/misc.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/response_item.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/thread_item.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/models/tool_config.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/py.typed +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/request_handlers.py +0 -0
- {codexed-1.1.1 → codexed-1.1.3}/src/codexed/transport.py +0 -0
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from .client import CodexClient
|
|
4
4
|
from .fs import CodexFS
|
|
5
|
+
from .skills import CodexSkills
|
|
5
6
|
from .realtime import RealtimeSession
|
|
6
7
|
from .session import Session
|
|
7
8
|
|
|
8
|
-
__all__ = ["CodexClient", "CodexFS", "RealtimeSession", "Session"]
|
|
9
|
+
__all__ = ["CodexClient", "CodexFS", "CodexSkills", "RealtimeSession", "Session"]
|
|
@@ -11,6 +11,7 @@ from pydantic import TypeAdapter
|
|
|
11
11
|
|
|
12
12
|
from codexed.client.dispatch import Dispatch
|
|
13
13
|
from codexed.client.fs import CodexFS
|
|
14
|
+
from codexed.client.skills import CodexSkills
|
|
14
15
|
from codexed.helpers import merge_config
|
|
15
16
|
from codexed.models import (
|
|
16
17
|
AppsListParams,
|
|
@@ -88,6 +89,7 @@ if TYPE_CHECKING:
|
|
|
88
89
|
Model,
|
|
89
90
|
Personality,
|
|
90
91
|
SandboxMode,
|
|
92
|
+
SandboxPolicy,
|
|
91
93
|
ServiceTier,
|
|
92
94
|
ThreadSortKey,
|
|
93
95
|
ThreadSourceKind,
|
|
@@ -173,6 +175,7 @@ class CodexClient:
|
|
|
173
175
|
self._mcp_elicitation_for_approvals = mcp_elicitation_for_approvals
|
|
174
176
|
self._server_request_handlers: dict[str, ServerRequestHandler] = {}
|
|
175
177
|
self.fs = CodexFS(self)
|
|
178
|
+
self.skills = CodexSkills(self)
|
|
176
179
|
if on_approval:
|
|
177
180
|
self.register_handler(SERVER_REQUEST_COMMAND_APPROVAL, on_approval) # type: ignore[arg-type]
|
|
178
181
|
self.register_handler(SERVER_REQUEST_FILE_CHANGE_APPROVAL, on_approval) # type: ignore[arg-type]
|
|
@@ -187,11 +190,11 @@ class CodexClient:
|
|
|
187
190
|
async def __aenter__(self) -> Self:
|
|
188
191
|
"""Async context manager entry - starts the app-server."""
|
|
189
192
|
import codexed
|
|
190
|
-
from codexed.models import InitializeParams
|
|
193
|
+
from codexed.models import ClientInfo, InitializeParams
|
|
191
194
|
|
|
192
195
|
await self.dispatch.start()
|
|
193
196
|
version = codexed.__version__
|
|
194
|
-
init_params = InitializeParams
|
|
197
|
+
init_params = InitializeParams(client_info=ClientInfo(name="codexed", version=version))
|
|
195
198
|
await self.dispatch.send_request("initialize", init_params)
|
|
196
199
|
return self
|
|
197
200
|
|
|
@@ -379,7 +382,6 @@ class CodexClient:
|
|
|
379
382
|
tools: list[ToolConfig] | None = None,
|
|
380
383
|
code_mode: bool | None = None,
|
|
381
384
|
service_tier: ServiceTier | None = None,
|
|
382
|
-
personality: Personality | None = None,
|
|
383
385
|
ephemeral: bool | None = None,
|
|
384
386
|
mcp_servers: Mapping[str, McpServerConfig] | None = None,
|
|
385
387
|
turn_id: str | None = None,
|
|
@@ -433,7 +435,6 @@ class CodexClient:
|
|
|
433
435
|
sandbox=sandbox,
|
|
434
436
|
config=cfg,
|
|
435
437
|
service_tier=service_tier,
|
|
436
|
-
personality=personality,
|
|
437
438
|
ephemeral=ephemeral,
|
|
438
439
|
persist_extended_history=persist_extended_history,
|
|
439
440
|
)
|
|
@@ -528,7 +529,8 @@ class CodexClient:
|
|
|
528
529
|
command: list[str],
|
|
529
530
|
*,
|
|
530
531
|
cwd: str | None = None,
|
|
531
|
-
sandbox_policy:
|
|
532
|
+
sandbox_policy: SandboxPolicy | None = None,
|
|
533
|
+
output_bytes_cap: int | None = None,
|
|
532
534
|
timeout_ms: int | None = None,
|
|
533
535
|
) -> CommandExecResponse:
|
|
534
536
|
"""Execute a command without creating a thread/turn.
|
|
@@ -537,6 +539,7 @@ class CodexClient:
|
|
|
537
539
|
command: Command and arguments as list (e.g., ["ls", "-la"])
|
|
538
540
|
cwd: Working directory for command
|
|
539
541
|
sandbox_policy: Sandbox policy override
|
|
542
|
+
output_bytes_cap: Cap output based on bytes
|
|
540
543
|
timeout_ms: Timeout in milliseconds
|
|
541
544
|
|
|
542
545
|
Returns:
|
|
@@ -545,6 +548,7 @@ class CodexClient:
|
|
|
545
548
|
params = CommandExecParams(
|
|
546
549
|
command=command,
|
|
547
550
|
cwd=cwd,
|
|
551
|
+
output_bytes_cap=output_bytes_cap,
|
|
548
552
|
sandbox_policy=sandbox_policy,
|
|
549
553
|
timeout_ms=timeout_ms,
|
|
550
554
|
)
|
|
@@ -425,7 +425,6 @@ class Session:
|
|
|
425
425
|
tools: list[ToolConfig] | None = None,
|
|
426
426
|
code_mode: bool | None = None,
|
|
427
427
|
service_tier: ServiceTier | None = None,
|
|
428
|
-
personality: Personality | None = None,
|
|
429
428
|
ephemeral: bool | None = None,
|
|
430
429
|
mcp_servers: Mapping[str, McpServerConfig] | None = None,
|
|
431
430
|
turn_id: str | None = None,
|
|
@@ -447,7 +446,6 @@ class Session:
|
|
|
447
446
|
tools: Builtin tool configurations for forked thread
|
|
448
447
|
code_mode: Enable experimental code mode feature flag
|
|
449
448
|
service_tier: Service tier (fast/flex)
|
|
450
|
-
personality: Personality for forked thread
|
|
451
449
|
ephemeral: If true, forked thread is not persisted
|
|
452
450
|
mcp_servers: Per-thread MCP server configurations
|
|
453
451
|
turn_id: If provided, rollback the forked thread to this turn
|
|
@@ -471,7 +469,6 @@ class Session:
|
|
|
471
469
|
tools=tools,
|
|
472
470
|
code_mode=code_mode,
|
|
473
471
|
service_tier=service_tier,
|
|
474
|
-
personality=personality,
|
|
475
472
|
ephemeral=ephemeral,
|
|
476
473
|
mcp_servers=mcp_servers,
|
|
477
474
|
turn_id=turn_id,
|
|
@@ -13,7 +13,6 @@ from codexed.models.v2_protocol import NetworkAccess, RestrictedReadOnlyAccess
|
|
|
13
13
|
# Type aliases for Codex types
|
|
14
14
|
ApprovalPolicy = Literal["untrusted", "on-failure", "on-request", "never"]
|
|
15
15
|
ItemStatus = Literal["pending", "running", "completed", "error"]
|
|
16
|
-
McpElicitationAction = Literal["accept", "decline", "cancel"]
|
|
17
16
|
McpServerStartupState = Literal["starting", "ready", "failed", "cancelled"]
|
|
18
17
|
"""Action taken by the user on an elicitation request."""
|
|
19
18
|
ApprovalDecision = Literal["allow", "allowForSession", "deny", "denyForSession"]
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from typing import TYPE_CHECKING, Annotated, Any, Literal, Required, Self, TypedDict
|
|
3
|
+
from typing import TYPE_CHECKING, Annotated, Any, Literal, Required, TypedDict
|
|
5
4
|
|
|
6
5
|
from pydantic import Discriminator, TypeAdapter
|
|
7
6
|
|
|
8
7
|
from codexed.models.base import CodexBaseModel
|
|
9
|
-
from codexed.models.codex_types import ApprovalDecision
|
|
8
|
+
from codexed.models.codex_types import ApprovalDecision
|
|
10
9
|
from codexed.models.misc import (
|
|
11
10
|
ExecPolicyAmendment,
|
|
12
11
|
NetworkApprovalContext,
|
|
@@ -14,16 +13,11 @@ from codexed.models.misc import (
|
|
|
14
13
|
ToolRequestUserInputQuestion,
|
|
15
14
|
)
|
|
16
15
|
from codexed.models.response_item import ResponseItem
|
|
17
|
-
from codexed.models.user_input import UserInput
|
|
18
16
|
from codexed.models.v2_protocol import (
|
|
19
17
|
ApprovalsReviewer,
|
|
20
18
|
AskForApproval,
|
|
21
|
-
ClientInfo,
|
|
22
|
-
CollaborationMode,
|
|
23
19
|
CommandAction,
|
|
24
20
|
Personality,
|
|
25
|
-
ReasoningEffort,
|
|
26
|
-
ReasoningSummary,
|
|
27
21
|
SandboxMode,
|
|
28
22
|
ServiceTier,
|
|
29
23
|
)
|
|
@@ -35,16 +29,7 @@ if TYPE_CHECKING:
|
|
|
35
29
|
|
|
36
30
|
HazelnutScope = Literal["example", "workspace-shared", "all-shared", "personal"]
|
|
37
31
|
ProductSurface = Literal["chatgpt", "codex", "api", "atlas"]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class InitializeParams(CodexBaseModel):
|
|
41
|
-
"""Parameters for initialize request."""
|
|
42
|
-
|
|
43
|
-
client_info: ClientInfo
|
|
44
|
-
|
|
45
|
-
@classmethod
|
|
46
|
-
def create(cls, name: str, version: str) -> Self:
|
|
47
|
-
return cls(client_info=ClientInfo(name=name, version=version))
|
|
32
|
+
PersistOption = Literal["session", "always"]
|
|
48
33
|
|
|
49
34
|
|
|
50
35
|
class ThreadResumeParams(CodexBaseModel):
|
|
@@ -67,32 +52,6 @@ class ThreadResumeParams(CodexBaseModel):
|
|
|
67
52
|
persist_extended_history: bool = False
|
|
68
53
|
|
|
69
54
|
|
|
70
|
-
class TurnStartParams(CodexBaseModel):
|
|
71
|
-
"""Parameters for turn/start request."""
|
|
72
|
-
|
|
73
|
-
thread_id: str
|
|
74
|
-
input: Sequence[UserInput]
|
|
75
|
-
model: str | None = None
|
|
76
|
-
effort: ReasoningEffort | None = None
|
|
77
|
-
approval_policy: ApprovalPolicy | None = None
|
|
78
|
-
approvals_reviewer: ApprovalsReviewer | None = None
|
|
79
|
-
cwd: str | None = None
|
|
80
|
-
sandbox_policy: dict[str, Any] | None = None # Sandbox config - flexible structure
|
|
81
|
-
service_tier: ServiceTier | None = None
|
|
82
|
-
summary: ReasoningSummary | None = None
|
|
83
|
-
output_schema: dict[str, Any] | None = None # JSON Schema - arbitrary structure
|
|
84
|
-
personality: Personality | None = None
|
|
85
|
-
collaboration_mode: CollaborationMode | None = None
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class TurnSteerParams(CodexBaseModel):
|
|
89
|
-
"""Parameters for turn/steer request."""
|
|
90
|
-
|
|
91
|
-
thread_id: str
|
|
92
|
-
input: Sequence[UserInput]
|
|
93
|
-
expected_turn_id: str
|
|
94
|
-
|
|
95
|
-
|
|
96
55
|
class SkillsRemoteListParams(CodexBaseModel):
|
|
97
56
|
"""Parameters for skills/remote/list request."""
|
|
98
57
|
|
|
@@ -166,9 +125,6 @@ class DynamicToolCallParams(CodexBaseModel):
|
|
|
166
125
|
arguments: Any
|
|
167
126
|
|
|
168
127
|
|
|
169
|
-
PersistOption = Literal["session", "always"]
|
|
170
|
-
|
|
171
|
-
|
|
172
128
|
class ToolApprovalParamDisplay(TypedDict):
|
|
173
129
|
"""A rendered tool parameter for display."""
|
|
174
130
|
|
|
@@ -229,11 +185,10 @@ class McpElicitationFormParams(_McpElicitationBase):
|
|
|
229
185
|
turn_id: str | None = None,
|
|
230
186
|
) -> McpElicitationFormParams:
|
|
231
187
|
"""Create from MCP ElicitRequestFormParams."""
|
|
232
|
-
meta = params.meta.model_dump(exclude={"progressToken"}) if params.meta else None
|
|
233
188
|
return cls(
|
|
234
189
|
message=params.message,
|
|
235
190
|
requested_schema=dict(params.requestedSchema),
|
|
236
|
-
meta=meta,
|
|
191
|
+
meta=params.meta.model_dump(exclude={"progressToken"}) if params.meta else None,
|
|
237
192
|
thread_id=thread_id,
|
|
238
193
|
server_name=server_name,
|
|
239
194
|
turn_id=turn_id,
|
|
@@ -268,12 +223,11 @@ class McpElicitationUrlParams(_McpElicitationBase):
|
|
|
268
223
|
turn_id: str | None = None,
|
|
269
224
|
) -> McpElicitationUrlParams:
|
|
270
225
|
"""Create from MCP ElicitRequestURLParams."""
|
|
271
|
-
meta = params.meta.model_dump(exclude={"progressToken"}) if params.meta else None
|
|
272
226
|
return cls(
|
|
273
227
|
message=params.message,
|
|
274
228
|
url=params.url,
|
|
275
229
|
elicitation_id=params.elicitationId,
|
|
276
|
-
meta=meta,
|
|
230
|
+
meta=params.meta.model_dump(exclude={"progressToken"}) if params.meta else None,
|
|
277
231
|
thread_id=thread_id,
|
|
278
232
|
server_name=server_name,
|
|
279
233
|
turn_id=turn_id,
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any
|
|
4
4
|
|
|
5
5
|
import mcp.types
|
|
6
6
|
|
|
7
7
|
from codexed.models.base import CodexBaseModel
|
|
8
|
-
from codexed.models.codex_types import
|
|
8
|
+
from codexed.models.codex_types import (
|
|
9
|
+
ApprovalDecision,
|
|
10
|
+
AskForApproval,
|
|
11
|
+
ElicitationAction,
|
|
12
|
+
SandboxPolicy,
|
|
13
|
+
)
|
|
9
14
|
from codexed.models.misc import (
|
|
10
15
|
McpServerStatusEntry,
|
|
11
16
|
Thread,
|
|
@@ -16,8 +21,8 @@ from codexed.models.misc import (
|
|
|
16
21
|
from codexed.models.v2_protocol import (
|
|
17
22
|
AuthMode,
|
|
18
23
|
DynamicToolCallOutputContentItem,
|
|
19
|
-
ExternalAgentConfigMigrationItem,
|
|
20
24
|
ReasoningEffort,
|
|
25
|
+
ServiceTier,
|
|
21
26
|
)
|
|
22
27
|
|
|
23
28
|
|
|
@@ -49,7 +54,7 @@ class DynamicToolCallResponse(CodexBaseModel):
|
|
|
49
54
|
class McpServerElicitationResponse(CodexBaseModel):
|
|
50
55
|
"""Response for mcpServer/elicitation/request server request."""
|
|
51
56
|
|
|
52
|
-
action:
|
|
57
|
+
action: ElicitationAction
|
|
53
58
|
content: Any | None = None
|
|
54
59
|
meta: Any | None = None
|
|
55
60
|
"""Optional metadata to include in the response.
|
|
@@ -86,7 +91,7 @@ class ThreadResponse(CodexBaseModel):
|
|
|
86
91
|
approval_policy: AskForApproval
|
|
87
92
|
sandbox: SandboxPolicy
|
|
88
93
|
reasoning_effort: ReasoningEffort | None = None
|
|
89
|
-
service_tier:
|
|
94
|
+
service_tier: ServiceTier | None = None
|
|
90
95
|
|
|
91
96
|
|
|
92
97
|
class TurnStartResponse(CodexBaseModel):
|
|
@@ -161,9 +166,3 @@ class LoginAccountResponse(CodexBaseModel):
|
|
|
161
166
|
type: AuthMode
|
|
162
167
|
login_id: str | None = None
|
|
163
168
|
auth_url: str | None = None
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
class ExternalAgentConfigDetectResponse(CodexBaseModel):
|
|
167
|
-
"""Response for externalAgentConfig/detect request."""
|
|
168
|
-
|
|
169
|
-
items: list[ExternalAgentConfigMigrationItem]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import base64
|
|
4
|
+
from typing import Self
|
|
5
|
+
|
|
6
|
+
from codexed.models.v2_protocol import (
|
|
7
|
+
ImageUserInput as CodexImageUserInput,
|
|
8
|
+
LocalImageUserInput as CodexLocalImageUserInput,
|
|
9
|
+
MentionUserInput as CodexMentionUserInput,
|
|
10
|
+
SkillUserInput as CodexSkillUserInput,
|
|
11
|
+
TextUserInput as CodexTextUserInput,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TextUserInput(CodexTextUserInput):
|
|
16
|
+
"""Text user input."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ImageUserInput(CodexImageUserInput):
|
|
20
|
+
"""Image URL user input."""
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def from_bytes(cls, data: bytes, media_type: str) -> Self:
|
|
24
|
+
"""Create from raw bytes as a base64 data URI."""
|
|
25
|
+
b64 = base64.b64encode(data).decode()
|
|
26
|
+
data_uri = f"data:{media_type};base64,{b64}"
|
|
27
|
+
return cls(url=data_uri)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class LocalImageUserInput(CodexLocalImageUserInput):
|
|
31
|
+
"""Local image file user input."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class SkillUserInput(CodexSkillUserInput):
|
|
35
|
+
"""Skill file user input."""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class MentionUserInput(CodexMentionUserInput):
|
|
39
|
+
"""Mention user input."""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# Discriminated union of user input types
|
|
43
|
+
UserInput = TextUserInput | ImageUserInput | LocalImageUserInput | SkillUserInput | MentionUserInput
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: codex_app_server_protocol.v2.schemas.json
|
|
3
|
-
# timestamp: 2026-
|
|
4
|
-
# command: datamodel-codegen --input /tmp/user/1000/codex-schema-
|
|
3
|
+
# timestamp: 2026-04-01T16:01:18+00:00
|
|
4
|
+
# command: datamodel-codegen --input /tmp/user/1000/codex-schema-4fyk5nzw/codex_app_server_protocol.v2.schemas.json --input-file-type jsonschema --output /home/phil65/dev/oss/codexed/src/codexed/models/v2_protocol.py --output-model-type pydantic_v2.BaseModel --target-python-version 3.13 --target-pydantic-version 2 --use-standard-collections --use-standard-primitive-types --snake-case-field --no-alias --base-class codexed.models.base.CodexBaseModel --field-constraints --use-schema-description --use-field-description --use-double-quotes --enum-field-as-literal all --use-one-literal-as-default --keep-model-order --use-title-as-name --enable-command-header --use-type-alias --formatters ruff-check ruff-format
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
@@ -414,6 +414,27 @@ class ChatgptAuthTokensv2LoginAccountResponse(CodexBaseModel):
|
|
|
414
414
|
|
|
415
415
|
|
|
416
416
|
|
|
417
|
+
class ChatgptDeviceCodev2LoginAccountParams(CodexBaseModel):
|
|
418
|
+
type: Literal["chatgptDeviceCode"] = "chatgptDeviceCode"
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
class ChatgptDeviceCodev2LoginAccountResponse(CodexBaseModel):
|
|
424
|
+
login_id: str
|
|
425
|
+
type: Literal["chatgptDeviceCode"] = "chatgptDeviceCode"
|
|
426
|
+
user_code: str
|
|
427
|
+
"""
|
|
428
|
+
One-time code the user must enter after signing in.
|
|
429
|
+
"""
|
|
430
|
+
verification_url: str
|
|
431
|
+
"""
|
|
432
|
+
URL the client should open in a browser to complete device code authorization.
|
|
433
|
+
"""
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
417
438
|
class Chatgptv2LoginAccountParams(CodexBaseModel):
|
|
418
439
|
type: Literal["chatgpt"] = "chatgpt"
|
|
419
440
|
|
|
@@ -2421,6 +2442,7 @@ type LocalShellStatus = Literal["completed", "in_progress", "incomplete"]
|
|
|
2421
2442
|
type LoginAccountParams = Annotated[
|
|
2422
2443
|
ApiKeyv2LoginAccountParams
|
|
2423
2444
|
| Chatgptv2LoginAccountParams
|
|
2445
|
+
| ChatgptDeviceCodev2LoginAccountParams
|
|
2424
2446
|
| ChatgptAuthTokensv2LoginAccountParams,
|
|
2425
2447
|
Field(..., title="LoginAccountParams"),
|
|
2426
2448
|
]
|
|
@@ -2429,6 +2451,7 @@ type LoginAccountParams = Annotated[
|
|
|
2429
2451
|
type LoginAccountResponse = Annotated[
|
|
2430
2452
|
ApiKeyv2LoginAccountResponse
|
|
2431
2453
|
| Chatgptv2LoginAccountResponse
|
|
2454
|
+
| ChatgptDeviceCodev2LoginAccountResponse
|
|
2432
2455
|
| ChatgptAuthTokensv2LoginAccountResponse,
|
|
2433
2456
|
Field(..., title="LoginAccountResponse"),
|
|
2434
2457
|
]
|
|
@@ -2726,17 +2749,44 @@ class ModelUpgradeInfo(CodexBaseModel):
|
|
|
2726
2749
|
type NetworkAccess = Literal["restricted", "enabled"]
|
|
2727
2750
|
|
|
2728
2751
|
|
|
2752
|
+
type NetworkDomainPermission = Literal["allow", "deny"]
|
|
2753
|
+
|
|
2754
|
+
|
|
2729
2755
|
class NetworkRequirements(CodexBaseModel):
|
|
2730
2756
|
allow_local_binding: bool | None = None
|
|
2731
2757
|
allow_unix_sockets: list[str] | None = None
|
|
2758
|
+
"""
|
|
2759
|
+
Legacy compatibility view derived from `unix_sockets`.
|
|
2760
|
+
"""
|
|
2732
2761
|
allow_upstream_proxy: bool | None = None
|
|
2733
2762
|
allowed_domains: list[str] | None = None
|
|
2763
|
+
"""
|
|
2764
|
+
Legacy compatibility view derived from `domains`.
|
|
2765
|
+
"""
|
|
2734
2766
|
dangerously_allow_all_unix_sockets: bool | None = None
|
|
2735
2767
|
dangerously_allow_non_loopback_proxy: bool | None = None
|
|
2736
2768
|
denied_domains: list[str] | None = None
|
|
2769
|
+
"""
|
|
2770
|
+
Legacy compatibility view derived from `domains`.
|
|
2771
|
+
"""
|
|
2772
|
+
domains: dict[str, Any] | None = None
|
|
2773
|
+
"""
|
|
2774
|
+
Canonical network permission map for `experimental_network`.
|
|
2775
|
+
"""
|
|
2737
2776
|
enabled: bool | None = None
|
|
2738
2777
|
http_port: int | None = Field(None, ge=0)
|
|
2778
|
+
managed_allowed_domains_only: bool | None = None
|
|
2779
|
+
"""
|
|
2780
|
+
When true, only managed allowlist entries are respected while managed network enforcement is active.
|
|
2781
|
+
"""
|
|
2739
2782
|
socks_port: int | None = Field(None, ge=0)
|
|
2783
|
+
unix_sockets: dict[str, Any] | None = None
|
|
2784
|
+
"""
|
|
2785
|
+
Canonical unix socket permission map for `experimental_network`.
|
|
2786
|
+
"""
|
|
2787
|
+
|
|
2788
|
+
|
|
2789
|
+
type NetworkUnixSocketPermission = Literal["allow", "none"]
|
|
2740
2790
|
|
|
2741
2791
|
|
|
2742
2792
|
type NonSteerableTurnKind = Literal["review", "compact"]
|
|
@@ -2829,7 +2879,17 @@ class PlanThreadItem(CodexBaseModel):
|
|
|
2829
2879
|
|
|
2830
2880
|
|
|
2831
2881
|
type PlanType = Literal[
|
|
2832
|
-
"free",
|
|
2882
|
+
"free",
|
|
2883
|
+
"go",
|
|
2884
|
+
"plus",
|
|
2885
|
+
"pro",
|
|
2886
|
+
"team",
|
|
2887
|
+
"self_serve_business_usage_based",
|
|
2888
|
+
"business",
|
|
2889
|
+
"enterprise_cbp_usage_based",
|
|
2890
|
+
"enterprise",
|
|
2891
|
+
"edu",
|
|
2892
|
+
"unknown",
|
|
2833
2893
|
]
|
|
2834
2894
|
|
|
2835
2895
|
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import base64
|
|
4
|
-
from typing import Literal, Self
|
|
5
|
-
|
|
6
|
-
from pydantic import Field
|
|
7
|
-
|
|
8
|
-
from codexed.models.base import CodexBaseModel
|
|
9
|
-
from codexed.models.v2_protocol import TextElement
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class TextUserInput(CodexBaseModel):
|
|
13
|
-
"""Text user input."""
|
|
14
|
-
|
|
15
|
-
type: Literal["text"] = "text"
|
|
16
|
-
text: str
|
|
17
|
-
text_elements: list[TextElement] = Field(default_factory=list)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class ImageUserInput(CodexBaseModel):
|
|
21
|
-
"""Image URL user input."""
|
|
22
|
-
|
|
23
|
-
type: Literal["image"] = "image"
|
|
24
|
-
url: str
|
|
25
|
-
|
|
26
|
-
@classmethod
|
|
27
|
-
def from_bytes(cls, data: bytes, media_type: str) -> Self:
|
|
28
|
-
"""Create from raw bytes as a base64 data URI."""
|
|
29
|
-
b64 = base64.b64encode(data).decode()
|
|
30
|
-
data_uri = f"data:{media_type};base64,{b64}"
|
|
31
|
-
return cls(url=data_uri)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class LocalImageUserInput(CodexBaseModel):
|
|
35
|
-
"""Local image file user input."""
|
|
36
|
-
|
|
37
|
-
type: Literal["localImage"] = "localImage"
|
|
38
|
-
path: str
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class SkillUserInput(CodexBaseModel):
|
|
42
|
-
"""Skill file user input."""
|
|
43
|
-
|
|
44
|
-
type: Literal["skill"] = "skill"
|
|
45
|
-
name: str
|
|
46
|
-
path: str
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class MentionUserInput(CodexBaseModel):
|
|
50
|
-
"""Mention user input."""
|
|
51
|
-
|
|
52
|
-
type: Literal["mention"] = "mention"
|
|
53
|
-
name: str
|
|
54
|
-
path: str
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
# Discriminated union of user input types
|
|
58
|
-
UserInput = TextUserInput | ImageUserInput | LocalImageUserInput | SkillUserInput | MentionUserInput
|
|
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
|
|
@@ -68,11 +68,11 @@ from codexed.models.misc import (
|
|
|
68
68
|
TurnData,
|
|
69
69
|
)
|
|
70
70
|
from codexed.models.request_params import (
|
|
71
|
-
InitializeParams,
|
|
72
71
|
HazelnutScope,
|
|
73
72
|
ProductSurface,
|
|
74
73
|
CommandExecutionRequestApprovalParams,
|
|
75
74
|
DynamicToolCallParams,
|
|
75
|
+
ThreadResumeParams,
|
|
76
76
|
FileChangeRequestApprovalParams,
|
|
77
77
|
McpElicitationFormParams,
|
|
78
78
|
McpElicitationUrlParams,
|
|
@@ -86,7 +86,6 @@ from codexed.models.request_params import (
|
|
|
86
86
|
from codexed.models.responses import (
|
|
87
87
|
CommandExecutionRequestApprovalResponse,
|
|
88
88
|
DynamicToolCallResponse,
|
|
89
|
-
ExternalAgentConfigDetectResponse,
|
|
90
89
|
FileChangeRequestApprovalResponse,
|
|
91
90
|
ListMcpServerStatusResponse,
|
|
92
91
|
LoginAccountResponse,
|
|
@@ -161,11 +160,13 @@ from codexed.models.user_input import (
|
|
|
161
160
|
from codexed.models.v2_protocol import (
|
|
162
161
|
ByteRange,
|
|
163
162
|
ExternalAgentConfigImportParams,
|
|
163
|
+
InitializeParams,
|
|
164
164
|
CommandExecParams,
|
|
165
165
|
ThreadStartParams,
|
|
166
166
|
ThreadForkParams,
|
|
167
167
|
CompactionResponseItem,
|
|
168
168
|
ContentItem,
|
|
169
|
+
ExternalAgentConfigDetectResponse,
|
|
169
170
|
CustomToolCallOutputResponseItem,
|
|
170
171
|
CustomToolCallResponseItem,
|
|
171
172
|
FunctionCallOutputResponseItem,
|
|
@@ -180,7 +181,6 @@ from codexed.models.v2_protocol import (
|
|
|
180
181
|
WebSearchCallResponseItem,
|
|
181
182
|
ReviewStartParams,
|
|
182
183
|
ReviewTarget,
|
|
183
|
-
ThreadResumeParams,
|
|
184
184
|
TurnStartParams,
|
|
185
185
|
TurnSteerParams,
|
|
186
186
|
ConfigBatchWriteParams,
|
|
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
|