opencode_sdk_dart 0.1.0
opencode_sdk_dart: ^0.1.0 copied to clipboard
Cross-platform Dart SDK for the OpenCode V2 HTTP API. Generated from the official OpenAPI 3.1 contract with sealed model unions, typed errors, multiplexed event streams, plugin RPC, PTY sockets, and l [...]
0.1.0 #
Initial release.
- Generated from the OpenCode V2 OpenAPI 3.1 contract (438 declarations, 142 operations, 28 resources).
- Sealed unions, branded
extension typescalars, and wire-mapped enums. - Structured
_tagerror decoding with HTTP status codes. - Shared lazy event multiplexer with
server.connectedreplay and capacity protection. - Plugin RPC calls, streaming subscriptions, and sequential callback subscriptions.
- PTY and persistent PTY WebSocket helpers.
- Local background service discovery, startup, stop, version constraints, and persistent-terminal handoff.
- Request cancellation via
CancellationToken. - One-call session turns:
client.streamPrompt(...)streams text and reasoning deltas, falls back tosession.waitpolling when the live-only event stream drops, and reconciles the final answer with the server's record. - Cursor pagination helpers:
session.listAll(...)andsession.message.listAll(...)followcursor.nextuntil it runs out. - Opt-in
RetryPolicyfor transient transport failures, configurable on the transport or per request, withRetry-Aftersupport and idempotent-only defaults. - Unit test suite (87 tests) plus a live read-only smoke test.