opencode-ruby — idiomatic Ruby client for OpenCode (HTTP + SSE). Hand-rolled, opinionated Ruby SDK with block-form streaming, value- object responses, and automatic SSE reconnection. Pluggable Opencode::Instrumentation adapter for routing events to ActiveSupport::Notifications, OpenTelemetry, stdout, or any custom emitter. Companion to opencode-rails for AR-coupled Rails apps. What this version ships: - Opencode::Client (Net::HTTP + SSE) - Opencode::Reply / Reply::Result / ReplyObserver - Opencode::Tracer, Opencode::Prompts - Opencode::ResponseParser, ToolPart, PartSource, Todo - Opencode::Instrumentation (instrument + notify) - Opencode::Error and seven subclasses - examples/conversation_recipe.rb — canonical Rails wiring blueprint 15 smoke tests. CI on Ruby 3.2/3.3/3.4. Ruby >= 3.2. Runtime dep: activesupport >= 6.1, < 9.0. See CHANGELOG.md for the alpha1 -> alpha2 delta.
11 lines
265 B
Ruby
11 lines
265 B
Ruby
# frozen_string_literal: true
|
|
|
|
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
|
|
|
require "opencode-ruby"
|
|
require "minitest/autorun"
|
|
require "webmock/minitest"
|
|
|
|
# Tests run against WebMock-stubbed endpoints; never hit the network.
|
|
WebMock.disable_net_connect!
|