engram

package
v0.0.0-...-5439220 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SetupModeEnvVar   = "GENTLE_AI_ENGRAM_SETUP_MODE"
	SetupStrictEnvVar = "GENTLE_AI_ENGRAM_SETUP_STRICT"
)

Variables

View Source
var EngramLookPath = exec.LookPath

EngramLookPath is the function used to resolve the engram binary path. It is a package-level variable so it can be replaced in tests — both from within the engram package and from external test packages (e.g. golden_test.go). In production it is set to exec.LookPath.

Functions

func DownloadLatestBinary

func DownloadLatestBinary(profile system.PlatformProfile) (string, error)

DownloadLatestBinary fetches the latest engram release from GitHub and installs it to the appropriate directory for the given platform. It returns the full path to the installed binary.

Checksum verification is mandatory: the install fails if checksums.txt is unavailable, if the archive is not listed, or if the digest does not match.

This is the non-brew installation method for Linux and Windows. On macOS, brew handles engram transitively and this should not be called.

func InstallCommand

func InstallCommand(profile system.PlatformProfile) ([][]string, error)

func ParseSetupStrict

func ParseSetupStrict(value string) bool

func SetLookPathForTest

func SetLookPathForTest(t interface {
	Helper()
	Cleanup(func())
}, result, errMsg string)

SetLookPathForTest replaces EngramLookPath with a mock for the duration of a test and restores the original after the test completes. Exported so that external test packages (e.g. golden_test.go in components) can control the resolved engram path.

func SetupAgentSlug

func SetupAgentSlug(agent model.AgentID) (string, bool)

func ShouldAttemptSetup

func ShouldAttemptSetup(mode SetupMode, agent model.AgentID) bool

func VerifyHealth

func VerifyHealth(ctx context.Context, baseURL string) error

func VerifyInstalled

func VerifyInstalled() error

func VerifyVersion

func VerifyVersion() (string, error)

VerifyVersion runs "engram version" and returns the trimmed output. Returns an error if the command fails or produces no output.

Types

type InjectionResult

type InjectionResult struct {
	Changed bool
	Files   []string
}

func Inject

func Inject(homeDir string, adapter agents.Adapter) (InjectionResult, error)

func InjectWithPromptDir

func InjectWithPromptDir(configHomeDir, promptDir string, adapter agents.Adapter) (InjectionResult, error)

InjectWithPromptDir writes Engram's MCP configuration using configHomeDir and writes prompt protocol files using promptDir. This is needed for agents such as OpenClaw where MCP is loaded from the global config but instructions are read from an active workspace.

type SetupMode

type SetupMode string
const (
	SetupModeOff       SetupMode = "off"
	SetupModeOpenCode  SetupMode = "opencode"
	SetupModeSupported SetupMode = "supported"
)

func ParseSetupMode

func ParseSetupMode(value string) SetupMode

Jump to

Keyboard shortcuts

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