chp-adapter-github
GitHub inspection as governed Capability Host Protocol
capabilities. Read-only first slice: repositories, pull requests, issues, CI
workflow runs, and PR reviews — each exposed as chp.adapters.github.<op> with a
full execution evidence chain.
Built on the canonical chp-core adapter template (BaseAdapter + @capability),
the same pattern as chp-adapter-mcp.
Install
pip install chp-adapter-github
Usage
from chp_core import LocalCapabilityHost, register_adapter
from chp_adapter_github import GitHubAdapter, GitHubConfig
host = LocalCapabilityHost()
register_adapter(host, GitHubAdapter(GitHubConfig())) # token from GITHUB_TOKEN
pr = host.invoke("chp.adapters.github.get_pull_request", {
"owner": "capabilityhostprotocol", "repo": "chp-core", "number": 1,
})
print(pr.data["state"], pr.data["mergeable_state"])
Capabilities (read-only)
| Capability | Purpose |
|---|---|
chp.adapters.github.get_repo |
Repository metadata |
chp.adapters.github.list_pull_requests |
List PRs (state filter) |
chp.adapters.github.get_pull_request |
Single PR + merge/CI detail |
chp.adapters.github.list_issues |
List issues (PRs excluded) |
chp.adapters.github.get_issue |
Single issue |
chp.adapters.github.list_workflow_runs |
GitHub Actions CI status |
chp.adapters.github.list_pr_reviews |
Reviews on a PR |
Each returns a curated projection — a capability, not a raw API mirror.
Auth
GitHubConfig.token (or the GITHUB_TOKEN / GH_TOKEN env var). A token is
optional for public reads but raises the rate limit. The token is sent in the
Authorization header and never appears in evidence payloads.
Design notes
- A fresh
httpx.AsyncClientis created per call: the host runs handlers viaasyncio.run(a new loop perhost.invoke), and an AsyncClient is loop-bound. GitHubConfig.transportaccepts anhttpxtransport (e.g.httpx.MockTransport) for tests — no network required.- Write operations (create issue, comment, etc.) are a deliberate later slice; they carry a higher risk tier and policy gates.
Metadata
Release files for chp-adapter-github 0.53.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chp_adapter_github-0.53.0.tar.gz | 16.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chp_adapter_github-0.53.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.5 kB
Release files / chp_adapter_github-0.53.0.tar.gz
| Download URL | chp_adapter_github-0.53.0.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a2bba44f2f6df284ed1d471b11b9f3151c4b4975258ff929ecc6c6420c982dd
|
|
BLAKE2b-256 checksum How to use checksums |
4688ce5e004eadea3c9b240939d6721b86598b33b7224f11fe18cc31d370356e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / chp_adapter_github-0.53.0-py3-none-any.whl
| Download URL | chp_adapter_github-0.53.0-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
443cd78ed814b0673ba12f402b7554ef3d6af8e910cf9d051955ea04af49b080
|
|
BLAKE2b-256 checksum How to use checksums |
34ef963a0174a7a1cf209aae30dcfbb02e26e25f8a647052f4834948bd1134a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|