pack

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package pack defines the gridctl pack manifest: a versioned selector over a repo's skills, agents, context rule fragments, and gateway wiring, so one git import configures a whole team setup. This package is deliberately thin — types, parsing, and validation only. There is no pack engine: the CLI expands a manifest into calls against the existing kind managers (skillsync, agentsync, contexts, wiring), which own every write.

Field names align with the Claude Code plugin.json family where the semantics match (name, version, description, author, skills, agents), so a pack maps onto that ecosystem instead of fighting it. The word "bundle" is avoided: the MCP ecosystem uses it for .mcpb, a single-server archive format.

Index

Constants

View Source
const APIVersion = "gridctl.dev/v1"

APIVersion is the current manifest schema, emitted by everything gridctl writes and documented as the value authors should use.

View Source
const Kind = "Pack"

Kind is the manifest's required kind value.

View Source
const LegacyAPIVersion = "gridctl.dev/v1alpha1"

LegacyAPIVersion is the pre-1.0 alpha schema. It is structurally identical to APIVersion and stays accepted indefinitely so packs authored before the graduation keep importing (Article IX).

View Source
const ManifestFileName = "gridctl-pack.yaml"

ManifestFileName is the fixed manifest location at a repo root.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
	URL  string `yaml:"url,omitempty" json:"url,omitempty"`
}

Author identifies a pack's maintainer (plugin.json-aligned subset).

type Manifest

type Manifest struct {
	APIVersion  string `yaml:"apiVersion" json:"apiVersion"`
	Kind        string `yaml:"kind" json:"kind"`
	Name        string `yaml:"name" json:"name"`
	Version     string `yaml:"version,omitempty" json:"version,omitempty"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	Author      Author `yaml:"author,omitempty" json:"author,omitempty"`
	// Sources names external git repositories this pack selects from.
	// Empty means every selection comes from this repository.
	Sources map[string]Source `yaml:"sources,omitempty" json:"sources,omitempty"`
	// Skills and Agents select resources by name. A string entry (Source
	// empty) comes from this repository. A mapping names a declared source.
	// Empty means every resource of that kind discovered in this repository
	// only; external sources are never import-all.
	Skills []Selection `yaml:"skills,omitempty" json:"skills,omitempty"`
	Agents []Selection `yaml:"agents,omitempty" json:"agents,omitempty"`
	// Wiring asks apply to ensure the gateway entry is present in the
	// selected clients (empty Clients = all detected).
	Wiring  bool     `yaml:"wiring,omitempty" json:"wiring,omitempty"`
	Clients []string `yaml:"clients,omitempty" json:"clients,omitempty"`
	// Rules selects context rule fragments from the pack repo's
	// rules/*.md (or fragments/*.md) discovery. Empty means none
	// (rules are opt-in, never import-all).
	Rules []string `yaml:"rules,omitempty" json:"rules,omitempty"`
	// Variables documents value-free prerequisites. Installing a pack never
	// writes these declarations to a stack or variable store.
	Variables map[string]VariableDeclaration `yaml:"variables,omitempty" json:"variables,omitempty"`
	// Stack names a stack file inside this repository. Empty means the
	// pack carries no stack and apply does not start a gateway.
	Stack string `yaml:"stack,omitempty" json:"stack,omitempty"`
}

Manifest is a parsed gridctl-pack.yaml.

func Parse

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

Parse decodes and validates a manifest.

func ParseFile

func ParseFile(path string) (*Manifest, error)

ParseFile reads and parses a manifest from path. A missing file reports os.IsNotExist-compatible errors so callers can distinguish "no manifest" from "broken manifest".

func (*Manifest) AgentNames

func (m *Manifest) AgentNames() []string

AgentNames returns agent selections that come from the pack repository.

func (*Manifest) SkillNames

func (m *Manifest) SkillNames() []string

SkillNames returns skill selections that come from the pack repository.

func (*Manifest) Validate

func (m *Manifest) Validate() error

Validate checks the manifest's schema envelope and name.

func (*Manifest) Warnings

func (m *Manifest) Warnings() []string

Warnings reports advisory conditions a valid manifest still carries. Currently none; the reserved-rules warning was removed when the rules fragment library activated.

type Selection

type Selection struct {
	Name   string `yaml:"name" json:"name"`
	Source string `yaml:"source,omitempty" json:"source,omitempty"`
}

Selection is one skill or agent name. A scalar is a name from the pack repository. A mapping names a resource in a declared source. JSON encoding is always the object form.

func (*Selection) UnmarshalYAML

func (s *Selection) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML accepts a scalar name or a mapping with name and source. A mapping that omits either key is an error that names the line.

type Source

type Source struct {
	Repo string      `yaml:"repo" json:"repo"`
	Ref  string      `yaml:"ref,omitempty" json:"ref,omitempty"`
	Path string      `yaml:"path,omitempty" json:"path,omitempty"`
	Auth *SourceAuth `yaml:"auth,omitempty" json:"auth,omitempty"`
}

Source is one external git repository a pack selects skills and agents from. Field names and YAML tags mirror skills.SkillSource. A source is a repository the pack author chose, pinned by commit at import, not an index entry.

type SourceAuth

type SourceAuth struct {
	Method        string `yaml:"method,omitempty" json:"method,omitempty"`
	CredentialRef string `yaml:"credential_ref,omitempty" json:"credentialRef,omitempty"`
	SSHUser       string `yaml:"ssh_user,omitempty" json:"sshUser,omitempty"`
	// contains filtered or unexported fields
}

SourceAuth is the declarative auth block on a pack source. It mirrors skills.SourceAuth except ssh_key_path, which a manifest must not carry: a key path is a caller secret, not pack content. UnmarshalYAML captures that key so validation can refuse it by name instead of dropping it.

func (*SourceAuth) HasSSHKeyPath

func (a *SourceAuth) HasSSHKeyPath() bool

HasSSHKeyPath reports whether the manifest named ssh_key_path.

func (*SourceAuth) UnmarshalYAML

func (a *SourceAuth) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML decodes the auth block and remembers ssh_key_path so Validate can reject it explicitly.

type VariableDeclaration

type VariableDeclaration struct {
	Required    *bool  `yaml:"required,omitempty" json:"required,omitempty"`
	Secret      *bool  `yaml:"secret,omitempty" json:"secret,omitempty"`
	Type        string `yaml:"type,omitempty" json:"type,omitempty"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	Docs        string `yaml:"docs,omitempty" json:"docs,omitempty"`
}

VariableDeclaration documents a pack prerequisite.

Jump to

Keyboard shortcuts

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