Documentation
¶
Index ¶
- Constants
- func AppendAgent(original []byte, agent Agent) ([]byte, error)
- func AppendExport(original []byte, export Export) ([]byte, error)
- func Format(original []byte) ([]byte, error)
- func Marshal(m *Manifest) ([]byte, error)
- func MarshalLock(l *Lock) ([]byte, error)
- func Path(dir string) (string, error)
- func ReadDir(dir string) ([]byte, string, error)
- func RemoveAgent(original []byte, name string) ([]byte, error)
- func SchemaReport(data []byte, lock bool) (int, []string, error)
- func UpdateDependencies(original []byte, dependencies []Dependency) ([]byte, error)
- func UpdatePolicy(original []byte, intents [][2]string, may, mayNot *[]string, notes *string) ([]byte, error)
- type Agent
- type Consumers
- type Contact
- type ContactSettings
- type Dependency
- type Export
- type Lock
- type LockedCardKey
- type LockedDependency
- type LockedVendor
- type Manifest
- type Module
- type MovedTo
- type Policy
- type Release
- type Require
- type Settings
- type Shim
- type Trust
- type UnsupportedSchemaError
- type Vendor
Constants ¶
const ( CanonicalName = "a2amodule.yml" AlternateName = "a2amodule.yaml" )
const CurrentSchema = 1
Variables ¶
This section is empty.
Functions ¶
func AppendAgent ¶ added in v1.1.0
AppendAgent edits only the agents sequence. Existing YAML nodes are retained so their comments, ordering, scalar spelling, and flow/block collection styles remain owned by the author rather than by the Go encoder.
func AppendExport ¶ added in v1.1.0
AppendExport edits only module.exports and retains every pre-existing module node.
func MarshalLock ¶
func Path ¶ added in v1.7.0
Path resolves the single manifest in dir. The canonical .yml spelling is probed first, but repositories may use .yaml. Keeping this rule here avoids subtly different behavior between CLI commands, the cache, and renderers.
func RemoveAgent ¶ added in v1.1.0
RemoveAgent removes one matching agents item without rebuilding the remaining sequence.
func SchemaReport ¶ added in v1.6.0
SchemaReport returns the schema number and optional schema paths explicitly present in data. It is deliberately syntax-aware so false, empty strings, and empty collections remain visible.
func UpdateDependencies ¶
func UpdateDependencies(original []byte, dependencies []Dependency) ([]byte, error)
UpdateDependencies edits only the dependencies sequence in an existing manifest. YAML nodes retain comments, scalar styles, flow collections, and extension fields that are not owned by the dependency editor.
func UpdatePolicy ¶ added in v1.1.0
func UpdatePolicy(original []byte, intents [][2]string, may, mayNot *[]string, notes *string) ([]byte, error)
UpdatePolicy changes only the explicitly supplied policy fields. Nil pointers mean leave the field untouched; non-nil slices replace that consumer vocabulary list, including with empty.
Types ¶
type Agent ¶
type Agent struct {
Name string `yaml:"name" json:"name"`
Role string `yaml:"role" json:"role"`
Scope []string `yaml:"scope,omitempty" json:"scope,omitempty"`
Card string `yaml:"card,omitempty" json:"card,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Contacts []Contact `yaml:"contacts,omitempty" json:"contacts,omitempty"`
Trust *Trust `yaml:"trust,omitempty" json:"trust,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Contact ¶
type Contact struct {
Intents []string `yaml:"intents" json:"intents"`
Kind string `yaml:"kind" json:"kind"`
Note string `yaml:"note,omitempty" json:"note,omitempty"`
URL string `yaml:"url,omitempty" json:"url,omitempty"`
Skill string `yaml:"skill,omitempty" json:"skill,omitempty"`
Address string `yaml:"address,omitempty" json:"address,omitempty"`
SubjectPrefix string `yaml:"subject-prefix,omitempty" json:"subject-prefix,omitempty"`
Repo string `yaml:"repo,omitempty" json:"repo,omitempty"`
Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
Template string `yaml:"template,omitempty" json:"template,omitempty"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
Organization string `yaml:"organization,omitempty" json:"organization,omitempty"`
IssueType string `yaml:"issue-type,omitempty" json:"issue-type,omitempty"`
Channel string `yaml:"channel,omitempty" json:"channel,omitempty"`
Handle string `yaml:"handle,omitempty" json:"handle,omitempty"`
Server string `yaml:"server,omitempty" json:"server,omitempty"`
Method string `yaml:"method,omitempty" json:"method,omitempty"`
Headers map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
ContentType string `yaml:"content-type,omitempty" json:"content-type,omitempty"`
Body string `yaml:"body,omitempty" json:"body,omitempty"`
Command []string `yaml:"command,omitempty" json:"command,omitempty"`
Args []string `yaml:"args,omitempty" json:"args,omitempty"`
Stdin string `yaml:"stdin,omitempty" json:"stdin,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
func (Contact) MarshalJSON ¶
type ContactSettings ¶ added in v1.4.0
type Dependency ¶
type Dependency struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Git string `yaml:"git" json:"git"`
Ref string `yaml:"ref,omitempty" json:"ref,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Track string `yaml:"track,omitempty" json:"track,omitempty"`
Wire *[]string `yaml:"wire,omitempty" json:"wire,omitempty"`
Vendor *Vendor `yaml:"vendor,omitempty" json:"vendor,omitempty"`
Shim *Shim `yaml:"shim,omitempty" json:"shim,omitempty"`
Require *Require `yaml:"require,omitempty" json:"require,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
func (Dependency) ShimManifest ¶ added in v1.7.0
func (d Dependency) ShimManifest() *Manifest
ShimManifest projects a dependency shim onto the normal manifest model so routing and adapters have exactly one metadata shape to consume.
type Lock ¶
type Lock struct {
Schema int `yaml:"schema" json:"schema"`
Dependencies map[string]LockedDependency `yaml:"dependencies" json:"dependencies"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type LockedCardKey ¶ added in v1.3.0
type LockedDependency ¶
type LockedDependency struct {
Git string `yaml:"git" json:"git"`
Ref string `yaml:"ref" json:"ref"`
Path string `yaml:"path" json:"path"`
Commit string `yaml:"commit" json:"commit"`
Manifest string `yaml:"manifest" json:"manifest"`
Cards map[string]string `yaml:"cards,omitempty" json:"cards,omitempty"`
CardsKeys map[string]LockedCardKey `yaml:"cards-keys,omitempty" json:"cards-keys,omitempty"`
Verified string `yaml:"verified,omitempty" json:"verified,omitempty"`
Surface string `yaml:"surface,omitempty" json:"surface,omitempty"`
Vendor *LockedVendor `yaml:"vendor,omitempty" json:"vendor,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type LockedVendor ¶ added in v1.2.0
type Manifest ¶
type Manifest struct {
Schema int `yaml:"schema" json:"schema"`
Module Module `yaml:"module" json:"module"`
Agents []Agent `yaml:"agents,omitempty" json:"agents,omitempty"`
Policy *Policy `yaml:"policy,omitempty" json:"policy,omitempty"`
Settings *Settings `yaml:"settings,omitempty" json:"settings,omitempty"`
Dependencies []Dependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Module ¶
type Module struct {
ID string `yaml:"id" json:"id"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Languages []string `yaml:"languages,omitempty" json:"languages,omitempty"`
Surface string `yaml:"surface,omitempty" json:"surface,omitempty"`
Repository string `yaml:"repository,omitempty" json:"repository,omitempty"`
MovedTo *MovedTo `yaml:"moved-to,omitempty" json:"moved-to,omitempty"`
Docs string `yaml:"docs,omitempty" json:"docs,omitempty"`
Release *Release `yaml:"release,omitempty" json:"release,omitempty"`
Exports []Export `yaml:"exports,omitempty" json:"exports,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type MovedTo ¶
type MovedTo struct {
Git string `yaml:"git" json:"git"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Notes string `yaml:"notes,omitempty" json:"notes,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
MovedTo is the owner's announcement, left at the old location, that the module now lives elsewhere. Consumers are told on update and follow it only on explicit request.
type Policy ¶
type Policy struct {
Intents map[string]string `yaml:"intents,omitempty" json:"intents,omitempty"`
Consumers *Consumers `yaml:"consumers,omitempty" json:"consumers,omitempty"`
ContactBudget map[string]string `yaml:"contact-budget,omitempty" json:"contact-budget,omitempty"`
Notes string `yaml:"notes,omitempty" json:"notes,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Require ¶ added in v1.3.0
type Require struct {
Commits string `yaml:"commits,omitempty" json:"commits,omitempty"`
Signers string `yaml:"signers,omitempty" json:"signers,omitempty"`
Cards string `yaml:"cards,omitempty" json:"cards,omitempty"`
CardOrigin bool `yaml:"card-origin,omitempty" json:"card-origin,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Settings ¶ added in v1.2.0
type Settings struct {
VendorDir string `yaml:"vendor-dir,omitempty" json:"vendor-dir,omitempty"`
SyncTargets []string `yaml:"sync-targets,omitempty" json:"sync-targets,omitempty"`
Organisation []string `yaml:"organisation,omitempty" json:"organisation,omitempty"`
Contact *ContactSettings `yaml:"contact,omitempty" json:"contact,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Shim ¶ added in v1.7.0
type Shim struct {
Exports []Export `yaml:"exports,omitempty" json:"exports,omitempty"`
Agents []Agent `yaml:"agents,omitempty" json:"agents,omitempty"`
Notes string `yaml:"notes,omitempty" json:"notes,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
Shim is consumer-authored module metadata for a plain Git dependency. It is ignored as soon as the locked upstream commit publishes its own manifest.
type Trust ¶
type Trust struct {
Signatures bool `yaml:"signatures,omitempty" json:"signatures,omitempty"`
AcceptsExternal *bool `yaml:"accepts-external,omitempty" json:"accepts-external,omitempty"`
JWKS []string `yaml:"jwks,omitempty" json:"jwks,omitempty"`
Keys []string `yaml:"keys,omitempty" json:"keys,omitempty"`
Origins []string `yaml:"origins,omitempty" json:"origins,omitempty"`
JWKSMaxAge string `yaml:"jwks-max-age,omitempty" json:"jwks-max-age,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type UnsupportedSchemaError ¶ added in v1.6.0
type UnsupportedSchemaError struct {
Schema int
}
func (*UnsupportedSchemaError) Error ¶ added in v1.6.0
func (e *UnsupportedSchemaError) Error() string