16 Commits

Author SHA1 Message Date
Dickson Tsai
b3656b1765 Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
Ashwin Bhat
233cefa3e1 feat: add version environment variable (#184)
Include the SDK version in the environment when spawning the Claude CLI
process.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-26 12:23:33 -07:00
Ashwin Bhat
12fdca9b1b feat: improve GitHub release notes generation (#173)
Use `gh release create --generate-notes` to automatically include PR
titles, commits, and contributors in release notes instead of static
template text.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-17 20:09:35 -07:00
Ashwin Bhat
839300404f Add custom tool callbacks and e2e tests (#157)
## Summary
This PR adds support for custom tool callbacks and comprehensive e2e
testing for MCP calculator functionality.

## Key Features Added
- **Custom tool permission callbacks** - Allow dynamic tool permission
control via `can_use_tool` callback
- **E2E test suite** - Real Claude API tests validating MCP tool
execution end-to-end
- **Fixed MCP calculator example** - Now properly uses `allowed_tools`
for permission management

## Changes
### Custom Callbacks
- Added `ToolPermissionContext` and `PermissionResult` types for tool
permission handling
- Implemented `can_use_tool` callback support in SDK client
- Added comprehensive tests in `tests/test_tool_callbacks.py`

### E2E Testing Infrastructure  
- Created `e2e-tests/` directory with pytest-based test suite
- `test_mcp_calculator.py` - Tests all calculator operations with real
API calls
- `conftest.py` - Pytest config with mandatory API key validation
- GitHub Actions workflow for automated e2e testing on main branch
- Comprehensive documentation in `e2e-tests/README.md`

### Bug Fixes
- Fixed MCP calculator example to use `allowed_tools` instead of
incorrect `permission_mode`
- Resolved tool permission issues preventing MCP tools from executing

## Testing
E2E tests require `ANTHROPIC_API_KEY` environment variable and will fail
without it.

Run locally:
```bash
export ANTHROPIC_API_KEY=your-key
python -m pytest e2e-tests/ -v -m e2e
```

Run unit tests including callback tests:
```bash
python -m pytest tests/test_tool_callbacks.py -v
```

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Kashyap Murali <kashyap@anthropic.com>
2025-09-08 08:51:40 -07:00
Ashwin Bhat
9377faa943 Standardize GitHub workflow triggers (#155)
## Summary
- Standardized the trigger configuration across test, lint, and e2e
workflows
- All workflows now use consistent format with pull_request listed
before push
- E2E workflow now also runs on pushes to main branch

## Test plan
- [ ] Verify workflows trigger correctly on pull requests
- [ ] Verify workflows trigger correctly on pushes to main branch
- [ ] Check that e2e tests run successfully on main branch

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-07 18:31:38 -07:00
Ashwin Bhat
73f861235e Add CI workflow for Claude Code SDK e2e testing (#154)
## Summary
- Added GitHub Actions workflow to test SDK integration with Claude Code
CLI
- Tests run on PR open/synchronize events across Python 3.10-3.13

## Test plan
- [x] Workflow triggers on PR events
- [x] Installs Claude Code CLI via official script
- [x] Runs quickstart example
- [x] Runs streaming_mode example

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-06 22:41:53 -07:00
Sam Fu
6bbe00cc15 fix pytest allowed tool (#117) 2025-08-06 16:03:30 -07:00
Sam Fu
58b5a41a15 allow claude gh action to lint, typecheck, and run tests (#115)
Co-authored-by: Ashwin Bhat <ashwin@anthropic.com>
2025-08-06 15:29:34 -07:00
Dickson Tsai
21428b4f4d Fix "Publish to PyPI" workflow: Add commit signing and improve diff (#82)
* Adds commit signing
* Converts sed pattern matching to a script to ensure we don't update
version values unrelated to PyPI
* Remove the `Publish to Test PyPI first'` step since it no longer works
2025-07-21 09:53:24 -07:00
Lina Tawfik
7a9f606e5f Add Claude issue triage workflow
- Uses claude-code-base-action for automated issue triage
- Analyzes new issues and applies appropriate labels
- Uses GitHub MCP server for issue operations
- Requires ANTHROPIC_API_KEY secret to be configured

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-03 11:15:41 -07:00
Duc Nguyen
c7630bb3c1 chore: cleanup 2025-06-29 14:35:44 +07:00
Duc Nguyen
1e20f633f1 fix: changelog comparison URL in release workflow 2025-06-29 14:27:08 +07:00
Lina Tawfik
149142c960 feat: automate version updates after PyPI release
- Update publish.yml to create PR after publishing
- Add create-release-tag.yml to tag releases when PR merges
- Eliminates manual version syncing between repo and PyPI
2025-06-27 16:56:01 -07:00
Lina Tawfik
7d488f47c0 Add Claude Code GitHub Workflow
This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.

Claude Code is an AI coding agent that can help with:
- Bug fixes and improvements
- Documentation updates
- Implementing new features
- Code reviews and suggestions
- Writing tests
- And more\!

Once merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 17:03:37 -07:00
Lina Tawfik
8c950a7457 Fix CI: Don't fail on Codecov upload errors
The tests are passing but CI was failing due to missing Codecov token.
Set fail_ci_if_error to false since coverage upload is optional.
2025-06-12 00:21:45 -07:00
Lina Tawfik
6ca3514261 Initial Python SDK import 2025-06-12 00:16:19 -07:00