paths

package
v0.14.4-dev.43 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LockfileName              = "pack.lock"
	ManifestName              = "agentpack.toml"
	StagedAgentpackBundleName = "agentpack-bundle"
	DotAgentsDir              = ".agents"
	DotClaudeDir              = ".claude"
)
View Source
const MCPCredentialIndexName = "mcp-credentials.json"

MCPCredentialIndexName lists the gateway's stored MCP credentials (no secrets) for staging.

View Source
const RacyTreeMetadataWindow = 3 * time.Second

RacyTreeMetadataWindow keeps a recent edit from becoming a reusable verification stamp.

Variables

View Source
var ErrProjectNotFound = errors.New("no agentpack.toml or pack.lock found")

Functions

func AgyOverlayManifestPath

func AgyOverlayManifestPath(projectRoot string) (string, error)

func CacheDBPath

func CacheDBPath() (string, error)

func CacheDir

func CacheDir() (string, error)

func CursorOverlayManifestPath

func CursorOverlayManifestPath(projectRoot string) (string, error)

func EnsurePrivateDirectory added in v0.14.0

func EnsurePrivateDirectory(path string) error

EnsurePrivateDirectory protects both newly created and existing directories.

func EnsureUserAgentpackLayout

func EnsureUserAgentpackLayout() (string, error)

func EnvironmentsRoot

func EnvironmentsRoot() (string, error)

EnvironmentsRoot holds portable external definition directories.

func FindProjectRoot

func FindProjectRoot(start string) (string, error)

func LaunchSyncStatePath

func LaunchSyncStatePath(projectRoot, modeName, key string) (string, error)

func LocalMirrorPathFromShorthand

func LocalMirrorPathFromShorthand(spec string) (string, error)

func LocalRegistryRoot

func LocalRegistryRoot() (string, error)

func LockPath

func LockPath(projectRoot string) string

func MCPCredentialIndexPath added in v0.14.1

func MCPCredentialIndexPath() (string, error)

func ManifestPath

func ManifestPath(projectRoot string) string

func MarkProjectDirectory

func MarkProjectDirectory(directory, projectRoot string) error

MarkProjectDirectory records which project a directory belongs to.

func ModePathComponent

func ModePathComponent(modeName string) string

func OrphanedProjectDirectories

func OrphanedProjectDirectories(parent string) []string

OrphanedProjectDirectories lists the directories directly under parent that carry a project marker for a project directory that no longer exists. A directory without a marker is never listed.

func PluginDataDir

func PluginDataDir(projectRoot, module string) (string, error)

PluginDataDir is the durable directory a plugin's ${CLAUDE_PLUGIN_DATA} names for a project; it survives staging rebuilds and package updates.

func ProjectDotAgentsDir

func ProjectDotAgentsDir(projectRoot string) string

func ProjectDotClaudeDir

func ProjectDotClaudeDir(projectRoot string) string

func ProjectPathHash

func ProjectPathHash(projectRoot string) (string, error)

func ProjectStateDir

func ProjectStateDir(projectRoot string) (string, error)

func ProjectStateFile

func ProjectStateFile(projectRoot, name string) (string, error)

ProjectStateFile is the public form of the per-project state path helper.

func ProxyLogDir

func ProxyLogDir(projectRoot string) (string, error)

func RenameDurable added in v0.14.0

func RenameDurable(source, target string, replace bool) error

func ResolveProjectRoot

func ResolveProjectRoot(explicit string) (string, error)

func ResolveProjectRootOrCWD

func ResolveProjectRootOrCWD(explicit string) (string, error)

func RestoreUserEnvironment added in v0.12.10

func RestoreUserEnvironment()

RestoreUserEnvironment is only needed on Windows.

func SelectStagingGeneration added in v0.12.11

func SelectStagingGeneration(projectRoot, modeName, root string) error

SelectStagingGeneration makes this command use an existing generation of the mode. A generation that is gone or not of this mode is ignored: the caller rebuilds as it would for any stale staging.

func SessionHistoryRecoveryDirForComponent

func SessionHistoryRecoveryDirForComponent(projectRoot, harness, modeComponent string) (string, error)

func SharedCodexAuthPath

func SharedCodexAuthPath() (string, error)

