pack

package
v2.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pack provides SDK-side loading and conversion for PromptPacks.

The pack data types are the runtime's canonical types, aliased in alias.go. This file adds the behavior the SDK needs on top of them: schema-validated loading, and conversion into the runtime prompt.Registry / tool repository consumed by the pipeline.

Package pack provides internal pack loading functionality.

Index

Constants

This section is empty.

Variables

View Source
var ValidatorValues = prompt.ValidatorValues

ValidatorValues dereferences the generated Prompt's []*Validator into values.

Functions

func ToPromptRegistry

func ToPromptRegistry(p *Pack) *prompt.Registry

ToPromptRegistry builds a prompt.Registry from the pack so the SDK uses the same PromptAssemblyMiddleware as Arena.

func ToToolRepository

func ToToolRepository(p *Pack) *memory.ToolRepository

ToToolRepository builds a memory.ToolRepository from the pack so the SDK uses the same tools.Registry as Arena. Pack tools are registered with mode "local" as a placeholder; the host binds the real execution mode.

func ValidateAgainstSchema

func ValidateAgainstSchema(data []byte) error

ValidateAgainstSchema validates pack JSON data against the PromptPack schema. It uses the $schema URL from the pack if present, otherwise uses the embedded schema. The PROMPTKIT_SCHEMA_SOURCE environment variable can override this behavior:

  • "local": Always use embedded schema (default, for offline support)
  • "remote": Always fetch from URL
  • file path: Load schema from local file

Returns nil if validation passes, or a SchemaValidationError with details.

Types

type AgentDef

type AgentDef = prompt.AgentDef

AgentDef is A2A agent-card metadata for a single prompt.

type AgentsConfig

type AgentsConfig = prompt.AgentsConfig

AgentsConfig maps prompts to A2A agent definitions.

type AgentsValidationError

type AgentsValidationError struct {
	Errors []string
}

AgentsValidationError represents an agents section validation error with details.

func (*AgentsValidationError) Error

func (e *AgentsValidationError) Error() string

type GovernanceValidationError added in v2.13.0

type GovernanceValidationError struct {
	Errors   []string
	Warnings []string
}

GovernanceValidationError reports RFC 0016 governance references that do not resolve. Warnings found alongside the errors are carried too.

func (*GovernanceValidationError) Error added in v2.13.0

func (e *GovernanceValidationError) Error() string

type LoadOptions

type LoadOptions struct {
	// SkipSchemaValidation disables JSON schema validation during load.
	// Default is false (validation enabled).
	SkipSchemaValidation bool
}

LoadOptions configures pack loading behavior.

type MediaConfig

type MediaConfig = prompt.MediaConfig

MediaConfig is a prompt's multimodal media configuration.

type Pack

type Pack = prompt.Pack

Pack is the runtime's PromptPack type.

func Load

func Load(path string, opts ...LoadOptions) (*Pack, error)

Load loads a pack from a JSON file. By default, the pack is validated against the PromptPack JSON schema. Use LoadOptions to customize behavior.

func Parse

func Parse(data []byte) (*Pack, error)

Parse parses pack JSON data.

type Parameters

type Parameters = prompt.ParametersPack

Parameters holds model parameters for a prompt.

type Prompt

type Prompt = prompt.PackPrompt

Prompt is a single prompt definition within a pack.

type SchemaValidationError

type SchemaValidationError struct {
	Errors []string
}

SchemaValidationError represents a schema validation error with details.

func (*SchemaValidationError) Error

func (e *SchemaValidationError) Error() string

type SkillSourceConfig

type SkillSourceConfig = prompt.SkillSourceConfig

SkillSourceConfig declares a skill source for the pack.

type Tool

type Tool = prompt.PackTool

Tool is a pack-level tool definition.

type ToolPolicy

type ToolPolicy = prompt.ToolPolicyPack

ToolPolicy governs how a prompt may use tools.

type Validator

type Validator = prompt.Validator

Validator is a compiled, spec-exact pack validator.

type Variable

type Variable = prompt.Variable

Variable is a spec-exact compiled prompt template variable (no Binding).

type WorkflowArtifactDef

type WorkflowArtifactDef = workflow.ArtifactDef

WorkflowArtifactDef declares a workflow artifact.

type WorkflowSpec

type WorkflowSpec = workflow.Spec

WorkflowSpec is a pack's workflow state-machine specification.

type WorkflowState

type WorkflowState = workflow.State

WorkflowState is a single state within a workflow.

type WorkflowValidationError

type WorkflowValidationError struct {
	Errors   []string
	Warnings []string
}

WorkflowValidationError represents a workflow section validation error with details.

func (*WorkflowValidationError) Error

func (e *WorkflowValidationError) Error() string

Jump to

Keyboard shortcuts

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