projectstate

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package projectstate owns immutable loaded project facts and resolved target declarations.

Index

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

func ValidateTarget(target Target) error

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

func BuiltinTarget(name string) Target

BuiltinTarget returns a defensive copy of one named built-in target.

func ResolveTargets

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

ResolveTargets resolves defensive copies of the closed built-in target declarations.

func (Target) AgentPath

func (t Target) AgentPath(name string) string

AgentPath is the output path for a rendered agent under this target.

func (Target) SkillPath

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

SkillPath is the output path for a rendered skill under this target.

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"
)

Jump to

Keyboard shortcuts

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