codexed 1.1.0__tar.gz → 1.1.1__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.1}/PKG-INFO +1 -1
- {codexed-1.1.0 → codexed-1.1.1}/pyproject.toml +1 -1
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/__init__.py +10 -12
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/client/client.py +2 -87
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/client/session.py +3 -3
- codexed-1.1.1/src/codexed/client/skills.py +104 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/__init__.py +84 -91
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/event_data.py +0 -8
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/request_params.py +6 -160
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/responses.py +0 -6
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/tool_config.py +2 -9
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/user_input.py +6 -6
- {codexed-1.1.0 → codexed-1.1.1}/LICENSE +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/README.md +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/README.md +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/client/__init__.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/client/dispatch.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/client/fs.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/client/realtime.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/exceptions.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/helpers.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/log.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/base.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/codex_types.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/events.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/mcp_server.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/misc.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/response_item.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/thread_item.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/models/v2_protocol.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/py.typed +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/src/codexed/request_handlers.py +0 -0
- {codexed-1.1.0 → codexed-1.1.1}/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",
|
|
@@ -44,13 +44,6 @@ from codexed.models import (
|
|
|
44
44
|
McpServerOauthLoginResponse,
|
|
45
45
|
ModelListParams,
|
|
46
46
|
ModelListResponse,
|
|
47
|
-
SkillsConfigWriteParams,
|
|
48
|
-
SkillsListParams,
|
|
49
|
-
SkillsListResponse,
|
|
50
|
-
SkillsRemoteExportParams,
|
|
51
|
-
SkillsRemoteExportResponse,
|
|
52
|
-
SkillsRemoteListParams,
|
|
53
|
-
SkillsRemoteListResponse,
|
|
54
47
|
ThreadForkParams,
|
|
55
48
|
ThreadListParams,
|
|
56
49
|
ThreadListResponse,
|
|
@@ -90,16 +83,12 @@ if TYPE_CHECKING:
|
|
|
90
83
|
DynamicToolSpec,
|
|
91
84
|
ExperimentalFeature,
|
|
92
85
|
ExternalAgentConfigMigrationItem,
|
|
93
|
-
HazelnutScope,
|
|
94
86
|
McpServerConfig,
|
|
95
87
|
MergeStrategy,
|
|
96
88
|
Model,
|
|
97
89
|
Personality,
|
|
98
|
-
ProductSurface,
|
|
99
|
-
RemoteSkillSummary,
|
|
100
90
|
SandboxMode,
|
|
101
91
|
ServiceTier,
|
|
102
|
-
SkillMetadata,
|
|
103
92
|
ThreadSortKey,
|
|
104
93
|
ThreadSourceKind,
|
|
105
94
|
ToolConfig,
|
|
@@ -502,81 +491,6 @@ class CodexClient:
|
|
|
502
491
|
response = ThreadLoadedListResponse.model_validate(result)
|
|
503
492
|
return response.data
|
|
504
493
|
|
|
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
494
|
# ========================================================================
|
|
581
495
|
# Model methods
|
|
582
496
|
# ========================================================================
|
|
@@ -722,12 +636,13 @@ class CodexClient:
|
|
|
722
636
|
Returns:
|
|
723
637
|
LoginAccountResponse with login details
|
|
724
638
|
"""
|
|
725
|
-
|
|
639
|
+
dct = dict(
|
|
726
640
|
type=login_type,
|
|
727
641
|
api_key=api_key,
|
|
728
642
|
access_token=access_token,
|
|
729
643
|
chatgpt_account_id=chatgpt_account_id,
|
|
730
644
|
)
|
|
645
|
+
params = TypeAdapter[LoginAccountParams](LoginAccountParams).validate_python(dct)
|
|
731
646
|
result = await self.dispatch.send_request("account/login/start", params)
|
|
732
647
|
return LoginAccountResponse.model_validate(result)
|
|
733
648
|
|
|
@@ -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)
|
|
@@ -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
|
# ============================================================================
|
|
@@ -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
|
|
|
@@ -9,7 +9,7 @@ from codexed.models.base import CodexBaseModel
|
|
|
9
9
|
from codexed.models.v2_protocol import TextElement
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class TextUserInput(CodexBaseModel):
|
|
13
13
|
"""Text user input."""
|
|
14
14
|
|
|
15
15
|
type: Literal["text"] = "text"
|
|
@@ -17,7 +17,7 @@ class UserInputText(CodexBaseModel):
|
|
|
17
17
|
text_elements: list[TextElement] = Field(default_factory=list)
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class
|
|
20
|
+
class ImageUserInput(CodexBaseModel):
|
|
21
21
|
"""Image URL user input."""
|
|
22
22
|
|
|
23
23
|
type: Literal["image"] = "image"
|
|
@@ -31,14 +31,14 @@ class UserInputImage(CodexBaseModel):
|
|
|
31
31
|
return cls(url=data_uri)
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
class
|
|
34
|
+
class LocalImageUserInput(CodexBaseModel):
|
|
35
35
|
"""Local image file user input."""
|
|
36
36
|
|
|
37
37
|
type: Literal["localImage"] = "localImage"
|
|
38
38
|
path: str
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
class
|
|
41
|
+
class SkillUserInput(CodexBaseModel):
|
|
42
42
|
"""Skill file user input."""
|
|
43
43
|
|
|
44
44
|
type: Literal["skill"] = "skill"
|
|
@@ -46,7 +46,7 @@ class UserInputSkill(CodexBaseModel):
|
|
|
46
46
|
path: str
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
class
|
|
49
|
+
class MentionUserInput(CodexBaseModel):
|
|
50
50
|
"""Mention user input."""
|
|
51
51
|
|
|
52
52
|
type: Literal["mention"] = "mention"
|
|
@@ -55,4 +55,4 @@ class UserInputMention(CodexBaseModel):
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
# Discriminated union of user input types
|
|
58
|
-
UserInput =
|
|
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
|
|
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
|