python-codex 0.2.3__tar.gz → 0.2.4__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.
Files changed (124) hide show
  1. python_codex-0.2.4/.github/workflows/publish.yml +157 -0
  2. {python_codex-0.2.3 → python_codex-0.2.4}/PKG-INFO +1 -1
  3. {python_codex-0.2.3 → python_codex-0.2.4}/pyproject.toml +1 -1
  4. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_workspace_server.py +8 -1
  5. python_codex-0.2.3/.github/workflows/publish.yml +0 -81
  6. {python_codex-0.2.3 → python_codex-0.2.4}/.github/workflows/test.yml +0 -0
  7. {python_codex-0.2.3 → python_codex-0.2.4}/.gitignore +0 -0
  8. {python_codex-0.2.3 → python_codex-0.2.4}/AGENTS.md +0 -0
  9. {python_codex-0.2.3 → python_codex-0.2.4}/LICENSE +0 -0
  10. {python_codex-0.2.3 → python_codex-0.2.4}/README.md +0 -0
  11. {python_codex-0.2.3 → python_codex-0.2.4}/README_ZH.md +0 -0
  12. {python_codex-0.2.3 → python_codex-0.2.4}/docs/ALIGNMENT.md +0 -0
  13. {python_codex-0.2.3 → python_codex-0.2.4}/docs/CONTEXT.md +0 -0
  14. {python_codex-0.2.3 → python_codex-0.2.4}/docs/responses_server/README.md +0 -0
  15. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/__init__.py +0 -0
  16. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/agent.py +0 -0
  17. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/cli.py +0 -0
  18. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/collaboration.py +0 -0
  19. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/compat.py +0 -0
  20. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/context.py +0 -0
  21. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/doctor.py +0 -0
  22. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/feishu_card.py +0 -0
  23. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/feishu_link.py +0 -0
  24. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/interactive_session.py +0 -0
  25. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/model.py +0 -0
  26. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/portable.py +0 -0
  27. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/portable_server.py +0 -0
  28. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/collaboration_default.md +0 -0
  29. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/collaboration_plan.md +0 -0
  30. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/default_base_instructions.md +0 -0
  31. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/models.json +0 -0
  32. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/approval_policy/never.md +0 -0
  33. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/approval_policy/on_failure.md +0 -0
  34. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/approval_policy/on_request.md +0 -0
  35. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/approval_policy/on_request_rule_request_permission.md +0 -0
  36. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/approval_policy/unless_trusted.md +0 -0
  37. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/sandbox_mode/danger_full_access.md +0 -0
  38. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/sandbox_mode/read_only.md +0 -0
  39. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/prompts/permissions/sandbox_mode/workspace_write.md +0 -0
  40. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/protocol.py +0 -0
  41. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/runtime.py +0 -0
  42. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/runtime_services.py +0 -0
  43. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/__init__.py +0 -0
  44. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/agent_tool_schemas.py +0 -0
  45. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/apply_patch_tool.py +0 -0
  46. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/base_tool.py +0 -0
  47. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/close_agent_tool.py +0 -0
  48. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/code_mode_manager.py +0 -0
  49. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/exec_command_tool.py +0 -0
  50. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/exec_runtime.js +0 -0
  51. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/exec_tool.py +0 -0
  52. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/grep_files_tool.py +0 -0
  53. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/ipython_tool.py +0 -0
  54. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/list_dir_tool.py +0 -0
  55. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/read_file_tool.py +0 -0
  56. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/request_permissions_tool.py +0 -0
  57. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/request_user_input_tool.py +0 -0
  58. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/resume_agent_tool.py +0 -0
  59. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/send_input_tool.py +0 -0
  60. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/shell_command_tool.py +0 -0
  61. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/shell_tool.py +0 -0
  62. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/spawn_agent_tool.py +0 -0
  63. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/unified_exec_manager.py +0 -0
  64. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/update_plan_tool.py +0 -0
  65. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/view_image_tool.py +0 -0
  66. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/wait_agent_tool.py +0 -0
  67. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/wait_tool.py +0 -0
  68. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/web_search_tool.py +0 -0
  69. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/tools/write_stdin_tool.py +0 -0
  70. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/__init__.py +0 -0
  71. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/async_bridge.py +0 -0
  72. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/compactor.py +0 -0
  73. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/debug.py +0 -0
  74. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/dotenv.py +0 -0
  75. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/get_env.py +0 -0
  76. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/random_ids.py +0 -0
  77. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/session_persist.py +0 -0
  78. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/toolcall_visualize.py +0 -0
  79. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/truncation.py +0 -0
  80. {python_codex-0.2.3 → python_codex-0.2.4}/pycodex/utils/visualize.py +0 -0
  81. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/__init__.py +0 -0
  82. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/__main__.py +0 -0
  83. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/app.py +0 -0
  84. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/config.py +0 -0
  85. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/messages_api.py +0 -0
  86. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/payload_processors.py +0 -0
  87. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/server.py +0 -0
  88. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/session_store.py +0 -0
  89. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/stream_router.py +0 -0
  90. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/tools/__init__.py +0 -0
  91. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/tools/custom_adapter.py +0 -0
  92. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/tools/web_search.py +0 -0
  93. {python_codex-0.2.3 → python_codex-0.2.4}/responses_server/trajectory_dump.py +0 -0
  94. {python_codex-0.2.3 → python_codex-0.2.4}/tests/TESTS.md +0 -0
  95. {python_codex-0.2.3 → python_codex-0.2.4}/tests/__init__.py +0 -0
  96. {python_codex-0.2.3 → python_codex-0.2.4}/tests/compare_request_user_input_roundtrip.py +0 -0
  97. {python_codex-0.2.3 → python_codex-0.2.4}/tests/compare_steer_request_bodies.py +0 -0
  98. {python_codex-0.2.3 → python_codex-0.2.4}/tests/compare_tool_schemas.py +0 -0
  99. {python_codex-0.2.3 → python_codex-0.2.4}/tests/fake_responses_server.py +0 -0
  100. {python_codex-0.2.3 → python_codex-0.2.4}/tests/fakes.py +0 -0
  101. {python_codex-0.2.3 → python_codex-0.2.4}/tests/responses_server/fake_chat_completions_server.py +0 -0
  102. {python_codex-0.2.3 → python_codex-0.2.4}/tests/responses_server/test_server.py +0 -0
  103. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_agent.py +0 -0
  104. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_async_bridge.py +0 -0
  105. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_builtin_tools.py +0 -0
  106. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_cli.py +0 -0
  107. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_compactor.py +0 -0
  108. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_context.py +0 -0
  109. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_doctor.py +0 -0
  110. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_fake_responses_server.py +0 -0
  111. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_feishu_card.py +0 -0
  112. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_feishu_link.py +0 -0
  113. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_ipython_tool.py +0 -0
  114. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_model.py +0 -0
  115. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_portable.py +0 -0
  116. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_py36_syntax.py +0 -0
  117. {python_codex-0.2.3 → python_codex-0.2.4}/tests/test_visualize.py +0 -0
  118. {python_codex-0.2.3 → python_codex-0.2.4}/tools/feishu_oauth.py +0 -0
  119. {python_codex-0.2.3 → python_codex-0.2.4}/workspace_server/__init__.py +0 -0
  120. {python_codex-0.2.3 → python_codex-0.2.4}/workspace_server/__main__.py +0 -0
  121. {python_codex-0.2.3 → python_codex-0.2.4}/workspace_server/app.py +0 -0
  122. {python_codex-0.2.3 → python_codex-0.2.4}/workspace_server/workspace.html +0 -0
  123. {python_codex-0.2.3 → python_codex-0.2.4}/workspace_server/workspaces.html +0 -0
  124. {python_codex-0.2.3 → python_codex-0.2.4}/workspace_server/workspaces.py +0 -0
