askcontext

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BeginCLIDocMarker       = "<!-- BEGIN GENERATED:ASK_CLI_CONTEXT -->"
	EndCLIDocMarker         = "<!-- END GENERATED:ASK_CLI_CONTEXT -->"
	BeginAuthoringDocMarker = "<!-- BEGIN GENERATED:ASK_AUTHORING_CONTEXT -->"
	EndAuthoringDocMarker   = "<!-- END GENERATED:ASK_AUTHORING_CONTEXT -->"
)

Variables

This section is empty.

Functions

func AllowedGeneratedPath

func AllowedGeneratedPath(path string) bool

func AllowedGeneratedPathPatterns

func AllowedGeneratedPathPatterns() []string

func AuthoringDocBlock

func AuthoringDocBlock() string

func CLIDocBlock

func CLIDocBlock() string

func CLIHintsBlock

func CLIHintsBlock() string

func ComponentGuidanceBlock

func ComponentGuidanceBlock() string

func GlobalAuthoringBlock

func GlobalAuthoringBlock() string

func RoleGuidanceBlock

func RoleGuidanceBlock() string

func SyncManagedBlocks

func SyncManagedBlocks(content string) string

func SyncedAuthoringDocBlock

func SyncedAuthoringDocBlock() string

func SyncedCLIDocBlock

func SyncedCLIDocBlock() string

func ValidationFixesForError added in v0.2.0

func ValidationFixesForError(message string) []string

func VarsGuidanceBlock

func VarsGuidanceBlock() string

func WorkspaceTopologyBlock

func WorkspaceTopologyBlock() string

Types

type AskCommandMetadata

type AskCommandMetadata struct {
	Short  string
	Plan   AskPlanCommandMetadata
	Config AskConfigCommandMetadata
	Flags  []CLIFlag
}

func AskCommandMeta

func AskCommandMeta() AskCommandMetadata

type AskCommandSpec added in v0.2.2

type AskCommandSpec struct {
	Root   CLICommandSpec
	Plan   CLICommandSpec
	Config CLICommandSpec
}

func CurrentCommandSpec added in v0.2.2

func CurrentCommandSpec() AskCommandSpec

type AskConfigCommandMetadata

type AskConfigCommandMetadata struct {
	Short string
}

type AskPlanCommandMetadata

type AskPlanCommandMetadata struct {
	Short string
	Long  string
	Flags []CLIFlag
}

type AuthoringPolicy added in v0.2.0

type AuthoringPolicy struct {
	AssumeOfflineByDefault bool
	PrepareArtifactKinds   []string
	ForbiddenApplyActions  []string
	VarsAdvisory           []string
	ComponentAdvisory      []string
}

type Bundle added in v0.2.2

type Bundle struct {
	Workflow    WorkflowKnowledge
	Topology    TopologyKnowledge
	Components  ComponentKnowledge
	Vars        VarsKnowledge
	Policy      PolicyKnowledge
	Steps       []StepKnowledge
	Constraints []ConstraintKnowledge
}

func CurrentBundle added in v0.2.2

func CurrentBundle() Bundle

func (Bundle) ComponentPromptBlock added in v0.2.2

func (b Bundle) ComponentPromptBlock() string

func (Bundle) ConstraintPromptBlock added in v0.2.2

func (b Bundle) ConstraintPromptBlock(stepKinds []string) string

func (Bundle) PolicyPromptBlock added in v0.2.2

func (b Bundle) PolicyPromptBlock() string

func (Bundle) VarsPromptBlock added in v0.2.2

func (b Bundle) VarsPromptBlock() string

func (Bundle) WorkflowPromptBlock added in v0.2.2

func (b Bundle) WorkflowPromptBlock() string

type CLICommandSpec added in v0.2.2

type CLICommandSpec struct {
	Use   string
	Short string
	Long  string
	Flags []CLIFlag
}

type CLIContext

type CLIContext struct {
	Command             string
	PlanSubcommand      string
	ConfigSubcommand    string
	TopLevelDescription string
	ImportantFlags      []CLIFlag
	Examples            []string
}

type CLIFlag

type CLIFlag struct {
	Name        string
	Description string
}

