package bot

import (
	"fmt"
	"os"

	"github.com/salvacybersec/keyhunter/pkg/engine/sources"
)

// selectBotSource returns the appropriate Source for a bot scan request.
// Only file and directory paths are supported (no git, stdin, clipboard, URL).
func selectBotSource(path string) (sources.Source, error) {
	info, err := os.Stat(path)
	if err != nil {
		return nil, fmt.Errorf("stat %q: %w", path, err)
	}
	if info.IsDir() {
		return sources.NewDirSource(path), nil
	}
	return sources.NewFileSource(path), nil
}
