sync from monorepo @ 2452e92e

This commit is contained in:
2026-05-08 01:59:04 +02:00
commit b03dc15371
459 changed files with 129586 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# Package: opencode_client
Rust client library for interacting with the OpenCode.ai API.
## Quick Facts
- **Type**: Library
- **Main Entry**: src/lib.rs
- **Dependencies**: reqwest, serde, serde_json, chrono
## Key Files
- `src/lib.rs` - Public API exports
- `src/types.rs` - OpenCode API type definitions (Session, Message, Part, etc.)
- `src/client.rs` - HTTP client implementation with optional logging callbacks
## Main Exports
- `OpenCodeClient` - Main API client with methods: list_sessions, list_messages, send_message
- `Session` - Session metadata and configuration
- `Message` - User or Assistant message (tagged enum)
- `MessageWithParts` - Message info + content parts
- `Part` - Text, Reasoning, or workflow parts (StepStart, StepFinish, Tool)
- `ClientError` - Error types: Http, Request, Serialization
- `LogCallback` - Type alias for logging callbacks
## Related
- Used by: web, mobile (future), desktop (future)
- Independent: Can be used in any Rust project
## Documentation
- README: ./README.md
- API spec: ../../docs/api/opencode.md