Documentation
¶
Overview ¶
Package setupcheck evaluates local runtime readiness (defaults, backends) for the CLI.
Index ¶
Constants ¶
const ( CategoryDefaults = "defaults" CategoryRegistration = "registration" CategoryHealth = "health" )
const DefaultOllamaSuggestModel = "qwen2.5:7b"
DefaultOllamaSuggestModel is the model name we suggest for local Ollama when no chat models are present yet.
Variables ¶
This section is empty.
Functions ¶
func ProbeLocalOllamaAPI ¶
ProbeLocalOllamaAPI returns (baseURL, true) if GET {base}/api/tags responds with HTTP 200.
func StatesFromMap ¶
func StatesFromMap(m map[string]statetype.BackendRuntimeState) []statetype.BackendRuntimeState
StatesFromMap flattens runtime state snapshots for Evaluate / GatherInput.
Types ¶
type BackendCheck ¶
type BackendCheck struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
BaseURL string `json:"baseUrl"`
Status string `json:"status"`
Reachable bool `json:"reachable"`
DefaultProvider bool `json:"defaultProvider"`
ModelCount int `json:"modelCount"`
ChatModelCount int `json:"chatModelCount"`
ChatModels []string `json:"chatModels,omitempty"`
Error string `json:"error,omitempty"`
Hint string `json:"hint,omitempty"`
}
BackendCheck reports the runtime status of one registered backend.
type Input ¶
type Input struct {
DefaultModel string
DefaultProvider string
DefaultAltModel string
DefaultAltProvider string
DefaultChain string
HITLPolicyName string
States []statetype.BackendRuntimeState
// RegisteredBackendCount, if non-nil, overrides len(RegisteredBackends) / len(States)
// for BackendCount. CLI doctor sets this from ListBackends when runtime state sync is unavailable.
RegisteredBackendCount *int
RegisteredBackends []runtimetypes.Backend
// ResolvedFrom records where workspace-scoped keys came from: "workspace" or "global".
// Keys are camelCase JSON names: "defaultChain", "hitlPolicyName".
ResolvedFrom map[string]string
}
Input is everything needed to compute readiness; callers gather from DB + runtime state.
func GatherInput ¶
func GatherInput(ctx context.Context, db libdbexec.DBManager, states []statetype.BackendRuntimeState, workspaceID string) (Input, error)
GatherInput builds Input from SQLite KV defaults, registered backend count, and a runtime state snapshot. workspaceID scopes workspace-scoped keys (default-chain, hitl-policy-name) with global fallback.
type Issue ¶
type Issue struct {
Code string `json:"code"`
Severity string `json:"severity"`
Category string `json:"category,omitempty"`
Message string `json:"message"`
FixPath string `json:"fixPath,omitempty"`
CLICommand string `json:"cliCommand,omitempty"`
}
Issue describes one setup problem and how to fix it.
type Result ¶
type Result struct {
DefaultModel string `json:"defaultModel"`
DefaultProvider string `json:"defaultProvider"`
DefaultChain string `json:"defaultChain"`
HITLPolicyName string `json:"hitlPolicyName"`
BackendCount int `json:"backendCount"`
ReachableBackendCount int `json:"reachableBackendCount"`
Issues []Issue `json:"issues"`
BackendChecks []BackendCheck `json:"backendChecks,omitempty"`
ResolvedFrom map[string]string `json:"resolvedFrom,omitempty"`
}
Result is returned by GET /setup-status and contenox doctor.
func EnrichResultWithOllamaProbe ¶
EnrichResultWithOllamaProbe probes the local Ollama HTTP API (OLLAMA_HOST or default) and augments registration-related issues when /api/tags is reachable but no Ollama backend is ready yet.
func (Result) BlockingIssues ¶
BlockingIssues returns the issues that make the runtime not ready, in the order Evaluate produced them. It performs no I/O.