Documentation
¶
Index ¶
- Constants
- func InTempDir(path string) bool
- func LegacyProjectDir(project string) string
- func LegacyUserDir() string
- func Migrate(src, dst string) error
- func MigrateProjectDir(project string) error
- func ProjectDir(project string) string
- func Report(err error)
- func Resolve(home, preferred, legacyOverride string) (string, error)
- func TestRedirect(home, preferred, legacy string) string
- func UserDir() (string, error)
Constants ¶
const ( LiveAgentHomeEnv = "LIVEAGENT_HOME" LegacyHomeEnv = "K_BRAIN_HOME" LiveAgentDirName = ".liveagent" LegacyDirName = ".k-brain" )
Variables ¶
This section is empty.
Functions ¶
func InTempDir ¶ added in v0.107.28
InTempDir reports whether path lies inside the system temporary directory, comparing both the paths as written and with symbolic links resolved (on macOS the temporary directory is reached through /var -> /private/var).
func LegacyProjectDir ¶
func LegacyUserDir ¶ added in v0.107.28
func LegacyUserDir() string
LegacyUserDir is the pre-LiveAgent global directory (~/.k-brain) that is imported once. Under `go test` it is "" unless the home directory is a temporary one: tests must not read a developer's real data.
func Migrate ¶
Migrate imports a legacy directory once. Completed imports are not replayed after users delete or archive data in the destination. Root symlinks are rejected; links inside the source are copied verbatim without following them.
func MigrateProjectDir ¶
func ProjectDir ¶
ProjectDir returns the project-scoped data directory. It uses .liveagent exclusively; .k-brain remains available for one-way prompt compatibility.
func Report ¶
func Report(err error)
Report keeps migration failures visible in discovery APIs without error returns.
func TestRedirect ¶ added in v0.107.28
TestRedirect reports the directory UserDir would use, when a test process must not use it because it lies outside the temporary directory; "" when it is safe.
Types ¶
This section is empty.