codex-python 0.1.0__py3-none-any.whl → 0.1.2__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.
- codex/__init__.py +1 -1
- codex/api.py +17 -1
- codex/protocol/runtime.py +80 -0
- codex/protocol/types.py +1595 -0
- {codex_python-0.1.0.dist-info → codex_python-0.1.2.dist-info}/METADATA +31 -3
- codex_python-0.1.2.dist-info/RECORD +9 -0
- codex_python-0.1.0.dist-info/RECORD +0 -7
- {codex_python-0.1.0.dist-info → codex_python-0.1.2.dist-info}/WHEEL +0 -0
- {codex_python-0.1.0.dist-info → codex_python-0.1.2.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: codex-python
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: A minimal Python library scaffold for codex-python
|
5
5
|
Project-URL: Homepage, https://github.com/gersmann/codex-python
|
6
6
|
Project-URL: Repository, https://github.com/gersmann/codex-python
|
@@ -36,6 +36,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
36
36
|
Classifier: Programming Language :: Python :: 3.13
|
37
37
|
Classifier: Typing :: Typed
|
38
38
|
Requires-Python: >=3.13
|
39
|
+
Requires-Dist: pydantic>=2.11.7
|
39
40
|
Description-Content-Type: text/markdown
|
40
41
|
|
41
42
|
# codex-python
|
@@ -70,6 +71,18 @@ Options:
|
|
70
71
|
- Full auto: `run_exec("scaffold a cli", full_auto=True)`
|
71
72
|
- Run in another dir: `run_exec("...", cd="/path/to/project")`
|
72
73
|
|
74
|
+
Streaming JSON events (no PyO3 required):
|
75
|
+
|
76
|
+
```
|
77
|
+
from codex.protocol.runtime import stream_exec_events
|
78
|
+
|
79
|
+
for event in stream_exec_events("explain this repo", full_auto=True):
|
80
|
+
# event is a dict with shape {"id": str, "msg": {...}}
|
81
|
+
print(event)
|
82
|
+
```
|
83
|
+
|
84
|
+
The event payload matches the Pydantic models in `codex.protocol.types` (e.g., `EventMsg`).
|
85
|
+
|
73
86
|
Using a client with defaults:
|
74
87
|
|
75
88
|
```
|
@@ -113,8 +126,10 @@ export PYPI_API_TOKEN="pypi-XXXX" # create at https://pypi.org/manage/account/t
|
|
113
126
|
uv publish --token "$PYPI_API_TOKEN"
|
114
127
|
```
|
115
128
|
|
116
|
-
- GitHub Actions
|
117
|
-
|
129
|
+
- GitHub Actions (Trusted Publishing): enable PyPI Trusted Publishing for
|
130
|
+
`gersmann/codex-python` and push a tag like `v0.1.0`. No token is needed.
|
131
|
+
The workflow at `.github/workflows/publish.yml` requests an OIDC token and
|
132
|
+
runs `uv publish --trusted-publishing=always` on `v*` tags.
|
118
133
|
|
119
134
|
### Dev tooling
|
120
135
|
|
@@ -123,6 +138,19 @@ uv publish --token "$PYPI_API_TOKEN"
|
|
123
138
|
- Format: `make fmt` (ruff formatter)
|
124
139
|
- Pre-commit: `uvx pre-commit install && uvx pre-commit run --all-files`
|
125
140
|
|
141
|
+
### Protocol bindings (from codex-rs)
|
142
|
+
|
143
|
+
- Prereq: Rust toolchain (`cargo`) installed.
|
144
|
+
- Generate Python types from the upstream protocol with:
|
145
|
+
|
146
|
+
```
|
147
|
+
make gen-protocol
|
148
|
+
```
|
149
|
+
|
150
|
+
This will:
|
151
|
+
- run `codex-proj/codex-rs/protocol-ts` to emit TypeScript types under `.generated/ts/`
|
152
|
+
- convert them to Python `TypedDict`/`Literal` aliases at `codex/protocol/types.py`
|
153
|
+
|
126
154
|
## Project Layout
|
127
155
|
|
128
156
|
```
|
@@ -0,0 +1,9 @@
|
|
1
|
+
codex/__init__.py,sha256=H12NLxWqZAOhHbkZO0rnMRhkdo_9y5DUVTmxyX2ncI0,514
|
2
|
+
codex/api.py,sha256=gabhwkBQpdu7QdA_K75m8TPpusC9a4LteyhiZN0cI1Y,5173
|
3
|
+
codex/protocol/runtime.py,sha256=lfnlkMYDg303Ug8awiu2FKwmbz3PGWnhTpFng-CsIe4,2229
|
4
|
+
codex/protocol/types.py,sha256=852vSY0cdepXcu9DOJakzhsZBYpa0xF9aqBBj9GI_hE,39108
|
5
|
+
codex/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
6
|
+
codex_python-0.1.2.dist-info/METADATA,sha256=swB6w-sW3820mh45KzPfoxlYBGIvAzWjN8N3efzySZg,5083
|
7
|
+
codex_python-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
+
codex_python-0.1.2.dist-info/licenses/LICENSE,sha256=ZhGahTKhsCbPWNmZ7ugZ14LVewMo4Gh1OeIOlQabyrI,1066
|
9
|
+
codex_python-0.1.2.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
codex/__init__.py,sha256=E7HRcKV0xN5jhgmzYsAkQ2lm1KngmQgiH1T1LbQQ1mU,514
|
2
|
-
codex/api.py,sha256=aP1OcnMxSF-vJyxwVIllbydmrFiUESsuePvCyYkBXxo,4614
|
3
|
-
codex/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
4
|
-
codex_python-0.1.0.dist-info/METADATA,sha256=sVDPpdgXr-zFL0ege7Spc6ctWuPVE4-Sjnwb17Sls98,4246
|
5
|
-
codex_python-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
6
|
-
codex_python-0.1.0.dist-info/licenses/LICENSE,sha256=ZhGahTKhsCbPWNmZ7ugZ14LVewMo4Gh1OeIOlQabyrI,1066
|
7
|
-
codex_python-0.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|