Skip to content

Commit e27216b

Browse files
author
Chojan Shang
committed
docs: polish docs
Signed-off-by: Chojan Shang <chojan.shang@vesoft.com>
1 parent c898f59 commit e27216b

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- Target Python 3.10+ with four-space indentation and type hints on public APIs.
1818
- Ruff enforces formatting and lint rules (`uv run ruff check`, `uv run ruff format`); keep both clean before publishing.
1919
- Prefer dataclasses or generated Pydantic models from `acp.schema` over ad-hoc dicts. Place shared utilities in `_`-prefixed internal modules.
20-
- When constructing ACP payloads, use the builders in `acp.helpers` (for example `text_block`, `start_tool_call`). These helpers keep the generated Pydantic models authoritative while hiding required literal fields, and the golden tests (`tests/test_golden.py`) ensure they always match the schema.
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`).
2121

2222
## Testing Guidelines
2323
- Tests live in `tests/` and must be named `test_*.py`. Use `pytest.mark.asyncio` for coroutine coverage.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Welcome to the Python SDK for the Agent Client Protocol (ACP). The package ships
1111
- Pydantic models generated from the upstream ACP schema (`acp.schema`)
1212
- Async agent/client wrappers with JSON-RPC task supervision built in
1313
- Process helpers (`spawn_agent_process`, `spawn_client_process`) for embedding ACP nodes inside Python applications
14-
- Helper APIs in `acp.helpers` that mirror the Go/TS SDK builders for content blocks, tool calls, and session updates
14+
- Helper APIs in `acp.helpers` that mirror the Go/TS SDK builders for content blocks, tool calls, and session updates. They instantiate the generated Pydantic types for you, so call sites stay concise without sacrificing validation.
1515
- Examples that showcase streaming updates, file operations, permission flows, and even a Gemini CLI bridge (`examples/gemini.py`)
1616

1717
## Getting started

docs/quickstart.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ finish_update = update_tool_call(
121121
)
122122
```
123123

124+
Each helper wraps the generated Pydantic models in `acp.schema`, so the right discriminator fields (`type`, `sessionUpdate`, and friends) are always populated. That keeps examples readable while maintaining the same validation guarantees as constructing the models directly. Golden fixtures in `tests/test_golden.py` ensure the helpers stay in sync with future schema revisions.
125+
124126
## 5. Optional: Talk to the Gemini CLI
125127

126128
If you have the Gemini CLI installed and authenticated:

docs/releasing.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,53 @@ This project tracks the ACP schema tags published by
55
Every release should line up with one of those tags so that the generated `acp.schema` module, examples, and package
66
version remain consistent.
77

8-
## 准备阶段
8+
## Preparation
99

10-
1. 选择目标 schema 版本(例如 `v0.4.5`),并重新生成协议文件:
10+
1. Pick the target schema tag (for example `v0.4.5`) and regenerate the protocol bindings:
1111

1212
```bash
1313
ACP_SCHEMA_VERSION=v0.4.5 make gen-all
1414
```
1515

16-
该命令会下载对应的 schema 包并重写 `schema/` `src/acp/schema.py`
16+
This downloads the upstream schema package and rewrites `schema/` plus the generated `src/acp/schema.py`.
1717

18-
2. 同步更新 `pyproject.toml` 中的版本号,并根据需要调整 `uv.lock`
18+
2. Bump the project version in `pyproject.toml`, updating `uv.lock` if dependencies changed.
1919

20-
3. 运行基础校验:
20+
3. Run the standard checks:
2121

2222
```bash
2323
make check
2424
make test
2525
```
2626

27-
`make check` 会执行 Ruff 格式化/静态检查、类型分析以及依赖完整性校验;`make test` 则运行 pytest(含 doctest)。
27+
`make check` covers Ruff formatting/linting, static analysis, and dependency hygiene.
28+
`make test` executes pytest (including doctests).
2829

29-
4. 更新文档与示例(例如 Gemini 集成)以反映变化。
30+
4. Refresh documentation and examples (for instance the Gemini walkthrough) so they match the new schema behaviour.
3031

31-
## 提交与合并
32+
## Commit & Merge
3233

33-
1. 确认 diff 仅包含预期变动:schema 源文件、生成的 Pydantic 模型、版本号以及相应文档。
34-
2. 使用 Conventional Commits(如 `release: v0.4.5`)提交,并在 PR 中记录:
35-
- 引用的 ACP schema 标签
36-
- `make check` / `make test` 的结果
37-
- 重要的行为或 API 变更
38-
3. 获得评审通过后合并 PR。
34+
1. Make sure the diff only includes the expected artifacts: regenerated schema sources, `src/acp/schema.py`, version bumps, and doc updates.
35+
2. Commit with a Conventional Commit message (for example `release: v0.4.5`) and note in the PR:
36+
- The ACP schema tag you targeted
37+
- Results from `make check` / `make test`
38+
- Any behavioural or API changes worth highlighting
39+
3. Merge once the review is approved.
3940

40-
## 通过 GitHub Release 触发发布
41+
## Publish via GitHub Release
4142

42-
仓库采用 GitHub Workflow (`on-release-main.yml`) 自动完成发布。主干合并完成后:
43+
Publishing is automated through `on-release-main.yml`. After the release PR merges to `main`:
4344

44-
1. GitHub Releases 页面创建新的 Release,选择目标标签(形如 `v0.4.5`)。如标签不存在,Release 创建过程会自动打上该标签。
45-
2. Release 发布后,工作流会:
46-
- 将标签写回 `pyproject.toml`(以保证包版本与标签一致)
47-
- 构建并通过 `uv publish` 发布到 PyPI(使用 `PYPI_TOKEN` 机密)
48-
- 使用 `mkdocs gh-deploy` 更新 GitHub Pages 文档
45+
1. Draft a GitHub Release for the new tag (e.g. `v0.4.5`). If the tag is missing, the release UI will create it.
46+
2. Once published, the workflow will:
47+
- Write the tag back into `pyproject.toml` to keep the package version aligned
48+
- Build and publish to PyPI via `uv publish` (using the `PYPI_TOKEN` secret)
49+
- Deploy updated documentation with `mkdocs gh-deploy`
4950

50-
无需在本地执行 `uv build``uv publish`;只需确保 Release 草稿信息完整(新增特性、兼容性注意事项等)。
51+
No local `uv build`/`uv publish` runs are required—focus on providing a complete release summary (highlights, compatibility notes, etc.).
5152

52-
## 其他注意事项
53+
## Additional Notes
5354

54-
- Schema 有破坏性修改时,请同步更新 `tests/test_json_golden.py`、端到端用例(如 `tests/test_rpc.py`)以及相关示例。
55-
- 如果需要清理生成文件,可运行 `make clean`,之后重新执行 `make gen-all`
56-
- 发布前务必确认 `ACP_ENABLE_GEMINI_TESTS` 等可选测试在必要环境下运行通过,以避免 Release 后出现回归。
55+
- Breaking schema updates often require refreshing golden fixtures (`tests/test_golden.py`), end-to-end cases such as `tests/test_rpc.py`, and any affected examples.
56+
- Use `make clean` to remove generated artifacts if you need a fresh baseline before re-running `make gen-all`.
57+
- Run optional checks like the Gemini smoke test (`ACP_ENABLE_GEMINI_TESTS=1`) whenever the environment is available to catch regressions before publishing.

0 commit comments

Comments
 (0)