type ComponentGuidance

type ComponentGuidance struct {
	Summary         string
	ImportRule      string
	ReuseRule       string
	LocationRule    string
	FragmentRule    string
	ImportExample   string
	FragmentExample string
}

type ComponentKnowledge added in v0.2.2

type ComponentKnowledge struct {
	ImportRule      string
	FragmentRule    string
	ImportExample   string
	FragmentExample string
	AllowedRootKeys []string
}

type ConstrainedFieldHint added in v0.2.0

type ConstrainedFieldHint struct {
	Path          string
	AllowedValues []string
	Guidance      string
}

type ConstraintKnowledge added in v0.2.2

type ConstraintKnowledge struct {
	StepKind      string
	Path          string
	AllowedValues []string
	Guidance      string
	SourceRef     string
}

type Manifest

type Manifest struct {
	CLI        CLIContext
	Topology   WorkspaceTopology
	Workflow   WorkflowRules
	Policy     AuthoringPolicy
	Modes      []ModeGuidance
	Components ComponentGuidance
	Vars       VarsGuidance
	StepKinds  []StepKindContext
}

func Current

func Current() Manifest

type ModeGuidance

type ModeGuidance struct {
	Mode        string
	Summary     string
	WhenToUse   string
	Prefer      []string
	Avoid       []string
	OutputFiles []string
}

type PolicyKnowledge added in v0.2.2

type PolicyKnowledge struct {
	AssumeOfflineByDefault bool
	PrepareArtifactKinds   []string
	ForbiddenApplyActions  []string
	VarsAdvisory           []string
	ComponentAdvisory      []string
}

type PromptBlock

type PromptBlock struct {
	Topic   Topic
	Title   string
	Content string
}

func CLIHintsPromptBlock

func CLIHintsPromptBlock() PromptBlock

func ComponentGuidancePromptBlock

func ComponentGuidancePromptBlock() PromptBlock

func InvariantPromptBlock

func InvariantPromptBlock() PromptBlock

func PolicyPromptBlock

func PolicyPromptBlock() PromptBlock

func RoleGuidancePromptBlock

func RoleGuidancePromptBlock() PromptBlock

func VarsGuidancePromptBlock

func VarsGuidancePromptBlock() PromptBlock

func WorkspaceTopologyPromptBlock

func WorkspaceTopologyPromptBlock() PromptBlock

type QualityRule added in v0.2.0

type QualityRule struct {
	Trigger string
	Message string
	Level   string
}

type SelectedStepGuidance added in v0.2.0

type SelectedStepGuidance struct {
	Step        StepKindContext
	Confidence  string
	Reasons     []string
	WhyRelevant string
}

func DiscoverCandidateSteps added in v0.2.0

func DiscoverCandidateSteps(prompt string) []SelectedStepGuidance

func DiscoverCandidateStepsWithOptions added in v0.2.0

func DiscoverCandidateStepsWithOptions(prompt string, options StepGuidanceOptions) []SelectedStepGuidance

func SelectStepGuidance added in v0.2.0

func SelectStepGuidance(prompt string) []SelectedStepGuidance

func SelectStepGuidanceWithOptions added in v0.2.0

func SelectStepGuidanceWithOptions(prompt string, options StepGuidanceOptions) []SelectedStepGuidance

type StepActionContext

type StepActionContext struct {
	Action  string
	Note    string
	Example string
}

type StepExampleContext added in v0.2.0

type StepExampleContext struct {
	Purpose string
	YAML    string
}

type StepFieldContext

type StepFieldContext struct {
	Path        string
	Description string
	Example     string
	Requirement string
}

type StepGuidanceOptions added in v0.2.0

type StepGuidanceOptions struct {
	ModeIntent           string
	Topology             string
	RequiredCapabilities []string
}

type StepKindContext

