store

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MPL-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAssistantPresetStoreHandlers

func InitAssistantPresetStoreHandlers(api huma.API, store *AssistantPresetStore)

func SetPreparedData

func SetPreparedData(
	s *AssistantPresetStore,
	fileName string,
	dirName string,
	data map[string]any,
) error

SetPreparedData is only for tests/runtime preparation helpers.

Types

type AssistantPresetStore

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

func NewAssistantPresetStore

func NewAssistantPresetStore(baseDir string, opts ...Option) (*AssistantPresetStore, error)

func (*AssistantPresetStore) Close

func (s *AssistantPresetStore) Close() error

func (*AssistantPresetStore) DeleteAssistantPreset

func (*AssistantPresetStore) GetAssistantPreset

func (*AssistantPresetStore) ListAssistantPresetBundles

func (*AssistantPresetStore) ListAssistantPresets

func (*AssistantPresetStore) PatchAssistantPreset

func (*AssistantPresetStore) PatchAssistantPresetBundle

func (*AssistantPresetStore) PutAssistantPreset

PutAssistantPreset creates a new immutable assistant preset version.

func (*AssistantPresetStore) PutAssistantPresetBundle

PutAssistantPresetBundle creates or replaces a bundle. Bundle slug is intentionally immutable once the bundle exists so directory addressing for existing version files cannot be orphaned.

type BuiltInData

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

func NewBuiltInData

func NewBuiltInData(
	ctx context.Context,
	overlayBaseDir string,
	snapshotMaxAge time.Duration,
	lookups ReferenceLookups,
	opts ...BuiltInDataOption,
) (data *BuiltInData, err error)

func (*BuiltInData) Close

func (d *BuiltInData) Close() error

func (*BuiltInData) GetBuiltInAssistantPreset

func (d *BuiltInData) GetBuiltInAssistantPreset(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	slug bundleitemutils.ItemSlug,
	version bundleitemutils.ItemVersion,
) (spec.AssistantPreset, error)

func (*BuiltInData) GetBuiltInBundle

func (*BuiltInData) ListBuiltInData

ListBuiltInData returns deep-copied snapshots.

func (*BuiltInData) SetAssistantPresetBundleEnabled

func (d *BuiltInData) SetAssistantPresetBundleEnabled(
	ctx context.Context,
	id bundleitemutils.BundleID,
	enabled bool,
) (spec.AssistantPresetBundle, error)

func (*BuiltInData) SetAssistantPresetEnabled

func (d *BuiltInData) SetAssistantPresetEnabled(
	ctx context.Context,
	bundleID bundleitemutils.BundleID,
	slug bundleitemutils.ItemSlug,
	version bundleitemutils.ItemVersion,
	enabled bool,
) (spec.AssistantPreset, error)

type BuiltInDataOption

type BuiltInDataOption func(*BuiltInData)

func WithBundlesFS

func WithBundlesFS(fsys fs.FS, rootDir string) BuiltInDataOption

WithBundlesFS overrides the default embedded built-in assistant preset FS.

type ModelPresetLookup

type ModelPresetLookup interface {
	GetModelPresetSummary(
		ctx context.Context,
		ref modelpresetSpec.ModelPresetRef,
	) (ModelPresetSummary, error)
}

ModelPresetLookup validates/loads model preset refs without coupling this package to a concrete model preset store implementation.

type ModelPresetSummary

type ModelPresetSummary struct {
	IsEnabled bool
}

type Option

type Option func(*AssistantPresetStore) error

func WithBuiltInDataOptions

func WithBuiltInDataOptions(opts ...BuiltInDataOption) Option

func WithModelPresetLookup

func WithModelPresetLookup(lookup ModelPresetLookup) Option

func WithPromptTemplateLookup

func WithPromptTemplateLookup(lookup PromptTemplateLookup) Option

func WithReferenceLookups

func WithReferenceLookups(lookups ReferenceLookups) Option

func WithSkillLookup

func WithSkillLookup(lookup SkillLookup) Option

func WithToolSelectionLookup

func WithToolSelectionLookup(lookup ToolSelectionLookup) Option

type PromptTemplateLookup

type PromptTemplateLookup interface {
	GetPromptTemplateSummary(
		ctx context.Context,
		ref promptSpec.PromptTemplateRef,
	) (PromptTemplateSummary, error)
}

PromptTemplateLookup validates/loads prompt template refs without coupling this package to a concrete prompt store implementation.

type PromptTemplateSummary

type PromptTemplateSummary struct {
	IsEnabled  bool
	Kind       promptSpec.PromptTemplateKind
	IsResolved bool
}

type ReferenceLookups

type ReferenceLookups struct {
	ModelPresets    ModelPresetLookup
	PromptTemplates PromptTemplateLookup
	ToolSelections  ToolSelectionLookup
	Skills          SkillLookup
}

type SkillLookup

type SkillLookup interface {
	GetSkillSummaryForSelection(
		ctx context.Context,
		selection skillSpec.SkillSelection,
	) (SkillSummary, error)
}

SkillLookup validates/loads skill selections without coupling this package to a concrete skill store implementation.

type SkillSummary

type SkillSummary struct {
	IsEnabled bool
}

type ToolSelectionLookup

type ToolSelectionLookup interface {
	GetToolSummaryForSelection(
		ctx context.Context,
		selection toolSpec.ToolSelection,
	) (ToolSummary, error)
}

ToolSelectionLookup validates/loads tool selections without coupling this package to a concrete tool store implementation.

type ToolSummary

type ToolSummary struct {
	IsEnabled bool
}

Jump to

Keyboard shortcuts

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