@@ -0,0 +1,157 @@
1
+ name: publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ repository:
7
+ description: Publish target repository
8
+ required: true
9
+ default: testpypi
10
+ type: choice
11
+ options:
12
+ - testpypi
13
+ - pypi
14
+ release:
15
+ types: [published]
16
+ push:
17
+ tags:
18
+ - "v*"
19
+
20
+ jobs:
21
+ pytest-modern:
22
+ name: pytest (Python ${{ matrix.python-version }})
23
+ runs-on: ubuntu-22.04
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ python-version:
28
+ - "3.7"
29
+ - "3.8"
30
+ - "3.10"
31
+ steps:
32
+ - name: Check out repository
33
+ uses: actions/checkout@v4
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: ${{ matrix.python-version }}
39
+
40
+ - name: Set up uv
41
+ uses: astral-sh/setup-uv@v5
42
+
43
+ - name: Sync dependencies
44
+ run: uv sync --dev
45
+
46
+ - name: Run pytest
47
+ run: uv run pytest
48
+
49
+ pytest-py36:
50
+ name: pytest (Python 3.6)
51
+ runs-on: ubuntu-22.04
52
+ container:
53
+ image: python:3.6.15-slim-bullseye
54
+ steps:
55
+ - name: Install system dependencies
56
+ run: |
57
+ apt-get update
58
+ apt-get install -y --no-install-recommends git nodejs npm
59
+
60
+ - name: Check out repository
61
+ uses: actions/checkout@v4
62
+
63
+ - name: Mark workspace as safe for git
64
+ run: git config --global --add safe.directory "$PWD"
65
+
66
+ - name: Show runtime versions
67
+ run: |
68
+ python --version
69
+ pip --version
70
+ git --version
71
+ node --version
72
+
73
+ - name: Install Python 3.6 compatibility dependencies
74
+ run: |
75
+ python -m pip install -i https://pypi.org/simple \
76
+ "dataclasses>=0.8" \
77
+ "typing_extensions>=4.1.1,<4.2" \
78
+ "importlib_metadata>=4.8.3,<5" \
79
+ "tomli>=1.2.3,<2" \
80
+ "requests>=2.27.1" \
81
+ "prompt-toolkit>=3.0.36,<3.1" \
82
+ "loguru>=0.7.3,<1" \
83
+ "cryptography>=40.0.2,<41" \
84
+ "fastapi>=0.83,<0.84" \
85
+ "uvicorn>=0.16,<0.17" \
86
+ "pytest>=6.2.5,<7" \
87
+ "pytest-asyncio>=0.16,<0.17"
88
+
89
+ - name: Run Python 3.6 pytest
90
+ env:
91
+ PYTHONPATH: ${{ github.workspace }}
92
+ run: python -m pytest -c /dev/null
93
+
94
+ build:
95
+ needs:
96
+ - pytest-modern
97
+ - pytest-py36
98
+ runs-on: ubuntu-latest
99
+ steps:
100
+ - name: Check out repository
101
+ uses: actions/checkout@v4
102
+
103
+ - name: Set up Python
104
+ uses: actions/setup-python@v5
105
+ with:
106
+ python-version: "3.12"
107
+
108
+ - name: Build distributions
109
+ run: |
110
+ python -m pip install --upgrade build
111
+ python -m build
112
+
113
+ - name: Upload distributions
114
+ uses: actions/upload-artifact@v4
115
+ with:
116
+ name: python-package-distributions
117
+ path: dist/
118
+
119
+ publish-testpypi:
120
+ if: github.event_name == 'workflow_dispatch' && inputs.repository == 'testpypi'
121
+ needs: build
122
+ runs-on: ubuntu-latest
123
+ permissions:
124
+ id-token: write
125
+ environment:
126
+ name: testpypi
127
+ url: https://test.pypi.org/project/pycodex/
128
+ steps:
129
+ - name: Download distributions
130
+ uses: actions/download-artifact@v4
131
+ with:
132
+ name: python-package-distributions
133
+ path: dist/
134
+
135
+ - name: Publish to TestPyPI
136
+ uses: pypa/gh-action-pypi-publish@release/v1
137
+ with:
138
+ repository-url: https://test.pypi.org/legacy/
139
+
140
+ publish-pypi:
141
+ if: github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.repository == 'pypi')
142
+ needs: build
143
+ runs-on: ubuntu-latest
144
+ permissions:
145
+ id-token: write
146
+ environment:
147
+ name: pypi
148
+ url: https://pypi.org/project/pycodex/
149
+ steps:
150
+ - name: Download distributions
151
+ uses: actions/download-artifact@v4
152
+ with:
153
+ name: python-package-distributions
154
+ path: dist/
155
+
156
+ - name: Publish to PyPI
157
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-codex
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A minimal Python extraction of Codex's main agent loop
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.6.2
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-codex"
7
- version = "0.2.3"
7
+ version = "0.2.4"
8
8
  description = "A minimal Python extraction of Codex's main agent loop"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.6.2"
