python-codex 0.3.3__py3-none-any.whl → 0.4.0__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.
Files changed (58) hide show
  1. pycodex/__init__.py +3 -27
  2. pycodex/bootstrap.py +5 -45
  3. pycodex/cli.py +1 -14
  4. pycodex/context.py +1 -1
  5. pycodex/events.py +1 -1
  6. pycodex/model.py +2 -2
  7. pycodex/portable/__init__.py +45 -0
  8. pycodex/{portable.py → portable/client.py} +4 -7
  9. pycodex/{portable_server.py → portable/server.py} +3 -3
  10. pycodex/protocol.py +1 -1
  11. pycodex/runtime.py +1 -1
  12. pycodex/tools/base_tool.py +1 -1
  13. pycodex/tools/close_agent_tool.py +1 -1
  14. pycodex/tools/code_mode_manager.py +1 -1
  15. pycodex/tools/request_permissions_tool.py +1 -1
  16. pycodex/tools/resume_agent_tool.py +1 -1
  17. pycodex/{runtime_services.py → tools/runtime_services.py} +5 -5
  18. pycodex/tools/send_input_tool.py +1 -1
  19. pycodex/tools/spawn_agent_tool.py +1 -1
  20. pycodex/tools/unified_exec_manager.py +1 -1
  21. pycodex/tools/update_plan_tool.py +1 -1
  22. pycodex/tools/view_image_tool.py +5 -0
  23. pycodex/tools/wait_agent_tool.py +1 -1
  24. pycodex/utils/__init__.py +0 -4
  25. pycodex/utils/_aes_gcm/LICENSE +56 -0
  26. pycodex/utils/_aes_gcm/README.md +61 -0
  27. pycodex/utils/_aes_gcm/__init__.py +1 -0
  28. pycodex/utils/_aes_gcm/aes.py +175 -0
  29. pycodex/utils/_aes_gcm/gcm.py +73 -0
  30. pycodex/utils/_aes_gcm/source-sha256.json +4 -0
  31. pycodex/{compat.py → utils/compat.py} +2 -0
  32. pycodex/utils/crypto.py +35 -0
  33. pycodex/utils/debug.py +24 -0
  34. pycodex/{doctor.py → utils/doctor.py} +3 -3
  35. pycodex/utils/image_utils.py +3 -2
  36. pycodex/{model_metadata.py → utils/model_metadata.py} +2 -2
  37. {python_codex-0.3.3.dist-info → python_codex-0.4.0.dist-info}/METADATA +120 -42
  38. {python_codex-0.3.3.dist-info → python_codex-0.4.0.dist-info}/RECORD +42 -50
  39. {python_codex-0.3.3.dist-info → python_codex-0.4.0.dist-info}/entry_points.txt +0 -1
  40. responses_server/app.py +28 -15
  41. pycodex/feishu_card.py +0 -793
  42. pycodex/feishu_link.py +0 -440
  43. pycodex/tools/ipython_tool.py +0 -142
  44. workspace_server/__init__.py +0 -39
  45. workspace_server/__main__.py +0 -4
  46. workspace_server/app.py +0 -1906
  47. workspace_server/content_views.LICENSE.txt +0 -470
  48. workspace_server/content_views.css +0 -1
  49. workspace_server/content_views.mjs +0 -25
  50. workspace_server/editor.css +0 -1
  51. workspace_server/editor.mjs +0 -1260
  52. workspace_server/owned_process.py +0 -27
  53. workspace_server/workspace.html +0 -2267
  54. workspace_server/workspace_views.py +0 -533
  55. workspace_server/workspaces.html +0 -550
  56. workspace_server/workspaces.py +0 -632
  57. {python_codex-0.3.3.dist-info → python_codex-0.4.0.dist-info}/WHEEL +0 -0
  58. {python_codex-0.3.3.dist-info → python_codex-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,27 +0,0 @@
1
- import os
2
- import threading
3
-
4
-
5
- def run_owned_server(app, host, port, input_fd):
6
- """Keep a server alive while its launching process holds stdin open."""
7
- import uvicorn
8
-
9
- owner_closed = threading.Event()
10
-
11
- def watch_owner():
12
- # A buffered stdin read can hold its lock across interpreter shutdown.
13
- while os.read(input_fd, 4096):
14
- pass
15
- owner_closed.set()
16
-
17
- class OwnedServer(uvicorn.Server):
18
- async def on_tick(self, counter):
19
- # Check after startup so even an early EOF goes through shutdown.
20
- if owner_closed.is_set():
21
- self.should_exit = True
22
- return await super().on_tick(counter)
23
-
24
- watcher = threading.Thread(target=watch_owner, name="workspace-owner", daemon=True)
25
- watcher.start()
26
- server = OwnedServer(uvicorn.Config(app, host=host, port=port, loop="asyncio"))
27
- server.run()