Documentation
¶
Index ¶
- Constants
- Variables
- func Init(cfg InitConfig) (string, error)
- func MaxSkillNameLength(prefix, suffix string) int
- func ParseStoragePath(storagePath string) (string, string, error)
- func ReferencingConsumers(ctx context.Context, reader client.Reader, key client.ObjectKey) ([]string, error)
- func Validate(skillDir string) error
- func ValidateName(name string) error
- func ValidateNames(names []string) error
- func ValidateReferences(ctx context.Context, reader client.Reader, namespace string, ...) field.ErrorList
- type Bundle
- type Client
- func (c *Client) DeleteImmutableSkill(ctx context.Context, namespace, name string) error
- func (c *Client) DeleteVersion(ctx context.Context, namespace, name string, version int64) error
- func (c *Client) DownloadManifest(ctx context.Context, manifestPath, targetDir string) error
- func (c *Client) UploadVersion(ctx context.Context, namespace string, tree Tree, version int64) error
- func (c *Client) VersionSummary(ctx context.Context, namespace, name string, version int64) (Summary, error)
- func (c *Client) Versions(ctx context.Context, namespace, name string) ([]int64, error)
- func (c *Client) WriteVersionsZIP(ctx context.Context, w io.Writer, selections []VersionSelection) error
- type Config
- type Decision
- type DecisionAction
- type File
- type ImportIssue
- type ImportIssueKind
- type InitConfig
- type Manifest
- type ManifestSkill
- type Summary
- type Tree
- type VersionSelection
Constants ¶
const ( // BucketSecretName is the tenant namespace Secret mounted by Agent init containers. BucketSecretName = "agentz-immutable-skills-bucket" // BucketSecretEndpointKey stores the S3-compatible endpoint URL. BucketSecretEndpointKey = "endpoint" // BucketSecretRegionKey stores the S3 region. BucketSecretRegionKey = "region" // BucketSecretBucketKey stores the bucket name. BucketSecretBucketKey = "bucket" // BucketSecretAccessKeyIDKey stores the S3 access key ID. BucketSecretAccessKeyIDKey = "access-key-id" // BucketSecretSecretAccessKeyKey stores the S3 secret access key. BucketSecretSecretAccessKeyKey = "secret-access-key" )
const KubernetesDNSLabelMax = 63
KubernetesDNSLabelMax is the storage limit for immutable skill names.
Variables ¶
var ErrVersionExists = errors.New("immutable skill version already exists")
ErrVersionExists indicates that an immutable version's first object already exists and the version cannot be created conditionally.
Functions ¶
func Init ¶
func Init(cfg InitConfig) (string, error)
Init creates a new skill directory and writes its initial SKILL.md.
func MaxSkillNameLength ¶
MaxSkillNameLength returns the available Kubernetes DNS-label name length.
func ParseStoragePath ¶
ParseStoragePath splits an S3 storage URI into its bucket and object prefix.
func ReferencingConsumers ¶
func ReferencingConsumers(ctx context.Context, reader client.Reader, key client.ObjectKey) ([]string, error)
ReferencingConsumers finds direct references before deletion or finalization. Namespace identity, rather than current sharing permissions, determines whether a reference still protects the skill's stored versions.
func ValidateName ¶
ValidateName checks the Kubernetes DNS-label skill name contract.
func ValidateNames ¶
ValidateNames checks the count, canonical syntax, and uniqueness of a skill name set used by batch operations.
func ValidateReferences ¶
func ValidateReferences(ctx context.Context, reader client.Reader, namespace string, refs []agentzv1alpha1.ResourceReference) field.ErrorList
ValidateReferences prevents consumers from attaching missing or deleting skills.
Types ¶
type Bundle ¶
type Bundle struct {
Skills []Tree
}
Bundle is a validated set of imported skills.
func ParseCanonicalZIP ¶
ParseCanonicalZIP revalidates a gateway-generated ZIP whose size may exceed the public upload limit after canonical re-encoding.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps object storage operations needed by immutable skills.
func (*Client) DeleteImmutableSkill ¶
DeleteImmutableSkill deletes every stored version of one immutable skill.
func (*Client) DeleteVersion ¶
DeleteVersion deletes one stored immutable skill version.
func (*Client) DownloadManifest ¶
DownloadManifest stages all immutable skills from manifestPath into targetDir.
func (*Client) UploadVersion ¶
func (c *Client) UploadVersion(ctx context.Context, namespace string, tree Tree, version int64) error
UploadVersion conditionally creates one complete immutable skill version.
func (*Client) VersionSummary ¶
func (c *Client) VersionSummary(ctx context.Context, namespace, name string, version int64) (Summary, error)
VersionSummary calculates file metadata for one immutable skill version.
func (*Client) Versions ¶
Versions returns sorted immutable skill versions present in object storage.
func (*Client) WriteVersionsZIP ¶
func (c *Client) WriteVersionsZIP(ctx context.Context, w io.Writer, selections []VersionSelection) error
WriteVersionsZIP streams immutable skill versions into a portable ZIP.
type Config ¶
type Config struct {
Endpoint string
Region string
Bucket string
AccessKeyID string
SecretAccessKey string
}
Config contains S3-compatible object storage settings.
func ConfigFromDir ¶
ConfigFromDir reads a mounted Kubernetes Secret directory into Config.
func (Config) SecretData ¶
SecretData returns Kubernetes Secret data for immutable skill downloads.
func (Config) StoragePath ¶
StoragePath returns the full S3 URI for one immutable skill version.
type Decision ¶
type Decision struct {
Action DecisionAction `json:"action"`
Name string `json:"name"`
Rename string `json:"rename,omitempty"`
}
Decision selects the destination and precondition for one imported skill.
type DecisionAction ¶
type DecisionAction string
DecisionAction describes how an imported skill is applied.
const ( // DecisionCreate requires the destination not to exist. DecisionCreate DecisionAction = "create" // DecisionOverwrite requires the destination to exist. DecisionOverwrite DecisionAction = "overwrite" // DecisionRename creates a skill under a different name. DecisionRename DecisionAction = "rename" )
type ImportIssue ¶
type ImportIssue struct {
Kind ImportIssueKind
Path string
Message string
}
ImportIssue describes one safe, path-specific import failure.
func (*ImportIssue) Error ¶
func (i *ImportIssue) Error() string
type ImportIssueKind ¶
type ImportIssueKind string
ImportIssueKind identifies a stable skill-import failure category.
const ( ImportIssueUnsupportedFileType ImportIssueKind = "unsupported_file_type" ImportIssueInvalidArchive ImportIssueKind = "invalid_archive" ImportIssueInvalidTree ImportIssueKind = "invalid_tree" ImportIssueMalformedFrontmatter ImportIssueKind = "malformed_frontmatter" ImportIssueInvalidName ImportIssueKind = "invalid_name" ImportIssueInvalidDescription ImportIssueKind = "invalid_description" ImportIssueInvalidUTF8 ImportIssueKind = "invalid_utf8" ImportIssueLimitExceeded ImportIssueKind = "limit_exceeded" )
type InitConfig ¶
InitConfig describes one skill scaffolding request.
type Manifest ¶
type Manifest struct {
Namespace string `json:"namespace"`
Skills []ManifestSkill `json:"skills"`
}
Manifest lists immutable skill versions to stage for one Agent pod.
type ManifestSkill ¶
type ManifestSkill struct {
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
Version int64 `json:"version"`
StoragePath string `json:"storagePath"`
}
ManifestSkill describes one immutable skill version in a pod bootstrap manifest.
type VersionSelection ¶
VersionSelection identifies one immutable skill version for export.