@@ -45,6 +45,13 @@ from tests.fakes import ScriptedModelClient
45
45
  import time
46
46
 
47
47
 
48
+ def _get_without_redirects(client: TestClient, url: str):
49
+ try:
50
+ return client.get(url, follow_redirects=False)
51
+ except TypeError:
52
+ return client.get(url, allow_redirects=False)
53
+
54
+
48
55
  class _FailingWorkspaceTool(BaseTool):
49
56
  name = "fail"
50
57
  description = "Always fails."
@@ -346,7 +353,7 @@ def test_multi_workspace_app_password_protects_http_routes(tmp_path) -> None:
346
353
  app = create_multi_workspace_app(registry, password="12345")
347
354
 
348
355
  with TestClient(app) as client:
349
- unauthorized = client.get("/", follow_redirects=False)
356
+ unauthorized = _get_without_redirects(client, "/")
350
357
  login_page = client.get("/login")
351
358
  api_unauthorized = client.get("/api/workspaces")
352
359
  wrong = client.post("/login", json={"password": "wrong"})
@@ -1,81 +0,0 @@
1
- name: publish
2
-
3
- on:
4
- workflow_dispatch:
5
- inputs:
6
- repository:
7
- description: Publish target repository
8
- required: true
9
- default: testpypi
10
- type: choice
11
- options:
12
- - testpypi
13
- - pypi
14
- release:
15
- types: [published]
16
- push:
17
- tags:
18
- - "v*"
19
-
20
- jobs:
21
- build:
22
- runs-on: ubuntu-latest
23
- steps:
24
- - name: Check out repository
25
- uses: actions/checkout@v4
26
-
27
- - name: Set up Python
28
- uses: actions/setup-python@v5
29
- with:
30
- python-version: "3.12"
31
-
32
- - name: Build distributions
33
- run: |
34
- python -m pip install --upgrade build
35
- python -m build
36
-
37
- - name: Upload distributions
38
- uses: actions/upload-artifact@v4
39
- with:
40
- name: python-package-distributions
41
- path: dist/
42
-
43
- publish-testpypi:
44
- if: github.event_name == 'workflow_dispatch' && inputs.repository == 'testpypi'
45
- needs: build
46
- runs-on: ubuntu-latest
47
- permissions:
48
- id-token: write
49
- environment:
50
- name: testpypi
51
- url: https://test.pypi.org/project/pycodex/
52
- steps:
53
- - name: Download distributions
54
- uses: actions/download-artifact@v4
55
- with:
56
- name: python-package-distributions
57
- path: dist/
58
-
59
- - name: Publish to TestPyPI
60
- uses: pypa/gh-action-pypi-publish@release/v1
61
- with:
62
- repository-url: https://test.pypi.org/legacy/
63
-
64
- publish-pypi:
65
- if: github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.repository == 'pypi')
66
- needs: build
67
- runs-on: ubuntu-latest
68
- permissions:
69
- id-token: write
70
- environment:
71
- name: pypi
72
- url: https://pypi.org/project/pycodex/
73
- steps:
74
- - name: Download distributions
75
- uses: actions/download-artifact@v4
76
- with:
77
- name: python-package-distributions
78
- path: dist/
79
-
80
- - name: Publish to PyPI
81
- uses: pypa/gh-action-pypi-publish@release/v1
File without changes
File without changes
File without changes
File without changes
File without changes