builtin

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuiltInToolBundlesRootDir = "tools"
	BuiltInToolBundlesJSON    = "tools.bundles.json"

	BuiltInSkillBundlesRootDir = "skills"
	BuiltInSkillBundlesJSON    = "skills.json"

	BuiltInAssistantPresetBundlesRootDir = "assistantpresets"
	BuiltInAssistantPresetBundlesJSON    = "assistantpresets.bundles.json"

	BuiltInMCPBundlesRootDir = "mcp"
	BuiltInMCPBundlesJSON    = "mcp.bundles.json"
)
View Source
const (
	ProviderNameAnthropic       = string(modelpreset.ProviderAnthropic)
	ProviderNameLocalAI         = string(modelpreset.ProviderLocalAI)
	ProviderNameLMStudio        = string(modelpreset.ProviderLMStudio)
	ProviderNameGoogleGemini    = string(modelpreset.ProviderGoogleGemini)
	ProviderNameHuggingFace     = string(modelpreset.ProviderHuggingFace)
	ProviderNameLlamaCPP        = string(modelpreset.ProviderLlamaCPP)
	ProviderNameMistral         = string(modelpreset.ProviderMistral)
	ProviderNameOllama          = string(modelpreset.ProviderOllama)
	ProviderNameOpenAIChat      = string(modelpreset.ProviderOpenAIChat)
	ProviderNameOpenAIResponses = string(modelpreset.ProviderOpenAIResponses)
	ProviderNameOpenRouter      = string(modelpreset.ProviderOpenRouter)
	ProviderNameSGLang          = string(modelpreset.ProviderSGLang)
	ProviderNameVLLM            = string(modelpreset.ProviderVLLM)
	ProviderNameXAI             = string(modelpreset.ProviderXAI)
)
View Source
const (
	BuiltinBundleIDLLMToolsFS    = "018fe0f4-b8cd-7e55-82d5-9df0bd70e400"
	BuiltinBundleIDLLMToolsImage = "018fe0f4-b8cd-7e55-82d5-9df0bd70e401"
	BuiltinBundleIDLLMToolsExec  = "019c0415-40f7-70cb-9200-d804c9388a57"
	BuiltinBundleIDLLMToolsText  = "019c0da2-02d2-7e71-81d7-35f2e5a0bebf"
	BuiltinBundleIDLLMToolsGit   = "019f27b6-10ee-7858-8ad0-a20081c1a88d"
	BuiltinBundleIDLLMToolsWeb   = "019f27b6-bce1-742f-8ff9-d3a12ce4361c"
)

IMPORTANT: keep these stable (match tools.bundles.json).

Variables

View Source
var BuiltInAssistantPresetBundlesFS embed.FS
View Source
var BuiltInMCPBundlesFS embed.FS
View Source
var BuiltInSkillBundlesFS embed.FS
View Source
var BuiltInToolBundlesFS embed.FS
View Source
var SkillRegistryJSON []byte

Functions

func EmbeddedSkillsPackages added in v0.2.15

func EmbeddedSkillsPackages() (fs.FS, error)

EmbeddedSkillsPackages returns the root containing Skill built-in package directories. Generic built-in code validates the filesystem boundary but does not own or inspect Skill package content.

Types

type AsyncRebuilder

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

AsyncRebuilder calls fn in a background goroutine when Trigger detects that the previous successful run is older than maxAge.

func NewAsyncRebuilder

func NewAsyncRebuilder(maxAge time.Duration, fn func() error) *AsyncRebuilder

NewAsyncRebuilder returns a ready-to-use AsyncRebuilder. If maxAge <= 0 the rebuilder will consider a snapshot stale immediately (i.e. every Trigger may start a rebuild).

func (*AsyncRebuilder) Close added in v0.0.79

func (r *AsyncRebuilder) Close()

Close prevents any new rebuilds from starting and waits for any running rebuild to finish. The Close action is performed only once (sync.Once); subsequent Close calls return immediately.

