class SpoolMemory < Formula
  desc "Local-first developer memory system for AI coding tools"
  homepage "https://github.com/lukylong/Spool"
  version "0.1.0"
  
  on_macos do
    if Hardware::CPU.arm?
      url "https://github.com/lukylong/Spool/releases/download/v#{version}/spool-macos-arm64.tar.gz"
      sha256 "PLACEHOLDER_ARM64_SHA256"
    else
      url "https://github.com/lukylong/Spool/releases/download/v#{version}/spool-macos-intel.tar.gz"
      sha256 "PLACEHOLDER_INTEL_SHA256"
    end
  end

  on_linux do
    if Hardware::CPU.arm?
      url "https://github.com/lukylong/Spool/releases/download/v#{version}/spool-linux-arm64.tar.gz"
      sha256 "PLACEHOLDER_LINUX_ARM64_SHA256"
    else
      url "https://github.com/lukylong/Spool/releases/download/v#{version}/spool-linux-x86_64.tar.gz"
      sha256 "PLACEHOLDER_LINUX_X86_64_SHA256"
    end
  end

  def install
    bin.install "spool"
    bin.install "spool-mcp"
    bin.install "spool-daemon"
  end

  test do
    system "#{bin}/spool", "--version"
  end
end
