codexed 1.1.0__tar.gz → 1.1.2__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.0 → codexed-1.1.2}/PKG-INFO +1 -1
- {codexed-1.1.0 → codexed-1.1.2}/pyproject.toml +1 -1
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/__init__.py +10 -12
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/client/__init__.py +2 -1
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/client/client.py +9 -90
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/client/session.py +3 -6
- codexed-1.1.2/src/codexed/client/skills.py +104 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/__init__.py +84 -91
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/event_data.py +0 -8
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/request_params.py +8 -164
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/responses.py +0 -6
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/tool_config.py +2 -9
- codexed-1.1.2/src/codexed/models/user_input.py +43 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/v2_protocol.py +63 -3
- codexed-1.1.0/src/codexed/models/user_input.py +0 -58
- {codexed-1.1.0 → codexed-1.1.2}/LICENSE +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/README.md +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/README.md +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/client/dispatch.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/client/fs.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/client/realtime.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/exceptions.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/helpers.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/log.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/base.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/codex_types.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/events.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/mcp_server.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/misc.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/response_item.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/models/thread_item.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/py.typed +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/request_handlers.py +0 -0
- {codexed-1.1.0 → codexed-1.1.2}/src/codexed/transport.py +0 -0
|
@@ -61,15 +61,14 @@ from codexed.models import (
|
|
|
61
61
|
ThreadUnarchiveResponse,
|
|
62
62
|
TokenUsageBreakdown,
|
|
63
63
|
TurnCompletedData,
|
|
64
|
-
TurnErrorData,
|
|
65
64
|
TurnStartedData,
|
|
66
65
|
TurnSteerResponse,
|
|
67
66
|
UserInput,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
ImageUserInput,
|
|
68
|
+
LocalImageUserInput,
|
|
69
|
+
MentionUserInput,
|
|
70
|
+
SkillUserInput,
|
|
71
|
+
TextUserInput,
|
|
73
72
|
ApprovalPolicy,
|
|
74
73
|
AskForApproval,
|
|
75
74
|
CollaborationMode,
|
|
@@ -177,6 +176,7 @@ __all__ = [
|
|
|
177
176
|
"ExternalSandboxPolicy",
|
|
178
177
|
"FsChangedMessage",
|
|
179
178
|
"HttpMcpServer",
|
|
179
|
+
"ImageUserInput",
|
|
180
180
|
"InputModality",
|
|
181
181
|
"InternalRpcError",
|
|
182
182
|
"InvalidParamsError",
|
|
@@ -189,9 +189,11 @@ __all__ = [
|
|
|
189
189
|
"ItemReasoningTextDeltaNotification",
|
|
190
190
|
"ItemStartedEvent",
|
|
191
191
|
"ItemStatus",
|
|
192
|
+
"LocalImageUserInput",
|
|
192
193
|
"McpAuthStatus",
|
|
193
194
|
"McpElicitationHandler",
|
|
194
195
|
"McpServerConfig",
|
|
196
|
+
"MentionUserInput",
|
|
195
197
|
"MessagePhase",
|
|
196
198
|
"MethodNotFoundError",
|
|
197
199
|
"ModeKind",
|
|
@@ -222,8 +224,10 @@ __all__ = [
|
|
|
222
224
|
"SkillApprovalDecision",
|
|
223
225
|
"SkillMetadata",
|
|
224
226
|
"SkillScope",
|
|
227
|
+
"SkillUserInput",
|
|
225
228
|
"StdioMcpServer",
|
|
226
229
|
"StdioTransport",
|
|
230
|
+
"TextUserInput",
|
|
227
231
|
"Thread",
|
|
228
232
|
"ThreadActiveFlag",
|
|
229
233
|
"ThreadArchivedMessage",
|
|
@@ -250,7 +254,6 @@ __all__ = [
|
|
|
250
254
|
"TransportClosedError",
|
|
251
255
|
"TurnCompletedData",
|
|
252
256
|
"TurnCompletedEvent",
|
|
253
|
-
"TurnErrorData",
|
|
254
257
|
"TurnFailedError",
|
|
255
258
|
"TurnPlanUpdatedMessage",
|
|
256
259
|
"TurnStartedData",
|
|
@@ -259,11 +262,6 @@ __all__ = [
|
|
|
259
262
|
"TurnSteerResponse",
|
|
260
263
|
"UserInput",
|
|
261
264
|
"UserInputHandler",
|
|
262
|
-
"UserInputImage",
|
|
263
|
-
"UserInputLocalImage",
|
|
264
|
-
"UserInputMention",
|
|
265
|
-
"UserInputSkill",
|
|
266
|
-
"UserInputText",
|
|
267
265
|
"WebSocketTransport",
|
|
268
266
|
"WorkspaceWriteSandboxPolicy",
|
|
269
267
|
"is_retryable_error",
|
|
@@ -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,
|
|
@@ -44,13 +45,6 @@ from codexed.models import (
|
|
|
44
45
|
McpServerOauthLoginResponse,
|
|
45
46
|
ModelListParams,
|
|
46
47
|
ModelListResponse,
|
|
47
|
-
SkillsConfigWriteParams,
|
|
48
|
-
SkillsListParams,
|
|
49
|
-
SkillsListResponse,
|
|
50
|
-
SkillsRemoteExportParams,
|
|
51
|
-
SkillsRemoteExportResponse,
|
|
52
|
-
SkillsRemoteListParams,
|
|
53
|
-
SkillsRemoteListResponse,
|
|
54
48
|
ThreadForkParams,
|
|
55
49
|
ThreadListParams,
|
|
56
50
|
ThreadListResponse,
|
|
@@ -90,16 +84,13 @@ if TYPE_CHECKING:
|
|
|
90
84
|
DynamicToolSpec,
|
|
91
85
|
ExperimentalFeature,
|
|
92
86
|
ExternalAgentConfigMigrationItem,
|
|
93
|
-
HazelnutScope,
|
|
94
87
|
McpServerConfig,
|
|
95
88
|
MergeStrategy,
|
|
96
89
|
Model,
|
|
97
90
|
Personality,
|
|
98
|
-
ProductSurface,
|
|
99
|
-
RemoteSkillSummary,
|
|
100
91
|
SandboxMode,
|
|
92
|
+
SandboxPolicy,
|
|
101
93
|
ServiceTier,
|
|
102
|
-
SkillMetadata,
|
|
103
94
|
ThreadSortKey,
|
|
104
95
|
ThreadSourceKind,
|
|
105
96
|
ToolConfig,
|
|
@@ -184,6 +175,7 @@ class CodexClient:
|
|
|
184
175
|
self._mcp_elicitation_for_approvals = mcp_elicitation_for_approvals
|
|
185
176
|
self._server_request_handlers: dict[str, ServerRequestHandler] = {}
|
|
186
177
|
self.fs = CodexFS(self)
|
|
178
|
+
self.skills = CodexSkills(self)
|
|
187
179
|
if on_approval:
|
|
188
180
|
self.register_handler(SERVER_REQUEST_COMMAND_APPROVAL, on_approval) # type: ignore[arg-type]
|
|
189
181
|
self.register_handler(SERVER_REQUEST_FILE_CHANGE_APPROVAL, on_approval) # type: ignore[arg-type]
|
|
@@ -390,7 +382,6 @@ class CodexClient:
|
|
|
390
382
|
tools: list[ToolConfig] | None = None,
|
|
391
383
|
code_mode: bool | None = None,
|
|
392
384
|
service_tier: ServiceTier | None = None,
|
|
393
|
-
personality: Personality | None = None,
|
|
394
385
|
ephemeral: bool | None = None,
|
|
395
386
|
mcp_servers: Mapping[str, McpServerConfig] | None = None,
|
|
396
387
|
turn_id: str | None = None,
|
|
@@ -444,7 +435,6 @@ class CodexClient:
|
|
|
444
435
|
sandbox=sandbox,
|
|
445
436
|
config=cfg,
|
|
446
437
|
service_tier=service_tier,
|
|
447
|
-
personality=personality,
|
|
448
438
|
ephemeral=ephemeral,
|
|
449
439
|
persist_extended_history=persist_extended_history,
|
|
450
440
|
)
|
|
@@ -502,81 +492,6 @@ class CodexClient:
|
|
|
502
492
|
response = ThreadLoadedListResponse.model_validate(result)
|
|
503
493
|
return response.data
|
|
504
494
|
|
|
505
|
-
# ========================================================================
|
|
506
|
-
# Skills methods
|
|
507
|
-
# ========================================================================
|
|
508
|
-
|
|
509
|
-
async def skills_list(
|
|
510
|
-
self,
|
|
511
|
-
*,
|
|
512
|
-
cwds: list[str] | None = None,
|
|
513
|
-
force_reload: bool | None = None,
|
|
514
|
-
) -> list[SkillMetadata]:
|
|
515
|
-
"""List available skills.
|
|
516
|
-
|
|
517
|
-
Args:
|
|
518
|
-
cwds: Optional working directories to scope skills
|
|
519
|
-
force_reload: Force reload of skills cache
|
|
520
|
-
|
|
521
|
-
Returns:
|
|
522
|
-
List of skills with metadata
|
|
523
|
-
"""
|
|
524
|
-
params = SkillsListParams(cwds=cwds, force_reload=force_reload)
|
|
525
|
-
result = await self.dispatch.send_request("skills/list", params)
|
|
526
|
-
response = SkillsListResponse.model_validate(result)
|
|
527
|
-
if response.data:
|
|
528
|
-
return response.data[0].skills
|
|
529
|
-
return []
|
|
530
|
-
|
|
531
|
-
async def skills_config_write(self, path: str, *, enabled: bool) -> None:
|
|
532
|
-
"""Write skills configuration.
|
|
533
|
-
|
|
534
|
-
Args:
|
|
535
|
-
path: Path to the skill
|
|
536
|
-
enabled: Whether the skill is enabled
|
|
537
|
-
"""
|
|
538
|
-
params = SkillsConfigWriteParams(path=path, enabled=enabled)
|
|
539
|
-
await self.dispatch.send_request("skills/config/write", params)
|
|
540
|
-
|
|
541
|
-
async def skills_remote_list(
|
|
542
|
-
self,
|
|
543
|
-
*,
|
|
544
|
-
hazelnut_scope: HazelnutScope = "example",
|
|
545
|
-
product_surface: ProductSurface = "codex",
|
|
546
|
-
enabled: bool = False,
|
|
547
|
-
) -> list[RemoteSkillSummary]:
|
|
548
|
-
"""List remote skills.
|
|
549
|
-
|
|
550
|
-
Args:
|
|
551
|
-
hazelnut_scope: Scope filter (example/workspace-shared/all-shared/personal)
|
|
552
|
-
product_surface: Product surface filter (chatgpt/codex/api/atlas)
|
|
553
|
-
enabled: Whether to filter by enabled status
|
|
554
|
-
|
|
555
|
-
Returns:
|
|
556
|
-
List of remote skill summaries
|
|
557
|
-
"""
|
|
558
|
-
params = SkillsRemoteListParams(
|
|
559
|
-
hazelnut_scope=hazelnut_scope,
|
|
560
|
-
product_surface=product_surface,
|
|
561
|
-
enabled=enabled,
|
|
562
|
-
)
|
|
563
|
-
result = await self.dispatch.send_request("skills/remote/list", params)
|
|
564
|
-
response = SkillsRemoteListResponse.model_validate(result)
|
|
565
|
-
return response.data
|
|
566
|
-
|
|
567
|
-
async def skills_remote_export(self, hazelnut_id: str) -> SkillsRemoteExportResponse:
|
|
568
|
-
"""Export a skill to remote storage.
|
|
569
|
-
|
|
570
|
-
Args:
|
|
571
|
-
hazelnut_id: ID of the remote skill to export
|
|
572
|
-
|
|
573
|
-
Returns:
|
|
574
|
-
SkillsRemoteExportResponse with id and local path
|
|
575
|
-
"""
|
|
576
|
-
params = SkillsRemoteExportParams(hazelnut_id=hazelnut_id)
|
|
577
|
-
result = await self.dispatch.send_request("skills/remote/export", params)
|
|
578
|
-
return SkillsRemoteExportResponse.model_validate(result)
|
|
579
|
-
|
|
580
495
|
# ========================================================================
|
|
581
496
|
# Model methods
|
|
582
497
|
# ========================================================================
|
|
@@ -614,7 +529,8 @@ class CodexClient:
|
|
|
614
529
|
command: list[str],
|
|
615
530
|
*,
|
|
616
531
|
cwd: str | None = None,
|
|
617
|
-
sandbox_policy:
|
|
532
|
+
sandbox_policy: SandboxPolicy | None = None,
|
|
533
|
+
output_bytes_cap: int | None = None,
|
|
618
534
|
timeout_ms: int | None = None,
|
|
619
535
|
) -> CommandExecResponse:
|
|
620
536
|
"""Execute a command without creating a thread/turn.
|
|
@@ -623,6 +539,7 @@ class CodexClient:
|
|
|
623
539
|
command: Command and arguments as list (e.g., ["ls", "-la"])
|
|
624
540
|
cwd: Working directory for command
|
|
625
541
|
sandbox_policy: Sandbox policy override
|
|
542
|
+
output_bytes_cap: Cap output based on bytes
|
|
626
543
|
timeout_ms: Timeout in milliseconds
|
|
627
544
|
|
|
628
545
|
Returns:
|
|
@@ -631,6 +548,7 @@ class CodexClient:
|
|
|
631
548
|
params = CommandExecParams(
|
|
632
549
|
command=command,
|
|
633
550
|
cwd=cwd,
|
|
551
|
+
output_bytes_cap=output_bytes_cap,
|
|
634
552
|
sandbox_policy=sandbox_policy,
|
|
635
553
|
timeout_ms=timeout_ms,
|
|
636
554
|
)
|
|
@@ -722,12 +640,13 @@ class CodexClient:
|
|
|
722
640
|
Returns:
|
|
723
641
|
LoginAccountResponse with login details
|
|
724
642
|
"""
|
|
725
|
-
|
|
643
|
+
dct = dict(
|
|
726
644
|
type=login_type,
|
|
727
645
|
api_key=api_key,
|
|
728
646
|
access_token=access_token,
|
|
729
647
|
chatgpt_account_id=chatgpt_account_id,
|
|
730
648
|
)
|
|
649
|
+
params = TypeAdapter[LoginAccountParams](LoginAccountParams).validate_python(dct)
|
|
731
650
|
result = await self.dispatch.send_request("account/login/start", params)
|
|
732
651
|
return LoginAccountResponse.model_validate(result)
|
|
733
652
|
|
|
@@ -17,6 +17,7 @@ from codexed.models import (
|
|
|
17
17
|
ErrorNotification,
|
|
18
18
|
ReviewStartParams,
|
|
19
19
|
ReviewStartResponse,
|
|
20
|
+
TextUserInput,
|
|
20
21
|
ThreadArchiveParams,
|
|
21
22
|
ThreadCompactStartParams,
|
|
22
23
|
ThreadReadParams,
|
|
@@ -38,7 +39,6 @@ from codexed.models import (
|
|
|
38
39
|
TurnStartResponse,
|
|
39
40
|
TurnSteerParams,
|
|
40
41
|
TurnSteerResponse,
|
|
41
|
-
UserInputText,
|
|
42
42
|
)
|
|
43
43
|
|
|
44
44
|
|
|
@@ -153,7 +153,7 @@ class Session:
|
|
|
153
153
|
assert_never(sandbox_policy)
|
|
154
154
|
params = TurnStartParams(
|
|
155
155
|
thread_id=self.thread_id,
|
|
156
|
-
input=[
|
|
156
|
+
input=[TextUserInput(text=user_input)] if isinstance(user_input, str) else user_input,
|
|
157
157
|
model=model,
|
|
158
158
|
effort=effort,
|
|
159
159
|
approval_policy=approval_policy,
|
|
@@ -212,7 +212,7 @@ class Session:
|
|
|
212
212
|
"""
|
|
213
213
|
params = TurnSteerParams(
|
|
214
214
|
thread_id=self.thread_id,
|
|
215
|
-
input=[
|
|
215
|
+
input=[TextUserInput(text=user_input)] if isinstance(user_input, str) else user_input,
|
|
216
216
|
expected_turn_id=expected_turn_id,
|
|
217
217
|
)
|
|
218
218
|
result = await self._client.dispatch.send_request("turn/steer", params)
|
|
@@ -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,
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"""Codex app-server client."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from codexed.models import (
|
|
9
|
+
SkillsConfigWriteParams,
|
|
10
|
+
SkillsListParams,
|
|
11
|
+
SkillsListResponse,
|
|
12
|
+
SkillsRemoteExportParams,
|
|
13
|
+
SkillsRemoteExportResponse,
|
|
14
|
+
SkillsRemoteListParams,
|
|
15
|
+
SkillsRemoteListResponse,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from codexed.client import CodexClient
|
|
21
|
+
from codexed.models import (
|
|
22
|
+
HazelnutScope,
|
|
23
|
+
ProductSurface,
|
|
24
|
+
RemoteSkillSummary,
|
|
25
|
+
SkillMetadata,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
logger = logging.getLogger(__name__)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class CodexSkills:
|
|
32
|
+
def __init__(self, client: CodexClient):
|
|
33
|
+
self._client = client
|
|
34
|
+
|
|
35
|
+
async def list_skills(
|
|
36
|
+
self,
|
|
37
|
+
*,
|
|
38
|
+
cwds: list[str] | None = None,
|
|
39
|
+
force_reload: bool | None = None,
|
|
40
|
+
) -> list[SkillMetadata]:
|
|
41
|
+
"""List available skills.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
cwds: Optional working directories to scope skills
|
|
45
|
+
force_reload: Force reload of skills cache
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
List of skills with metadata
|
|
49
|
+
"""
|
|
50
|
+
params = SkillsListParams(cwds=cwds, force_reload=force_reload)
|
|
51
|
+
result = await self._client.dispatch.send_request("skills/list", params)
|
|
52
|
+
response = SkillsListResponse.model_validate(result)
|
|
53
|
+
if response.data:
|
|
54
|
+
return response.data[0].skills
|
|
55
|
+
return []
|
|
56
|
+
|
|
57
|
+
async def config_write(self, path: str, *, enabled: bool) -> None:
|
|
58
|
+
"""Write skills configuration.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
path: Path to the skill
|
|
62
|
+
enabled: Whether the skill is enabled
|
|
63
|
+
"""
|
|
64
|
+
params = SkillsConfigWriteParams(path=path, enabled=enabled)
|
|
65
|
+
await self._client.dispatch.send_request("skills/config/write", params)
|
|
66
|
+
|
|
67
|
+
async def remote_list(
|
|
68
|
+
self,
|
|
69
|
+
*,
|
|
70
|
+
hazelnut_scope: HazelnutScope = "example",
|
|
71
|
+
product_surface: ProductSurface = "codex",
|
|
72
|
+
enabled: bool = False,
|
|
73
|
+
) -> list[RemoteSkillSummary]:
|
|
74
|
+
"""List remote skills.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
hazelnut_scope: Scope filter (example/workspace-shared/all-shared/personal)
|
|
78
|
+
product_surface: Product surface filter (chatgpt/codex/api/atlas)
|
|
79
|
+
enabled: Whether to filter by enabled status
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
List of remote skill summaries
|
|
83
|
+
"""
|
|
84
|
+
params = SkillsRemoteListParams(
|
|
85
|
+
hazelnut_scope=hazelnut_scope,
|
|
86
|
+
product_surface=product_surface,
|
|
87
|
+
enabled=enabled,
|
|
88
|
+
)
|
|
89
|
+
result = await self._client.dispatch.send_request("skills/remote/list", params)
|
|
90
|
+
response = SkillsRemoteListResponse.model_validate(result)
|
|
91
|
+
return response.data
|
|
92
|
+
|
|
93
|
+
async def remote_export(self, hazelnut_id: str) -> SkillsRemoteExportResponse:
|
|
94
|
+
"""Export a skill to remote storage.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
hazelnut_id: ID of the remote skill to export
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
SkillsRemoteExportResponse with id and local path
|
|
101
|
+
"""
|
|
102
|
+
params = SkillsRemoteExportParams(hazelnut_id=hazelnut_id)
|
|
103
|
+
result = await self._client.dispatch.send_request("skills/remote/export", params)
|
|
104
|
+
return SkillsRemoteExportResponse.model_validate(result)
|
|
@@ -27,7 +27,6 @@ from codexed.models.event_data import (
|
|
|
27
27
|
ItemStartedData,
|
|
28
28
|
RawResponseItemCompletedData,
|
|
29
29
|
ThreadStartedData,
|
|
30
|
-
TurnErrorData,
|
|
31
30
|
TurnStartedData,
|
|
32
31
|
TurnCompletedData,
|
|
33
32
|
)
|
|
@@ -40,57 +39,18 @@ from codexed.models.events import (
|
|
|
40
39
|
ItemAgentMessageDeltaNotification,
|
|
41
40
|
AppListUpdatedMessage,
|
|
42
41
|
CodexEvent,
|
|
43
|
-
ItemCommandExecutionOutputDeltaNotification,
|
|
44
|
-
ItemCommandExecutionTerminalInteractionNotification,
|
|
45
|
-
ConfigWarningMessage,
|
|
46
|
-
FsChangedMessage,
|
|
47
42
|
DeltaEvent,
|
|
48
|
-
HookCompletedMessage,
|
|
49
|
-
HookStartedMessage,
|
|
50
|
-
CommandExecOutputDeltaMessage,
|
|
51
|
-
FuzzyFileSearchSessionCompletedMessage,
|
|
52
|
-
FuzzyFileSearchSessionUpdatedMessage,
|
|
53
|
-
ThreadRealtimeClosedMessage,
|
|
54
|
-
ThreadRealtimeErrorMessage,
|
|
55
|
-
ThreadRealtimeItemAddedMessage,
|
|
56
|
-
ThreadRealtimeOutputAudioDeltaMessage,
|
|
57
|
-
ThreadRealtimeStartedMessage,
|
|
58
|
-
ThreadRealtimeTranscriptUpdatedMessage,
|
|
59
|
-
DeprecationNoticeMessage,
|
|
60
|
-
ErrorMessage,
|
|
61
43
|
EventType,
|
|
62
|
-
ItemFileChangeOutputDeltaNotification,
|
|
63
44
|
ItemCompletedEvent,
|
|
64
45
|
ItemStartedEvent,
|
|
65
|
-
McpServerOauthLoginCompletedMessage,
|
|
66
|
-
McpServerStartupStatusUpdatedNotification,
|
|
67
|
-
ItemMcpToolCallProgressNotification,
|
|
68
|
-
ModelReroutedMessage,
|
|
69
|
-
ItemPlanDeltaNotification,
|
|
70
46
|
RawResponseItemCompletedEvent,
|
|
71
|
-
ItemReasoningSummaryPartAddedNotification,
|
|
72
|
-
ItemReasoningSummaryTextDeltaNotification,
|
|
73
|
-
ItemReasoningTextDeltaNotification,
|
|
74
|
-
ServerRequestResolvedMessage,
|
|
75
|
-
ThreadArchivedMessage,
|
|
76
|
-
ThreadCompactedMessage,
|
|
77
|
-
ThreadNameUpdatedMessage,
|
|
78
47
|
ThreadStartedEvent,
|
|
79
|
-
ThreadStatusChangedMessage,
|
|
80
48
|
ThreadTokenUsageUpdatedEvent,
|
|
81
|
-
ThreadUnarchivedMessage,
|
|
82
49
|
TurnCompletedEvent,
|
|
83
|
-
TurnDiffUpdatedMessage,
|
|
84
|
-
TurnPlanUpdatedMessage,
|
|
85
50
|
TurnStartedEvent,
|
|
86
|
-
WindowsWorldWritableWarningMessage,
|
|
87
51
|
codex_event_adapter,
|
|
88
52
|
)
|
|
89
53
|
from codexed.models.mcp_server import HttpMcpServer, McpServerConfig, StdioMcpServer
|
|
90
|
-
|
|
91
|
-
# Import order matters: misc ↔ thread_item have circular imports at module level.
|
|
92
|
-
# By importing misc first (which triggers thread_item), both modules are fully
|
|
93
|
-
# initialized before event_data or events try to use them.
|
|
94
54
|
from codexed.models.misc import (
|
|
95
55
|
ExecPolicyAmendment,
|
|
96
56
|
McpResource,
|
|
@@ -108,63 +68,25 @@ from codexed.models.misc import (
|
|
|
108
68
|
TurnData,
|
|
109
69
|
)
|
|
110
70
|
from codexed.models.request_params import (
|
|
111
|
-
|
|
71
|
+
InitializeParams,
|
|
112
72
|
HazelnutScope,
|
|
113
73
|
ProductSurface,
|
|
114
|
-
CollaborationModeListParams,
|
|
115
|
-
CommandExecParams,
|
|
116
74
|
CommandExecutionRequestApprovalParams,
|
|
117
|
-
CommitReviewTarget,
|
|
118
|
-
ConfigBatchWriteParams,
|
|
119
|
-
ConfigValueWriteParams,
|
|
120
|
-
CustomReviewTarget,
|
|
121
75
|
DynamicToolCallParams,
|
|
122
|
-
ExternalAgentConfigImportParams,
|
|
123
76
|
FileChangeRequestApprovalParams,
|
|
124
|
-
InitializeParams,
|
|
125
|
-
LoginAccountParams,
|
|
126
|
-
AuthMode,
|
|
127
77
|
McpElicitationFormParams,
|
|
128
78
|
McpElicitationUrlParams,
|
|
129
79
|
McpServerElicitationRequestParams,
|
|
130
|
-
ReviewStartParams,
|
|
131
|
-
ReviewTarget,
|
|
132
80
|
SkillRequestApprovalParams,
|
|
133
|
-
SkillsListExtraRootsForCwd,
|
|
134
|
-
SkillsListParams,
|
|
135
81
|
SkillsRemoteExportParams,
|
|
136
82
|
SkillsRemoteListParams,
|
|
137
|
-
ThreadForkParams,
|
|
138
|
-
ThreadListParams,
|
|
139
|
-
ThreadLoadedListParams,
|
|
140
|
-
ThreadResumeParams,
|
|
141
|
-
ThreadStartParams,
|
|
142
83
|
ToolRequestUserInputParams,
|
|
143
|
-
TurnStartParams,
|
|
144
|
-
TurnSteerParams,
|
|
145
|
-
UncommittedChangesReviewTarget,
|
|
146
|
-
)
|
|
147
|
-
from codexed.models.response_item import (
|
|
148
|
-
CompactionResponseItem,
|
|
149
|
-
ContentItem,
|
|
150
|
-
CustomToolCallOutputResponseItem,
|
|
151
|
-
CustomToolCallResponseItem,
|
|
152
|
-
FunctionCallOutputResponseItem,
|
|
153
|
-
FunctionCallResponseItem,
|
|
154
|
-
GhostSnapshotResponseItem,
|
|
155
|
-
ImageGenerationCallResponseItem,
|
|
156
|
-
LocalShellCallResponseItem,
|
|
157
|
-
MessageResponseItem,
|
|
158
|
-
OtherResponseItem,
|
|
159
|
-
ReasoningResponseItem,
|
|
160
|
-
ResponseItem,
|
|
161
|
-
WebSearchCallResponseItem,
|
|
162
84
|
)
|
|
85
|
+
|
|
163
86
|
from codexed.models.responses import (
|
|
164
87
|
CommandExecutionRequestApprovalResponse,
|
|
165
88
|
DynamicToolCallResponse,
|
|
166
89
|
ExternalAgentConfigDetectResponse,
|
|
167
|
-
FeedbackUploadResponse,
|
|
168
90
|
FileChangeRequestApprovalResponse,
|
|
169
91
|
ListMcpServerStatusResponse,
|
|
170
92
|
LoginAccountResponse,
|
|
@@ -230,16 +152,88 @@ from codexed.models.tool_config import (
|
|
|
230
152
|
)
|
|
231
153
|
from codexed.models.user_input import (
|
|
232
154
|
UserInput,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
155
|
+
ImageUserInput,
|
|
156
|
+
LocalImageUserInput,
|
|
157
|
+
MentionUserInput,
|
|
158
|
+
SkillUserInput,
|
|
159
|
+
TextUserInput,
|
|
238
160
|
)
|
|
239
161
|
from codexed.models.v2_protocol import (
|
|
240
162
|
ByteRange,
|
|
163
|
+
ExternalAgentConfigImportParams,
|
|
164
|
+
CommandExecParams,
|
|
165
|
+
ThreadStartParams,
|
|
166
|
+
ThreadForkParams,
|
|
167
|
+
CompactionResponseItem,
|
|
168
|
+
ContentItem,
|
|
169
|
+
CustomToolCallOutputResponseItem,
|
|
170
|
+
CustomToolCallResponseItem,
|
|
171
|
+
FunctionCallOutputResponseItem,
|
|
172
|
+
FunctionCallResponseItem,
|
|
173
|
+
GhostSnapshotResponseItem,
|
|
174
|
+
ImageGenerationCallResponseItem,
|
|
175
|
+
LocalShellCallResponseItem,
|
|
176
|
+
MessageResponseItem,
|
|
177
|
+
OtherResponseItem,
|
|
178
|
+
ReasoningResponseItem,
|
|
179
|
+
ResponseItem,
|
|
180
|
+
WebSearchCallResponseItem,
|
|
181
|
+
ReviewStartParams,
|
|
182
|
+
ReviewTarget,
|
|
183
|
+
ThreadResumeParams,
|
|
184
|
+
TurnStartParams,
|
|
185
|
+
TurnSteerParams,
|
|
186
|
+
ConfigBatchWriteParams,
|
|
187
|
+
ThreadListParams,
|
|
188
|
+
FeedbackUploadResponse,
|
|
189
|
+
LoginAccountParams,
|
|
241
190
|
TextElement,
|
|
191
|
+
ThreadLoadedListParams,
|
|
192
|
+
SkillsListExtraRootsForCwd,
|
|
193
|
+
SkillsListParams,
|
|
194
|
+
BaseBranchReviewTarget,
|
|
195
|
+
ItemFileChangeOutputDeltaNotification,
|
|
196
|
+
ItemCommandExecutionOutputDeltaNotification,
|
|
197
|
+
ItemCommandExecutionTerminalInteractionNotification,
|
|
198
|
+
ConfigWarningMessage,
|
|
199
|
+
FsChangedMessage,
|
|
200
|
+
HookCompletedMessage,
|
|
201
|
+
HookStartedMessage,
|
|
202
|
+
CommandExecOutputDeltaMessage,
|
|
203
|
+
FuzzyFileSearchSessionCompletedMessage,
|
|
204
|
+
FuzzyFileSearchSessionUpdatedMessage,
|
|
205
|
+
ThreadRealtimeClosedMessage,
|
|
206
|
+
ThreadRealtimeErrorMessage,
|
|
207
|
+
ThreadRealtimeItemAddedMessage,
|
|
208
|
+
ThreadRealtimeOutputAudioDeltaMessage,
|
|
209
|
+
ThreadRealtimeStartedMessage,
|
|
210
|
+
ThreadRealtimeTranscriptUpdatedMessage,
|
|
211
|
+
DeprecationNoticeMessage,
|
|
212
|
+
ErrorMessage,
|
|
213
|
+
McpServerOauthLoginCompletedMessage,
|
|
214
|
+
McpServerStartupStatusUpdatedNotification,
|
|
215
|
+
ItemMcpToolCallProgressNotification,
|
|
216
|
+
ModelReroutedMessage,
|
|
217
|
+
ItemPlanDeltaNotification,
|
|
218
|
+
ItemReasoningSummaryPartAddedNotification,
|
|
219
|
+
ItemReasoningSummaryTextDeltaNotification,
|
|
220
|
+
ItemReasoningTextDeltaNotification,
|
|
221
|
+
ServerRequestResolvedMessage,
|
|
222
|
+
ThreadArchivedMessage,
|
|
223
|
+
ThreadCompactedMessage,
|
|
224
|
+
ThreadNameUpdatedMessage,
|
|
225
|
+
ThreadStatusChangedMessage,
|
|
226
|
+
ThreadUnarchivedMessage,
|
|
227
|
+
TurnDiffUpdatedMessage,
|
|
228
|
+
TurnPlanUpdatedMessage,
|
|
229
|
+
WindowsWorldWritableWarningMessage,
|
|
230
|
+
CollaborationModeListParams,
|
|
231
|
+
CommitReviewTarget,
|
|
232
|
+
ConfigValueWriteParams,
|
|
233
|
+
CustomReviewTarget,
|
|
234
|
+
UncommittedChangesReviewTarget,
|
|
242
235
|
MergeStrategy,
|
|
236
|
+
AuthMode,
|
|
243
237
|
WriteStatus,
|
|
244
238
|
ActiveThreadStatus,
|
|
245
239
|
GhostCommit,
|
|
@@ -632,6 +626,7 @@ __all__ = [
|
|
|
632
626
|
"IdleThreadStatus",
|
|
633
627
|
"ImageGenerationCallResponseItem",
|
|
634
628
|
"ImageGenerationToolConfig",
|
|
629
|
+
"ImageUserInput",
|
|
635
630
|
"InitializeParams",
|
|
636
631
|
"InputModality",
|
|
637
632
|
"ItemAgentMessageDeltaNotification",
|
|
@@ -657,6 +652,7 @@ __all__ = [
|
|
|
657
652
|
"ListFilesCommandAction",
|
|
658
653
|
"ListMcpServerStatusParams",
|
|
659
654
|
"ListMcpServerStatusResponse",
|
|
655
|
+
"LocalImageUserInput",
|
|
660
656
|
"LocalShellCallResponseItem",
|
|
661
657
|
"LoginAccountParams",
|
|
662
658
|
"LoginAccountResponse",
|
|
@@ -681,6 +677,7 @@ __all__ = [
|
|
|
681
677
|
"McpToolCallError",
|
|
682
678
|
"McpToolCallProgressNotification",
|
|
683
679
|
"McpToolCallResult",
|
|
680
|
+
"MentionUserInput",
|
|
684
681
|
"MergeStrategy",
|
|
685
682
|
"MessagePhase",
|
|
686
683
|
"MessageResponseItem",
|
|
@@ -756,6 +753,7 @@ __all__ = [
|
|
|
756
753
|
"SkillRequestApprovalResponse",
|
|
757
754
|
"SkillScope",
|
|
758
755
|
"SkillToolDependency",
|
|
756
|
+
"SkillUserInput",
|
|
759
757
|
"SkillsConfigWriteParams",
|
|
760
758
|
"SkillsConfigWriteResponse",
|
|
761
759
|
"SkillsListEntry",
|
|
@@ -770,6 +768,7 @@ __all__ = [
|
|
|
770
768
|
"SystemErrorThreadStatus",
|
|
771
769
|
"TerminalInteractionNotification",
|
|
772
770
|
"TextElement",
|
|
771
|
+
"TextUserInput",
|
|
773
772
|
"Thread",
|
|
774
773
|
"ThreadActiveFlag",
|
|
775
774
|
"ThreadActiveFlag",
|
|
@@ -865,7 +864,6 @@ __all__ = [
|
|
|
865
864
|
"TurnDiffUpdatedMessage",
|
|
866
865
|
"TurnDiffUpdatedNotification",
|
|
867
866
|
"TurnError",
|
|
868
|
-
"TurnErrorData",
|
|
869
867
|
"TurnInterruptParams",
|
|
870
868
|
"TurnPlanStep",
|
|
871
869
|
"TurnPlanStepStatus",
|
|
@@ -881,11 +879,6 @@ __all__ = [
|
|
|
881
879
|
"UncommittedChangesReviewTarget",
|
|
882
880
|
"UnknownCommandAction",
|
|
883
881
|
"UserInput",
|
|
884
|
-
"UserInputImage",
|
|
885
|
-
"UserInputLocalImage",
|
|
886
|
-
"UserInputMention",
|
|
887
|
-
"UserInputSkill",
|
|
888
|
-
"UserInputText",
|
|
889
882
|
"ViewImageToolConfig",
|
|
890
883
|
"WebSearchAction",
|
|
891
884
|
"WebSearchCallResponseItem",
|
|
@@ -17,28 +17,15 @@ from codexed.models.response_item import ResponseItem
|
|
|
17
17
|
from codexed.models.user_input import UserInput
|
|
18
18
|
from codexed.models.v2_protocol import (
|
|
19
19
|
ApprovalsReviewer,
|
|
20
|
-
|
|
21
|
-
BaseBranchReviewTarget,
|
|
20
|
+
AskForApproval,
|
|
22
21
|
ClientInfo,
|
|
23
22
|
CollaborationMode,
|
|
24
23
|
CommandAction,
|
|
25
|
-
CommandExecTerminalSize,
|
|
26
|
-
CommitReviewTarget,
|
|
27
|
-
ConfigEdit,
|
|
28
|
-
CustomReviewTarget,
|
|
29
|
-
DynamicToolSpec,
|
|
30
|
-
ExternalAgentConfigMigrationItem,
|
|
31
|
-
MergeStrategy,
|
|
32
24
|
Personality,
|
|
33
25
|
ReasoningEffort,
|
|
34
26
|
ReasoningSummary,
|
|
35
|
-
ReviewDelivery,
|
|
36
27
|
SandboxMode,
|
|
37
28
|
ServiceTier,
|
|
38
|
-
SkillsListExtraRootsForCwd,
|
|
39
|
-
ThreadSortKey,
|
|
40
|
-
ThreadSourceKind,
|
|
41
|
-
UncommittedChangesReviewTarget,
|
|
42
29
|
)
|
|
43
30
|
|
|
44
31
|
|
|
@@ -46,6 +33,10 @@ if TYPE_CHECKING:
|
|
|
46
33
|
from mcp.types import ElicitRequestFormParams, ElicitRequestURLParams
|
|
47
34
|
|
|
48
35
|
|
|
36
|
+
HazelnutScope = Literal["example", "workspace-shared", "all-shared", "personal"]
|
|
37
|
+
ProductSurface = Literal["chatgpt", "codex", "api", "atlas"]
|
|
38
|
+
|
|
39
|
+
|
|
49
40
|
class InitializeParams(CodexBaseModel):
|
|
50
41
|
"""Parameters for initialize request."""
|
|
51
42
|
|
|
@@ -56,27 +47,6 @@ class InitializeParams(CodexBaseModel):
|
|
|
56
47
|
return cls(client_info=ClientInfo(name=name, version=version))
|
|
57
48
|
|
|
58
49
|
|
|
59
|
-
class ThreadStartParams(CodexBaseModel):
|
|
60
|
-
"""Parameters for thread/start request."""
|
|
61
|
-
|
|
62
|
-
cwd: str | None = None
|
|
63
|
-
model: str | None = None
|
|
64
|
-
model_provider: str | None = None
|
|
65
|
-
base_instructions: str | None = None
|
|
66
|
-
developer_instructions: str | None = None
|
|
67
|
-
approval_policy: ApprovalPolicy | None = None
|
|
68
|
-
approvals_reviewer: ApprovalsReviewer | None = None
|
|
69
|
-
sandbox: SandboxMode | None = None
|
|
70
|
-
config: dict[str, Any] | None = None
|
|
71
|
-
service_name: str | None = None
|
|
72
|
-
service_tier: ServiceTier | None = None
|
|
73
|
-
personality: Personality | None = None
|
|
74
|
-
ephemeral: bool | None = None
|
|
75
|
-
dynamic_tools: list[DynamicToolSpec] | None = None
|
|
76
|
-
experimental_raw_events: bool = False
|
|
77
|
-
persist_extended_history: bool = False
|
|
78
|
-
|
|
79
|
-
|
|
80
50
|
class ThreadResumeParams(CodexBaseModel):
|
|
81
51
|
"""Parameters for thread/resume request."""
|
|
82
52
|
|
|
@@ -88,7 +58,7 @@ class ThreadResumeParams(CodexBaseModel):
|
|
|
88
58
|
model_provider: str | None = None
|
|
89
59
|
base_instructions: str | None = None
|
|
90
60
|
developer_instructions: str | None = None
|
|
91
|
-
approval_policy:
|
|
61
|
+
approval_policy: AskForApproval | None = None
|
|
92
62
|
approvals_reviewer: ApprovalsReviewer | None = None
|
|
93
63
|
sandbox: SandboxMode | None = None
|
|
94
64
|
config: dict[str, Any] | None = None
|
|
@@ -97,43 +67,6 @@ class ThreadResumeParams(CodexBaseModel):
|
|
|
97
67
|
persist_extended_history: bool = False
|
|
98
68
|
|
|
99
69
|
|
|
100
|
-
class ThreadForkParams(CodexBaseModel):
|
|
101
|
-
"""Parameters for thread/fork request."""
|
|
102
|
-
|
|
103
|
-
thread_id: str
|
|
104
|
-
path: str | None = None
|
|
105
|
-
cwd: str | None = None
|
|
106
|
-
model: str | None = None
|
|
107
|
-
model_provider: str | None = None
|
|
108
|
-
base_instructions: str | None = None
|
|
109
|
-
developer_instructions: str | None = None
|
|
110
|
-
approval_policy: ApprovalPolicy | None = None
|
|
111
|
-
approvals_reviewer: ApprovalsReviewer | None = None
|
|
112
|
-
sandbox: SandboxMode | None = None
|
|
113
|
-
config: dict[str, Any] | None = None
|
|
114
|
-
service_tier: ServiceTier | None = None
|
|
115
|
-
personality: Personality | None = None
|
|
116
|
-
ephemeral: bool | None = None
|
|
117
|
-
persist_extended_history: bool = False
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class ThreadListParams(CodexBaseModel):
|
|
121
|
-
"""Parameters for thread/list request."""
|
|
122
|
-
|
|
123
|
-
cursor: str | None = None
|
|
124
|
-
limit: int | None = None
|
|
125
|
-
sort_key: ThreadSortKey | None = None
|
|
126
|
-
model_providers: list[str] | None = None
|
|
127
|
-
source_kinds: list[ThreadSourceKind] | None = None
|
|
128
|
-
archived: bool | None = None
|
|
129
|
-
cwd: str | None = None
|
|
130
|
-
search_term: str | None = None
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
class ThreadLoadedListParams(CodexBaseModel):
|
|
134
|
-
"""Parameters for thread/loaded/list request."""
|
|
135
|
-
|
|
136
|
-
|
|
137
70
|
class TurnStartParams(CodexBaseModel):
|
|
138
71
|
"""Parameters for turn/start request."""
|
|
139
72
|
|
|
@@ -160,34 +93,6 @@ class TurnSteerParams(CodexBaseModel):
|
|
|
160
93
|
expected_turn_id: str
|
|
161
94
|
|
|
162
95
|
|
|
163
|
-
ReviewTarget = (
|
|
164
|
-
UncommittedChangesReviewTarget
|
|
165
|
-
| BaseBranchReviewTarget
|
|
166
|
-
| CommitReviewTarget
|
|
167
|
-
| CustomReviewTarget
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
class ReviewStartParams(CodexBaseModel):
|
|
172
|
-
"""Parameters for review/start request."""
|
|
173
|
-
|
|
174
|
-
thread_id: str
|
|
175
|
-
target: ReviewTarget
|
|
176
|
-
delivery: ReviewDelivery | None = None
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
class SkillsListParams(CodexBaseModel):
|
|
180
|
-
"""Parameters for skills/list request."""
|
|
181
|
-
|
|
182
|
-
cwds: list[str] | None = None
|
|
183
|
-
force_reload: bool | None = None
|
|
184
|
-
per_cwd_extra_user_roots: list[SkillsListExtraRootsForCwd] | None = None
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
HazelnutScope = Literal["example", "workspace-shared", "all-shared", "personal"]
|
|
188
|
-
ProductSurface = Literal["chatgpt", "codex", "api", "atlas"]
|
|
189
|
-
|
|
190
|
-
|
|
191
96
|
class SkillsRemoteListParams(CodexBaseModel):
|
|
192
97
|
"""Parameters for skills/remote/list request."""
|
|
193
98
|
|
|
@@ -202,65 +107,6 @@ class SkillsRemoteExportParams(CodexBaseModel):
|
|
|
202
107
|
hazelnut_id: str
|
|
203
108
|
|
|
204
109
|
|
|
205
|
-
class CollaborationModeListParams(CodexBaseModel):
|
|
206
|
-
"""Parameters for collaborationMode/list request."""
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
class CommandExecParams(CodexBaseModel):
|
|
210
|
-
"""Parameters for command/exec request."""
|
|
211
|
-
|
|
212
|
-
command: list[str]
|
|
213
|
-
process_id: str | None = None
|
|
214
|
-
tty: bool = False
|
|
215
|
-
stream_stdin: bool = False
|
|
216
|
-
stream_stdout_stderr: bool = False
|
|
217
|
-
output_bytes_cap: int | None = None
|
|
218
|
-
disable_output_cap: bool = False
|
|
219
|
-
disable_timeout: bool = False
|
|
220
|
-
timeout_ms: int | None = None
|
|
221
|
-
cwd: str | None = None
|
|
222
|
-
env: dict[str, str | None] | None = None
|
|
223
|
-
size: CommandExecTerminalSize | None = None
|
|
224
|
-
sandbox_policy: dict[str, Any] | None = None
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
class ConfigValueWriteParams(CodexBaseModel):
|
|
228
|
-
"""Parameters for config/value/write request."""
|
|
229
|
-
|
|
230
|
-
key_path: str
|
|
231
|
-
value: Any
|
|
232
|
-
merge_strategy: MergeStrategy
|
|
233
|
-
file_path: str | None = None
|
|
234
|
-
expected_version: str | None = None
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
class ConfigBatchWriteParams(CodexBaseModel):
|
|
238
|
-
"""Parameters for config/batchWrite request."""
|
|
239
|
-
|
|
240
|
-
edits: list[ConfigEdit]
|
|
241
|
-
file_path: str | None = None
|
|
242
|
-
expected_version: str | None = None
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
class LoginAccountParams(CodexBaseModel):
|
|
246
|
-
"""Parameters for account/login/start request.
|
|
247
|
-
|
|
248
|
-
This is a discriminated union - use type field.
|
|
249
|
-
"""
|
|
250
|
-
|
|
251
|
-
type: AuthMode
|
|
252
|
-
api_key: str | None = None
|
|
253
|
-
access_token: str | None = None
|
|
254
|
-
chatgpt_account_id: str | None = None
|
|
255
|
-
chatgpt_plan_type: str | None = None
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
class ExternalAgentConfigImportParams(CodexBaseModel):
|
|
259
|
-
"""Parameters for externalAgentConfig/import request."""
|
|
260
|
-
|
|
261
|
-
migration_items: list[ExternalAgentConfigMigrationItem]
|
|
262
|
-
|
|
263
|
-
|
|
264
110
|
# ============================================================================
|
|
265
111
|
# Filesystem params
|
|
266
112
|
# ============================================================================
|
|
@@ -383,11 +229,10 @@ class McpElicitationFormParams(_McpElicitationBase):
|
|
|
383
229
|
turn_id: str | None = None,
|
|
384
230
|
) -> McpElicitationFormParams:
|
|
385
231
|
"""Create from MCP ElicitRequestFormParams."""
|
|
386
|
-
meta = params.meta.model_dump(exclude={"progressToken"}) if params.meta else None
|
|
387
232
|
return cls(
|
|
388
233
|
message=params.message,
|
|
389
234
|
requested_schema=dict(params.requestedSchema),
|
|
390
|
-
meta=meta,
|
|
235
|
+
meta=params.meta.model_dump(exclude={"progressToken"}) if params.meta else None,
|
|
391
236
|
thread_id=thread_id,
|
|
392
237
|
server_name=server_name,
|
|
393
238
|
turn_id=turn_id,
|
|
@@ -422,12 +267,11 @@ class McpElicitationUrlParams(_McpElicitationBase):
|
|
|
422
267
|
turn_id: str | None = None,
|
|
423
268
|
) -> McpElicitationUrlParams:
|
|
424
269
|
"""Create from MCP ElicitRequestURLParams."""
|
|
425
|
-
meta = params.meta.model_dump(exclude={"progressToken"}) if params.meta else None
|
|
426
270
|
return cls(
|
|
427
271
|
message=params.message,
|
|
428
272
|
url=params.url,
|
|
429
273
|
elicitation_id=params.elicitationId,
|
|
430
|
-
meta=meta,
|
|
274
|
+
meta=params.meta.model_dump(exclude={"progressToken"}) if params.meta else None,
|
|
431
275
|
thread_id=thread_id,
|
|
432
276
|
server_name=server_name,
|
|
433
277
|
turn_id=turn_id,
|
|
@@ -163,12 +163,6 @@ class LoginAccountResponse(CodexBaseModel):
|
|
|
163
163
|
auth_url: str | None = None
|
|
164
164
|
|
|
165
165
|
|
|
166
|
-
class FeedbackUploadResponse(CodexBaseModel):
|
|
167
|
-
"""Response for feedback/upload request."""
|
|
168
|
-
|
|
169
|
-
thread_id: str
|
|
170
|
-
|
|
171
|
-
|
|
172
166
|
class ExternalAgentConfigDetectResponse(CodexBaseModel):
|
|
173
167
|
"""Response for externalAgentConfig/detect request."""
|
|
174
168
|
|
|
@@ -15,6 +15,8 @@ from typing import Annotated, Any, Literal, assert_never
|
|
|
15
15
|
|
|
16
16
|
from pydantic import BaseModel, ConfigDict, Discriminator
|
|
17
17
|
|
|
18
|
+
from codexed.models.v2_protocol import WebSearchLocation
|
|
19
|
+
|
|
18
20
|
|
|
19
21
|
class _ToolConfigBase(BaseModel):
|
|
20
22
|
"""Base for individual tool configuration models."""
|
|
@@ -55,15 +57,6 @@ class ApplyPatchToolConfig(_ToolConfigBase):
|
|
|
55
57
|
# ---------------------------------------------------------------------------
|
|
56
58
|
|
|
57
59
|
|
|
58
|
-
class WebSearchLocation(_ToolConfigBase):
|
|
59
|
-
"""Location hints for web search results."""
|
|
60
|
-
|
|
61
|
-
country: str | None = None
|
|
62
|
-
region: str | None = None
|
|
63
|
-
city: str | None = None
|
|
64
|
-
timezone: str | None = None
|
|
65
|
-
|
|
66
|
-
|
|
67
60
|
class WebSearchToolConfig(_ToolConfigBase):
|
|
68
61
|
"""Configuration for the web_search tool."""
|
|
69
62
|
|
|
@@ -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 UserInputText(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 UserInputImage(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 UserInputLocalImage(CodexBaseModel):
|
|
35
|
-
"""Local image file user input."""
|
|
36
|
-
|
|
37
|
-
type: Literal["localImage"] = "localImage"
|
|
38
|
-
path: str
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class UserInputSkill(CodexBaseModel):
|
|
42
|
-
"""Skill file user input."""
|
|
43
|
-
|
|
44
|
-
type: Literal["skill"] = "skill"
|
|
45
|
-
name: str
|
|
46
|
-
path: str
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class UserInputMention(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 = UserInputText | UserInputImage | UserInputLocalImage | UserInputSkill | UserInputMention
|
|
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
|