compiler

package
v1.3.26 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package compiler provides a reusable compilation pipeline for PromptKit packs. It extracts the core compilation logic from the packc CLI so it can be used programmatically by other tools and libraries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSkillErrors

func ValidateSkillErrors(pack *prompt.Pack, packDir string) []string

ValidateSkillErrors returns blocking errors for skill configuration in the pack.

func ValidateSkills

func ValidateSkills(pack *prompt.Pack, packDir string) []string

ValidateSkills returns non-blocking warnings for skill configuration in the pack.

Types

type CompileResult

type CompileResult struct {
	// Pack is the compiled prompt pack.
	Pack *prompt.Pack
	// JSON is the pack serialized as indented JSON.
	JSON []byte
	// Warnings contains non-fatal warnings from the compilation process.
	Warnings []string
}

CompileResult contains the output of a successful compilation.

func Compile

func Compile(configFile string, opts ...Option) (*CompileResult, error)

Compile loads an arena config file and compiles all prompts into a single pack. It performs media validation, skill validation, workflow validation, and schema validation (unless skipped). Errors are returned rather than printed or causing os.Exit.

type Option

type Option func(*compileOptions)

Option configures the compilation behavior.

func WithCompilerVersion

func WithCompilerVersion(v string) Option

WithCompilerVersion sets the compiler version string embedded in the pack. If not provided, defaults to "compiler-dev".

func WithPackID

func WithPackID(id string) Option

WithPackID sets the pack identifier. If not provided, a default is derived from the config file's parent directory name.

func WithSkipSchemaValidation

func WithSkipSchemaValidation() Option

WithSkipSchemaValidation disables JSON schema validation of the compiled pack.

Jump to

Keyboard shortcuts

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