python-codex 0.2.5__py3-none-any.whl → 0.2.7__py3-none-any.whl
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.
- pycodex/__init__.py +4 -0
- pycodex/agent.py +54 -14
- pycodex/cli.py +110 -36
- pycodex/image_utils.py +79 -0
- pycodex/model.py +7 -1
- pycodex/portable.py +14 -7
- pycodex/prompts/models.json +170 -0
- pycodex/runtime.py +2 -0
- pycodex/tools/__init__.py +3 -0
- pycodex/tools/clock_tool.py +168 -0
- pycodex/tools/view_image_tool.py +7 -9
- pycodex/utils/compactor.py +17 -2
- pycodex/utils/session_persist.py +50 -2
- pycodex/utils/visualize.py +11 -4
- {python_codex-0.2.5.dist-info → python_codex-0.2.7.dist-info}/METADATA +47 -17
- {python_codex-0.2.5.dist-info → python_codex-0.2.7.dist-info}/RECORD +27 -25
- responses_server/config.py +4 -1
- responses_server/messages_api.py +49 -0
- responses_server/payload_processors.py +1 -0
- responses_server/stream_router.py +108 -22
- responses_server/trajectory_dump.py +18 -2
- workspace_server/app.py +12 -12
- workspace_server/workspace.html +300 -103
- workspace_server/workspaces.py +34 -24
- {python_codex-0.2.5.dist-info → python_codex-0.2.7.dist-info}/WHEEL +0 -0
- {python_codex-0.2.5.dist-info → python_codex-0.2.7.dist-info}/entry_points.txt +0 -0
- {python_codex-0.2.5.dist-info → python_codex-0.2.7.dist-info}/licenses/LICENSE +0 -0
workspace_server/workspaces.py
CHANGED
|
@@ -123,19 +123,23 @@ def load_workspace_definitions(
|
|
|
123
123
|
)
|
|
124
124
|
|
|
125
125
|
board_value = item.get("board")
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"workspace
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
board_path = None
|
|
127
|
+
if board_value is not False:
|
|
128
|
+
if not isinstance(board_value, str) or not board_value.strip():
|
|
129
|
+
raise ValueError(
|
|
130
|
+
"workspace `{0}` requires a board path or false".format(workspace_id)
|
|
131
|
+
)
|
|
132
|
+
board_path = _resolve_workspace_path(board_value, path.parent)
|
|
133
|
+
if board_path in seen_boards:
|
|
134
|
+
raise ValueError("duplicate workspace board: {0}".format(board_path))
|
|
135
|
+
seen_boards.add(board_path)
|
|
136
|
+
if not board_path.parent.is_dir():
|
|
137
|
+
raise ValueError(
|
|
138
|
+
"workspace `{0}` board parent directory does not exist: {1}".format(
|
|
139
|
+
workspace_id,
|
|
140
|
+
board_path.parent,
|
|
141
|
+
)
|
|
137
142
|
)
|
|
138
|
-
)
|
|
139
143
|
|
|
140
144
|
result.append(
|
|
141
145
|
WorkspaceDefinition(
|
|
@@ -169,7 +173,7 @@ def save_workspace_definitions(
|
|
|
169
173
|
def _workspace_definition_to_json(
|
|
170
174
|
definition: 'WorkspaceDefinition',
|
|
171
175
|
base_dir: 'Path',
|
|
172
|
-
) -> 'typing.Dict[str,
|
|
176
|
+
) -> 'typing.Dict[str, object]':
|
|
173
177
|
result = {
|
|
174
178
|
"id": definition.workspace_id,
|
|
175
179
|
"work_dir": _format_path_for_workspace_config(definition.work_dir, base_dir),
|
|
@@ -179,6 +183,8 @@ def _workspace_definition_to_json(
|
|
|
179
183
|
definition.board_path,
|
|
180
184
|
base_dir,
|
|
181
185
|
)
|
|
186
|
+
else:
|
|
187
|
+
result["board"] = False
|
|
182
188
|
return result
|
|
183
189
|
|
|
184
190
|
|
|
@@ -440,7 +446,7 @@ class WorkspaceRegistry:
|
|
|
440
446
|
|
|
441
447
|
def _key_for_definition(self, definition: 'WorkspaceDefinition') -> str:
|
|
442
448
|
if definition.board_path is None:
|
|
443
|
-
|
|
449
|
+
return "workspace:{0}".format(definition.workspace_id)
|
|
444
450
|
return str(definition.board_path.resolve())
|
|
445
451
|
|
|
446
452
|
async def start(self) -> None:
|
|
@@ -466,7 +472,7 @@ class WorkspaceRegistry:
|
|
|
466
472
|
self,
|
|
467
473
|
name: str,
|
|
468
474
|
work_dir: str = "./",
|
|
469
|
-
board: "typing.Union[str, None]" = None,
|
|
475
|
+
board: "typing.Union[str, bool, None]" = None,
|
|
470
476
|
) -> 'WorkspaceEntry':
|
|
471
477
|
if self._entry_factory is None:
|
|
472
478
|
raise ValueError("workspace creation is unavailable")
|
|
@@ -475,15 +481,19 @@ class WorkspaceRegistry:
|
|
|
475
481
|
resolved_work_dir = _resolve_workspace_path(str(work_dir or "./"), base_dir)
|
|
476
482
|
resolved_work_dir.mkdir(parents=True, exist_ok=True)
|
|
477
483
|
|
|
478
|
-
board_path =
|
|
479
|
-
|
|
480
|
-
if
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
484
|
+
board_path = None
|
|
485
|
+
if board is not False:
|
|
486
|
+
if board is not None and not isinstance(board, str):
|
|
487
|
+
raise ValueError("board must be a path string or false")
|
|
488
|
+
board_path = (
|
|
489
|
+
_resolve_workspace_path(board, base_dir)
|
|
490
|
+
if board and board.strip()
|
|
491
|
+
else default_board_path()
|
|
492
|
+
)
|
|
493
|
+
board_path.parent.mkdir(parents=True, exist_ok=True)
|
|
494
|
+
board_key = str(board_path.resolve())
|
|
495
|
+
if board_key in self._entries:
|
|
496
|
+
raise ValueError("workspace board already exists: {0}".format(board_path))
|
|
487
497
|
|
|
488
498
|
workspace_id = normalize_workspace_id(name)
|
|
489
499
|
if not workspace_id:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|