store

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 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.

func ValidateAssistantPresetStructure added in v0.2.9

func ValidateAssistantPresetStructure(preset *spec.AssistantPreset) error

ValidateAssistantPresetStructure exposes the owning store's structural validation for read-only projections. It intentionally does not resolve installed-resource references.

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 MCPContextLookup added in v0.1.22

type MCPContextLookup interface {
	ValidateMCPConversationContext(
		ctx context.Context,
		mcpContext mcpSpec.MCPConversationContext,
	) error
}

MCPContextLookup validates MCP starter contexts without coupling this package to a concrete MCP store/runtime implementation.

Implementations should validate persistent server config strictly, but should treat live discovery as best-effort because MCP capabilities are dynamic and may require an active connection/auth session.

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 WithMCPContextLookup added in v0.1.22

func WithMCPContextLookup(lookup MCPContextLookup) Option

func WithModelPresetLookup

func WithModelPresetLookup(lookup ModelPresetLookup) Option

func WithReferenceLookups

func WithReferenceLookups(lookups ReferenceLookups) Option

func WithSkillLookup

func WithSkillLookup(lookup SkillLookup) Option

func WithToolSelectionLookup

func WithToolSelectionLookup(lookup ToolSelectionLookup) Option

type ReferenceLookups

type ReferenceLookups struct {
	ModelPresets   ModelPresetLookup
	ToolSelections ToolSelectionLookup
	Skills         SkillLookup
	MCPContext     MCPContextLookup
}

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
	Insert    skillSpec.SkillInsert

	// HasArguments is used to reject preloaded instruction skills that need runtime input.
	HasArguments bool
	HasResources 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