Skip to content

Commit 4d4e9de

Browse files
authored
*: polish docs with real use case and add a maker file for typing hint (#29)
* chore: add a maker file for typing hint Signed-off-by: Chojan Shang <chojan.shang@vesoft.com> * docs: better documents, also add real use cases Signed-off-by: Chojan Shang <chojan.shang@vesoft.com> * docs: make every docs read easy Signed-off-by: Chojan Shang <chojan.shang@vesoft.com> * chore: add github templates Signed-off-by: Chojan Shang <chojan.shang@vesoft.com> --------- Signed-off-by: Chojan Shang <chojan.shang@vesoft.com>
1 parent 53761f1 commit 4d4e9de

File tree

14 files changed

+457
-432
lines changed

14 files changed

+457
-432
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Bug Report
2+
description: Tell us about a regression or defect in the ACP Python SDK.
3+
title: "bug: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
Thanks for filing a detailed bug. Fill out every section so we can
10+
reproduce the issue quickly and keep the SDK solid.
11+
12+
- type: textarea
13+
id: summary
14+
attributes:
15+
label: Summary
16+
description: What went wrong? Keep it short but specific.
17+
placeholder: "Streaming updates stop after the second prompt…"
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: repro
23+
attributes:
24+
label: Reproduction steps
25+
description: >
26+
Commands, code, or payloads that trigger the bug. Include any relevant
27+
input files or snippets (redact secrets).
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: expected
33+
attributes:
34+
label: Expected result
35+
placeholder: "Tool call should finish and emit a completed status…"
36+
validations:
37+
required: true
38+
39+
- type: textarea
40+
id: actual
41+
attributes:
42+
label: Actual result
43+
placeholder: "Agent hangs and no further session/update payloads arrive…"
44+
validations:
45+
required: true
46+
47+
- type: input
48+
id: versions
49+
attributes:
50+
label: Versions / environment
51+
description: >
52+
Include SDK version, ACP schema tag (if pinned), Python version, and OS.
53+
placeholder: "sdk 0.5.1 (schema v0.4.7), Python 3.12.2 on macOS 14.4"
54+
validations:
55+
required: true
56+
57+
- type: textarea
58+
id: logs
59+
attributes:
60+
label: Logs & screenshots
61+
description: Paste relevant stack traces, JSON snippets, or console output.
62+
render: shell
63+
64+
- type: checkboxes
65+
id: willing-to-pr
66+
attributes:
67+
label: Open to submitting a fix?
68+
options:
69+
- label: I’m willing to open a PR for this bug.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/agentclientprotocol/python-sdk/discussions/new?category=q-a
5+
about: Usage questions, architecture ideas, and doc clarifications live best in Discussions.
6+
- name: Read the docs
7+
url: https://agentclientprotocol.github.io/python-sdk/
8+
about: The published docs cover quickstart steps, contrib helpers, and release workflows.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Feature Request
2+
description: Pitch an improvement for the ACP Python SDK docs, runtime, or tooling.
3+
title: "feat: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
Feature requests work best when they focus on the problem first. Tell us
10+
what you’re trying to achieve and why existing APIs aren’t enough.
11+
12+
- type: textarea
13+
id: problem
14+
attributes:
15+
label: Problem statement
16+
description: >
17+
What use case is blocked? Include relevant transports, helpers, or user
18+
journeys.
19+
placeholder: "Need a helper to batch tool call updates when streaming…"
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: proposal
25+
attributes:
26+
label: Proposed solution
27+
description: >
28+
Sketch the API or behaviour you’d like to see. Code snippets welcome.
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: alternatives
34+
attributes:
35+
label: Alternatives considered
36+
description: >
37+
Mention workarounds you’ve tried or other approaches we should weigh.
38+
39+
- type: textarea
40+
id: extra
41+
attributes:
42+
label: Additional context
43+
description: Links, screenshots, related issues, etc.
44+
45+
- type: checkboxes
46+
id: willing-to-help
47+
attributes:
48+
label: Can you help build it?
49+
options:
50+
- label: I can contribute code or docs for this request.

.github/pull_request_template.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Summary
2+
3+
<!-- What does this change do? Keep it short. -->
4+
5+
6+
## Related issues
7+
8+
<!--
9+
Link the tracked issue(s) using the GitHub syntax, e.g. "Closes #123".
10+
If the work only partially addresses an issue, use "Relates to #123".
11+
-->
12+
13+
14+
## Testing
15+
16+
<!--
17+
List the checks you ran (e.g. `make check`, `make test`, targeted pytest files, manual CLI steps).
18+
Include output snippets when helpful.
19+
-->
20+
21+
22+
## Docs & screenshots
23+
24+
<!--
25+
Note any documentation or example updates included (or explain why none are needed).
26+
Attach screenshots/GIFs when the change affects UX.
27+
-->
28+
29+
30+
## Checklist
31+
32+
- [ ] Conventional Commit title (e.g. `feat:`, `fix:`).
33+
- [ ] Tests cover the change or are not required (explain above).
34+
- [ ] Docs/examples updated when behaviour is user-facing.
35+
- [ ] Schema regenerations (`make gen-all`) are called out if applicable.

AGENTS.md

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
1-
# Repository Guidelines
2-
3-
## Project Structure & Module Organization
4-
- `src/acp/`: runtime package exposing agent/client abstractions, transports, and the generated `schema.py`.
5-
- `schema/`: upstream JSON schema sources; regenerate Python bindings with `make gen-all`.
6-
- `examples/`: runnable scripts (`echo_agent.py`, `client.py`, `gemini.py`, etc.) demonstrating stdio orchestration patterns.
7-
- `tests/`: pytest suite, including opt-in Gemini smoke checks under `tests/test_gemini_example.py`.
8-
- `docs/`: MkDocs content powering the hosted documentation.
9-
10-
## Build, Test, and Development Commands
11-
- `make install` — provision the `uv` virtualenv and install pre-commit hooks.
12-
- `make check` — run Ruff linting/formatting, type analysis, dependency hygiene, and lock verification.
13-
- `make test` — execute `pytest` (with doctests) inside the managed environment.
14-
- `make gen-all` — refresh protocol artifacts when the ACP schema version advances (`ACP_SCHEMA_VERSION=<ref>` to pin an upstream tag).
15-
16-
## Coding Style & Naming Conventions
17-
- Target Python 3.10+ with four-space indentation and type hints on public APIs.
18-
- Ruff enforces formatting and lint rules (`uv run ruff check`, `uv run ruff format`); keep both clean before publishing.
19-
- Prefer dataclasses or generated Pydantic models from `acp.schema` over ad-hoc dicts. Place shared utilities in `_`-prefixed internal modules.
20-
- Prefer the builders in `acp.helpers` (for example `text_block`, `start_tool_call`) when constructing ACP payloads. The helpers instantiate the generated Pydantic models for you, keep literal discriminator fields out of call sites, and stay in lockstep with the schema thanks to the golden tests (`tests/test_golden.py`).
21-
22-
## Testing Guidelines
23-
- Tests live in `tests/` and must be named `test_*.py`. Use `pytest.mark.asyncio` for coroutine coverage.
24-
- Run `make test` (or `uv run python -m pytest`) prior to commits; include reproducing steps for any added fixtures.
25-
- Gemini CLI coverage is disabled by default. Set `ACP_ENABLE_GEMINI_TESTS=1` (and `ACP_GEMINI_BIN=/path/to/gemini`) to exercise `tests/test_gemini_example.py`.
26-
27-
## Commit & Pull Request Guidelines
28-
- Follow Conventional Commits (`feat:`, `fix:`, `docs:`, etc.) with succinct scopes, noting schema regenerations when applicable.
29-
- PRs should describe exercised agent behaviours, link relevant issues, and include output from `make check` or focused pytest runs.
30-
- Update documentation and examples whenever public APIs or transport behaviours change, and call out environment prerequisites for new integrations.
1+
# Repository Handbook
2+
3+
Use this page as the quick orientation for the Python SDK repo. It mirrors the tone of the main README/index and surfaces what you need without hunting through multiple docs.
4+
5+
## Repo Map
6+
7+
| Path | Why it exists |
8+
| --- | --- |
9+
| `src/acp/` | Runtime package: agent/client bases, transports, helpers, schema bindings, contrib utilities |
10+
| `schema/` | Upstream JSON schema sources (regenerate with `make gen-all`) |
11+
| `examples/` | Runnable scripts such as `echo_agent.py`, `client.py`, `gemini.py`, `duet.py` |
12+
| `tests/` | Pytest suite, including optional Gemini smoke tests in `tests/test_gemini_example.py` |
13+
| `docs/` | MkDocs content published at `agentclientprotocol.github.io/python-sdk/` |
14+
15+
## Daily Commands
16+
17+
| Need | Command |
18+
| --- | --- |
19+
| Bootstrap env + pre-commit | `make install` |
20+
| Format, lint, types, deps | `make check` |
21+
| Test suite (pytest + doctest) | `make test` |
22+
| Regenerate schema + bindings | `ACP_SCHEMA_VERSION=<tag> make gen-all` |
23+
24+
## Style Guardrails
25+
26+
- Target Python 3.10+ and keep public APIs typed.
27+
- Ruff handles formatting + linting (`uv run ruff format` / `check`)—keep both clean before pushing.
28+
- Reach for the generated Pydantic models and helpers (e.g. `text_block`, `start_tool_call`) instead of hand-crafting dicts; helpers stay aligned with the schema via `tests/test_golden.py`.
29+
- Place reusable internals in `_`-prefixed modules.
30+
31+
## Testing Expectations
32+
33+
- Tests live under `tests/` and follow the `test_*.py` naming. Mark async tests with `pytest.mark.asyncio`.
34+
- Run `make test` (or `uv run python -m pytest`) before committing and include reproduction steps for new fixtures.
35+
- Gemini CLI checks are opt-in: set `ACP_ENABLE_GEMINI_TESTS=1` and optionally `ACP_GEMINI_BIN=/path/to/gemini` to exercise `tests/test_gemini_example.py`.
36+
37+
## PR Checklist
38+
39+
- Use Conventional Commit prefixes (`feat:`, `fix:`, `docs:`, etc.) and call out schema regenerations explicitly.
40+
- Summarise exercised behaviours, link related issues, and attach `make check` / targeted pytest output in PR descriptions.
41+
- Update docs/examples when user-visible APIs or transports change, and document any new environment requirements.
3142

3243
## Agent Integration Tips
33-
- Bootstrap agents from `examples/echo_agent.py` or `examples/agent.py`; pair with `examples/client.py` for round-trip validation.
34-
- Use `spawn_agent_process` / `spawn_client_process` to embed ACP parties directly in Python applications.
35-
- Validate new transports against `tests/test_rpc.py` and, when applicable, the Gemini example to ensure streaming updates and permission flows stay compliant.
44+
45+
- Start new agents from `examples/echo_agent.py` or `examples/agent.py`; pair them with `examples/client.py` for loopback validation.
46+
- `spawn_agent_process` / `spawn_client_process` embed ACP parties inside Python apps without hand-wiring stdio.
47+
- Validate new transports against `tests/test_rpc.py` and (when relevant) the Gemini example to ensure streaming + permission flows stay compliant.

0 commit comments

Comments
 (0)