pack

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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

This section is empty.

Functions

func ToPromptRegistry added in v1.5.5

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 added in v1.5.5

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 added in v1.3.1

type AgentDef = prompt.AgentDef

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

type AgentsConfig added in v1.3.1

type AgentsConfig = prompt.AgentsConfig

AgentsConfig maps prompts to A2A agent definitions.

type AgentsValidationError added in v1.3.1

type AgentsValidationError struct {
	Errors []string
}

AgentsValidationError represents an agents section validation error with details.

func (*AgentsValidationError) Error added in v1.3.1

func (e *AgentsValidationError) 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 added in v1.3.1

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 added in v1.3.24

type WorkflowArtifactDef = workflow.ArtifactDef

WorkflowArtifactDef declares a workflow artifact.

type WorkflowSpec added in v1.3.1

type WorkflowSpec = workflow.Spec

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

type WorkflowState added in v1.3.1

type WorkflowState = workflow.State

WorkflowState is a single state within a workflow.

type WorkflowValidationError added in v1.3.1

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

WorkflowValidationError represents a workflow section validation error with details.

func (*WorkflowValidationError) Error added in v1.3.1

func (e *WorkflowValidationError) Error() string

Jump to

Keyboard shortcuts

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