package port

import (
	"context"

	"github.com/orchard9/rdev/internal/domain"
)

// CommandExecutor defines operations for executing commands in pods.
type CommandExecutor interface {
	// Execute runs a command in the target pod and streams output to the handler.
	Execute(ctx context.Context, cmd *domain.Command, podName string, handler domain.OutputHandler) (*domain.CommandResult, error)

	// Cancel attempts to cancel a running command.
	Cancel(ctx context.Context, cmdID domain.CommandID) error

	// PodExists checks if a pod exists and is running.
	PodExists(ctx context.Context, podName string) (bool, error)

	// CheckConnection verifies connectivity to the Kubernetes cluster.
	CheckConnection(ctx context.Context) error
}
