Documentation
¶
Overview ¶
Package packaging handles agent package creation, verification, and installation.
Index ¶
- Constants
- func GenerateKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func LoadPrivateKey(path string) (ed25519.PrivateKey, error)
- func LoadPublicKey(path string) (ed25519.PublicKey, error)
- func SavePrivateKey(path string, key ed25519.PrivateKey) error
- func SavePublicKey(path string, key ed25519.PublicKey) error
- func Verify(pkg *Package, publicKey ed25519.PublicKey) error
- type Author
- type Input
- type InstallOptions
- type InstallResult
- type Manifest
- type Output
- type PackOptions
- type Package
- type Requirements
Constants ¶
const ( ManifestFile = "manifest.json" ContentFile = "content.tar.gz" SignatureFile = "signature" FormatVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyPair ¶
func GenerateKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
GenerateKeyPair generates a new Ed25519 key pair.
func LoadPrivateKey ¶
func LoadPrivateKey(path string) (ed25519.PrivateKey, error)
LoadPrivateKey loads a private key from a PEM file.
func LoadPublicKey ¶
LoadPublicKey loads a public key from a PEM file.
func SavePrivateKey ¶
func SavePrivateKey(path string, key ed25519.PrivateKey) error
SavePrivateKey saves a private key to a PEM file.
func SavePublicKey ¶
SavePublicKey saves a public key to a PEM file.
Types ¶
type Author ¶
type Author struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
KeyFingerprint string `json:"key_fingerprint,omitempty"`
}
Author represents package author information.
type Input ¶
type Input struct {
Required bool `json:"required,omitempty"`
Default string `json:"default,omitempty"`
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
}
Input represents a package input parameter.
type InstallOptions ¶
type InstallOptions struct {
PackagePath string
TargetDir string // Default: ~/.agent/packages/
PublicKey ed25519.PublicKey
NoDeps bool
DryRun bool
}
InstallOptions configures package installation.
type InstallResult ¶
type InstallResult struct {
Installed []string // Package names installed
Dependencies []string // Dependency names (for display)
InstallPath string // Where package was installed
}
InstallResult contains installation results.
func Install ¶
func Install(opts InstallOptions) (*InstallResult, error)
Install installs a package.
type Manifest ¶
type Manifest struct {
Format int `json:"format"`
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
Author *Author `json:"author,omitempty"`
License string `json:"license,omitempty"`
Inputs map[string]Input `json:"inputs,omitempty"`
Outputs map[string]Output `json:"outputs,omitempty"`
Requires *Requirements `json:"requires,omitempty"`
Dependencies map[string]string `json:"dependencies,omitempty"`
CreatedAt string `json:"created_at"`
}
Manifest represents the public API of an agent package.
type Output ¶
type Output struct {
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
}
Output represents a package output.
type PackOptions ¶
type PackOptions struct {
SourceDir string
OutputPath string
PrivateKey ed25519.PrivateKey
Author *Author
Description string
License string
}
PackOptions configures package creation.
type Package ¶
type Package struct {
Manifest *Manifest
Content []byte // tar.gz of agent files
Signature []byte // Raw Ed25519 signature (64 bytes)
Path string
}
Package represents a loaded agent package.
func LoadByName ¶
LoadByName loads a package by name from a base directory.
func LoadFromPath ¶
LoadFromPath loads a package from a file path (convenience wrapper for Load).
func Pack ¶
func Pack(opts PackOptions) (*Package, error)
Pack creates an agent package from a directory.
func (*Package) ExtractToTemp ¶
ExtractToTemp extracts package contents to a temporary directory.
func (*Package) GetAgentfile ¶
GetAgentfile returns the Agentfile content from the package.
type Requirements ¶
type Requirements struct {
Profiles []string `json:"profiles,omitempty"`
Tools []string `json:"tools,omitempty"`
}
Requirements represents runtime requirements.