type StepKindContext struct {
	Kind                     string
	Category                 string
	Group                    string
	GroupTitle               string
	GroupAliases             []string
	Summary                  string
	WhenToUse                string
	SchemaFile               string
	AllowedRoles             []string
	Actions                  []string
	Outputs                  []string
	MinimalShape             string
	CuratedShape             string
	KeyFields                []StepFieldContext
	SchemaRuleSummaries      []string
	ActionGuides             []StepActionContext
	PromptExamples           []StepExampleContext
	ValidationHints          []ValidationHint
	ConstrainedLiteralFields []ConstrainedFieldHint
	Capabilities             []string
	ProducesArtifacts        []string
	ConsumesArtifacts        []string
	PublishesState           []string
	ConsumesState            []string
	RoleSensitive            bool
	VerificationRelated      bool
	MatchSignals             []string
	AntiSignals              []string
	QualityRules             []QualityRule
	Notes                    []string
}

func RelevantStepKinds

func RelevantStepKinds(prompt string) []StepKindContext

func RelevantStepKindsWithOptions added in v0.2.0

func RelevantStepKindsWithOptions(prompt string, options StepGuidanceOptions) []StepKindContext

func StepKind added in v0.2.0

func StepKind(kind string) (StepKindContext, bool)

func StrongTypedAlternatives added in v0.2.0

func StrongTypedAlternatives(prompt string) []StepKindContext

func StrongTypedAlternativesWithOptions added in v0.2.0

func StrongTypedAlternativesWithOptions(prompt string, options StepGuidanceOptions) []StepKindContext

type StepKnowledge added in v0.2.2

type StepKnowledge struct {
	Kind                     string
	Category                 string
	Group                    string
	GroupTitle               string
	GroupAliases             []string
	Summary                  string
	WhenToUse                string
	SchemaFile               string
	AllowedRoles             []string
	Outputs                  []string
	Example                  string
	KeyFields                []StepFieldContext
	SchemaRuleSummaries      []string
	ConstrainedLiteralFields []ConstrainedFieldHint
}

type Topic

type Topic string
const (
	TopicWorkflowInvariants   Topic = "workflow-invariants"
	TopicPolicy               Topic = "policy"
	TopicWorkspaceTopology    Topic = "workspace-topology"
	TopicPrepareApplyGuidance Topic = "prepare-apply-guidance"
	TopicComponentsImports    Topic = "components-imports"
	TopicVarsGuidance         Topic = "vars-guidance"
	TopicTypedSteps           Topic = "typed-steps"
	TopicStepQuality          Topic = "step-quality-rules"
	TopicCLIHints             Topic = "cli-hints"
	TopicProjectPhilosophy    Topic = "project-philosophy"
	TopicLocalFacts           Topic = "local-facts"
	TopicExternalEvidence     Topic = "external-evidence"
)

type TopologyKnowledge added in v0.2.2

type TopologyKnowledge struct {
	WorkflowRoot     string
	ScenarioDir      string
	ComponentDir     string
	VarsPath         string
	CanonicalPrepare string
	CanonicalApply   string
	AllowedPaths     []string
}

type ValidationHint added in v0.2.0

type ValidationHint struct {
	ErrorContains string
	Fix           string
}

type VarsGuidance

type VarsGuidance struct {
	Path        string
	Summary     string
	PreferFor   []string
	AvoidFor    []string
	ExampleKeys []string
}

type VarsKnowledge added in v0.2.2

type VarsKnowledge struct {
	Path        string
	Summary     string
	PreferFor   []string
	AvoidFor    []string
	ExampleKeys []string
}

type WorkflowKnowledge added in v0.2.2

type WorkflowKnowledge struct {
	SupportedRoles   []string
	SupportedVersion string
	TopLevelModes    []string
	RequiredFields   []string
	Notes            []string
	PhaseExample     string
	StepsExample     string
}

type WorkflowRules

type WorkflowRules struct {
	Summary          string
	TopLevelModes    []string
	SupportedModes   []string
	SupportedVersion string
	ImportRule       string
	RequiredFields   []string
	PhaseRules       []string
	StepRules        []string
	PhaseExample     string
	StepsExample     string
	Notes            []string
}

type WorkspaceTopology

type WorkspaceTopology struct {
	WorkflowRoot      string
	ScenarioDir       string
	ComponentDir      string
	VarsPath          string
	AllowedPaths      []string
	CanonicalPrepare  string
	CanonicalApply    string
	GeneratedPathNote string
}

Jump to

Keyboard shortcuts

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