settings

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package settings owns the single-row system_settings table: the tenant-wide default (provider FK, bare model name) pairs the agent-create flow prefills from. Read is open to any authenticated user (the agent-create form needs it); write is admin-only. Both gates run through authz.Authorize.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelCatalog

type ModelCatalog interface {
	ListModels(ctx context.Context, p authz.Principal, opts catalog.ListModelsOptions) ([]catalog.Model, error)
}

ModelCatalog is the slice of the catalog service settings needs to verify, server-side, that a chosen default model actually has the capability its slot requires (defense-in-depth behind the UI's capability-filtered pickers). *catalog.Service satisfies it.

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(d *db.DB, cat ModelCatalog, logger *zap.Logger) *Service

func (*Service) Get

func (*Service) Update

type SlotUpdate

type SlotUpdate struct {
	Name          string // logical key: "default_build", "default_exec", …
	Model         string
	ProviderIDRaw string
	ModelRequired bool // when false, an empty model paired with an FK is allowed (e.g. default_search)
}

SlotUpdate is one (provider FK, bare model name) pair the operator is editing for a single capability. The raw FK string is parsed inside Update so the handler doesn't need to know which empty/uuid rules apply per capability.

type UpdateRequest

type UpdateRequest struct {
	Slots []SlotUpdate
}

UpdateRequest carries every capability slot. The handler builds it from the inbound proto; the service does the empty/FK validation + per-slot model-required rule.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL