resolve

package
v1.0.0-alpha.53 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 4 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 spec's inheritance table (AGENTFILE-v1.0.0.md, Merge Semantics):

  • RUNTIME: replace; if the child sets it, all parent CONFIGs are dropped
  • MODEL, NAME, EXEC: replace
  • CONTEXT: keyed-merge by name
  • CONFIG: append (dropped entirely if child sets RUNTIME)
  • BIN, ADD, ENV: append
  • LABEL, ARG: keyed-merge (child wins)
  • CAPABILITY: set-union

The parent chain must be acyclic; a repeated ref is a resolve error.

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. A cycle in the parent chain is an error.

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