Documentation
¶
Index ¶
- Variables
- func EnsureEnabled(name string, enabled *bool) error
- func LoadLockedSources(sys System, root string) (*config.ProjectConfig, error)
- func LoadSources(fsys fs.FS, root string) (*config.ProjectConfig, error)
- func RecoverInterruptedImport(root string) error
- func WithLockedProject(sys System, root string, fn func(*config.ProjectConfig) error) error
- func WriteAgentSkills(sys System, root string, skills []config.Skill) error
- func WriteClaudeSkills(sys System, root string, skills []config.Skill) error
- type OrderedMap
- type RealSystem
- func (RealSystem) Close(file *os.File) error
- func (RealSystem) Flock(fd int, how int) error
- func (RealSystem) LookPath(file string) (string, error)
- func (RealSystem) Lstat(name string) (os.FileInfo, error)
- func (RealSystem) MarshalIndent(v any, prefix, indent string) ([]byte, error)
- func (RealSystem) MkdirAll(path string, perm os.FileMode) error
- func (RealSystem) Now() time.Time
- func (RealSystem) ReadDir(name string) ([]os.DirEntry, error)
- func (RealSystem) ReadFile(name string) ([]byte, error)
- func (RealSystem) Readlink(name string) (string, error)
- func (RealSystem) Remove(name string) error
- func (RealSystem) RemoveAll(path string) error
- func (RealSystem) Rename(oldpath string, newpath string) error
- func (RealSystem) Sleep(d time.Duration)
- func (RealSystem) Stat(name string) (os.FileInfo, error)
- func (RealSystem) WriteFileAtomic(filename string, data []byte, perm os.FileMode) error
- type Result
- func ProjectLocked(sys System, root string) (*Result, error)
- func Run(root string) (*Result, error)
- func RunLockedProject(sys System, root string, project *config.ProjectConfig) (*Result, error)
- func RunWithProject(sys System, root string, project *config.ProjectConfig) (*Result, error)
- func RunWithSystemFS(sys System, fsys fs.FS, root string) (*Result, error)
- type System
Constants ¶
This section is empty.
Variables ¶
var ErrPostWriteLockCleanup = projectlock.ErrPostWriteCleanup
ErrPostWriteLockCleanup identifies a fatal lock cleanup failure after sync has already written all generated outputs successfully. It aliases the projectlock sentinel so existing `errors.Is` callers keep working after the lock moved into its own package.
Functions ¶
func EnsureEnabled ¶
EnsureEnabled is a helper for command handlers.
func LoadLockedSources ¶ added in v0.16.0
func LoadLockedSources(sys System, root string) (*config.ProjectConfig, error)
LoadLockedSources acquires the project lock and returns the combined source snapshot. It is the entry point for callers that need the validated snapshot but do not perform their own writes under the lock.
func LoadSources ¶ added in v0.16.0
LoadSources reads the one combined skill-source snapshot every projection is built from: configuration, environment, instructions, the user-managed skill tier, and the imported skill tier.
It enforces the ownership invariants that only apply once both tiers exist: an imported directory with no lock entry is an actionable error, and one normalized skill name may not exist in both tiers.
Callers must already hold the project lock; use WithLockedProject unless the lock is held for a larger operation.
func RecoverInterruptedImport ¶ added in v0.16.0
RecoverInterruptedImport rolls back a skill import transaction an earlier process left in flight, so the caller reads one coherent generation of configuration, imported trees, and lock state. It is a no-op when no transaction was interrupted. Callers must already hold the project lock.
func WithLockedProject ¶ added in v0.16.0
WithLockedProject acquires the project lock, loads the combined source snapshot inside the critical section, and runs fn with it.
func WriteAgentSkills ¶ added in v0.10.0
WriteAgentSkills replaces the exclusively owned .agents/skills projection with the complete canonical skill snapshot.
Types ¶
type OrderedMap ¶
OrderedMap marshals map keys in a stable order.
func (OrderedMap[T]) MarshalJSON ¶
func (m OrderedMap[T]) MarshalJSON() ([]byte, error)
MarshalJSON encodes a map with sorted keys for deterministic output.
type RealSystem ¶ added in v0.5.4
type RealSystem struct{}
RealSystem implements System using actual system calls.
func (RealSystem) Close ¶ added in v0.13.0
func (RealSystem) Close(file *os.File) error
Close closes file.
func (RealSystem) Flock ¶ added in v0.13.0
func (RealSystem) Flock(fd int, how int) error
Flock applies or removes an advisory lock on the file represented by fd.
func (RealSystem) LookPath ¶ added in v0.5.4
func (RealSystem) LookPath(file string) (string, error)
LookPath searches for an executable named file in the directories named by the PATH environment variable.
func (RealSystem) Lstat ¶ added in v0.11.0
func (RealSystem) Lstat(name string) (os.FileInfo, error)
Lstat returns a FileInfo describing the named file without following symlinks.
func (RealSystem) MarshalIndent ¶ added in v0.5.4
func (RealSystem) MarshalIndent(v any, prefix, indent string) ([]byte, error)
MarshalIndent returns the JSON encoding of v with indentation.
func (RealSystem) MkdirAll ¶ added in v0.5.4
func (RealSystem) MkdirAll(path string, perm os.FileMode) error
MkdirAll creates a directory named path, along with any necessary parents.
func (RealSystem) Now ¶ added in v0.13.0
func (RealSystem) Now() time.Time
Now returns the current time.
func (RealSystem) ReadDir ¶ added in v0.8.0
func (RealSystem) ReadDir(name string) ([]os.DirEntry, error)
ReadDir reads the named directory and returns all directory entries.
func (RealSystem) ReadFile ¶ added in v0.5.4
func (RealSystem) ReadFile(name string) ([]byte, error)
ReadFile reads the named file and returns the contents.
func (RealSystem) Readlink ¶ added in v0.11.0
func (RealSystem) Readlink(name string) (string, error)
Readlink returns the destination of a symbolic link.
func (RealSystem) Remove ¶ added in v0.8.0
func (RealSystem) Remove(name string) error
Remove removes the named file or empty directory.
func (RealSystem) RemoveAll ¶ added in v0.8.0
func (RealSystem) RemoveAll(path string) error
RemoveAll removes path and any children it contains.
func (RealSystem) Rename ¶ added in v0.16.0
func (RealSystem) Rename(oldpath string, newpath string) error
Rename moves oldpath to newpath. Skill projection uses it to publish a fully staged skill tree and to roll a failed publication back.
func (RealSystem) Sleep ¶ added in v0.13.0
func (RealSystem) Sleep(d time.Duration)
Sleep pauses the current goroutine for at least d.
func (RealSystem) Stat ¶ added in v0.5.4
func (RealSystem) Stat(name string) (os.FileInfo, error)
Stat returns a FileInfo describing the named file.
func (RealSystem) WriteFileAtomic ¶ added in v0.5.4
WriteFileAtomic writes changed data atomically and preserves an identical regular file so no-op syncs do not emit configuration watcher events.
type Result ¶ added in v0.8.1
Result holds the outcome of a sync operation.
func ProjectLocked ¶ added in v0.16.0
ProjectLocked regenerates every output from the combined source snapshot.
Callers must already hold the project lock; skill import operations use it to project committed source state without releasing and reacquiring the lock, which would let another writer interleave.
func Run ¶
Run regenerates all configured outputs for the repo.
The combined skill-source snapshot is loaded inside the project lock so an `al skills` mutation running concurrently can never be observed half-applied. Returns any sync-time warnings and an error if sync failed.
func RunLockedProject ¶ added in v0.16.0
RunLockedProject regenerates outputs from an already loaded project while the caller holds the project lock. It lets launch and dispatch pipelines use one canonical source snapshot for validation and every derived projection.
func RunWithProject ¶
RunWithProject regenerates outputs using an already loaded project config.
Most production entry points use Run or RunWithSystemFS so source loading happens inside the lock. Callers that already hold the lock use RunLockedProject; this variant exists for focused projection tests. Returns any sync-time warnings and an error if sync failed.
func RunWithSystemFS ¶ added in v0.5.7
RunWithSystemFS loads the combined source snapshot from fsys inside the project lock and runs sync with the provided System. sys provides OS operations for sync writers; fsys must be rooted at repo root.
type System ¶ added in v0.5.4
type System interface {
LookPath(file string) (string, error)
Stat(name string) (os.FileInfo, error)
Lstat(name string) (os.FileInfo, error)
Readlink(name string) (string, error)
MkdirAll(path string, perm os.FileMode) error
WriteFileAtomic(filename string, data []byte, perm os.FileMode) error
MarshalIndent(v any, prefix, indent string) ([]byte, error)
ReadFile(name string) ([]byte, error)
ReadDir(name string) ([]os.DirEntry, error)
Remove(name string) error
RemoveAll(path string) error
Rename(oldpath string, newpath string) error
Close(file *os.File) error
Flock(fd int, how int) error
Now() time.Time
Sleep(d time.Duration)
}
System abstracts system-level operations to enable dependency injection in sync logic.
Source Files
¶
- agent_specific_merge.go
- antigravity.go
- antigravity_chime.go
- chime.go
- claude.go
- claude_chime.go
- claude_question_tool.go
- claude_statusline.go
- codex.go
- codex_agent_specific.go
- codex_config_merge.go
- codex_statusline.go
- constants.go
- copilotcli.go
- grok.go
- grok_chime.go
- grok_trust.go
- instructions.go
- lock.go
- mcp.go
- orderedjson.go
- permissions.go
- prompts.go
- sources.go
- sync.go
- system.go
- vscode.go
- vscode_mcp.go
- vscode_settings_jsonc.go