# frozen_string_literal: true

require_relative "lib/dispatch/adapter/claude/version"

Gem::Specification.new do |spec|
  spec.name = "dispatch-adapter-claude"
  spec.version = Dispatch::Adapter::ClaudeVersion::VERSION
  spec.authors = ["Adam Malczewski"]
  spec.email = ["github@tradam.dev"]

  spec.summary = "Anthropic Claude adapter for Dispatch LLM framework"
  spec.description = "Anthropic Claude adapter for the Dispatch LLM framework, implementing the " \
                     "dispatch-adapter-interface to provide chat completions via the Anthropic API."
  spec.homepage = "https://github.com/realtradam/dispatch-adapter-claude"
  spec.license = "MIT"
  spec.required_ruby_version = ">= 3.2"
  spec.metadata["homepage_uri"] = spec.homepage
  spec.metadata["source_code_uri"] = spec.homepage
  spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
  spec.metadata["rubygems_mfa_required"] = "true"

  gemspec = File.basename(__FILE__)
  all_files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
    ls.readlines("\x0", chomp: true).reject do |f|
      (f == gemspec) ||
        f.start_with?(*%w[bin/ Gemfile .gitignore .rspec spec/ .rubocop.yml])
    end
  end
  spec.files = all_files.select { |f| File.exist?(File.join(__dir__, f)) }
  spec.bindir = "exe"
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
  spec.require_paths = ["lib"]

  spec.add_dependency "dispatch-adapter-interface", "~> 0.2"
  spec.add_dependency "json"
  spec.add_dependency "webrick"
end
