package dto

type (
	// RuntimeResponse is the JSON response for runtime endpoints.
	RuntimeResponse struct {
		Name   string                `json:"name"`
		Type   string                `json:"type"`
		Binary string                `json:"binary"`
		Args   []string              `json:"args"`
		Port   int                   `json:"port"`
		Health RuntimeHealthResponse `json:"health"`
		Env    map[string]string     `json:"env"`
	}

	// RuntimeHealthResponse is the health check configuration within a runtime.
	RuntimeHealthResponse struct {
		Path     string `json:"path"`
		Interval string `json:"interval"`
		Timeout  string `json:"timeout"`
	}

	// DetectRuntimeResponse is the JSON response for runtime detection.
	DetectRuntimeResponse struct {
		Type       string `json:"type"`
		Binary     string `json:"binary"`
		Path       string `json:"path,omitempty"`
		Found      bool   `json:"found"`
		Installed  bool   `json:"installed"`
		Capable    bool   `json:"capable"`
		ReasonCode string `json:"reasonCode,omitempty"`
		Message    string `json:"message,omitempty"`
		Version    string `json:"version,omitempty"`
	}

	// RuntimeConfigEditable holds the user-editable fields of a runtime configuration (API key, model, base URL, etc.).
	RuntimeConfigEditable struct {
		BaseURL          string `json:"baseUrl,omitempty"`
		APIKey           string `json:"apiKey,omitempty"`
		APIKeyConfigured bool   `json:"apiKeyConfigured,omitempty"`
		APIKeyEnvKey     string `json:"apiKeyEnvKey,omitempty"`
		Model            string `json:"model,omitempty"`
		ReasoningEffort  string `json:"reasoningEffort,omitempty"`
		WireAPI          string `json:"wireApi,omitempty"`
	}

	// RuntimeConfigOfflineResponse is the result of an offline (no network) runtime config validation.
	RuntimeConfigOfflineResponse struct {
		OK      bool     `json:"ok"`
		Message string   `json:"message,omitempty"`
		Missing []string `json:"missing,omitempty"`
	}

	// RuntimeConfigResponse is the JSON response for the runtime config endpoint.
	RuntimeConfigResponse struct {
		Runtime    string                       `json:"runtime"`
		ConfigPath string                       `json:"configPath"`
		Exists     bool                         `json:"exists"`
		Editable   RuntimeConfigEditable        `json:"editable"`
		Offline    RuntimeConfigOfflineResponse `json:"offline"`
	}

	// RuntimeConfigOnlineResponse is the result of an online (network) runtime config validation.
	RuntimeConfigOnlineResponse struct {
		OK         bool     `json:"ok"`
		Message    string   `json:"message,omitempty"`
		ReasonCode string   `json:"reasonCode,omitempty"`
		WireAPIs   []string `json:"wireApis,omitempty"`
		Models     []string `json:"models,omitempty"`
	}

	// RuntimeConfigValidationResponse combines offline and online validation results.
	RuntimeConfigValidationResponse struct {
		Offline RuntimeConfigOfflineResponse `json:"offline"`
		Online  RuntimeConfigOnlineResponse  `json:"online"`
	}
)
