Documentation
¶
Overview ¶
Package project handles project-scope source trees: a <root>/.agentsync/ directory (same on-disk layout as the user-scope ~/.agentsync/), walk-up discovery from cwd, and overlay merge against the user-scope canonical model.
A project tree is a full canonical home rooted at a repository instead of $HOME, so every existing loader/writer/capture path works unchanged by simply pointing `home` at project.Home(root). The retired M5 single-file .agentsync.toml marker is no longer a live schema; Discover surfaces a migration error if it finds one (see Discover).
Index ¶
Constants ¶
const DirName = ".agentsync"
DirName is the project-scope source directory at a repository root.
const LegacyMarkerFile = ".agentsync.toml"
LegacyMarkerFile is the retired M5 single-file project marker. It is no longer loaded; Discover reports it so a user can migrate to a DirName tree.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
Discover walks up from start looking for a project source tree: a DirName directory. Returns the project root (the directory CONTAINING DirName) and found=true on the nearest match. Returns ("", false, nil) when no project tree exists at or above start.
If it encounters the retired single-file LegacyMarkerFile at a directory that has no DirName tree, it returns a migration error rather than silently ignoring it — a project that worked under M5 must not quietly lose its config. A DirName tree always wins over a legacy file at the same directory.
func Merge ¶
Merge overlays the project-scope canonical `proj` onto the user-scope `base`, returning a new Canonical. It never mutates base.
Semantics (documented in docs/architecture.md §project overlay):
- Agents: if proj declares any agents, its agent map REPLACES base's (the project picks its own agent set); an empty project agent map inherits base.
- MCP / LSP / Skills / Subagents / Commands: overlaid by identity (ID or Name) — a project entry replaces a base entry with the same key, and a new key is appended. Order is base-first, then appended project entries.
- Hooks: overlaid by Event — if the project declares any hook for an event, its hooks for that event REPLACE all base hooks for that event (hooks are a per-event set, not individually addressable).
- Memory: base body then project body, concatenated (project appended).
- Plugins / Marketplaces: project entries are not modeled at project scope in v1 and are inherited from base unchanged (see the migration note in docs/architecture.md). Config (Updates/Secrets) is inherited from base unless the project declares its own non-zero values.
Types ¶
This section is empty.