python-codex 0.0.1__py3-none-any.whl → 0.1.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 (62) hide show
  1. pycodex/__init__.py +139 -2
  2. pycodex/agent.py +290 -0
  3. pycodex/cli.py +641 -0
  4. pycodex/collaboration.py +21 -0
  5. pycodex/context.py +580 -0
  6. pycodex/doctor.py +360 -0
  7. pycodex/model.py +533 -0
  8. pycodex/prompts/collaboration_default.md +11 -0
  9. pycodex/prompts/collaboration_plan.md +128 -0
  10. pycodex/prompts/default_base_instructions.md +275 -0
  11. pycodex/prompts/exec_tools.json +411 -0
  12. pycodex/prompts/models.json +847 -0
  13. pycodex/prompts/permissions/approval_policy/never.md +1 -0
  14. pycodex/prompts/permissions/approval_policy/on_failure.md +1 -0
  15. pycodex/prompts/permissions/approval_policy/on_request.md +57 -0
  16. pycodex/prompts/permissions/approval_policy/on_request_rule_request_permission.md +33 -0
  17. pycodex/prompts/permissions/approval_policy/unless_trusted.md +1 -0
  18. pycodex/prompts/permissions/sandbox_mode/danger_full_access.md +1 -0
  19. pycodex/prompts/permissions/sandbox_mode/read_only.md +1 -0
  20. pycodex/prompts/permissions/sandbox_mode/workspace_write.md +1 -0
  21. pycodex/prompts/subagent_tools.json +163 -0
  22. pycodex/protocol.py +347 -0
  23. pycodex/runtime.py +200 -0
  24. pycodex/runtime_services.py +408 -0
  25. pycodex/tools/__init__.py +58 -0
  26. pycodex/tools/agent_tool_schemas.py +70 -0
  27. pycodex/tools/apply_patch_tool.py +363 -0
  28. pycodex/tools/base_tool.py +168 -0
  29. pycodex/tools/close_agent_tool.py +55 -0
  30. pycodex/tools/code_mode_manager.py +519 -0
  31. pycodex/tools/exec_command_tool.py +96 -0
  32. pycodex/tools/exec_runtime.js +161 -0
  33. pycodex/tools/exec_tool.py +48 -0
  34. pycodex/tools/grep_files_tool.py +150 -0
  35. pycodex/tools/list_dir_tool.py +135 -0
  36. pycodex/tools/read_file_tool.py +217 -0
  37. pycodex/tools/request_permissions_tool.py +95 -0
  38. pycodex/tools/request_user_input_tool.py +167 -0
  39. pycodex/tools/resume_agent_tool.py +56 -0
  40. pycodex/tools/send_input_tool.py +106 -0
  41. pycodex/tools/shell_command_tool.py +107 -0
  42. pycodex/tools/shell_tool.py +112 -0
  43. pycodex/tools/spawn_agent_tool.py +97 -0
  44. pycodex/tools/unified_exec_manager.py +380 -0
  45. pycodex/tools/update_plan_tool.py +79 -0
  46. pycodex/tools/view_image_tool.py +111 -0
  47. pycodex/tools/wait_agent_tool.py +75 -0
  48. pycodex/tools/wait_tool.py +68 -0
  49. pycodex/tools/web_search_tool.py +30 -0
  50. pycodex/tools/write_stdin_tool.py +75 -0
  51. pycodex/utils/__init__.py +40 -0
  52. pycodex/utils/dotenv.py +64 -0
  53. pycodex/utils/get_env.py +218 -0
  54. pycodex/utils/random_ids.py +19 -0
  55. pycodex/utils/visualize.py +978 -0
  56. python_codex-0.1.0.dist-info/METADATA +267 -0
  57. python_codex-0.1.0.dist-info/RECORD +60 -0
  58. python_codex-0.1.0.dist-info/entry_points.txt +2 -0
  59. python_codex-0.1.0.dist-info/licenses/LICENSE +201 -0
  60. python_codex-0.0.1.dist-info/METADATA +0 -30
  61. python_codex-0.0.1.dist-info/RECORD +0 -4
  62. {python_codex-0.0.1.dist-info → python_codex-0.1.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,267 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-codex
3
+ Version: 0.1.0
4
+ Summary: A minimal Python extraction of Codex's main agent loop
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: debugpy>=1.8.20
8
+ Requires-Dist: fastapi>=0.115
9
+ Requires-Dist: loguru>=0.7.3
10
+ Requires-Dist: prompt-toolkit>=3.0
11
+ Requires-Dist: requests>=2.31
12
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
13
+ Requires-Dist: uvicorn>=0.32
14
+ Description-Content-Type: text/markdown
15
+
16
+ # pycodex
17
+
18
+ PyPI distribution name: `python-codex`
19
+ Import path and CLI command remain `pycodex`.
20
+
21
+ 这个仓库把上游 Codex(`https://github.com/openai/codex`)里最核心的 agent
22
+ 闭环先抽成一个尽量小的 Python 版本,重点保留两层结构:
23
+
24
+ - `submission_loop`:顺序消费提交的操作。
25
+ - `run_turn`:在单个 turn 内持续执行 `模型采样 -> 工具调用 -> 把工具结果喂回模型`,直到拿到最终回答。
26
+
27
+ 对应的 Rust 参考点:
28
+
29
+ - `codex-rs/core/src/codex.rs` 里的 `submission_loop`
30
+ - `codex-rs/core/src/codex.rs` 里的 `run_turn`
31
+ - `codex-rs/core/src/codex.rs` 里的 `run_sampling_request`
32
+ - `codex-rs/core/src/tools/router.rs` 里的 `ToolRouter`
33
+ - `codex-rs/core/src/stream_events_utils.rs` 里的 `handle_output_item_done`
34
+
35
+ ## 快速开始
36
+
37
+ 先安装开发依赖:
38
+
39
+ ```bash
40
+ uv sync
41
+ ```
42
+
43
+ 试一下真实入口:
44
+
45
+ ```bash
46
+ uv run pycodex "Reply with exactly OK."
47
+ uv run pycodex
48
+ ```
49
+
50
+ ## 设计取舍
51
+
52
+ 这里不是对 Rust 版本做 1:1 移植,而是先收敛到一个最小可复用内核:
53
+
54
+ 1. 用一个很薄的 `ModelClient` 协议抽象模型侧。
55
+ 2. 用 `ToolRegistry` 管理工具规格和执行器。
56
+ 3. 用 `AgentLoop` 实现核心闭环。
57
+ 4. 用 `AgentRuntime` 保留外层提交队列,方便以后继续对齐 Rust 的 `submission_loop`。
58
+
59
+ 暂时刻意不包含:
60
+
61
+ - TUI / 流式增量渲染
62
+ - MCP / connectors / sandbox / approvals
63
+ - memory / compact / hooks / review mode
64
+ - 真实 OpenAI 适配器
65
+
66
+ 这些都可以后续继续往上叠,但当前项目先把最核心的“工具增强推理主循环”钉住。
67
+
68
+ ## 目录
69
+
70
+ - `pycodex/protocol.py`:最小的会话 item / prompt / event 协议
71
+ - `pycodex/model.py`:模型客户端协议和 Responses API 适配器
72
+ - `pycodex/cli.py`:`pycodex` 单轮命令行入口
73
+ - `pycodex/tools/base_tool.py`:`BaseTool`、`ToolRegistry`、`ToolContext`
74
+ - `pycodex/tools/`:具体工具实现
75
+ - `pycodex/agent.py`:主循环
76
+ - `pycodex/runtime.py`:外层提交队列
77
+ - `tests/test_agent.py`:核心行为测试
78
+
79
+ ## 当前对齐状态
80
+
81
+ 当前进度可以分成两层看:
82
+
83
+ - prompt/context 对齐:
84
+ - 非交互 `exec` 路径下,`instructions` 和 `input` 已经对齐到上游 Codex;
85
+ - 这一层现在主要由 `pycodex/context.py` 和 vendored prompt data 负责。
86
+ - turn-loop 语义对齐:
87
+ - `AgentLoop` 默认不再使用固定 12 轮上限;
88
+ - 现在和上游一样,按 “还有没有 follow-up / tool handoff” 自然收敛;
89
+ - 本地不再保留额外的 iteration-limit 参数。
90
+ - request-level 对齐:
91
+ - 非交互 `exec` 路径的 request body 已基本对齐;
92
+ - 默认 CLI 的 non-exec 首轮请求现在也已切到 `codex-tui` + `<collaboration_mode>` 这条上游路径;
93
+ - 默认 CLI 的两轮主线程对话 request/header 也已补抓并对齐,包括后续 turn 不再携带 `workspaces`;
94
+ - 当前剩余重点主要转向更外围的行为分支,而不是这条已比较路径上的 request/header。
95
+ - tool round-trip 对齐:
96
+ - `request_user_input` 的 Default-mode unavailable 路径已按真实 upstream capture 对齐;
97
+ - Plan-mode happy path 现在也已按 upstream 源码补齐到工具/协议层:会强制 `isOther=true`、要求非空 `options`,并以 JSON 字符串 + `success=true` 回传结构化答案;
98
+ - 新增了一个基于 `tests/fake_responses_server.py` proxy 模式的 deterministic round-trip compare 脚本 `tests/compare_request_user_input_roundtrip.py`;它在本机已安装的 `codex-cli 0.115.0` 上确认:Plan-mode live capture 里唯一剩余的 `function_call_output` schema 差异是 `pycodex` 多带了 `success=true`。
99
+
100
+ 更细的对齐说明见 `docs/ALIGNMENT.md`。
101
+
102
+ ## 真实模型联调
103
+
104
+ 如果本机已经有 Codex CLI 配置,可直接复用 `~/.codex/config.toml` 里的
105
+ `model`、`model_provider`、`base_url`、`env_key`:
106
+
107
+ ```python
108
+ from pycodex import ResponsesModelClient
109
+
110
+ client = ResponsesModelClient.from_codex_config()
111
+ ```
112
+
113
+ 当前实现走 OpenAI-compatible Responses API 的流式 `/responses` 接口。这个点
114
+ 已经用本机 `~/.codex/config.toml` 做过联调验证。
115
+
116
+ 通过 CLI 启动时,`pycodex` 还会在读取配置前加载同目录下的 `.env`
117
+ (通常是 `~/.codex/.env`),方便把 provider key 之类的环境变量放在那里。
118
+ 为对齐上游 Codex,`.env` 中以 `CODEX_` 开头的变量不会被导入。
119
+
120
+ ## pycodex
121
+
122
+ `pycodex` 现在默认是一个最小交互式入口,内部通过 `AgentRuntime` 驱动 turn
123
+ 提交循环,默认直接复用 `~/.codex/config.toml`:
124
+
125
+ ```bash
126
+ pycodex
127
+ pycodex "Summarize this repo in one sentence."
128
+ printf 'Reply with exactly OK.' | pycodex
129
+ pycodex --json "Reply with exactly OK."
130
+ pycodex --profile model_proxy "Reply with exactly OK."
131
+ pycodex --vllm-endpoint http://127.0.0.1:18000 "Reply with exactly OK."
132
+ pycodex doctor
133
+ ```
134
+
135
+ 当前行为:
136
+
137
+ - 没有 argv prompt 且 stdin 是 TTY 时,进入交互模式
138
+ - 有 argv prompt 或 stdin 管道输入时,执行单轮请求
139
+ - 交互模式下支持 `/exit` 和 `/quit`
140
+ - 交互模式下会显示简洁阶段事件流,例如工具执行状态和模型回看工具结果
141
+ - assistant 文本会按流式 delta 直接打印
142
+ - 交互模式下支持 `/history`、`/title` 和 `/model`
143
+ - `/model <name>` 会切换当前交互会话后续请求使用的模型;`/model` 会显示当前模型和可选模型
144
+ - 交互模式默认支持 steer:普通输入会走 runtime 的 steer 路径,当前请求会在下一个安全边界尽快停下,后续 steer 文本会按顺序并入下一次模型请求的 `input`;如需明确排队可用 `/queue <message>`,会打印 `[steer] queued: ...`,随后等该 turn 真正开始时再打印 `[steer] inserted: ...`
145
+ - 当前默认注册一组与原版 Codex 一一对应的本地工具子集:`shell`、`shell_command`、`exec_command`、`write_stdin`、`exec`、`wait`、`web_search`、`update_plan`、`request_user_input`、`request_permissions`、`spawn_agent`、`send_input`、`resume_agent`、`wait_agent`、`close_agent`、`apply_patch`、`grep_files`、`read_file`、`list_dir`、`view_image`
146
+ - `--vllm-endpoint http://host:port` 会自动拉起一个本地 `responses_server` compat 层;当 path 为空时会内部补 `/v1`,再把 `/responses` 请求转到下游 `/v1/chat/completions`,并在 provider 侧适配 mock `web_search` 与 custom-tool function wrapper
147
+ - `pycodex doctor` 会检查配置、`.env`、API key、DNS、TCP/TLS,以及可选的 live Responses API 请求
148
+
149
+ 它目前主要用于:
150
+
151
+ - 验证 provider / model / auth 配置是否可用
152
+ - 调试 `ResponsesModelClient`
153
+ - 做最小单轮 / 多轮 smoke test
154
+
155
+ `doctor` 示例:
156
+
157
+ ```bash
158
+ pycodex doctor
159
+ pycodex doctor --skip-live
160
+ pycodex doctor --json
161
+ ```
162
+
163
+ ## 示例
164
+
165
+ ```python
166
+ import asyncio
167
+
168
+ from pycodex import (
169
+ AgentLoop,
170
+ BaseTool,
171
+ ContextManager,
172
+ ResponsesModelClient,
173
+ ToolRegistry,
174
+ )
175
+
176
+
177
+ class EchoTool(BaseTool):
178
+ name = "echo"
179
+ description = "Echo the provided text."
180
+ input_schema = {
181
+ "type": "object",
182
+ "properties": {"text": {"type": "string"}},
183
+ "required": ["text"],
184
+ }
185
+
186
+ async def run(self, context, args):
187
+ del context
188
+ return args["text"]
189
+
190
+
191
+ async def main() -> None:
192
+ model = ResponsesModelClient.from_codex_config()
193
+ context_manager = ContextManager.from_codex_config()
194
+
195
+ tools = ToolRegistry()
196
+ tools.register(EchoTool())
197
+
198
+ agent = AgentLoop(model, tools, context_manager)
199
+ result = await agent.run_turn("Call the echo tool with text=hello, then tell me what it returned.")
200
+ print(result.output_text)
201
+
202
+
203
+ asyncio.run(main())
204
+ ```
205
+
206
+ ## 对齐清单
207
+
208
+ 更细的说明见 `docs/ALIGNMENT.md`。这里保留一个高层 checklist,方便直接看当前进度。
209
+
210
+ ### Tools 对齐
211
+
212
+ 上游官方工具:
213
+
214
+ - [x] `shell` — 执行 argv 形式的 shell 命令。
215
+ - [x] `shell_command` — 执行字符串形式的 shell script。
216
+ - [x] `exec_command` — 启动带 session 的长命令执行。
217
+ - [x] `write_stdin` — 向已有执行 session 写入 stdin 或轮询输出。
218
+ - [x] `web_search` — 暴露 provider-native 的网页搜索能力。
219
+ - [x] `update_plan` — 更新任务计划并维护步骤状态。
220
+ - [x] `request_user_input` — 向用户发起结构化问题并等待回答。
221
+ - [x] `request_permissions` — 请求额外权限再继续执行。
222
+ - [x] `spawn_agent` — 创建并启动子 agent。
223
+ - [x] `send_input` — 给已有子 agent 继续发送输入。
224
+ - [x] `resume_agent` — 恢复已关闭的子 agent。
225
+ - [x] `wait_agent` — 等待子 agent 进入终态。
226
+ - [x] `close_agent` — 关闭不再需要的子 agent。
227
+ - [x] `apply_patch` — 用 freeform patch 精确修改文件。
228
+ - [x] `grep_files` — 按模式搜索文件内容。
229
+ - [x] `read_file` — 读取文件片段并保留行号语义。
230
+ - [x] `list_dir` — 列出目录树片段。
231
+ - [x] `view_image` — 把本地图片转成模型可见输入。
232
+
233
+ 尚未单独建模的上游官方低频 / 特殊模式工具:
234
+
235
+ - [ ] `wait_infinite` — 长时间阻塞等待外部事件或后续输入。
236
+ - [ ] `spawn_agents_on_csv` — 按 CSV 批量创建子 agent 任务。
237
+ - [ ] `report_agent_job_result` — 上报批处理 agent job 的结果。
238
+ - [ ] `js_repl` — JavaScript REPL / code-mode 主入口。
239
+ - [ ] `js_repl_reset` — 重置 `js_repl` 的运行状态。
240
+ - [ ] `artifacts` — 生成或管理结构化工件输出。
241
+ - [ ] `list_mcp_resources` — 列出 MCP 资源。
242
+ - [ ] `list_mcp_resource_templates` — 列出 MCP 资源模板。
243
+ - [ ] `read_mcp_resource` — 读取 MCP 资源内容。
244
+ - [ ] `multi_tool_use.parallel` — 并行包装多个 developer tools 调用。
245
+
246
+ 本仓库额外兼容层 / 过渡工具:
247
+
248
+ - [x] `exec` — 当前对 code-mode 的本地近似实现。
249
+ - [x] `wait` — 当前对 code-mode 等待行为的本地近似实现。
250
+
251
+ ### 行为对齐
252
+
253
+ - [x] `AgentLoop` / `AgentRuntime` 主循环骨架 — turn 闭环和提交队列已成立。
254
+ - [x] 非交互 `exec` 路径的 `instructions` 对齐 — base instructions 已对齐上游。
255
+ - [x] 非交互 `exec` 路径的 `input` 对齐 — prompt input 已对齐上游。
256
+ - [x] developer/contextual-user message 的 shape 对齐 — message/content 结构已对齐。
257
+ - [x] `AGENTS.md` + `<environment_context>` 注入逻辑对齐 — 上下文拼接顺序已对齐。
258
+ - [x] 非交互 `exec` 路径的工具子集对齐 — 暴露给模型的工具集合已收敛。
259
+ - [x] `include = ["reasoning.encrypted_content"]` — reasoning include 字段已对齐。
260
+ - [x] `prompt_cache_key` — 请求级 prompt cache key 已补齐。
261
+ - [x] `x-client-request-id` — 请求 id header 已补齐。
262
+ - [x] `x-codex-turn-metadata` — turn id / sandbox header 已补齐。
263
+ - [x] `originator` — mode-aware originator header 已补齐。
264
+ - [x] `user-agent` 精确字符串对齐 — 非交互 `exec` 路径已对齐上游字符串。
265
+ - [x] exec-mode tool schema 的逐字段对齐 — 当前通过工具层直接复用上游 snapshot。
266
+ - [ ] 交互模式与非 `exec` 路径的完整行为对齐 — non-exec 首轮 context 已切到 `codex-tui` 路径,但 REPL 连续多轮行为还未完全验证。
267
+ - [ ] sandbox / approvals / compact / memory 等外围行为对齐 — 外围系统仍在后续范围。
@@ -0,0 +1,60 @@
1
+ pycodex/__init__.py,sha256=Cjeqgi3mmkmxE_xcTcPl4heS5k4UGBCG3qFGbwNm7PQ,2986
2
+ pycodex/agent.py,sha256=ApIneWSqDxryf9hdmTRFL65AH4e-sn0MWuuR80951Ec,10069
3
+ pycodex/cli.py,sha256=d3ug7fR9GeMDDe_BR37RBeUW6w5QnaFRTkGiNgvAkqA,21748
4
+ pycodex/collaboration.py,sha256=XAM2enljzHMjzZVlLxbOQF0JhWgKW4qaaDfVcUdE47g,632
5
+ pycodex/context.py,sha256=8-Eg1TE4-GVbEfW0fNZjDWhjLypK3jBlKZY1haYYVPY,23143
6
+ pycodex/doctor.py,sha256=VN-qetM2qJCNRNTZXBMe44VSrEOu8kUXE01luLMF050,10357
7
+ pycodex/model.py,sha256=ZqXSucpzBm0kn2XfhBdKebdwvJQH1Jc9xMqBfPwOKGM,19672
8
+ pycodex/protocol.py,sha256=8mQ7I-y9bxYueSr7d_yGj2Tw69t47OCgwvmxhwihdFw,10807
9
+ pycodex/runtime.py,sha256=Symum2pt6QibV_a3oWm9KWku50u22tLrmXQu76hJSH0,7560
10
+ pycodex/runtime_services.py,sha256=Ir2gM7Qf-uSy9JPc8ahL85ifkY5JPdX09y-iHS_qYo8,12374
11
+ pycodex/prompts/collaboration_default.md,sha256=MBTmPuMubeWfZgIeFVj49wwnwD4n_o3fVYAbgWKwu6Q,955
12
+ pycodex/prompts/collaboration_plan.md,sha256=IzjQAA5oHJz-3FmJdOjsJ4LHq6LW1tlEYMoy09n0HKk,8777
13
+ pycodex/prompts/default_base_instructions.md,sha256=D65mcj6bo4CDvVom-D9cbJRJVNquo0NghKt164_fRsg,20923
14
+ pycodex/prompts/exec_tools.json,sha256=2wYLsjL6VGzMnhFNCxE9IA_kxsxUspN68lr7JOlZq54,23369
15
+ pycodex/prompts/models.json,sha256=Xmuy5-FiiWdAe-Zz9w_-_kdEcRvIVssS1PugQSA64i8,251450
16
+ pycodex/prompts/subagent_tools.json,sha256=2ZOXyAiAaai2aazIlXdjjXb7cra5gZ2WYYbPltPaiYg,6199
17
+ pycodex/prompts/permissions/approval_policy/never.md,sha256=QceTG6wjkaJARjYr0HYV1aPnPcpGcrkRUW-smWRr6MQ,120
18
+ pycodex/prompts/permissions/approval_policy/on_failure.md,sha256=dfJjpXkpO6_ANdCKxbVJ8o4vyLxevrJWfKsGHTqtbkc,289
19
+ pycodex/prompts/permissions/approval_policy/on_request.md,sha256=hVQalzh0FAdkKzw5u-N4H7-LtC9ijVDlYsh3OKsZKzo,3661
20
+ pycodex/prompts/permissions/approval_policy/on_request_rule_request_permission.md,sha256=mOinishp1k-wlPsaEuIOMn5GoVm_dAIsWIuEMmv2r7o,1725
21
+ pycodex/prompts/permissions/approval_policy/unless_trusted.md,sha256=XHpi1Lfx1iIXFbbQ_ho_kGstA3JN-RLho291HM30UNw,247
22
+ pycodex/prompts/permissions/sandbox_mode/danger_full_access.md,sha256=nZ7YHacBd3cAHKRZc9XClOOOnXJPXPh0WFBueh5C2D0,197
23
+ pycodex/prompts/permissions/sandbox_mode/read_only.md,sha256=2rAPEXsBYCcuttI5j3euS-3uv_v97catIsnhxlSQSIM,173
24
+ pycodex/prompts/permissions/sandbox_mode/workspace_write.md,sha256=lVN-LwrBbHqlv5yVjcd_mU8tzZW8jfKpTatJKIZu9HI,277
25
+ pycodex/tools/__init__.py,sha256=aSLXrr_31KGQgDfRow5zVIc-2-KdXlHaCE6qUnE4HWI,1772
26
+ pycodex/tools/agent_tool_schemas.py,sha256=adzoo0L6jCM7rLF-O1mNrq85HENQ_oKakjzwP6id1Yk,2069
27
+ pycodex/tools/apply_patch_tool.py,sha256=8hHxoWxWovAYdhr0XzDCZwljtMlApp7-TMZtyxe3adY,13691
28
+ pycodex/tools/base_tool.py,sha256=34NaExjTCyDn333MzlU4ShQ9WHocW3WREfg9ifdAqY4,5299
29
+ pycodex/tools/close_agent_tool.py,sha256=InKhe2gFWOcqE187J3XYrCckecsyAR48VeVmGdYhKWE,1623
30
+ pycodex/tools/code_mode_manager.py,sha256=pEczPyCq-3DpJlTtfUEpl4JAGolz8cOpI8mBc7gdrn0,18603
31
+ pycodex/tools/exec_command_tool.py,sha256=_fWfkQLGeINb2-cniY9CWskkAPjC9hE8pfjcBKkWXAg,3459
32
+ pycodex/tools/exec_runtime.js,sha256=ZczdhrzpSZ-qNnJDDJOe8Ap86HpzHb2FZ_vSpHszgLs,3625
33
+ pycodex/tools/exec_tool.py,sha256=b3_HSlyA0qB9rJulSckLBXOcKS3Lw5xvsQXU-wpNpCs,1414
34
+ pycodex/tools/grep_files_tool.py,sha256=twsx1KsvOWh8mi-lbycAtEyh6PeLxtNzl9LzdjwgAf4,4742
35
+ pycodex/tools/list_dir_tool.py,sha256=7S0RsE-NL04G47FmFZtzo-N-O3fPCYQFF0HrjEVuv3U,4749
36
+ pycodex/tools/read_file_tool.py,sha256=GVamhSNEZ1F1IU_og9GgSCzV12TL5t5b1fOUlzTOQBQ,8084
37
+ pycodex/tools/request_permissions_tool.py,sha256=GzYG-mc1ifTiIM8xK8WD-vPGUKpYgMX9zyqq9O6K-EE,3036
38
+ pycodex/tools/request_user_input_tool.py,sha256=hVqCYGPLA29uxBblIjUIoIrzXVg5KZ8PcxJ84obgNro,5715
39
+ pycodex/tools/resume_agent_tool.py,sha256=vF-vLtx90bOuSjLFvn9vgqrKiznIbwpmZ3HVJlCP1LE,1640
40
+ pycodex/tools/send_input_tool.py,sha256=z9PR5VoFd9SF4A-ol04Op8AXQF_3YLE74C6coiTXsZ0,3546
41
+ pycodex/tools/shell_command_tool.py,sha256=Bbah_5HirG1BJOIiqzuMa8kNHNYVPCUvxCFa09eRU6A,3500
42
+ pycodex/tools/shell_tool.py,sha256=BWSaEJZwfQg9Ta-ld2wqeXqavrZC7Y8qgF_vBEOxfYA,3678
43
+ pycodex/tools/spawn_agent_tool.py,sha256=LfJlGI0Ecp9HWNLlTubyybFq-xeRNChILq9ozT7piA8,3556
44
+ pycodex/tools/unified_exec_manager.py,sha256=dyuGfaljXTuV4_Bf5Y6OwFGj5_Kb1LW-sh9ni5mMF1Y,12602
45
+ pycodex/tools/update_plan_tool.py,sha256=l_EG39bEw5K9BIUKoSUsXYDb0W7aLn8SviKSb-bs7Os,2887
46
+ pycodex/tools/view_image_tool.py,sha256=yB915Jd3he4RjPANdm-dYdvio24OXKhBkAsp-9WVPBg,3924
47
+ pycodex/tools/wait_agent_tool.py,sha256=1tJ5spBtpZ_MjoMv5xmZz5WWKl7UwMqHIJ3SYKXEPZw,2596
48
+ pycodex/tools/wait_tool.py,sha256=G4YhaYeWAvUedzxTDAxbczVmXXUp7H2OKWO3qZlEyyk,2324
49
+ pycodex/tools/web_search_tool.py,sha256=hq78XF6MRvmNyPFSIp5eI0eYn9ryKdKvvoIOFNU3tuY,987
50
+ pycodex/tools/write_stdin_tool.py,sha256=DghlwPJnAqDoRBYyh1zeXRsfTXoQUdLJ8JQfrdE4RLs,2542
51
+ pycodex/utils/__init__.py,sha256=Hj_0a7RhkAblWkaHyFhpi0cs2nSjJ1NdavbkBgEHieY,1024
52
+ pycodex/utils/dotenv.py,sha256=sOpu6PA1VrsPZK13ynh3nZg3-u9pdiCXkW648v3pwZQ,1789
53
+ pycodex/utils/get_env.py,sha256=3l_KA8JCWW9mrKE9FiV2mTx10-e5MUbxaU8jbn3JaRs,6265
54
+ pycodex/utils/random_ids.py,sha256=vOEVgkwKeQXaHoEVU7IfsPPjKUABkGIeQ7lu9MZctU8,413
55
+ pycodex/utils/visualize.py,sha256=fK79pTfOwMmRrQujAosGt0nGyyJjpz0GfpWY8BkK91c,35369
56
+ python_codex-0.1.0.dist-info/METADATA,sha256=27msS6W8ibM1JsRSE7zMXpVBAvMxdFkBIPlehjwjtAc,11720
57
+ python_codex-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
58
+ python_codex-0.1.0.dist-info/entry_points.txt,sha256=sNUVakoVuTrzJH505ZgRTQxmtRRPUHV_EH0i6EbYTyM,45
59
+ python_codex-0.1.0.dist-info/licenses/LICENSE,sha256=0X8ifk312hYAORM4hlzg8wVSEXYKNmiPgWlB1YIy2Nw,10926
60
+ python_codex-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pycodex = pycodex.cli:main
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 OpenAI
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,30 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python-codex
3
- Version: 0.0.1
4
- Summary: Placeholder initial release for python-codex.
5
- Project-URL: Homepage, https://github.com/Randomizez/pycodex
6
- Project-URL: Issues, https://github.com/Randomizez/pycodex/issues
7
- Requires-Python: >=3.10
8
- Description-Content-Type: text/markdown
9
-
10
- # python-codex
11
-
12
- This repository is intentionally starting with a minimal placeholder release for
13
- the `python-codex` package and a GitHub Actions-based PyPI publishing pipeline.
14
-
15
- ## What is included
16
-
17
- - a minimal importable package: `pycodex`
18
- - a GitHub Actions workflow at `.github/workflows/publish.yml`
19
- - Trusted Publishing-ready jobs for both TestPyPI and PyPI
20
-
21
- ## Release flow
22
-
23
- - `workflow_dispatch` with `repository=testpypi` publishes to TestPyPI
24
- - `workflow_dispatch` with `repository=pypi` publishes to PyPI
25
- - publishing a GitHub Release triggers the PyPI publish job
26
-
27
- ## Before the first publish
28
-
29
- Configure Trusted Publishing on TestPyPI/PyPI for this GitHub repository and
30
- workflow.
@@ -1,4 +0,0 @@
1
- pycodex/__init__.py,sha256=Gi_sxZl78Sep-OvI4SF_FG4JIQvYccPOSvzg-edcDCE,82
2
- python_codex-0.0.1.dist-info/METADATA,sha256=Tic6sz1Pihp9ZxGdxJrHrTWuwqHQN08VKFSQKnsRhao,995
3
- python_codex-0.0.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
4
- python_codex-0.0.1.dist-info/RECORD,,