export

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirtySource = errors.New("source changed since last pack; run agentpaas pack to rebuild")

ErrDirtySource is returned when project source no longer matches the locked digest.

View Source
var ErrNoPublisherIdentity = errors.New("publisher identity not initialized; run agentpaas identity init")

ErrNoPublisherIdentity is returned when publisher identity is missing.

View Source
var ErrV1Lock = errors.New("agent was packed without publisher identity; run agentpaas pack after agentpaas identity init")

ErrV1Lock is returned when the deployed lock is not schema v2 with publisher.

Functions

func CheckDeniedProjectFiles

func CheckDeniedProjectFiles(projectDir string) error

CheckDeniedProjectFiles rejects sensitive filenames even when a project ignore rule would otherwise omit them from the bundle. Ignoring a secret file is not proof that it is safe to export the project.

func ExportIgnoreMatcher

func ExportIgnoreMatcher(projectDir string) (*pack.IgnoreMatcher, error)

ExportIgnoreMatcher returns an IgnoreMatcher for export that matches exactly what pack uses (LoadIgnore). The export source digest MUST match the pack build input digest, so we must use the same ignore matcher — not a custom one with extra patterns.

func IsDeniedExportPath

func IsDeniedExportPath(relPath string) (bool, string)

IsDeniedExportPath reports whether relPath (project-relative, slash-separated) must be rejected before export.

Types

type Config

type Config struct {
	Home           string
	ProjectDir     string
	OutputPath     string
	WithImage      bool
	IncludeGlobs   []string
	SkipConfirm    bool
	PublisherStore identity.KeyStore
	Audit          pack.AuditAppender
}

Config controls the export pipeline.

type FileManifestEntry

type FileManifestEntry struct {
	Path   string `json:"path"`
	Digest string `json:"digest"`
	Bytes  int64  `json:"bytes"`
	Extra  bool   `json:"extra,omitempty"`
}

FileManifestEntry describes one file that would be written into the bundle.

type PreviewResult

type PreviewResult struct {
	AgentName    string
	AgentVersion string
	Files        []FileManifestEntry
}

PreviewResult is returned by Preview before writing a bundle.

func Preview

func Preview(ctx context.Context, cfg Config) (*PreviewResult, error)

Preview validates preconditions and returns the file manifest without writing.

type Result

type Result struct {
	BundleDigest         string
	PublisherFingerprint string
	FileCount            int
	TotalBytes           int64
	OutputPath           string
}

Result is returned after a successful export.

func Run

func Run(ctx context.Context, cfg Config) (*Result, error)

Run executes the full export pipeline (preconditions, secret gate, bundle write).

Jump to

Keyboard shortcuts

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