feat(sdk): add domain types, typed errors, and Response wrapper#29
Merged
feat(sdk): add domain types, typed errors, and Response wrapper#29
Conversation
Collaborator
retr0h
commented
Mar 5, 2026
- Add typed error hierarchy (APIError, AuthError, NotFoundError, etc.) and generic Response[T] wrapper for all service methods
- Introduce domain types and converters for all services, replacing raw generated types in the public API
- Update all service methods to return domain types instead of generated OpenAPI structs
- Restructure examples into examples/osapi/ and examples/orchestration/ directories
- Regenerate client from updated API spec (adds network interface and uptime types)
Introduce APIError, AuthError, NotFoundError, ValidationError, ServerError, and UnexpectedStatusError types enabling errors.As() pattern. Add generic Response[T] wrapper with RawJSON() for CLI --json mode. Add checkError helper mapping HTTP status codes to typed errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add Agent, Node, Job, Health, and Audit domain types with internal converter functions that handle all pointer dereferencing from gen types. Includes Collection[T] generic wrapper, shared sub-type helpers, and comprehensive test coverage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace gen response wrappers with Response[T] across Agent, Node, Job, Health, and Audit services. Status-code handling and pointer dereferencing now live inside the SDK. Health 503 treated as success with ServiceUnavailable flag. Delete returns error only. Orchestrator runner updated to consume domain types directly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Align tests with Response[T] wrapper and typed error hierarchy. Restructure examples into osapi/ and orchestration/ directories. Regenerate client from updated API spec adding network interface and uptime types. Add node-uptime operation docs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Thank you for contributing to this project! 😊🕹️ |
Rename CpuCount to CPUCount to follow Go initialism conventions. Replace unused http.ResponseWriter parameters with _ in test handlers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #29 +/- ##
===========================================
+ Coverage 98.51% 100.00% +1.48%
===========================================
Files 13 20 +7
Lines 674 1425 +751
===========================================
+ Hits 664 1425 +761
+ Misses 7 0 -7
+ Partials 3 0 -3
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.