Documentation
¶
Overview ¶
Package projectstate owns immutable loaded project facts and resolved target declarations.
Index ¶
- func KnownTargets() []string
- func ValidateTarget(target Target) error
- type AgentDialect
- type Capability
- type ProjectState
- func (s *ProjectState) Catalog() *catalog.Catalog
- func (s *ProjectState) CompleteCatalog() *catalog.Catalog
- func (s *ProjectState) Config() *config.Config
- func (s *ProjectState) Facts() config.Facts
- func (s *ProjectState) Nested() bool
- func (s *ProjectState) Root() string
- func (s *ProjectState) Roots() resident.Roots
- func (s *ProjectState) Targets() []Target
- type Target
- type TargetOutput
- type TargetOutputInput
- type TargetOutputProducer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KnownTargets ¶
func KnownTargets() []string
KnownTargets returns the known adapter names in sorted order. The bespoke `awf {enable,disable,list} target` path validates against this set (inv: target-cli).
func ValidateTarget ¶
ValidateTarget validates one resolved target declaration.
Types ¶
type AgentDialect ¶
type AgentDialect string
AgentDialect names the target-native encoding for rendered agents.
const ( // MarkdownAgentDialect selects Markdown agent encoding. MarkdownAgentDialect AgentDialect = "markdown" // PlainAgentDialect selects plain-text agent encoding. PlainAgentDialect AgentDialect = "plain" )
type Capability ¶
type Capability string
Capability is an awf-owned template capability. It is deliberately closed: targets cannot inject arbitrary template data.
const ( // CapabilitySubagentTools enables target-native subagent tools. CapabilitySubagentTools Capability = "subagent-tools" // CapabilitySessionHandoff enables target-native session handoff. CapabilitySessionHandoff Capability = "session-handoff" // CapabilityEffortSessions enables target-native effort sessions. CapabilityEffortSessions Capability = "effort-sessions" )
type ProjectState ¶
type ProjectState struct {
// contains filtered or unexported fields
}
ProjectState is the immutable loaded project fact snapshot.
func New ¶
func New(root string, roots resident.Roots, nested bool, cfg *config.Config, selected, complete *catalog.Catalog, targets []Target) (*ProjectState, error)
New constructs immutable loaded project facts from validated Loader inputs.
func NewDerivedWithFacts ¶
func NewDerivedWithFacts(root string, roots resident.Roots, nested bool, facts config.Facts, selected, complete *catalog.Catalog, targets []Target) *ProjectState
NewDerivedWithFacts constructs an already-derived universe while preserving its immutable loaded configuration facts.
func (*ProjectState) Catalog ¶
func (s *ProjectState) Catalog() *catalog.Catalog
Catalog returns a defensive copy of the selected catalog.
func (*ProjectState) CompleteCatalog ¶
func (s *ProjectState) CompleteCatalog() *catalog.Catalog
CompleteCatalog returns a defensive copy of the complete catalog.
func (*ProjectState) Config ¶
func (s *ProjectState) Config() *config.Config
Config returns a defensive copy of the loaded configuration facts.
func (*ProjectState) Facts ¶
func (s *ProjectState) Facts() config.Facts
Facts returns the immutable configuration snapshot.
func (*ProjectState) Nested ¶
func (s *ProjectState) Nested() bool
Nested reports whether the invoking project is nested below its control root.
func (*ProjectState) Root ¶
func (s *ProjectState) Root() string
Root returns the invoking checkout root.
func (*ProjectState) Roots ¶
func (s *ProjectState) Roots() resident.Roots
Roots returns the resolved resident-root facts.
func (*ProjectState) Targets ¶
func (s *ProjectState) Targets() []Target
Targets returns defensive copies of the resolved target declarations.
type Target ¶
type Target struct {
Name string
SkillDir string // dir holding rendered skills, e.g. ".claude/skills"
AgentDir string // dir holding rendered agents, e.g. ".claude/agents"
AgentSuffix string // agent filename suffix, including its extension
AgentDialect AgentDialect
BridgeFile string // adapter bridge file at repo root, "" if none
BridgeTemplate string
// Capabilities is the closed capability declaration exposed through the
// fixed targetTemplateData projection.
Capabilities []Capability
Outputs []TargetOutput
}
Target places adapter (tool-specific) artifacts for one runtime. Neutral artifacts (AGENTS.md, docs, domains) are not target-scoped (ADR-0016).
func BuiltinTarget ¶
BuiltinTarget returns a defensive copy of one named built-in target.
func ResolveTargets ¶
ResolveTargets resolves defensive copies of the closed built-in target declarations.
type TargetOutput ¶
type TargetOutput struct {
Path string
// SkillName derives a target-native skill path; exactly one of it and Path is set.
SkillName string
RequiresSkill string
TemplateID string
Producer TargetOutputProducer
Inputs []TargetOutputInput
Encoder AgentDialect
Provenance render.CommentStyle
Policy outputplan.Policy
PolicyDeclared bool
}
TargetOutput declares a target-owned non-catalog output such as a project extension.
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 declares a template-produced target output. TargetOutputTemplate TargetOutputProducer = "template" )