Thank you for your interest in contributing to the Build AI Agent SDK! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Node.js >= 22.19.0
- npm, pnpm, or yarn
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/agent-sdk.git cd agent-sdk - Install dependencies:
npm install
- Build the project:
npm run build
- Run tests:
npm test
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes
-
Ensure your code passes all checks:
npm run typecheck # Type checking npm run typecheck:tests # The test files are type-checked too npm run lint # Linting npm run test:coverage && npm run fallow # Dead code, duplication, complexity (must exit 0) npm test # Tests npm run build # Build
Changes to the Docker sandbox, its network egress, the credential broker or the docker deploy adapter also have real-daemon tests,
npm run test:docker(*.docker.test.ts, not part ofnpm test). They skip without a Docker daemon (the egress cases also skip on Docker Desktop and rootless Docker, where egress is refused by design), so they run in CI'scompatjob on Linux; setLOUSHO_DOCKER_TESTS=1to make a missing daemon fail the run instead. -
Commit your changes with a descriptive commit message
-
Push to your fork and create a pull request
npm run lint runs with --max-warnings 0; no-explicit-any, no-unused-vars and ban-ts-comment are errors (prefix an unused parameter an interface requires with _). When a real type is not possible, use a targeted // eslint-disable-next-line <rule> -- <reason> on that one line, never a file- or directory-wide disable, a rule turned off in the config or a new ignores entry. In tests, a value of the wrong type passed on purpose gets // @ts-expect-error -- <reason>, and a partial mock is cast to the type it stands in for (as Partial<T> as T when it lacks a required member).
- Use TypeScript for all code
- Follow existing code patterns and conventions
- Add JSDoc comments for public APIs
- Keep functions small and focused
- Write meaningful variable and function names
- Write tests for new features
- Ensure all existing tests pass
- Aim for good test coverage
- Tests are located alongside source files with
.test.tsextension npm run pack-smokeinstalls the tarball built from your checkout into a fresh project and exercises it.npm run registry-smokedoes the same for what is published on npm:npm create lousho-agent, the generated project's tests and type check,lousho doctor, every export in ESM and CJS, andlousho studio. Run it right after a publish (-- --version <semver|dist-tag>picks the version;-- --liveadds one real OpenRouter turn and needsOPENROUTER_API_KEY).
- Update README.md if adding new features
- Add JSDoc comments for new public APIs
- Update CHANGELOG.md for notable changes
Every exports entry of the package has a checked-in API report under api/
(api/index.api.md, api/executor.api.md, ..., one api/<subpath>.api.md
per subpath), generated by @microsoft/api-extractor from the built
declarations. If your change adds, removes or alters anything public, run
npm run build && npm run api:update and commit the report diffs with your
change - the reviewer reads that diff to see exactly how the public surface
moved. CI runs npm run api:check after the build and fails when the checked-in
reports are out of date. Types a public signature uses but the entry point does
not export are recorded in the report (ae-forgotten-export), so they are
visible too.
-
Ensure your PR includes:
- Clear description of changes
- Tests for new functionality
- Updated documentation if needed
-
Your PR will be reviewed by maintainers
-
Address any feedback
-
Once approved, your PR will be merged
When reporting issues, please include:
- A clear and descriptive title
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Node.js version
- Operating system
- Any relevant code snippets or error messages
Feature requests are welcome! Please:
- Check existing issues to avoid duplicates
- Provide a clear use case
- Explain why this feature would be useful
By contributing, you agree that your contributions will be licensed under the MIT License.
Feel free to open an issue for any questions about contributing.