func SharedGrokCredentialsDir

func SharedGrokCredentialsDir() (string, error)

func StagedManifestPath

func StagedManifestPath(projectRoot, modeName string) (string, error)

StagedManifestPath records staged content per generation, with the legacy project-state location used only for staging built by older releases.

func StagingAgyBundleDirForMode

func StagingAgyBundleDirForMode(root, mode string) (string, error)

func StagingAgyDirForMode

func StagingAgyDirForMode(root, mode string) (string, error)

func StagingCodexHomeDirForMode

func StagingCodexHomeDirForMode(root, mode string) (string, error)

func StagingCursorBundleDirForMode

func StagingCursorBundleDirForMode(root, mode string) (string, error)

func StagingCursorHomeDirForMode

func StagingCursorHomeDirForMode(root, mode string) (string, error)

func StagingCursorPackPluginDirForMode

func StagingCursorPackPluginDirForMode(root, mode string) (string, error)

func StagingGrokBundleDirForMode

func StagingGrokBundleDirForMode(root, mode string) (string, error)

func StagingGrokDirForMode

func StagingGrokDirForMode(root, mode string) (string, error)

func StagingGrokHomeDirForMode

func StagingGrokHomeDirForMode(root, mode string) (string, error)

func StagingOpenCodeDirForMode

func StagingOpenCodeDirForMode(root, mode string) (string, error)

func StagingPluginRootsDirForMode

func StagingPluginRootsDirForMode(root, mode string) (string, error)

StagingPluginRootsDirForMode holds whole copies of the plugins whose MCP servers run from their own directory, one per package, shared by every harness of the mode.

func StagingPluginsDirForMode

func StagingPluginsDirForMode(root, mode string) (string, error)

func StagingProjectDir

func StagingProjectDir(projectRoot string) (string, string, error)

StagingProjectDir is the directory that holds a project's staging for every mode. The second result is the directory such directories are created in when no AGENTPACK_STAGING_ROOT is set, and empty when one is.

func StagingRootForMode

func StagingRootForMode(projectRoot, modeName string) (string, error)

func TreeMetadata

func TreeMetadata(root string) (string, time.Time, error)

TreeMetadata digests the path, type, permission bits, size and modification time of every file below root, and reports the newest modification time. It reads no contents, so it detects visible changes without proving any bytes.

func UserAgentpackHome

func UserAgentpackHome() (string, error)

UserAgentpackHome implements the documented AGENTPACK_HOME/XDG/LOCALAPPDATA precedence without depending on a platform directory package.

Types

type Context

type Context struct {
	// DefinitionRoot holds agentpack.toml and pack.lock.
	DefinitionRoot string
	// WorkspaceRoot is the checkout / agent cwd (.agents, overlays).
	WorkspaceRoot string
}

Context separates where the portable definition lives from the checkout the agent uses as cwd.

func ResolveContext

func ResolveContext(projectRoot, definitionRoot, workspaceRoot string, boundDefinition string) (Context, error)

ResolveContext builds a Context from explicit flags and an optional binding. Legacy --project-root alone keeps today's single-root behavior.

func ResolveContextOrCWD

func ResolveContextOrCWD(projectRoot, definitionRoot, workspaceRoot string, boundDefinition string) (Context, error)

ResolveContextOrCWD allows a missing definition (launchers / add), using cwd as both roots when nothing is discoverable.

func (Context) SameRoot

func (ctx Context) SameRoot() bool

SameRoot reports whether definition and workspace are the same path.

type StagingGeneration added in v0.7.3

type StagingGeneration struct {
	Root string
	// contains filtered or unexported fields
}

StagingGeneration builds privately and publishes only after verification. Old generations are retained so running sessions and their support files survive. shortcut: generations accumulate, add lease-aware reclamation when disk use requires it.

func BeginStagingGeneration added in v0.7.3

func BeginStagingGeneration(projectRoot, modeName string) (*StagingGeneration, error)

func (*StagingGeneration) Abort added in v0.7.3

func (generation *StagingGeneration) Abort()

func (*StagingGeneration) Publish added in v0.7.3

func (generation *StagingGeneration) Publish() error

Jump to

Keyboard shortcuts

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