Documentation
¶
Overview ¶
Package workspace manages a bones workspace: the .bones/ directory, its on-disk config, and the associated leaf daemon process. Workspaces created before the rename used .agent-infra/; both Init and Join silently migrate that legacy name to .bones/ on first touch.
Two entry points:
Init creates a fresh workspace and starts a leaf daemon. Join locates an existing workspace (walking up from cwd) and verifies its leaf is reachable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ExitCode ¶
ExitCode maps errors returned by Init and Join to conventional process exit codes: 0 on success, 2-5 for known sentinels, 1 for anything else. Callers that want a different convention can inspect errors directly.
func FindRoot ¶ added in v0.4.0
FindRoot is the unauthenticated workspace lookup: walks up from start until it finds a directory containing the .bones marker dir, returns that directory, or ErrNoWorkspace if the filesystem root is reached.
Unlike Join, FindRoot does not load config.json or contact the leaf daemon — useful for commands that only need the workspace path (e.g. bones apply, which materializes from the hub fossil and never talks to the leaf).
Types ¶
type Info ¶
type Info struct {
AgentID string
NATSURL string
LeafHTTPURL string
RepoPath string
WorkspaceDir string
}
Info describes a live workspace. Returned by both Init and Join.
func Init ¶
Init creates a fresh workspace rooted at cwd, starts a leaf daemon, and returns its connection info. Returns ErrAlreadyInitialized only if a fully-formed workspace (marker dir AND config.json) already exists. An empty or partially-created marker dir is treated as a recoverable state and Init proceeds — this fixes the case where 'bones up' had previously mkdir'd .bones/ without writing config.json. A pre-rename .agent-infra/ marker is silently migrated to .bones/ first.