agent-client-protocol 0.0.1__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 (33) hide show
  1. agent_client_protocol-0.0.1/.github/actions/setup-python-env/action.yml +30 -0
  2. agent_client_protocol-0.0.1/.github/workflows/main.yml +62 -0
  3. agent_client_protocol-0.0.1/.github/workflows/on-release-main.yml +66 -0
  4. agent_client_protocol-0.0.1/.gitignore +211 -0
  5. agent_client_protocol-0.0.1/.pre-commit-config.yaml +24 -0
  6. agent_client_protocol-0.0.1/CONTRIBUTING.md +126 -0
  7. agent_client_protocol-0.0.1/LICENSE +202 -0
  8. agent_client_protocol-0.0.1/Makefile +59 -0
  9. agent_client_protocol-0.0.1/PKG-INFO +92 -0
  10. agent_client_protocol-0.0.1/README.md +70 -0
  11. agent_client_protocol-0.0.1/docs/index.md +31 -0
  12. agent_client_protocol-0.0.1/docs/mini-swe-agent.md +28 -0
  13. agent_client_protocol-0.0.1/docs/quickstart.md +71 -0
  14. agent_client_protocol-0.0.1/examples/agent.py +50 -0
  15. agent_client_protocol-0.0.1/examples/client.py +72 -0
  16. agent_client_protocol-0.0.1/examples/duet.py +112 -0
  17. agent_client_protocol-0.0.1/examples/mini_swe_agent/README.md +57 -0
  18. agent_client_protocol-0.0.1/examples/mini_swe_agent/agent.py +373 -0
  19. agent_client_protocol-0.0.1/mkdocs.yml +53 -0
  20. agent_client_protocol-0.0.1/pyproject.toml +115 -0
  21. agent_client_protocol-0.0.1/schema/meta.json +22 -0
  22. agent_client_protocol-0.0.1/schema/schema.json +2043 -0
  23. agent_client_protocol-0.0.1/scripts/gen_all.py +16 -0
  24. agent_client_protocol-0.0.1/scripts/gen_meta.py +26 -0
  25. agent_client_protocol-0.0.1/scripts/gen_schema.py +38 -0
  26. agent_client_protocol-0.0.1/src/acp/__init__.py +63 -0
  27. agent_client_protocol-0.0.1/src/acp/core.py +459 -0
  28. agent_client_protocol-0.0.1/src/acp/meta.py +4 -0
  29. agent_client_protocol-0.0.1/src/acp/schema.py +817 -0
  30. agent_client_protocol-0.0.1/src/acp/stdio.py +49 -0
  31. agent_client_protocol-0.0.1/tests/test_rpc.py +254 -0
  32. agent_client_protocol-0.0.1/tox.ini +18 -0
  33. agent_client_protocol-0.0.1/uv.lock +2512 -0
