aw

package
v0.92.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package aw defines the source AST for agentic workflow Markdown files.

Document separates YAML frontmatter from the Markdown prompt and retains source locations for diagnostics. Parse uses the shared frontmatter parser; Emit preserves unchanged source verbatim, including comments, shorthands, line endings, and prompt whitespace. Edited frontmatter is serialized deterministically without losing fields that are not modeled by a typed view.

Frontmatter retains the complete AW configuration, including engine, tools, imports, safe outputs, triggers, and custom jobs. Schema validation, import resolution, and typed configuration parsing remain the compiler's job.

workflow.Compiler.ParseWorkflowDocument accepts this source AST, and CompileDocument lowers it through the existing compiler to an actions.Workflow. The AW source AST and the native Actions execution AST are separate stages; AW-specific fields are never emitted as native Actions workflow properties.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(document *Document) (string, error)

Emit preserves unchanged regions verbatim. New or edited frontmatter uses canonical YAML; Markdown edits are emitted exactly as supplied.

Types

type Document

type Document struct {
	Frontmatter map[string]any
	Markdown    string
	Location    SourceLocation
	// contains filtered or unexported fields
}

Document represents an AW .md source file before imports or compiler defaults have been applied. Frontmatter is the authoritative configuration.

func Parse

func Parse(content string) (*Document, error)

Parse accepts main workflows, shared imports, redirect placeholders, and plain Markdown. Semantic workflow validation happens during compilation.

func (*Document) FrontmatterResult

func (document *Document) FrontmatterResult() *parser.FrontmatterResult

FrontmatterResult returns an independent parser view. Compiler preprocessing may mutate it without modifying the authored document or its source metadata.

type SourceLocation

type SourceLocation struct {
	FrontmatterLines []string
	FrontmatterStart int
	FieldLines       map[string]int
}

Jump to

Keyboard shortcuts

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