folders

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package folders gives every session path one folder identity: the git repository, the linked worktree and the subfolder it runs in. Clients print Folder.Label and never derive names themselves.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Folder

type Folder struct {
	Repo     string `json:"repo"`               // shown name of the top folder
	RepoPath string `json:"repoPath"`           // its full path, the grouping key
	Worktree string `json:"worktree,omitempty"` // linked worktree folder name; absent for the main checkout
	Sub      string `json:"sub,omitempty"`      // path below the worktree top, "/"-separated
	Label    string `json:"label"`              // "aimux / clients · ios"
}

Folder is the identity of a session's working directory.

type Resolver

type Resolver struct {
	Home      string
	CachePath string
	// Git returns the top-level and the common git dir (both absolute) of dir.
	Git    func(dir string) (top, commonDir string, err error)
	Exists func(string) bool
	// Tick is how often Run resolves a batch; zero means the default.
	Tick time.Duration
	// contains filtered or unexported fields
}

Resolver maps session paths to Folders. Folder never runs git; Run does.

func NewResolver

func NewResolver(home, cachePath string) *Resolver

NewResolver builds a Resolver for the given home directory and cache file, loading the cache when it exists and parses.

func (*Resolver) Folder

func (r *Resolver) Folder(path string) Folder

Folder returns the identity of path without running git. A path not yet resolved gets the non-git rule and is queued for Run.

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(path string)

ResolveNow resolves one path synchronously. A path that no longer exists is left on the non-git rule, so a deleted worktree never resolved stays that way.

func (*Resolver) Run

func (r *Resolver) Run(ctx context.Context)

Run resolves queued paths in the background until ctx ends.

Jump to

Keyboard shortcuts

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