Files
opencode-ruby/lib/opencode-ruby.rb
Ajay Krishnan 889d38332f
Some checks failed
Test / test (3.2) (push) Failing after 9m43s
Test / test (3.3) (push) Failing after 9m43s
Test / test (3.4) (push) Failing after 9m42s
Initial public release v0.0.1.alpha2
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.
2026-05-20 21:41:30 -07:00

27 lines
1.0 KiB
Ruby

# frozen_string_literal: true
# Minimal ActiveSupport surface — `present?`, `blank?`, `presence`,
# `truncate`, `duplicable?`. We deliberately load only the core_ext bits
# we use, not all of activesupport, to keep the boot footprint small in
# non-Rails apps.
require "active_support/core_ext/object/blank" # provides blank?, present?, presence
require "active_support/core_ext/object/duplicable"
require "active_support/core_ext/string/filters" # provides String#truncate
require "active_support/core_ext/numeric/bytes" # provides Integer#megabytes
require_relative "opencode/version"
require_relative "opencode/error"
require_relative "opencode/instrumentation"
require_relative "opencode/response_parser"
require_relative "opencode/part_source"
require_relative "opencode/tool_part"
require_relative "opencode/todo"
require_relative "opencode/prompts"
require_relative "opencode/reply_observer"
require_relative "opencode/reply"
require_relative "opencode/tracer"
require_relative "opencode/client"
module Opencode
end