Documentation
¶
Index ¶
- Constants
- Variables
- func DownloadLatestBinary(profile system.PlatformProfile) (string, error)
- func InstallCommand(profile system.PlatformProfile) ([][]string, error)
- func ParseSetupStrict(value string) bool
- func SetLookPathForTest(t interface{ ... }, result, errMsg string)
- func SetupAgentSlug(agent model.AgentID) (string, bool)
- func ShouldAttemptSetup(mode SetupMode, agent model.AgentID) bool
- func VerifyHealth(ctx context.Context, baseURL string) error
- func VerifyInstalled() error
- func VerifyVersion() (string, error)
- type InjectionResult
- type SetupMode
Constants ¶
const ( SetupModeEnvVar = "GENTLE_AI_ENGRAM_SETUP_MODE" SetupStrictEnvVar = "GENTLE_AI_ENGRAM_SETUP_STRICT" )
Variables ¶
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 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 VerifyInstalled ¶
func VerifyInstalled() error
func VerifyVersion ¶
VerifyVersion runs "engram version" and returns the trimmed output. Returns an error if the command fails or produces no output.
Types ¶
type InjectionResult ¶
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.