resolve

package
v1.0.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package resolve resolves FROM inheritance by pulling parent agent artifacts and merging them with child instructions.

The pipeline is: parse → resolve → build → execute.

FROM scratch is a no-op. FROM <ref> pulls the parent, recursively resolves its own FROM, then merges according to the inheritance rules:

  • RUNTIME: child overrides parent, clears configs
  • MODEL, NAME: child overrides parent
  • CONTEXT: same-name overrides parent, new names appended
  • CONFIG: appended (cleared if child sets RUNTIME)
  • BIN: appended
  • ADD: appended
  • LABEL: merged (child wins on key conflicts)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(ctx context.Context, af *spec.Agentfile, fetch Fetcher) (*spec.Agentfile, error)

Resolve resolves FROM inheritance. If af.Agent.From is "scratch", the Agentfile is returned as-is. Otherwise, the parent is fetched, recursively resolved, and merged.

Types

type Fetcher

type Fetcher func(ctx context.Context, ref spec.Reference) (*spec.Agentfile, error)

Fetcher pulls a parent agent artifact by OCI reference and returns the parsed Agentfile.

Jump to

Keyboard shortcuts

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