codex-a2a 0.3.0__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.
- codex_a2a-0.3.0/.github/workflows/ci.yml +61 -0
- codex_a2a-0.3.0/.github/workflows/publish.yml +78 -0
- codex_a2a-0.3.0/.gitignore +220 -0
- codex_a2a-0.3.0/.pre-commit-config.yaml +19 -0
- codex_a2a-0.3.0/.secrets.baseline +131 -0
- codex_a2a-0.3.0/AGENTS.md +55 -0
- codex_a2a-0.3.0/CONTRIBUTING.md +104 -0
- codex_a2a-0.3.0/LICENSE +176 -0
- codex_a2a-0.3.0/PKG-INFO +189 -0
- codex_a2a-0.3.0/README.md +152 -0
- codex_a2a-0.3.0/SECURITY.md +53 -0
- codex_a2a-0.3.0/docs/architecture.md +110 -0
- codex_a2a-0.3.0/docs/compatibility.md +121 -0
- codex_a2a-0.3.0/docs/guide.md +593 -0
- codex_a2a-0.3.0/mypy.ini +14 -0
- codex_a2a-0.3.0/pyproject.toml +80 -0
- codex_a2a-0.3.0/scripts/README.md +34 -0
- codex_a2a-0.3.0/scripts/smoke_test_built_cli.sh +126 -0
- codex_a2a-0.3.0/scripts/sync_codex_docs.sh +76 -0
- codex_a2a-0.3.0/scripts/validate_baseline.sh +26 -0
- codex_a2a-0.3.0/scripts/validate_runtime_matrix.sh +10 -0
- codex_a2a-0.3.0/setup.cfg +4 -0
- codex_a2a-0.3.0/src/codex_a2a/__init__.py +34 -0
- codex_a2a-0.3.0/src/codex_a2a/cli.py +38 -0
- codex_a2a-0.3.0/src/codex_a2a/config.py +284 -0
- codex_a2a-0.3.0/src/codex_a2a/contracts/__init__.py +0 -0
- codex_a2a-0.3.0/src/codex_a2a/contracts/extensions.py +720 -0
- codex_a2a-0.3.0/src/codex_a2a/contracts/runtime_output.py +264 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/__init__.py +0 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/cancellation.py +82 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/directory_policy.py +44 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/executor.py +451 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/output_mapping.py +217 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/request_metadata.py +60 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/response_emitter.py +108 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/session_runtime.py +314 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/stream_chunks.py +413 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/stream_interrupts.py +225 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/stream_processor.py +501 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/stream_state.py +232 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/streaming.py +153 -0
- codex_a2a-0.3.0/src/codex_a2a/execution/tool_call_payloads.py +338 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/__init__.py +0 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/application.py +183 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/control_params.py +227 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/errors.py +95 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/interrupt_lifecycle.py +120 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/interrupt_params.py +165 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/interrupts.py +164 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/params.py +41 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/params_common.py +131 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/payload_mapping.py +97 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/query_params.py +168 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/session_control.py +167 -0
- codex_a2a-0.3.0/src/codex_a2a/jsonrpc/session_query.py +119 -0
- codex_a2a-0.3.0/src/codex_a2a/logging_context.py +63 -0
- codex_a2a-0.3.0/src/codex_a2a/metrics.py +72 -0
- codex_a2a-0.3.0/src/codex_a2a/parts/text.py +15 -0
- codex_a2a-0.3.0/src/codex_a2a/profile/__init__.py +0 -0
- codex_a2a-0.3.0/src/codex_a2a/profile/runtime.py +346 -0
- codex_a2a-0.3.0/src/codex_a2a/server/__init__.py +0 -0
- codex_a2a-0.3.0/src/codex_a2a/server/agent_card.py +228 -0
- codex_a2a-0.3.0/src/codex_a2a/server/application.py +163 -0
- codex_a2a-0.3.0/src/codex_a2a/server/call_context.py +39 -0
- codex_a2a-0.3.0/src/codex_a2a/server/http_middlewares.py +299 -0
- codex_a2a-0.3.0/src/codex_a2a/server/openapi.py +315 -0
- codex_a2a-0.3.0/src/codex_a2a/server/request_handler.py +183 -0
- codex_a2a-0.3.0/src/codex_a2a/upstream/__init__.py +11 -0
- codex_a2a-0.3.0/src/codex_a2a/upstream/client.py +1075 -0
- codex_a2a-0.3.0/src/codex_a2a/upstream/interrupts.py +168 -0
- codex_a2a-0.3.0/src/codex_a2a/upstream/models.py +47 -0
- codex_a2a-0.3.0/src/codex_a2a/upstream/notification_mapping.py +150 -0
- codex_a2a-0.3.0/src/codex_a2a/upstream/request_mapping.py +57 -0
- codex_a2a-0.3.0/src/codex_a2a.egg-info/PKG-INFO +189 -0
- codex_a2a-0.3.0/src/codex_a2a.egg-info/SOURCES.txt +119 -0
- codex_a2a-0.3.0/src/codex_a2a.egg-info/dependency_links.txt +1 -0
- codex_a2a-0.3.0/src/codex_a2a.egg-info/entry_points.txt +2 -0
- codex_a2a-0.3.0/src/codex_a2a.egg-info/requires.txt +15 -0
- codex_a2a-0.3.0/src/codex_a2a.egg-info/top_level.txt +1 -0
- codex_a2a-0.3.0/tests/__init__.py +1 -0
- codex_a2a-0.3.0/tests/config/__init__.py +0 -0
- codex_a2a-0.3.0/tests/config/test_settings.py +123 -0
- codex_a2a-0.3.0/tests/contracts/__init__.py +0 -0
- codex_a2a-0.3.0/tests/contracts/test_extension_contract_consistency.py +376 -0
- codex_a2a-0.3.0/tests/execution/__init__.py +0 -0
- codex_a2a-0.3.0/tests/execution/test_agent_errors.py +81 -0
- codex_a2a-0.3.0/tests/execution/test_cancellation.py +154 -0
- codex_a2a-0.3.0/tests/execution/test_codex_agent_session_binding.py +171 -0
- codex_a2a-0.3.0/tests/execution/test_directory_validation.py +97 -0
- codex_a2a-0.3.0/tests/execution/test_metrics.py +179 -0
- codex_a2a-0.3.0/tests/execution/test_session_ownership.py +318 -0
- codex_a2a-0.3.0/tests/execution/test_stream_chunks.py +144 -0
- codex_a2a-0.3.0/tests/execution/test_stream_interrupts.py +85 -0
- codex_a2a-0.3.0/tests/execution/test_streaming_output_contract.py +2018 -0
- codex_a2a-0.3.0/tests/execution/test_tool_call_payloads.py +167 -0
- codex_a2a-0.3.0/tests/fixtures/codex_app_server/command_execution_output_delta.json +118 -0
- codex_a2a-0.3.0/tests/fixtures/codex_app_server/file_change_output_delta.json +103 -0
- codex_a2a-0.3.0/tests/jsonrpc/__init__.py +0 -0
- codex_a2a-0.3.0/tests/jsonrpc/test_codex_session_extension.py +1192 -0
- codex_a2a-0.3.0/tests/jsonrpc/test_jsonrpc_models.py +161 -0
- codex_a2a-0.3.0/tests/package/__init__.py +0 -0
- codex_a2a-0.3.0/tests/package/test_release_distribution_contract.py +98 -0
- codex_a2a-0.3.0/tests/package/test_version.py +22 -0
- codex_a2a-0.3.0/tests/parts/__init__.py +0 -0
- codex_a2a-0.3.0/tests/parts/test_text.py +41 -0
- codex_a2a-0.3.0/tests/profile/__init__.py +0 -0
- codex_a2a-0.3.0/tests/profile/test_profile.py +88 -0
- codex_a2a-0.3.0/tests/server/__init__.py +0 -0
- codex_a2a-0.3.0/tests/server/test_agent_card.py +359 -0
- codex_a2a-0.3.0/tests/server/test_call_context_builder.py +46 -0
- codex_a2a-0.3.0/tests/server/test_cli.py +41 -0
- codex_a2a-0.3.0/tests/server/test_request_handler.py +155 -0
- codex_a2a-0.3.0/tests/server/test_transport_contract.py +766 -0
- codex_a2a-0.3.0/tests/support/__init__.py +0 -0
- codex_a2a-0.3.0/tests/support/context.py +84 -0
- codex_a2a-0.3.0/tests/support/dummy_clients.py +207 -0
- codex_a2a-0.3.0/tests/support/fixtures.py +89 -0
- codex_a2a-0.3.0/tests/support/settings.py +13 -0
- codex_a2a-0.3.0/tests/upstream/__init__.py +0 -0
- codex_a2a-0.3.0/tests/upstream/test_codex_client_params.py +1001 -0
- codex_a2a-0.3.0/uv.lock +1010 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
quality-gate:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.13"
|
|
24
|
+
|
|
25
|
+
- name: Setup uv
|
|
26
|
+
uses: astral-sh/setup-uv@v4
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Sync Dependencies
|
|
31
|
+
run: uv sync --all-extras --frozen
|
|
32
|
+
|
|
33
|
+
- name: Run validation baseline
|
|
34
|
+
run: bash ./scripts/validate_baseline.sh
|
|
35
|
+
|
|
36
|
+
runtime-matrix:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
python-version: ["3.11", "3.12"]
|
|
42
|
+
|
|
43
|
+
steps:
|
|
44
|
+
- name: Checkout
|
|
45
|
+
uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
- name: Setup Python
|
|
48
|
+
uses: actions/setup-python@v5
|
|
49
|
+
with:
|
|
50
|
+
python-version: ${{ matrix.python-version }}
|
|
51
|
+
|
|
52
|
+
- name: Setup uv
|
|
53
|
+
uses: astral-sh/setup-uv@v4
|
|
54
|
+
with:
|
|
55
|
+
enable-cache: true
|
|
56
|
+
|
|
57
|
+
- name: Sync Dependencies
|
|
58
|
+
run: uv sync --all-extras --frozen
|
|
59
|
+
|
|
60
|
+
- name: Run runtime matrix validation
|
|
61
|
+
run: bash ./scripts/validate_runtime_matrix.sh
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
publish:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Setup Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
|
|
28
|
+
- name: Setup uv
|
|
29
|
+
uses: astral-sh/setup-uv@v4
|
|
30
|
+
with:
|
|
31
|
+
enable-cache: true
|
|
32
|
+
|
|
33
|
+
- name: Build package artifacts
|
|
34
|
+
run: uv build --no-sources
|
|
35
|
+
|
|
36
|
+
- name: Capture built wheel path
|
|
37
|
+
id: wheel
|
|
38
|
+
run: |
|
|
39
|
+
python - <<'PY' >> "$GITHUB_OUTPUT"
|
|
40
|
+
import pathlib
|
|
41
|
+
|
|
42
|
+
wheels = sorted(pathlib.Path("dist").glob("codex_a2a-*.whl"))
|
|
43
|
+
if len(wheels) != 1:
|
|
44
|
+
raise SystemExit(f"Expected exactly one wheel in dist/, found {len(wheels)}")
|
|
45
|
+
print(f"wheel_path={wheels[0]}")
|
|
46
|
+
PY
|
|
47
|
+
|
|
48
|
+
- name: Verify published version matches tag
|
|
49
|
+
run: |
|
|
50
|
+
python - <<'PY'
|
|
51
|
+
import os
|
|
52
|
+
import pathlib
|
|
53
|
+
|
|
54
|
+
wheel = pathlib.Path(os.environ["WHEEL_PATH"]).name
|
|
55
|
+
version = wheel.removeprefix("codex_a2a-").split("-py3", 1)[0]
|
|
56
|
+
tag = os.environ["GITHUB_REF_NAME"].removeprefix("v")
|
|
57
|
+
if version != tag:
|
|
58
|
+
raise SystemExit(f"Wheel version {version!r} does not match tag {tag!r}")
|
|
59
|
+
print(f"Validated release version: {version}")
|
|
60
|
+
PY
|
|
61
|
+
env:
|
|
62
|
+
WHEEL_PATH: ${{ steps.wheel.outputs.wheel_path }}
|
|
63
|
+
|
|
64
|
+
- name: Smoke test wheel install
|
|
65
|
+
run: bash ./scripts/smoke_test_built_cli.sh
|
|
66
|
+
env:
|
|
67
|
+
WHEEL_PATH: ${{ steps.wheel.outputs.wheel_path }}
|
|
68
|
+
|
|
69
|
+
- name: Publish to PyPI
|
|
70
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
71
|
+
|
|
72
|
+
- name: Create GitHub Release
|
|
73
|
+
uses: softprops/action-gh-release@v2
|
|
74
|
+
with:
|
|
75
|
+
generate_release_notes: true
|
|
76
|
+
files: |
|
|
77
|
+
dist/*.tar.gz
|
|
78
|
+
dist/*.whl
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
!tests/parts/
|
|
21
|
+
!tests/parts/**
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Local logs
|
|
42
|
+
logs/
|
|
43
|
+
run/
|
|
44
|
+
|
|
45
|
+
# Unit test / coverage reports
|
|
46
|
+
htmlcov/
|
|
47
|
+
.tox/
|
|
48
|
+
.nox/
|
|
49
|
+
.coverage
|
|
50
|
+
.coverage.*
|
|
51
|
+
.cache
|
|
52
|
+
nosetests.xml
|
|
53
|
+
coverage.xml
|
|
54
|
+
*.cover
|
|
55
|
+
*.py.cover
|
|
56
|
+
.hypothesis/
|
|
57
|
+
.pytest_cache/
|
|
58
|
+
cover/
|
|
59
|
+
|
|
60
|
+
# Translations
|
|
61
|
+
*.mo
|
|
62
|
+
*.pot
|
|
63
|
+
|
|
64
|
+
# Django stuff:
|
|
65
|
+
*.log
|
|
66
|
+
local_settings.py
|
|
67
|
+
db.sqlite3
|
|
68
|
+
db.sqlite3-journal
|
|
69
|
+
|
|
70
|
+
# Flask stuff:
|
|
71
|
+
instance/
|
|
72
|
+
.webassets-cache
|
|
73
|
+
|
|
74
|
+
# Scrapy stuff:
|
|
75
|
+
.scrapy
|
|
76
|
+
|
|
77
|
+
# Sphinx documentation
|
|
78
|
+
docs/_build/
|
|
79
|
+
|
|
80
|
+
# PyBuilder
|
|
81
|
+
.pybuilder/
|
|
82
|
+
target/
|
|
83
|
+
|
|
84
|
+
# Jupyter Notebook
|
|
85
|
+
.ipynb_checkpoints
|
|
86
|
+
|
|
87
|
+
# IPython
|
|
88
|
+
profile_default/
|
|
89
|
+
ipython_config.py
|
|
90
|
+
|
|
91
|
+
# pyenv
|
|
92
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
93
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
94
|
+
# .python-version
|
|
95
|
+
|
|
96
|
+
# pipenv
|
|
97
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
98
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
99
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
100
|
+
# install all needed dependencies.
|
|
101
|
+
#Pipfile.lock
|
|
102
|
+
|
|
103
|
+
# UV
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
#uv.lock
|
|
108
|
+
|
|
109
|
+
# poetry
|
|
110
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
111
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
112
|
+
# commonly ignored for libraries.
|
|
113
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
114
|
+
#poetry.lock
|
|
115
|
+
#poetry.toml
|
|
116
|
+
|
|
117
|
+
# pdm
|
|
118
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
119
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
120
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
121
|
+
#pdm.lock
|
|
122
|
+
#pdm.toml
|
|
123
|
+
.pdm-python
|
|
124
|
+
.pdm-build/
|
|
125
|
+
|
|
126
|
+
# pixi
|
|
127
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
128
|
+
#pixi.lock
|
|
129
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
130
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
131
|
+
.pixi
|
|
132
|
+
|
|
133
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
134
|
+
__pypackages__/
|
|
135
|
+
|
|
136
|
+
# Celery stuff
|
|
137
|
+
celerybeat-schedule
|
|
138
|
+
celerybeat.pid
|
|
139
|
+
|
|
140
|
+
# SageMath parsed files
|
|
141
|
+
*.sage.py
|
|
142
|
+
|
|
143
|
+
# Environments
|
|
144
|
+
.env
|
|
145
|
+
.envrc
|
|
146
|
+
.venv
|
|
147
|
+
env/
|
|
148
|
+
venv/
|
|
149
|
+
ENV/
|
|
150
|
+
env.bak/
|
|
151
|
+
venv.bak/
|
|
152
|
+
|
|
153
|
+
# Spyder project settings
|
|
154
|
+
.spyderproject
|
|
155
|
+
.spyproject
|
|
156
|
+
|
|
157
|
+
# Rope project settings
|
|
158
|
+
.ropeproject
|
|
159
|
+
|
|
160
|
+
# mkdocs documentation
|
|
161
|
+
/site
|
|
162
|
+
|
|
163
|
+
# mypy
|
|
164
|
+
.mypy_cache/
|
|
165
|
+
.dmypy.json
|
|
166
|
+
dmypy.json
|
|
167
|
+
|
|
168
|
+
# Pyre type checker
|
|
169
|
+
.pyre/
|
|
170
|
+
|
|
171
|
+
# pytype static type analyzer
|
|
172
|
+
.pytype/
|
|
173
|
+
|
|
174
|
+
# Cython debug symbols
|
|
175
|
+
cython_debug/
|
|
176
|
+
|
|
177
|
+
# PyCharm
|
|
178
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
179
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
180
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
181
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
182
|
+
#.idea/
|
|
183
|
+
|
|
184
|
+
# Abstra
|
|
185
|
+
# Abstra is an AI-powered process automation framework.
|
|
186
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
187
|
+
# Learn more at https://abstra.io/docs
|
|
188
|
+
.abstra/
|
|
189
|
+
|
|
190
|
+
# Visual Studio Code
|
|
191
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
192
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
193
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
194
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
195
|
+
# .vscode/
|
|
196
|
+
|
|
197
|
+
# Ruff stuff:
|
|
198
|
+
.ruff_cache/
|
|
199
|
+
|
|
200
|
+
# PyPI configuration file
|
|
201
|
+
.pypirc
|
|
202
|
+
|
|
203
|
+
# Cursor
|
|
204
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
205
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
206
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
207
|
+
.cursorignore
|
|
208
|
+
.cursorindexingignore
|
|
209
|
+
|
|
210
|
+
# Marimo
|
|
211
|
+
marimo/_static/
|
|
212
|
+
marimo/_lsp/
|
|
213
|
+
__marimo__/
|
|
214
|
+
|
|
215
|
+
# GitHub CLI temporary body files (should not be committed)
|
|
216
|
+
issue_*.md
|
|
217
|
+
|
|
218
|
+
# Local documentation sync/vendor cache
|
|
219
|
+
sync_codex_docs.sh
|
|
220
|
+
vendor/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
minimum_pre_commit_version: 4.5.1
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
|
+
rev: v4.6.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: trailing-whitespace
|
|
7
|
+
- id: end-of-file-fixer
|
|
8
|
+
- id: check-yaml
|
|
9
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
10
|
+
rev: v0.14.14
|
|
11
|
+
hooks:
|
|
12
|
+
- id: ruff
|
|
13
|
+
args: ["--fix"]
|
|
14
|
+
- id: ruff-format
|
|
15
|
+
- repo: https://github.com/Yelp/detect-secrets
|
|
16
|
+
rev: v1.5.0
|
|
17
|
+
hooks:
|
|
18
|
+
- id: detect-secrets
|
|
19
|
+
args: ["--baseline", ".secrets.baseline"]
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.5.0",
|
|
3
|
+
"plugins_used": [
|
|
4
|
+
{
|
|
5
|
+
"name": "ArtifactoryDetector"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "AWSKeyDetector"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "AzureStorageKeyDetector"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Base64HighEntropyString",
|
|
15
|
+
"limit": 4.5
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "BasicAuthDetector"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "CloudantDetector"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "DiscordBotTokenDetector"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "GitHubTokenDetector"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "GitLabTokenDetector"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "HexHighEntropyString",
|
|
34
|
+
"limit": 3.0
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "IbmCloudIamDetector"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "IbmCosHmacDetector"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "IPPublicDetector"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "JwtTokenDetector"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "KeywordDetector",
|
|
50
|
+
"keyword_exclude": ""
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "MailchimpDetector"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "NpmDetector"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "OpenAIDetector"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "PrivateKeyDetector"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "PypiTokenDetector"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "SendGridDetector"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "SlackDetector"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "SoftlayerDetector"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "SquareOAuthDetector"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "StripeDetector"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "TelegramBotTokenDetector"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "TwilioKeyDetector"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"filters_used": [
|
|
90
|
+
{
|
|
91
|
+
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"path": "detect_secrets.filters.common.is_baseline_file",
|
|
95
|
+
"filename": ".secrets.baseline"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
|
|
99
|
+
"min_level": 2
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"path": "detect_secrets.filters.heuristic.is_lock_file"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"path": "detect_secrets.filters.heuristic.is_sequential_string"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"path": "detect_secrets.filters.heuristic.is_swagger_file"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"path": "detect_secrets.filters.heuristic.is_templated_secret"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"results": {},
|
|
130
|
+
"generated_at": "2026-03-19T05:12:34Z"
|
|
131
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
以下规范适用于当前仓库内的 coding agent 协作与交付流程。
|
|
4
|
+
|
|
5
|
+
## 1. 核心原则
|
|
6
|
+
|
|
7
|
+
- 在保证安全、可追踪的前提下推进任务,避免不必要的流程阻断。
|
|
8
|
+
- 保持与现有仓库结构、实现风格和工程习惯一致。
|
|
9
|
+
|
|
10
|
+
## 2. Git 工作流
|
|
11
|
+
|
|
12
|
+
- 禁止直接向受保护分支提交或推送:`main`/`master`/`release/*`。
|
|
13
|
+
- 每项开发任务应在独立分支实施,建议从最新主干切出。
|
|
14
|
+
- 同步主干优先使用 `git fetch` + `git merge --ff-only`,避免隐式合并。
|
|
15
|
+
- 允许将开发分支推送到远端同名分支,便于协作与备份。
|
|
16
|
+
- 禁止改写公共历史:`git push --force`、`git push --force-with-lease`、随意 `rebase`。
|
|
17
|
+
- 仅提交本次任务相关文件,不清理或回滚与任务无关的在地改动。
|
|
18
|
+
|
|
19
|
+
## 3. Issue 与 PR 协作
|
|
20
|
+
|
|
21
|
+
- 开发类任务开始前,先检查是否已有相关 open Issue(例如 `gh issue list --state open`)。
|
|
22
|
+
- 若无相关 Issue,应创建新 Issue 跟踪;Issue 建议包含背景、复现步骤、预期/实际、验收标准,并附 `git rev-parse HEAD` 快照。
|
|
23
|
+
- 仅协作规范/流程文档改动(如 `AGENTS.md`)可直接修改,无需额外创建 Issue。
|
|
24
|
+
- Issue 标题前缀建议使用 `[feat]`、`[bug]`、`[docs]`、`[ops]`、`[chore]`。
|
|
25
|
+
- 提交信息若服务于某个 Issue,应在 commit message 中标注对应 `#issue`。
|
|
26
|
+
- PR 默认建议创建为 Draft,并在描述中标明关联关系(如 `Closes #xx` / `Relates to #xx`)。
|
|
27
|
+
- 出现关键进展、方案变化或新风险时,及时在对应 Issue/PR 中同步,避免重复评论。
|
|
28
|
+
|
|
29
|
+
## 4. 工具与文本规范
|
|
30
|
+
|
|
31
|
+
- 读写 Issue/PR 使用 `gh` CLI,不通过网页手工编辑。
|
|
32
|
+
- Issue、PR 与评论使用简体中文;专业术语可保留英文。
|
|
33
|
+
- 多行正文先写入临时文件,再用 `--body-file` 传入;不要在 `--body` 中拼接 `\\n`。
|
|
34
|
+
- 同仓引用使用 `#123` 自动链接;跨仓引用使用完整 URL。
|
|
35
|
+
|
|
36
|
+
## 5. 回归与验证
|
|
37
|
+
|
|
38
|
+
- 回归策略按改动类型选择;默认基线为:
|
|
39
|
+
- `bash ./scripts/validate_baseline.sh`
|
|
40
|
+
- Before committing, complete the required validation for the current change set; by default, run the baseline checks above before creating a commit.
|
|
41
|
+
- Before creating or updating a PR, confirm the relevant local validation has passed so CI is not left to catch issues that are already reproducible locally.
|
|
42
|
+
- `pre-commit` 若自动修复文件(如 `ruff --fix`),需复查改动后再提交。
|
|
43
|
+
- If `pre-commit` modifies files, include those changes in the same commit and rerun `uv run pre-commit run --all-files` until it completes without further rewrites.
|
|
44
|
+
- After running `pre-commit`, inspect `git status --short` before committing or pushing; do not assume hook-made rewrites are already included in the pending commit.
|
|
45
|
+
- Do not push or update a PR while the working tree still contains hook-generated edits from the latest `pre-commit` run.
|
|
46
|
+
- Shell/部署脚本改动:在基线之外,至少执行 `bash -n` 对改动脚本做语法校验。
|
|
47
|
+
- 文档-only 改动:可不跑测试,但应自检命令与路径示例可用。
|
|
48
|
+
- `uv sync --all-extras` 仅在首次初始化或依赖变更时需要,不作为每次改动必做项。
|
|
49
|
+
- 若受环境限制无法完成某项验证,必须在汇报中明确说明未执行项与原因。
|
|
50
|
+
|
|
51
|
+
## 6. 安全与配置
|
|
52
|
+
|
|
53
|
+
- 严禁提交密钥、令牌、凭证或其他敏感信息(含 `.env` 内容)。
|
|
54
|
+
- 日志与调试输出不得泄露访问令牌或隐私数据。
|
|
55
|
+
- 涉及部署、认证、密钥注入的改动,需同步更新文档并提供最小验收步骤。
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for contributing to `codex-a2a`.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
This repository is the server/runtime boundary around Codex for A2A clients.
|
|
8
|
+
Keep contributions aligned with that role:
|
|
9
|
+
|
|
10
|
+
- transport and contract correctness
|
|
11
|
+
- deployment and operations guardrails
|
|
12
|
+
- session, streaming, and interrupt interoperability
|
|
13
|
+
- security and observability for the service boundary
|
|
14
|
+
|
|
15
|
+
Client-only concerns should usually stay out of this repository.
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
1. Start from the latest `main`.
|
|
20
|
+
2. Work in a dedicated branch.
|
|
21
|
+
3. Link the change to an issue whenever the work changes runtime behavior,
|
|
22
|
+
contracts, deployment, or documentation beyond small editorial cleanup.
|
|
23
|
+
4. Keep PRs focused and describe contract or compatibility implications
|
|
24
|
+
explicitly.
|
|
25
|
+
|
|
26
|
+
## Development From Source
|
|
27
|
+
|
|
28
|
+
Use the repository checkout directly only for development, local debugging, or
|
|
29
|
+
validation against unreleased changes on `main`.
|
|
30
|
+
|
|
31
|
+
1. Install dependencies:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv sync --all-extras
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. Make sure local Codex is already usable:
|
|
38
|
+
|
|
39
|
+
- verify `codex` is installed and available on `PATH` (or set `CODEX_CLI_BIN`)
|
|
40
|
+
- verify Codex provider/auth configuration already works outside this repository
|
|
41
|
+
|
|
42
|
+
3. Generate a local bearer token:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
export A2A_BEARER_TOKEN="$(python -c 'import secrets; print(secrets.token_hex(24))')"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
4. Start this service from the source tree:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
CODEX_WORKSPACE_ROOT=/abs/path/to/workspace uv run codex-a2a
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
5. Open the Agent Card:
|
|
55
|
+
|
|
56
|
+
- `http://127.0.0.1:8000/.well-known/agent-card.json`
|
|
57
|
+
|
|
58
|
+
## Validation Baseline
|
|
59
|
+
|
|
60
|
+
Run the default validation baseline before opening or updating a PR:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
bash ./scripts/validate_baseline.sh
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This script runs `pre-commit`, `mypy`, `pytest` with the repository coverage
|
|
67
|
+
floor, then builds the package and smoke-tests the freshly built wheel.
|
|
68
|
+
|
|
69
|
+
For shell script changes, validate the touched scripts directly, for example:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
bash -n scripts/validate_baseline.sh
|
|
73
|
+
bash -n scripts/smoke_test_built_cli.sh
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If `pre-commit` rewrites files, review the rewritten output and re-run the
|
|
77
|
+
checks until the working tree is clean.
|
|
78
|
+
|
|
79
|
+
## Compatibility Expectations
|
|
80
|
+
|
|
81
|
+
- The repository targets Python 3.11, 3.12, and 3.13.
|
|
82
|
+
- Machine-readable declarations should match actual runtime behavior.
|
|
83
|
+
- Custom extensions must remain stable within the current major line unless a
|
|
84
|
+
change is explicitly documented as breaking.
|
|
85
|
+
- Shared metadata and wire contracts should not drift between Agent Card,
|
|
86
|
+
OpenAPI, and runtime behavior.
|
|
87
|
+
|
|
88
|
+
More detail: [Compatibility Guide](docs/compatibility.md)
|
|
89
|
+
|
|
90
|
+
## Security and Secrets
|
|
91
|
+
|
|
92
|
+
- Never commit bearer tokens, provider keys, or `.env` contents.
|
|
93
|
+
- Do not add logs that expose raw credentials or private payloads.
|
|
94
|
+
- Deployment, authentication, or secret-handling changes must update the
|
|
95
|
+
relevant documentation.
|
|
96
|
+
|
|
97
|
+
## Reviews
|
|
98
|
+
|
|
99
|
+
Good PRs in this repository are usually:
|
|
100
|
+
|
|
101
|
+
- small enough to review quickly
|
|
102
|
+
- explicit about contract changes
|
|
103
|
+
- backed by tests when runtime behavior changes
|
|
104
|
+
- clear about residual risk when the work is intentionally partial
|