artifactregistry

package
v0.46.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package artifactregistry owns awf's canonical managed-artifact declarations.

Index

Constants

View Source
const (
	TargetBridgeKind       = "target-bridge"
	ClaudeBridgeTemplateID = "claude/CLAUDE.md.tmpl"
	TopicTemplateID        = "topics/topic.md.tmpl"
	TopicIndexTemplateID   = "topics/index.md.tmpl"
	PitfallEntryTemplateID = "pitfalls/entry.md.tmpl"
	LocalDocTemplateID     = "docs/local.md.tmpl"
)

Canonical template identities for registry-owned dynamic artifact families.

Variables

This section is empty.

Functions

func AnyTargetHasCapability

func AnyTargetHasCapability(targets []Target, capability Capability) bool

AnyTargetHasCapability reports whether any selected target declares capability.

func CatalogNames

func CatalogNames(cat *catalog.Catalog, plural string) ([]string, bool)

CatalogNames is the named-catalog inventory projection.

func HookTemplateID

func HookTemplateID(name string) string

HookTemplateID returns the canonical template identity for a hook.

func Hooks

func Hooks() []string

Hooks returns the canonical hook names in stable order.

func KnownTargets

func KnownTargets() []string

KnownTargets returns the built-in target names in stable order.

func LocalDocOutputPath

func LocalDocOutputPath(name string) string

LocalDocOutputPath returns the managed output path for a local document.

func Names

func Names(cat *catalog.Catalog, plural string) ([]string, bool)

Names returns a kind's sorted catalog inventory. Freeform kinds have no pool.

func OutputPath

func OutputPath(cat *catalog.Catalog, target Target, prefix, plural, name string) string

OutputPath returns one catalog artifact's canonical managed output path.

func PitfallOutputPath

func PitfallOutputPath(slug string) string

PitfallOutputPath returns the managed output path for a pitfall entry.

func Policy

func Policy(kind string, regenerate bool) outputplan.Policy

Policy returns the canonical detailed check participation for a producer family.

func ResidentOutputPath

func ResidentOutputPath(name string) string

ResidentOutputPath returns the managed marker path for a resident root.

func ResidentTemplateID

func ResidentTemplateID(name string) string

ResidentTemplateID returns the canonical template identity for a resident marker.

func Sections

func Sections(cat *catalog.Catalog, plural, name string) ([]string, bool)

Sections returns one artifact's declared sections and catalog presence.

func TargetDescriptorProjection

func TargetDescriptorProjection(target Target) string

TargetDescriptorProjection returns the stable output-affecting target identity.

func TargetTemplateData

func TargetTemplateData(target Target) map[string]any

TargetTemplateData projects the closed capability set into template inputs.

func TemplateID

func TemplateID(cat *catalog.Catalog, plural, name string) string

TemplateID returns the canonical template source for one artifact.

func TopicIndexOutputPath

func TopicIndexOutputPath(domain string) string

TopicIndexOutputPath returns the managed output path for a domain topic index.

func TopicOutputPath

func TopicOutputPath(id string) string

TopicOutputPath returns the managed output path for a current-state topic.

func ValidateTarget

func ValidateTarget(target Target) error

ValidateTarget verifies a target declaration's closed registry contract.

func ValidateTargetRequirements

func ValidateTargetRequirements(target Target, cat *catalog.Catalog) error

ValidateTargetRequirements rejects outputs that name an absent catalog skill.

Types

type AgentDialect

type AgentDialect string

AgentDialect names the target-native output representation.

const (
	// MarkdownAgentDialect identifies Markdown target output.
	MarkdownAgentDialect AgentDialect = "markdown"
	// PlainAgentDialect identifies non-Markdown target output.
	PlainAgentDialect AgentDialect = "plain"
)

type Capability

type Capability string

Capability is one closed target capability.

const (
	// CapabilitySubagentTools permits target-native subagent tooling.
	CapabilitySubagentTools Capability = "subagent-tools"
	// CapabilitySessionHandoff permits target-native session handoff.
	CapabilitySessionHandoff Capability = "session-handoff"
)

type Cardinality

type Cardinality string

Cardinality describes how a managed artifact family is selected.

const (
	// CardinalityCatalog selects artifacts from a named catalog.
	CardinalityCatalog Cardinality = "catalog"
	// CardinalityFreeform selects artifacts by caller-provided name.
	CardinalityFreeform Cardinality = "freeform"
	// CardinalitySingleton selects exactly one artifact.
	CardinalitySingleton Cardinality = "singleton"
)

type Hook

type Hook struct {
	Name, TemplateID, OutputPath, Owner string
	Checked                             bool
}

Hook is the stable hook-specific projection of a managed unit.

func HookArtifacts

func HookArtifacts() []Hook

HookArtifacts returns the registry-owned hook declarations in stable order.

type Kind

type Kind struct {
	Plural          string
	Singular        string
	Cardinality     Cardinality
	Targeting       Targeting
	Owner           Owner
	TemplatePattern string
	OwnsParts       bool
}

Kind declares one CLI-addressable managed-artifact family.

