workspace

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package workspace locates and describes an amoxtli workspace: a project directory holding a .amoxtli/ configuration directory, discovered by walking up the filesystem from a starting point (like git does).

Index

Constants

View Source
const DirName = ".amoxtli"

DirName is the name of the workspace configuration directory.

View Source
const EnvDir = "AMOXTLI_DIR"

EnvDir is the environment variable pointing directly to a workspace configuration directory, bypassing discovery. Useful for processes whose working directory is unpredictable (e.g. MCP servers spawned by a client).

Variables

View Source
var ErrNotFound = errors.Errorf("no %s directory found; run \"amoxtli init\" first", DirName)

ErrNotFound is returned by Discover when no .amoxtli directory exists between the starting directory and the filesystem root.

Functions

This section is empty.

Types

type Workspace

type Workspace struct {
	Root string
	Dir  string
}

Workspace describes a located workspace. Dir is the .amoxtli directory itself; Root is its parent (the project root).

func Discover

func Discover(startDir string) (*Workspace, error)

Discover walks up from startDir and returns the first directory containing a .amoxtli subdirectory. If the AMOXTLI_DIR environment variable is set, it is used directly as the configuration directory instead.

func New

func New(dir string) *Workspace

New builds a Workspace from the path of its configuration directory.

func (*Workspace) ConfigPath

func (w *Workspace) ConfigPath() string

ConfigPath returns the path of the workspace configuration file.

func (*Workspace) DataDir

func (w *Workspace) DataDir() string

DataDir returns the directory holding the indexed data.

func (*Workspace) LockPath

func (w *Workspace) LockPath() string

LockPath returns the path of the workspace lock file.

func (*Workspace) Resolve

func (w *Workspace) Resolve(path string) string

Resolve resolves a possibly-relative path from the configuration file against the .amoxtli directory.

func (*Workspace) StagingDir

func (w *Workspace) StagingDir() string

StagingDir returns the stable staging directory used by persistent tasks.

Jump to

Keyboard shortcuts

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