tools

package
v0.0.0-...-e0b29d8 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultToolConfigs

func DefaultToolConfigs(tt []Tool) map[string]config.ToolConfig

DefaultToolConfigs builds the map that config.DefaultConfig needs from a slice of tool definitions.

func FetchURLVersion

func FetchURLVersion(url string) func(ctx context.Context) string

FetchURLVersion returns a LatestVersion function that fetches a URL and returns the trimmed response body as the version string.

Types

type Tool

type Tool struct {
	Name            string                           // build target / config key (e.g. "claude")
	Description     string                           // human-readable (e.g. "Claude Code - Anthropic's CLI")
	DockerfileStage string                           // Dockerfile fragment (FROM base AS <name> ...)
	Command         func(home string) []string       // container entrypoint + args
	DefaultConfig   func() config.ToolConfig         // default mounts/env/hooks
	LatestVersion   func(ctx context.Context) string // optional: returns latest version string for cache-busting
}

Tool defines a self-contained tool that can be run inside a silo container.

func (Tool) CachedVersion

func (t Tool) CachedVersion() string

CachedVersion reads the cached version for this tool. Returns "" if no cache exists.

func (Tool) FetchVersion

func (t Tool) FetchVersion(ctx context.Context)

FetchVersion fetches the latest version and writes it to the cache. Intended to be called from a goroutine. Errors are silently ignored. If LatestVersion is nil the call is a no-op.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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