project

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 5 Imported by: 0

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

View Source
const DirName = ".agentsync"

DirName is the project-scope source directory at a repository root.

View Source
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

func Discover(start string) (root string, found bool, err error)

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 Home

func Home(root string) string

Home returns the project canonical home (<root>/.agentsync) for a project root.

func Merge

func Merge(base, proj source.Canonical) source.Canonical

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.

Jump to

Keyboard shortcuts

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