From 05f54cc0cb8cf3535698ab5027d200842bdb28e3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 6 Apr 2026 11:06:19 +0300 Subject: refactor: consolidate provider factory test seams into shared named types Define audio.ProviderFactory, image.PromptAwareClient, image.OpenAIClientFactory, image.NanoBananaClientFactory, and image.ClientFactories as the single source of truth for the three injectable factory signatures that were previously duplicated across processor.Processor, gui.Application, and gui.GenerationOrchestrator. Replace all three separate function-type fields with imageFactories image.ClientFactories + newAudioProvider audio.ProviderFactory, eliminating the parallel field declarations and the local promptAwareImageClient interface in gui/generator.go. Co-Authored-By: Claude Sonnet 4.6 --- internal/audio/provider.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/audio') diff --git a/internal/audio/provider.go b/internal/audio/provider.go index e4e5888..296521d 100644 --- a/internal/audio/provider.go +++ b/internal/audio/provider.go @@ -131,6 +131,12 @@ func DefaultProviderConfig() *Config { } } +// ProviderFactory is the canonical type for functions that construct an audio +// Provider from a Config. Using a named type avoids duplicating the raw function +// signature in every package that needs to inject or replace the factory +// (processor, gui). The production default is audio.NewProvider itself. +type ProviderFactory func(*Config) (Provider, error) + // NewProvider creates the appropriate audio provider based on configuration. // It extracts provider-specific sub-configs so each implementation only // receives the fields it needs (ISP). -- cgit v1.2.3