Contributing
Thank you for your interest in contributing to the AI Agent SDK!
Development Setup
bash
# Clone the repository
git clone https://github.com/egain/ai-agent-sdk.git
cd ai-agent/ai-agent-sdk
# Install dependencies
npm install
# Build
npm run build:all
# Run tests
npm test
# Watch mode
npm run devProject Structure
ai-agent-sdk/
├── src/
│ ├── index.ts # Main exports
│ ├── core/
│ │ ├── AiAgent.ts # Main class
│ │ ├── api/ # API helpers
│ │ ├── auth/ # Authentication
│ │ ├── connection/ # WebSocket
│ │ ├── errors/ # Error classes
│ │ ├── events/ # Event emitter
│ │ ├── logging/ # Logging
│ │ ├── message/ # Message handling
│ │ └── queue/ # Message queue
│ └── browser/ # Browser-specific
├── docs/ # VitePress docs
├── usage-examples/ # Example apps
└── dist/ # Build outputCode Style
- TypeScript strict mode
- ESLint for linting
- Prettier for formatting
- Comprehensive JSDoc comments
Testing
bash
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverageDocumentation
bash
# Development server
npm run docs:dev
# Build docs
npm run docs:build
# Generate API reference
npm run docs:apiPull Request Process
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Update documentation if needed
- Run tests (
npm test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Commit Messages
Follow Conventional Commits:
feat: add new authentication strategy
fix: resolve connection timeout issue
docs: update authentication guide
test: add tests for message queue
refactor: simplify error handlingReporting Issues
When reporting issues, please include:
- SDK version
- Node.js/Browser version
- Minimal reproduction code
- Expected vs actual behavior
- Error messages and stack traces
Questions?
Open a GitHub Discussion for questions and ideas.