@@ -0,0 +1,30 @@
1
+ name: "Setup Python Environment"
2
+ description: "Set up Python environment for the given Python version"
3
+
4
+ inputs:
5
+ python-version:
6
+ description: "Python version to use"
7
+ required: true
8
+ default: "3.12"
9
+ uv-version:
10
+ description: "uv version to use"
11
+ required: true
12
+ default: "0.6.14"
13
+
14
+ runs:
15
+ using: "composite"
16
+ steps:
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ inputs.python-version }}
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v6
23
+ with:
24
+ version: ${{ inputs.uv-version }}
25
+ enable-cache: 'true'
26
+ cache-suffix: ${{ matrix.python-version }}
27
+
28
+ - name: Install Python dependencies
29
+ run: uv sync --frozen
30
+ shell: bash
@@ -0,0 +1,62 @@
1
+ name: Main
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ types: [opened, synchronize, reopened, ready_for_review]
9
+
10
+ jobs:
11
+ quality:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Check out
15
+ uses: actions/checkout@v4
16
+
17
+ - uses: actions/cache@v4
18
+ with:
19
+ path: ~/.cache/pre-commit
20
+ key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
21
+
22
+ - name: Set up the environment
23
+ uses: ./.github/actions/setup-python-env
24
+
25
+ - name: Run checks
26
+ run: make check
27
+
28
+ tests-and-type-check:
29
+ runs-on: ubuntu-latest
30
+ strategy:
31
+ matrix:
32
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
33
+ fail-fast: false
34
+ defaults:
35
+ run:
36
+ shell: bash
37
+ steps:
38
+ - name: Check out
39
+ uses: actions/checkout@v4
40
+
41
+ - name: Set up the environment
42
+ uses: ./.github/actions/setup-python-env
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+
46
+ - name: Run tests
47
+ run: make test
48
+
49
+ - name: Check typing
50
+ run: make check
51
+
52
+ check-docs:
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - name: Check out
56
+ uses: actions/checkout@v4
57
+
58
+ - name: Set up the environment
59
+ uses: ./.github/actions/setup-python-env
60
+
61
+ - name: Check if documentation can be built
62
+ run: make docs-test
@@ -0,0 +1,66 @@
1
+ name: release-main
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+
9
+ set-version:
10
+ runs-on: ubuntu-24.04
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Export tag
15
+ id: vars
16
+ run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
17
+ if: ${{ github.event_name == 'release' }}
18
+
19
+ - name: Update project version
20
+ run: |
21
+ sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml
22
+ env:
23
+ RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
24
+ if: ${{ github.event_name == 'release' }}
25
+
26
+ - name: Upload updated pyproject.toml
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: pyproject-toml
30
+ path: pyproject.toml
31
+
32
+ publish:
33
+ runs-on: ubuntu-latest
34
+ needs: [set-version]
35
+ steps:
36
+ - name: Check out
37
+ uses: actions/checkout@v4
38
+
39
+ - name: Set up the environment
40
+ uses: ./.github/actions/setup-python-env
41
+
42
+ - name: Download updated pyproject.toml
43
+ uses: actions/download-artifact@v4
44
+ with:
45
+ name: pyproject-toml
46
+
47
+ - name: Build package
48
+ run: uv build
49
+
50
+ - name: Publish package
51
+ run: uv publish
52
+ env:
53
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
54
+
55
+ deploy-docs:
56
+ needs: publish
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - name: Check out
60
+ uses: actions/checkout@v4
61
+
62
+ - name: Set up the environment
63
+ uses: ./.github/actions/setup-python-env
64
+
65
+ - name: Deploy documentation
66
+ run: uv run mkdocs gh-deploy --force
@@ -0,0 +1,211 @@
1
+ docs/source
2
+
3
+ # From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[codz]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py.cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # UV
102
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ #uv.lock
106
+
107
+ # poetry
108
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
110
+ # commonly ignored for libraries.
111
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
+ #poetry.lock
113
+ #poetry.toml
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
118
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
119
+ #pdm.lock
120
+ #pdm.toml
121
+ .pdm-python
122
+ .pdm-build/
123
+
124
+ # pixi
125
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
126
+ #pixi.lock
127
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
128
+ # in the .venv directory. It is recommended not to include this directory in version control.
129
+ .pixi
130
+
131
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
+ __pypackages__/
133
+
134
+ # Celery stuff
135
+ celerybeat-schedule
136
+ celerybeat.pid
137
+
138
+ # SageMath parsed files
139
+ *.sage.py
140
+
141
+ # Environments
142
+ .env
143
+ .envrc
144
+ .venv
145
+ env/
146
+ venv/
147
+ ENV/
148
+ env.bak/
149
+ venv.bak/
150
+
151
+ # Spyder project settings
152
+ .spyderproject
153
+ .spyproject
154
+
155
+ # Rope project settings
156
+ .ropeproject
157
+
158
+ # mkdocs documentation
159
+ /site
160
+
161
+ # mypy
162
+ .mypy_cache/
163
+ .dmypy.json
164
+ dmypy.json
165
+
166
+ # Pyre type checker
167
+ .pyre/
168
+
169
+ # pytype static type analyzer
170
+ .pytype/
171
+
172
+ # Cython debug symbols
173
+ cython_debug/
174
+
175
+ # PyCharm
176
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
177
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
178
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
179
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
180
+ #.idea/
181
+
182
+ # Abstra
183
+ # Abstra is an AI-powered process automation framework.
184
+ # Ignore directories containing user credentials, local state, and settings.
185
+ # Learn more at https://abstra.io/docs
186
+ .abstra/
187
+
188
+ # Visual Studio Code
189
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
190
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
191
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
192
+ # you could uncomment the following to ignore the entire vscode folder
193
+ # .vscode/
194
+
195
+ # Ruff stuff:
196
+ .ruff_cache/
197
+
198
+ # PyPI configuration file
199
+ .pypirc
200
+
201
+ # Cursor
202
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
203
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
204
+ # refer to https://docs.cursor.com/context/ignore-files
205
+ .cursorignore
206
+ .cursorindexingignore
207
+
208
+ # Marimo
209
+ marimo/_static/
210
+ marimo/_lsp/
211
+ __marimo__/
@@ -0,0 +1,24 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: "v5.0.0"
4
+ hooks:
5
+ - id: check-case-conflict
6
+ - id: check-merge-conflict
7
+ - id: check-toml
8
+ - id: check-yaml
9
+ - id: check-json
10
+ exclude: ^.devcontainer/devcontainer.json
11
+ - id: pretty-format-json
12
+ exclude: ^.devcontainer/devcontainer.json
13
+ args: [--autofix, --no-sort-keys]
14
+ - id: end-of-file-fixer
15
+ - id: trailing-whitespace
16
+
17
+ - repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: "v0.12.7"
19
+ hooks:
20
+ - id: ruff-check
21
+ args: [ --exit-non-zero-on-fix ]
22
+ exclude: ^src/acp/(meta|schema)\.py$
23
+ - id: ruff-format
24
+ exclude: ^src/acp/(meta|schema)\.py$
@@ -0,0 +1,126 @@
1
+ # Contributing to `agent-client-protocol-python`
2
+
3
+ Contributions are welcome, and they are greatly appreciated!
4
+ Every little bit helps, and credit will always be given.
5
+
6
+ You can contribute in many ways:
7
+
8
+ # Types of Contributions
9
+
10
+ ## Report Bugs
11
+
12
+ Report bugs at https://github.com/psiace/agent-client-protocol-python/issues
13
+
14
+ If you are reporting a bug, please include:
15
+
16
+ - Your operating system name and version.
17
+ - Any details about your local setup that might be helpful in troubleshooting.
18
+ - Detailed steps to reproduce the bug.
19
+
20
+ ## Fix Bugs
21
+
22
+ Look through the GitHub issues for bugs.
23
+ Anything tagged with "bug" and "help wanted" is open to whoever wants to implement a fix for it.
24
+
25
+ ## Implement Features
26
+
27
+ Look through the GitHub issues for features.
28
+ Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
29
+
30
+ ## Write Documentation
31
+
32
+ agent-client-protocol-python could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such.
33
+
34
+ ## Submit Feedback
35
+
36
+ The best way to send feedback is to file an issue at https://github.com/psiace/agent-client-protocol-python/issues.
37
+
38
+ If you are proposing a new feature:
39
+
40
+ - Explain in detail how it would work.
41
+ - Keep the scope as narrow as possible, to make it easier to implement.
42
+ - Remember that this is a volunteer-driven project, and that contributions
43
+ are welcome :)
44
+
45
+ # Get Started!
46
+
47
+ Ready to contribute? Here's how to set up `agent-client-protocol-python` for local development.
48
+ Please note this documentation assumes you already have `uv` and `Git` installed and ready to go.
49
+
50
+ 1. Fork the `agent-client-protocol-python` repo on GitHub.
51
+
52
+ 2. Clone your fork locally:
53
+
54
+ ```bash
55
+ cd <directory_in_which_repo_should_be_created>
56
+ git clone git@github.com:YOUR_NAME/agent-client-protocol-python.git
57
+ ```
58
+
59
+ 3. Now we need to install the environment. Navigate into the directory
60
+
61
+ ```bash
62
+ cd agent-client-protocol-python
63
+ ```
64
+
65
+ Then, install and activate the environment with:
66
+
67
+ ```bash
68
+ uv sync
69
+ ```
70
+
71
+ 4. Install pre-commit to run linters/formatters at commit time:
72
+
73
+ ```bash
74
+ uv run pre-commit install
75
+ ```
76
+
77
+ 5. Create a branch for local development:
78
+
79
+ ```bash
80
+ git checkout -b name-of-your-bugfix-or-feature
81
+ ```
82
+
83
+ Now you can make your changes locally.
84
+
85
+ 6. Don't forget to add test cases for your added functionality to the `tests` directory.
86
+
87
+ 7. When you're done making changes, check that your changes pass the formatting tests.
88
+
89
+ ```bash
90
+ make check
91
+ ```
92
+
93
+ Now, validate that all unit tests are passing:
94
+
95
+ ```bash
96
+ make test
97
+ ```
98
+
99
+ 9. Before raising a pull request you should also run tox.
100
+ This will run the tests across different versions of Python:
101
+
102
+ ```bash
103
+ tox
104
+ ```
105
+
106
+ This requires you to have multiple versions of python installed.
107
+ This step is also triggered in the CI/CD pipeline, so you could also choose to skip this step locally.
108
+
109
+ 10. Commit your changes and push your branch to GitHub:
110
+
111
+ ```bash
112
+ git add .
113
+ git commit -m "Your detailed description of your changes."
114
+ git push origin name-of-your-bugfix-or-feature
115
+ ```
116
+
117
+ 11. Submit a pull request through the GitHub website.
118
+
119
+ # Pull Request Guidelines
120
+
121
+ Before you submit a pull request, check that it meets these guidelines:
122
+
123
+ 1. The pull request should include tests.
124
+
125
+ 2. If the pull request adds functionality, the docs should be updated.
126
+ Put your new functionality into a function with a docstring, and add the feature to the list in `README.md`.