func (*AsyncRebuilder) Force

func (r *AsyncRebuilder) Force() error

Force executes fn synchronously and updates the timestamp on success. It is exported mainly for unit tests.

func (*AsyncRebuilder) IsDone

func (r *AsyncRebuilder) IsDone() <-chan struct{}

func (*AsyncRebuilder) MarkFresh

func (r *AsyncRebuilder) MarkFresh()

MarkFresh updates the last successful-run timestamp.

func (*AsyncRebuilder) Trigger

func (r *AsyncRebuilder) Trigger()

Trigger starts a rebuild in the background when the stored snapshot is considered stale. The call itself is cheap (non-blocking).

type BootstrapRegistry added in v0.2.15

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

BootstrapRegistry owns application-level built-in installation order and shared topology. It is intentionally unaware of Skills, MCPs, or any other artifact format.

func NewBootstrapRegistry added in v0.2.15

func NewBootstrapRegistry(
	configuration Registry,
	ensurer topology.Ensurer,
	hydrator topology.HydrationCoordinator,
) (*BootstrapRegistry, error)

func (*BootstrapRegistry) Ensure added in v0.2.15

func (r *BootstrapRegistry) Ensure(ctx context.Context) error

func (*BootstrapRegistry) Register added in v0.2.15

func (r *BootstrapRegistry) Register(installer Installer) error

type HydrationInstaller added in v0.2.15

type HydrationInstaller interface {
	Installer

	DesiredHydration(ctx context.Context) (topology.Hydration, error)

	EnsureHydration(ctx context.Context, current bool) error
}

HydrationInstaller supplies artifact-family desired state and receives the result of generic hydration comparison. It does not read or write hydration markers and it does not reset topology roots itself.

type Installer added in v0.2.15

type Installer interface {
	BuiltInName() string
	BuiltInIDs() []string
	BuiltInPackageScopes() []basespec.Locator
	Ensure(ctx context.Context) error
}

Installer is implemented by one artifact-family-owned built-in installer. The generic built-in layer deliberately does not inspect package contents, artifact definitions, or artifact-specific manifests.

type PackageFile added in v0.2.15

type PackageFile struct {
	Locator basespec.Locator
	Content []byte
}

PackageFile is an immutable-by-convention copy of one regular embedded file relative to a selected embedded package directory.

func ReadPackageFiles added in v0.2.15

func ReadPackageFiles(
	ctx context.Context,
	packages fs.FS,
	packageRoot basespec.Locator,
) ([]PackageFile, error)

ReadPackageFiles reads a complete embedded package directory into a bounded, deterministic, relative file list. Artifact-specific code can convert the result into its own publication or installation representation.

type Registry added in v0.2.15

type Registry struct {
	SchemaVersion string `json:"schemaVersion"`
	Root          Root   `json:"root"`
	Source        Source `json:"source"`
}

Registry describes application-owned protected topology only. Artifact families own their own embedded package registries and installation logic.

func LoadRegistry added in v0.2.15

func LoadRegistry() (Registry, error)

func (Registry) EnsureTopology added in v0.2.15

func (r Registry) EnsureTopology(
	ctx context.Context,
	ensurer topology.Ensurer,
) (topology.Installed, error)

EnsureTopology establishes only shared protected topology. Typed artifact installers are run separately by builtin.BootstrapRegistry.

func (Registry) TopologyDeclaration added in v0.2.15

func (r Registry) TopologyDeclaration() (topology.Declaration, error)

func (Registry) Validate added in v0.2.15

func (r Registry) Validate() error

type Root added in v0.2.15

type Root struct {
	ID          basespec.RootID `json:"id"`
	DisplayName string          `json:"displayName"`
	Description string          `json:"description,omitempty"`
}

type Source added in v0.2.15

type Source struct {
	ID          basespec.SourceID   `json:"id"`
	Kind        basespec.SourceKind `json:"kind"`
	DisplayName string              `json:"displayName"`
	Enabled     bool                `json:"enabled"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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