func KindByPlural

func KindByPlural(plural string) (Kind, bool)

KindByPlural returns the artifact kind with the given plural name.

func KindBySingular

func KindBySingular(singular string) (Kind, bool)

KindBySingular returns the artifact kind with the given singular name.

func Kinds

func Kinds() []Kind

Kinds returns the canonical artifact families in stable CLI display order.

type Owner

type Owner string

Owner identifies the subsystem responsible for an artifact declaration.

const (
	// OwnerCatalog identifies catalog-owned artifact declarations.
	OwnerCatalog Owner = "catalog"
	// OwnerTarget identifies target-owned artifact declarations.
	OwnerTarget Owner = "target"
	// OwnerCore identifies core artifact declarations.
	OwnerCore Owner = "core"
	// OwnerHooks identifies hook artifact declarations.
	OwnerHooks Owner = "hooks"
	// OwnerResident identifies resident-root artifact declarations.
	OwnerResident Owner = "resident"
)

type Participation

type Participation struct {
	Hook  bool
	Check bool
}

Participation declares whether an artifact participates in hook publication and in managed-output checks. Output policy supplies the detailed check lanes.

type ResidentArtifact

type ResidentArtifact struct {
	Name          string
	TemplateID    string
	OutputPath    string
	Participation Participation
	Owner         Owner
}

ResidentArtifact is one registry-owned resident-root marker declaration.

func Resident

func Resident(name string) ResidentArtifact

Resident returns the canonical marker declaration for one resident root.

type Singleton

type Singleton struct {
	Kind          string
	TemplateID    string
	OutputPath    string
	Sections      []string
	Generated     bool
	Participation Participation
	Owner         Owner
}

Singleton is a catalog-derived structural singleton artifact.

func PlainSingletons

func PlainSingletons(cat *catalog.Catalog) []Singleton

PlainSingletons excludes the root guide and computed generated outputs.

func Singletons

func Singletons(cat *catalog.Catalog) []Singleton

Singletons returns structural catalog artifacts in stable kind order.

type Target

type Target struct {
	Name           string
	SkillDir       string
	AgentDir       string
	AgentSuffix    string
	AgentDialect   AgentDialect
	BridgeFile     string
	BridgeTemplate string
	Capabilities   []Capability
	Outputs        []TargetOutput
}

Target places adapter artifacts for one runtime.

func BuiltinTarget

func BuiltinTarget(name string) Target

BuiltinTarget returns an isolated copy of the named built-in target.

func ResolveTargets

func ResolveTargets(names []string) ([]Target, error)

ResolveTargets validates and returns isolated copies of the named targets.

func Targets

func Targets() []Target

Targets returns all built-in targets in stable name order.

func (Target) AgentPath

func (t Target) AgentPath(name string) string

AgentPath returns the target-native path for a managed agent.

func (Target) SkillPath

func (t Target) SkillPath(prefix, name string) string

SkillPath returns the target-native path for a managed skill.

type TargetArtifact

type TargetArtifact struct {
	Output        TargetOutput
	Participation Participation
	Owner         Owner
}

TargetArtifact attaches registry governance metadata to one target output.

func ResolveTargetArtifacts

func ResolveTargetArtifacts(target Target, prefix string, selected []string) []TargetArtifact

ResolveTargetArtifacts applies required-skill selection and skill-path translation while retaining the registry's ownership and check-participation metadata.

type TargetOutput

type TargetOutput struct {
	Path           string
	SkillName      string
	RequiresSkill  string
	TemplateID     string
	Producer       TargetOutputProducer
	Inputs         []TargetOutputInput
	Encoder        AgentDialect
	Provenance     render.CommentStyle
	Policy         outputplan.Policy
	PolicyDeclared bool
}

TargetOutput is one target-owned non-catalog managed artifact.

type TargetOutputInput

type TargetOutputInput struct {
	Path string
	Role outputplan.ArtifactRole
}

TargetOutputInput declares one semantic input to a target-owned output.

type TargetOutputProducer

type TargetOutputProducer string

TargetOutputProducer identifies how a target-owned output is produced.

const TargetOutputTemplate TargetOutputProducer = "template"

TargetOutputTemplate identifies template-produced target output.

type Targeting

type Targeting string

Targeting describes whether one artifact is neutral or emitted per target.

const (
	// TargetNeutral identifies an artifact emitted independently of targets.
	TargetNeutral Targeting = "neutral"
	// TargetAdapter identifies an artifact emitted for each selected target.
	TargetAdapter Targeting = "target"
)

type Unit

type Unit struct {
	ID            string
	Kind          string
	Path          string
	TemplateID    string
	Sections      []string
	Enabled       func(*config.Config) bool
	Encoder       AgentDialect
	Provenance    render.CommentStyle
	Policy        outputplan.Policy
	Participation Participation
	Owner         Owner
}

Unit declares one core singleton or hook artifact.

func ConditionalUnits

func ConditionalUnits() []Unit

ConditionalUnits returns stable core singleton and hook declarations.

Jump to

Keyboard shortcuts

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