coval-agent-sdk 0.1.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.
- coval_agent_sdk-0.1.0/.python-version +1 -0
- coval_agent_sdk-0.1.0/AGENTS.md +81 -0
- coval_agent_sdk-0.1.0/AGENTS.meta.md +29 -0
- coval_agent_sdk-0.1.0/CHANGELOG.md +27 -0
- coval_agent_sdk-0.1.0/CONTRIBUTING.md +142 -0
- coval_agent_sdk-0.1.0/LICENSE +202 -0
- coval_agent_sdk-0.1.0/MANIFEST.in +7 -0
- coval_agent_sdk-0.1.0/NOTICE +5 -0
- coval_agent_sdk-0.1.0/PKG-INFO +178 -0
- coval_agent_sdk-0.1.0/README.md +137 -0
- coval_agent_sdk-0.1.0/SECURITY.md +19 -0
- coval_agent_sdk-0.1.0/docs/architecture.md +57 -0
- coval_agent_sdk-0.1.0/docs/developer-api.md +35 -0
- coval_agent_sdk-0.1.0/docs/local-development.md +53 -0
- coval_agent_sdk-0.1.0/docs/python-style.md +73 -0
- coval_agent_sdk-0.1.0/docs/releasing.md +61 -0
- coval_agent_sdk-0.1.0/docs/runtime.md +67 -0
- coval_agent_sdk-0.1.0/pyproject.toml +132 -0
- coval_agent_sdk-0.1.0/pyrightconfig.sdk.json +5 -0
- coval_agent_sdk-0.1.0/release_tests/test_releases.py +269 -0
- coval_agent_sdk-0.1.0/scripts/build +6 -0
- coval_agent_sdk-0.1.0/scripts/check +33 -0
- coval_agent_sdk-0.1.0/scripts/check_architecture.py +201 -0
- coval_agent_sdk-0.1.0/scripts/install +8 -0
- coval_agent_sdk-0.1.0/scripts/lint +8 -0
- coval_agent_sdk-0.1.0/scripts/validate_release.py +87 -0
- coval_agent_sdk-0.1.0/setup.cfg +4 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/__init__.py +29 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/_audio.py +101 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/_connection.py +165 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/_defaults.py +33 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/_exceptions.py +15 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/_http.py +196 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/_runs.py +254 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/_session.py +346 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/audio.py +147 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/client.py +110 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/config.py +54 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/errors.py +53 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/py.typed +0 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/results.py +66 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/telemetry.py +58 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk/tracing.py +346 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk.egg-info/PKG-INFO +178 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk.egg-info/SOURCES.txt +56 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk.egg-info/dependency_links.txt +1 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk.egg-info/requires.txt +17 -0
- coval_agent_sdk-0.1.0/src/coval_agent_sdk.egg-info/top_level.txt +1 -0
- coval_agent_sdk-0.1.0/tests/base_install.py +152 -0
- coval_agent_sdk-0.1.0/tests/test_architecture.py +97 -0
- coval_agent_sdk-0.1.0/tests/test_client.py +619 -0
- coval_agent_sdk-0.1.0/tests/test_errors.py +47 -0
- coval_agent_sdk-0.1.0/tests/test_http.py +325 -0
- coval_agent_sdk-0.1.0/tests/test_package.py +162 -0
- coval_agent_sdk-0.1.0/tests/test_public_api.py +363 -0
- coval_agent_sdk-0.1.0/tests/test_results.py +739 -0
- coval_agent_sdk-0.1.0/tests/test_streaming.py +546 -0
- coval_agent_sdk-0.1.0/tests/test_tracing.py +486 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Instructions for coding agents working on the Coval Agent SDK. The closest applicable `AGENTS.md` governs its directory; explicit user instructions take precedence. Follow existing authorization without asking for it again.
|
|
4
|
+
|
|
5
|
+
## Before you start
|
|
6
|
+
|
|
7
|
+
- Read `README.md` for the supported installation and developer API.
|
|
8
|
+
- Read `CONTRIBUTING.md` before changing code or preparing a pull request.
|
|
9
|
+
- Read `AGENTS.meta.md` before editing either agent-guidance file.
|
|
10
|
+
- Read `docs/python-style.md` before adding modules, imports, exports, types, docstrings, or lint exceptions.
|
|
11
|
+
- Read `docs/architecture.md` before changing dependency direction or moving state between modules.
|
|
12
|
+
- Read `docs/runtime.md` before changing audio, retries, deadlines, cancellation, or trace cleanup.
|
|
13
|
+
- Read `docs/developer-api.md` before turning a proposed interface into executable behavior.
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
- Run `scripts/install` from the repository root to create the development environment and install the editable SDK.
|
|
18
|
+
- Run `.venv/bin/ruff check --fix .` and `.venv/bin/ruff format .` to apply safe lint fixes and formatting, then review the diff.
|
|
19
|
+
- Run `scripts/lint` after Python changes; it checks Ruff, formatting, architecture, and strict production types.
|
|
20
|
+
- Run `scripts/check` after runtime, entry-point, dependency, or packaging changes; it also tests a wheel built from the source distribution outside the checkout.
|
|
21
|
+
- Run `scripts/build` when a consumer needs a local wheel; validate the artifact without publishing it.
|
|
22
|
+
- Check local links and run `git diff --check` for documentation-only changes; run broader checks only when the affected behavior warrants them.
|
|
23
|
+
- Use the same commands locally and in `.github/workflows/checks.yml` instead of adding a separate CI-only validation path.
|
|
24
|
+
|
|
25
|
+
## Python
|
|
26
|
+
|
|
27
|
+
- Follow the Google-based conventions in `docs/python-style.md`; use four spaces, double quotes, an 80-column target, and the pinned Ruff configuration.
|
|
28
|
+
- Import absolute owning modules inside the SDK; keep symbol imports limited to typing helpers and the explicit root API facade.
|
|
29
|
+
- Keep `src/coval_agent_sdk/__init__.py` limited to its docstring, explicit public imports, and literal `__all__`; `scripts/check_architecture.py` checks this boundary.
|
|
30
|
+
- Annotate production parameters and return values, and keep `Any` at validated JSON or dynamic adapter boundaries.
|
|
31
|
+
- Write Google-style docstrings for public APIs, including meaningful `Args:`, `Returns:`, `Yields:`, `Raises:`, and `Attributes:` sections where applicable.
|
|
32
|
+
- Split code by responsibility and state ownership rather than creating generic utility modules or forwarding layers to satisfy a size target.
|
|
33
|
+
- Use a rule-specific suppression with its concrete reason instead of weakening a production file's lint or type policy.
|
|
34
|
+
|
|
35
|
+
## Package and API
|
|
36
|
+
|
|
37
|
+
- Use `coval-agent-sdk` as the distribution name, `coval_agent_sdk` as the Python package, and the library API documented in `README.md`.
|
|
38
|
+
- Treat this unreleased SDK as a clean slate; update consumers alongside API changes without compatibility aliases or deprecation paths.
|
|
39
|
+
- Return outcomes and raise failures without printing, logging, configuring logging, or adding CLI entry points.
|
|
40
|
+
- Keep internal orchestration out of public client reexports; expose a definition through the root facade only when it is part of the reviewed developer API.
|
|
41
|
+
- Keep provider frameworks, backend imports, AWS configuration, and consumer source paths outside the core SDK.
|
|
42
|
+
- Keep optional integration dependencies behind extras and outside core imports; follow the dependency policy in `CONTRIBUTING.md`.
|
|
43
|
+
- Add a dependency only for a concrete runtime or development requirement and keep its supported Python range consistent with `pyproject.toml`.
|
|
44
|
+
- Update `README.md`, public docstrings, and affected examples when a supported interface changes.
|
|
45
|
+
- Include `LICENSE` and `NOTICE` in source and wheel distributions, and keep the SPDX expression in `pyproject.toml` consistent with them.
|
|
46
|
+
|
|
47
|
+
## Runtime
|
|
48
|
+
|
|
49
|
+
- Expose audio connections without SDK agent classes or factories; keep application pipeline construction and lifecycle outside the SDK.
|
|
50
|
+
- Bound unread input, await serialized output writes, and preserve PCM16 validation and cross-call pacing.
|
|
51
|
+
- Retry only documented transient reads and unconsumed relay upgrades; do not automatically repeat run creation or a consumed connection attempt.
|
|
52
|
+
- Preserve the primary session error through cancellation, application cleanup, and trace cleanup.
|
|
53
|
+
- Accept a missing terminal frame only when the simulation API explicitly confirms completion.
|
|
54
|
+
- Upload completed conversations separately and discard failed-session traces after closure and flush.
|
|
55
|
+
- Use synthetic fixtures and deterministic local collaborators for automated tests; live simulations need an explicitly selected environment and existing authorization.
|
|
56
|
+
- Never commit credentials, one-use connection tokens, customer audio, or transcripts; secret scanning cannot establish that every fixture is safe.
|
|
57
|
+
|
|
58
|
+
## Tests
|
|
59
|
+
|
|
60
|
+
- Follow `CONTRIBUTING.md` for behavior-focused tests and reviewable changes.
|
|
61
|
+
- Keep tests outside `src/` and exercise installed-package boundaries without modifying `sys.path`.
|
|
62
|
+
- Patch dependencies at the module that owns them and keep the behavior under test real.
|
|
63
|
+
- Preserve assertions for failure, cancellation, cleanup, and supported public entry points when reorganizing tests.
|
|
64
|
+
- Distinguish local, mocked, and hosted evidence; do not infer a completed simulation from a successful launch or connection.
|
|
65
|
+
|
|
66
|
+
## Documentation and comments
|
|
67
|
+
|
|
68
|
+
- Read `CONTRIBUTING.md`'s "Documentation and comments" section before writing documentation or code comments.
|
|
69
|
+
- Follow its document ownership, comment purpose, placement, and review rules; keep explanations in one authoritative page and link from other pages.
|
|
70
|
+
- Search README files, docs, guidance, templates, and examples for changed APIs or behavior, and update affected claims in the same change.
|
|
71
|
+
- Write Markdown paragraphs on one line; keep Python comments and docstrings within the Google-based formatting conventions.
|
|
72
|
+
- Keep public documentation focused on current supported behavior; retain internal delivery history in the work tracker and label proposals and unverified evidence explicitly.
|
|
73
|
+
|
|
74
|
+
## Releases and security
|
|
75
|
+
|
|
76
|
+
- Follow `docs/releasing.md` when preparing a version or distribution.
|
|
77
|
+
- Use Conventional Commit PR titles and squash merges; release automation owns version bumps, `CHANGELOG.md`, and release tags.
|
|
78
|
+
- Run `.venv/bin/python -m pytest release_tests -q` on Python 3.12 after changing release tooling; CI runs it separately from runtime tests.
|
|
79
|
+
- Obtain explicit authorization before publishing packages, changing repository visibility, or adding publishing automation.
|
|
80
|
+
- Preserve an existing pull request's draft state unless the user authorizes changing it.
|
|
81
|
+
- Follow `SECURITY.md` for vulnerability reports and avoid putting sensitive reproduction details in public issues.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# AGENTS.meta.md
|
|
2
|
+
|
|
3
|
+
Authoring rules for this repository's `AGENTS.md`. This file also governs edits to itself. Instruction discovery and precedence follow the [AGENTS.md standard](https://agents.md/); an explicit user instruction takes precedence.
|
|
4
|
+
|
|
5
|
+
## What belongs here
|
|
6
|
+
|
|
7
|
+
- Put short, actionable SDK rules and exact development commands in `AGENTS.md`.
|
|
8
|
+
- Put contributor workflow in `CONTRIBUTING.md`, Python conventions in `docs/python-style.md`, and technical explanations in the relevant `docs/` page.
|
|
9
|
+
- Record a recurring mistake as a rule at the boundary that owns it; avoid speculative rules and rules tied to one person's workstation.
|
|
10
|
+
- Keep unreleased API proposals separate from instructions for the implemented API.
|
|
11
|
+
|
|
12
|
+
## Writing a rule
|
|
13
|
+
|
|
14
|
+
- Start each rule with an imperative verb; use `Never` for a hard prohibition and `Ask first` only for a decision that needs authorization.
|
|
15
|
+
- Honor authorization already present in the conversation instead of asking for it again.
|
|
16
|
+
- Keep each bullet to one instruction, adding one explanatory sentence only when the reason is otherwise unclear.
|
|
17
|
+
- Name paths and commands exactly in backticks, including the flags needed to run a check.
|
|
18
|
+
- Link the explanatory document from the section that needs it rather than repeating its prose.
|
|
19
|
+
- State which check enforces a rule when enforcement exists; distinguish automated enforcement from reviewer judgment.
|
|
20
|
+
- Use headings and flat bullets; keep tables, long explanations, and nested procedures in the linked documentation.
|
|
21
|
+
- Avoid private issue links, pull-request narration, implementation-history notes, personal paths, and credentials.
|
|
22
|
+
|
|
23
|
+
## Maintaining the guidance
|
|
24
|
+
|
|
25
|
+
- Update a rule when the code, command, or supported interface changes.
|
|
26
|
+
- Remove obsolete rules and duplicated instructions instead of accumulating exceptions.
|
|
27
|
+
- Read `AGENTS.md`, this file, and affected linked sections after an edit; resolve contradictions before finishing.
|
|
28
|
+
- Verify every referenced local path and command, and label any check that was not executed.
|
|
29
|
+
- Follow `CONTRIBUTING.md` for documentation ownership, prose, and comment review; preserve Python formatting rules when adapting guidance from another language.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## v0.1.0 (2026-10-20)
|
|
5
|
+
|
|
6
|
+
### Chores
|
|
7
|
+
|
|
8
|
+
- Initial commit
|
|
9
|
+
([`3c95020`](https://github.com/coval-ai/coval-agent-sdk/commit/3c950207a6c72738bfa9b69aebd68fbe924a4a9f))
|
|
10
|
+
|
|
11
|
+
### Continuous Integration
|
|
12
|
+
|
|
13
|
+
- Automate sdk versioning, changelogs, and pypi releases
|
|
14
|
+
([#2](https://github.com/coval-ai/coval-agent-sdk/pull/2),
|
|
15
|
+
[`b036423`](https://github.com/coval-ai/coval-agent-sdk/commit/b036423abd734fad397dd4bf96c96244e741395a))
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- Add the standalone python voice agent sdk
|
|
20
|
+
([#1](https://github.com/coval-ai/coval-agent-sdk/pull/1),
|
|
21
|
+
[`445a752`](https://github.com/coval-ai/coval-agent-sdk/commit/445a752468537e052c05f217eed630509e305759))
|
|
22
|
+
|
|
23
|
+
### Refactoring
|
|
24
|
+
|
|
25
|
+
- Standardize conversation results and sdk errors
|
|
26
|
+
([#3](https://github.com/coval-ai/coval-agent-sdk/pull/3),
|
|
27
|
+
[`336fd5b`](https://github.com/coval-ai/coval-agent-sdk/commit/336fd5b7381bc4737fba54d3914bbe8c8071f5ed))
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
The [README](README.md) introduces the SDK and its supported API. This guide describes how to make a reviewable change; [Python conventions](docs/python-style.md) define the coding standard.
|
|
4
|
+
|
|
5
|
+
## Set up the project
|
|
6
|
+
|
|
7
|
+
Use Python 3.12 and [uv](https://docs.astral.sh/uv/) for development. The package supports Python 3.10 and newer; CI exercises 3.10, 3.12, and 3.14.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
git clone https://github.com/coval-ai/coval-agent-sdk.git
|
|
11
|
+
cd coval-agent-sdk
|
|
12
|
+
scripts/install
|
|
13
|
+
.venv/bin/python -c "import coval_agent_sdk"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The editable installation makes source changes available in `.venv`. Installation, imports, static checks, and tests do not need Coval or model-provider credentials. Use `PYTHON_VERSION=3.10 scripts/install` in a fresh checkout to create a development environment for another supported interpreter.
|
|
17
|
+
|
|
18
|
+
## Pull requests
|
|
19
|
+
|
|
20
|
+
1. Start a focused branch from `main`. For a substantial API change, describe the proposed behavior in an issue before adding another abstraction.
|
|
21
|
+
2. Identify the owning module using [architecture](docs/architecture.md). Keep provider integrations in adapters outside the core package.
|
|
22
|
+
3. Implement the change and add behavior-focused coverage for affected contracts, including relevant failure and cancellation paths.
|
|
23
|
+
4. Run the checks below and describe any unavailable or unrelated failing check accurately.
|
|
24
|
+
5. Open a pull request explaining the problem, resulting behavior, relevant evidence, and any migration or release implications. Link the issue when one exists.
|
|
25
|
+
6. Have the change reviewed before merging. Keep design experiments in draft until their scope and API are ready for review.
|
|
26
|
+
|
|
27
|
+
Use squash merges with a concise Conventional Commit PR title such as `fix: preserve cancellation during trace cleanup` or `docs: clarify audio connection ownership`. Commit and PR bodies explain why the change is needed; they should not narrate every command run.
|
|
28
|
+
|
|
29
|
+
## Checks
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
scripts/lint
|
|
33
|
+
scripts/check
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`scripts/lint` runs Ruff lint, Ruff formatting checks, the architecture policy, and strict Pyright checks for production code. `scripts/check` also builds a source distribution, builds its wheel, checks metadata, installs the wheel into an isolated environment, and runs the SDK's tests outside the checkout. CI uses the same entry points.
|
|
37
|
+
|
|
38
|
+
For a focused test during iteration:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
.venv/bin/python -m pytest tests/test_streaming.py -q
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Release tooling uses Python 3.12 and the pinned `python-semantic-release` development dependency. After changing its configuration, workflow, or validator, also run `.venv/bin/python -m pytest release_tests -q`. This separate suite exercises real release tooling in isolated Git repositories without contacting GitHub or PyPI; CI runs it in a dedicated job. It is not part of the installed SDK runtime suite.
|
|
45
|
+
|
|
46
|
+
For safe automated fixes:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
.venv/bin/ruff check --fix .
|
|
50
|
+
.venv/bin/ruff format .
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Review generated edits before committing. Run `scripts/check` before pushing runtime, dependency, entry-point, or packaging changes. For a prose-only edit, verify links and commands that changed and run `git diff --check`; do not rerun unrelated runtime tests merely to change a paragraph.
|
|
54
|
+
|
|
55
|
+
## Tests
|
|
56
|
+
|
|
57
|
+
Assert on observable behavior: the audio or requests sent, returned results, typed failures, resource state, and cancellation or cleanup outcomes. Keep the owner under test real, and substitute only external boundaries needed for a deterministic test. Use populated values and otherwise-valid inputs so a rejection case fails for the intended reason.
|
|
58
|
+
|
|
59
|
+
Patch collaborators at their owning modules, not through the root facade. Keep tests under `tests/`; do not insert the checkout into `sys.path`. Packaging and public API tests must also pass against an installed wheel. Preserve each distinct behavior when splitting or consolidating cases, and never hide an affected failure with a skip, weaker assertion, or broader mock.
|
|
60
|
+
|
|
61
|
+
Use synthetic identifiers and audio. Do not make live API or provider calls in the automated suite. A separately authorized hosted check must record the selected environment, source/artifact identity, and terminal result; mocked checks do not establish hosted acceptance.
|
|
62
|
+
|
|
63
|
+
The public wire tests use loopback HTTP and TLS WebSocket servers. They require `openssl` on `PATH` to generate a temporary certificate and key; no test credentials are committed. Only the local CA trust and polling interval are injected into the client. Discovery, the HTTP adapter, WebSocket upgrade, audio exchange, monitoring, and public result construction execute normally. These tests prove the local protocol path, not deployed Cloudflare or production behavior.
|
|
64
|
+
|
|
65
|
+
## API and dependencies
|
|
66
|
+
|
|
67
|
+
Add public exports deliberately and document their ownership, inputs, outputs, error behavior, and cleanup obligations. Keep the importable package independent of any particular agent framework. Put unimplemented interfaces in [API design](docs/developer-api.md), clearly marked as proposals.
|
|
68
|
+
|
|
69
|
+
Expose conversation audio connections without agent classes or factories. Applications own agent/pipeline construction and cleanup; SDK connection contexts and async run handlers own only audio transport and simulation orchestration. Framework plugins belong in consumers, and application cleanup must finish before trace finalization.
|
|
70
|
+
|
|
71
|
+
Keep the SDK a Python library only. Return structured results and raise failures without printing, emitting log records, configuring logging, or adding console-script or package-execution entry points. Calling applications own presentation. Preserve useful diagnostics in returned outcomes and errors as described in [runtime contracts](docs/runtime.md#returned-outcomes); test that affected public operations return the expected information without writing console output or log records.
|
|
72
|
+
|
|
73
|
+
Keep `coval-sdk` and its HTTP dependency inside the private `_http.py` adapter. Do not expose dependency clients, configuration, models, raw responses, or exception types through public attributes, parameters, return values, or exports. Translate request failures into this package's errors at that boundary; orchestration owns read retries, and run creation must remain a single attempt. Do not enable dependency debug output or change application logging configuration.
|
|
74
|
+
|
|
75
|
+
Derive SDK-owned failures from `CovalError` and retain useful specific subclasses. Do not wrap application exceptions or cancellation as SDK errors. Preserve the original failure through session cleanup and batch sibling cancellation; attach `RunError` snapshots only to SDK failures after launch. Completed-session trace delivery failures remain structured diagnostics.
|
|
76
|
+
|
|
77
|
+
Put optional integration dependencies in a named extra and declare every external package imported directly by that integration. Keep the base SDK importable and runnable without those dependencies. OpenTelemetry belongs only in `coval_agent_sdk.tracing`; use its protobuf encoder with the private HTTP adapter rather than an exporter that emits logs or hides retry policy. Core code uses the dependency-free `TraceExporter` contract. `scripts/check` first exercises a clean base wheel installation, then installs `[tracing]` and runs the full suite.
|
|
78
|
+
|
|
79
|
+
For a new dependency, explain why the SDK needs it, its Python support, and its distribution/license implications. Update the affected tests and package metadata. Review dependency upgrades as code changes; do not relax constraints solely to silence a failing check.
|
|
80
|
+
|
|
81
|
+
Release automation owns the version in `pyproject.toml` and [CHANGELOG.md](CHANGELOG.md). Do not bump versions or edit the changelog in feature PRs. Squash-merged Conventional Commit titles supply the release notes: `fix:` and `perf:` produce a patch, `feat:` a minor, and `!` or `BREAKING CHANGE:` a major, including a move from `0.x` to `1.0.0`. Other types do not trigger a release on their own. Follow [releasing](docs/releasing.md) for setup, retries, and publication evidence.
|
|
82
|
+
|
|
83
|
+
## Where prose lives
|
|
84
|
+
|
|
85
|
+
- `README.md` introduces the SDK, installation, and a complete first-run example.
|
|
86
|
+
- `AGENTS.md` contains concise coding-agent instructions and links to their explanations.
|
|
87
|
+
- `AGENTS.meta.md` governs changes to the agent instructions.
|
|
88
|
+
- `CONTRIBUTING.md` describes the human contribution and review workflow.
|
|
89
|
+
- `docs/python-style.md` defines imports, initializers, types, docstrings, and formatting.
|
|
90
|
+
- `docs/architecture.md` maps responsibilities and dependency direction.
|
|
91
|
+
- `docs/runtime.md` explains audio, connection, timeout, cancellation, and trace contracts.
|
|
92
|
+
- `docs/local-development.md` explains editable installs, built-wheel checks, and consumer development.
|
|
93
|
+
- `docs/releasing.md` describes maintainer release preparation and publication boundaries.
|
|
94
|
+
- `SECURITY.md` describes private vulnerability reporting.
|
|
95
|
+
|
|
96
|
+
Keep explanations in their owning document and link to them elsewhere. Use one paragraph per line in Markdown; leave code blocks, tables, and lists structured normally. Python comments and docstrings follow the formatter and 80-column conventions instead.
|
|
97
|
+
|
|
98
|
+
## Documentation and comments
|
|
99
|
+
|
|
100
|
+
Document the current behavior and the decisions a developer needs to use or change it. The ownership map above determines where an explanation belongs; keep a single authoritative explanation and link to it from other pages.
|
|
101
|
+
|
|
102
|
+
### Write a comment when
|
|
103
|
+
|
|
104
|
+
- A value, limit, dependency pin, or protocol choice has a reason the code cannot express.
|
|
105
|
+
- Changing the behavior has a consequence outside the function, such as a wire-contract change, resource leak, cancellation interaction, or broken consumer.
|
|
106
|
+
- Correctness depends on ordering, concurrency, or another component's behavior.
|
|
107
|
+
- A temporary workaround has a specific condition for removal.
|
|
108
|
+
|
|
109
|
+
### Leave a comment out when
|
|
110
|
+
|
|
111
|
+
- It repeats a name, annotation, expression, or the next statement.
|
|
112
|
+
- It is a banner, divider, file-level narrative, or an explanation repeated in sibling modules.
|
|
113
|
+
- It recounts a previous implementation, rejected approach, ticket, pull request, or incident; durable delivery history belongs in the work tracker.
|
|
114
|
+
- It makes a claim that will drift, such as an unexplained current count or "for now" without an exit condition.
|
|
115
|
+
|
|
116
|
+
### Form and review
|
|
117
|
+
|
|
118
|
+
Place a comment immediately above the code it explains. Use concise plain sentences; put a longer explanation in a README or docs page and link to that path. Prefer documentation links over private issue or pull-request links. Rule-specific tool suppressions may remain inline when the checker requires it; include their concrete reason.
|
|
119
|
+
|
|
120
|
+
Delete the comment mentally and read the code again. If no useful information disappears, remove it. If information does disappear, first check whether a clearer name, type, or structure can express it directly.
|
|
121
|
+
|
|
122
|
+
Use one paragraph per line in Markdown and structured lists/tables where useful. Python comments and docstrings follow the Google-based 80-column conventions in [Python conventions](docs/python-style.md); the Markdown wrapping rule does not override the formatter.
|
|
123
|
+
|
|
124
|
+
### Keep documentation current
|
|
125
|
+
|
|
126
|
+
When changing an API, configuration value, dependency, behavior, or command, search README files, docs, contribution guidance, templates, and examples for its name and update every affected claim in the same change. Recheck "all", "every", and "only" claims against the resulting implementation.
|
|
127
|
+
|
|
128
|
+
Describe supported behavior separately from proposals and release prerequisites. Verify local links and anchors, check examples and commands against the actual API, and distinguish syntax checks, offline tests, and hosted evidence. Do not imply publication, deployment, or live acceptance from a successful local build.
|
|
129
|
+
|
|
130
|
+
### Docstrings
|
|
131
|
+
|
|
132
|
+
Document public behavior with [Google-style docstrings](docs/python-style.md#docstrings), including meaningful arguments, results, errors, units, ownership, and cancellation where relevant. Docstrings explain the callable's contract; code comments explain constraints at the point they matter.
|
|
133
|
+
|
|
134
|
+
## Security and conduct
|
|
135
|
+
|
|
136
|
+
Follow [SECURITY.md](SECURITY.md) for vulnerabilities. For ordinary bugs and feature requests, use the repository's issue templates and remove credentials, customer identifiers, audio, and transcripts from reproductions.
|
|
137
|
+
|
|
138
|
+
Keep discussion respectful, specific, and focused on the work. Explain tradeoffs, give actionable review feedback, and do not publish another person's private information. Maintainers may remove abusive or unsafe content.
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
This project is licensed under [Apache-2.0](LICENSE). Contributions intentionally submitted for inclusion are provided under that license unless an existing written agreement states otherwise. Preserve applicable copyright and attribution notices, and disclose third-party material included with a contribution.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
include AGENTS.md AGENTS.meta.md CONTRIBUTING.md SECURITY.md CHANGELOG.md
|
|
2
|
+
include LICENSE NOTICE pyrightconfig.sdk.json .python-version
|
|
3
|
+
recursive-include docs *.md
|
|
4
|
+
recursive-include scripts *
|
|
5
|
+
recursive-include tests *.py
|
|
6
|
+
recursive-include release_tests *.py
|
|
7
|
+
global-exclude __pycache__ *.py[cod]
|