agentpaths

package
v1.10.10 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AppDirName = "agent-deck"

Variables

View Source
var ErrMigrationConflict = errors.New("migration destination conflict")

Functions

func CacheDir

func CacheDir() (string, error)

func CachePath

func CachePath(name string) (string, error)

func ConfigDir

func ConfigDir() (string, error)

func CopyTree added in v1.9.63

func CopyTree(source, destination string) error

CopyTree copies source to destination, refusing to overwrite any destination leaf that already exists (atomic O_EXCL/Link publish). It returns ErrMigrationConflict if a leaf already exists, so callers can treat a pre-existing destination as a conflict to preserve rather than a hard error. Use for the no-prior-destination fast path; use MergeTree when the destination may already hold (newer) data to merge into.

func DataDir

func DataDir() (string, error)

func EffectiveConfigPath

func EffectiveConfigPath(name string) (string, error)

func EffectiveDataDir

func EffectiveDataDir(markers ...string) (string, error)

func EffectiveDataPath

func EffectiveDataPath(name string, markers ...string) (string, error)

func LegacyDir

func LegacyDir() (string, error)

func MergeTree added in v1.9.63

func MergeTree(source, destination string) (conflicted bool, err error)

MergeTree merges source into destination using the same non-destructive, no-clobber semantics as the legacy layout migration: an existing destination file/symlink is PRESERVED (the source copy is skipped and reported via conflicted=true), directories are merged recursively, and a TOCTOU race on a leaf surfaces as a conflict rather than a truncation. It never removes the destination tree. Exposed for reuse by conductor dir relocation, which needs the identical "newer destination wins, report conflicts" guarantee.

Types

type MigrationItem

type MigrationItem struct {
	Name        string
	Category    PathCategory
	Source      string
	Destination string
	Directory   bool
}

type MigrationOptions

type MigrationOptions struct {
	DryRun bool
	Force  bool
}

type MigrationResult

type MigrationResult struct {
	DryRun    bool
	Copied    []MigrationItem
	Skipped   []MigrationItem
	Conflicts []MigrationItem
}

func MigrateLegacyLayout

func MigrateLegacyLayout(opts MigrationOptions) (*MigrationResult, error)

type PathCategory

type PathCategory string
const (
	CategoryConfig PathCategory = "config"
	CategoryData   PathCategory = "data"
	CategoryCache  PathCategory = "cache"
)

Jump to

Keyboard shortcuts

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