Documentation
¶
Overview ¶
Copyright 2026 Retail Cortex
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Retail Cortex ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Retail Cortex ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package agentpkg is agentic assets as packages (spec_065_packages): agents, skills, rules, guardrails, workflows and evals, each a versioned asset another may depend on by a version range, as Blitz, Blitz Enterprise's library and builders outside Blitz read them.
Index ¶
- Constants
- Variables
- func Digest(files map[string]string) string
- func MainFile(kind, name string) string
- func Owns(kind, name, path string) bool
- func ReadAsset(root, kind, name string) (map[string]string, string)
- func ReadAssets(root string, kinds ...string) (map[string]map[string]string, map[string]string)
- func RemoveAsset(root, kind, name string) error
- func ValidName(name string) bool
- func WriteAsset(root, kind, name string, files map[string]string) error
- type Dep
- type Lock
- type LockEntry
- type Manifest
- type ManifestAsset
- type Range
- type URI
- type Version
Constants ¶
const ( MaxFile = 1 << 20 MaxTotal = 5 << 20 MaxFiles = 200 )
The most of an asset that's read (an organization's service's limits).
const ( SchemeBlitz = "blitz" // an organization's registry: blitz://<host>/<kind>/<name>[@<range>] SchemeGitHub = "github" // a repository's folder: github://<owner>/<repo>[@<ref>][/<path>] SchemeFile = "file" // a folder or file here: file://<path> SchemeCastor = "castor" // a Castor registry's skill: castor://<name> SchemeGo = "mod" // a Go module's folder: mod://<module>@<version>[/<path>] SchemeMaven = "maven" // a Maven artifact's folder: maven://<group>:<artifact>:<version>[/<path>] )
The schemes a package's URI may have (PK-10), Castor's among them.
const LockFile = "blitz.lock"
LockFile is a workspace's lockfile, beside its assets (PK-12): .agents/blitz.lock.
const ManifestFile = "agents_manifest.json"
ManifestFile is a compiled manifest's name (PK-13), beside the assets.
Variables ¶
var Folders = map[string]string{"agent": "agents", "skill": "skills", "workflow": "workflows", "rule": "rules", "guardrail": "guardrails", "eval": "evals"}
Folders are where each kind of asset lives under an assets folder (a workspace's .agents, or ~/.blitz): agents/<name>.md, skills/<name>/SKILL.md and its other files, workflows/<name>.flow.yaml, rules/<name>.md, guardrails/<name>.md, evals/<name>.md (PK-11).
var Kinds = []string{"agent", "skill", "workflow", "rule", "guardrail", "eval"}
Kinds are the kinds of asset a package is (PK-11).
Functions ¶
func Digest ¶
Digest is a version's files' digest (PK-05): for each path in order, the path, a zero byte, its text and a zero byte, hashed with SHA-256.
func Owns ¶
Owns reports whether path (under the assets folder) is one of the kind's asset name's files: its main file, or, for a skill, one in its folder.
func ReadAssets ¶
ReadAssets are the assets of kinds under root, by "kind/name", each its files by path under root; skipped are those that can't be read as a package, and why: a name Blitz doesn't give, a file that isn't text or is over 1 MB, an asset over 5 MB or 200 files. Hidden files are left out, and a linked skill folder isn't read.
func RemoveAsset ¶
RemoveAsset removes an asset's files under root.
Types ¶
type Dep ¶
type Dep struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
}
Dep is one asset another depends on, by name and version range (PK-03): an agent's skills. In YAML it's "name", "name@range", or {name: …, version: …}.
func (Dep) Check ¶
Check says what's wrong with d: a name Blitz can't have, a range that doesn't read.
func (Dep) MarshalYAML ¶
MarshalYAML writes d as "name" or "name@range".
type Lock ¶
Lock is what a workspace added from elsewhere (PK-12): each asset by "kind/name", where it came from, the version it resolved to and its files' digest, so `blitz pkg verify` tells a change. A superset of Castor's .manifest.lock (its skills' URI and SHA-256).
type LockEntry ¶
type LockEntry struct {
Kind string `json:"kind"`
Name string `json:"name"`
URI string `json:"uri"`
Version string `json:"version,omitempty"`
SHA256 string `json:"sha256"`
Added time.Time `json:"added"`
}
LockEntry is one asset a lock holds.
type Manifest ¶
type Manifest struct {
Schema int `json:"schema"`
Assets map[string]ManifestAsset `json:"assets"`
}
Manifest is a workspace's assets compiled into one file (PK-13), for loaders that read it rather than the folders: each asset by "kind/name", with its version, description, files' digest, where it came from, its dependencies and its files.
type ManifestAsset ¶
type ManifestAsset struct {
Kind string `json:"kind"`
Name string `json:"name"`
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
SHA256 string `json:"sha256"`
SourceURI string `json:"source_uri"`
Deps []Dep `json:"deps,omitempty"`
Files map[string]string `json:"files"`
}
ManifestAsset is one asset in a manifest.
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
Range is the versions a dependency accepts (PK-02):
"" "*" "latest" any "1.4.2" that one "1" "1.x" any 1.y.z "1.4" "1.4.x" any 1.4.z "^1.4.2" 1.4.2 or later, before 2.0.0 (before 0.5.0 for 0.4.x) "~1.4.2" 1.4.2 or later, before 1.5.0
type URI ¶
type URI struct {
Scheme string
Host string
Target string
Ref string
Subpath string
Kind string
Name string
}
URI is where a package comes from (PK-10), parsed: its scheme; the registry's host (blitz); its target (the repository, module, artifact, path or name); the ref or range it pins (a branch, tag or version); the folder in it; and, for blitz, the asset's kind and name.
func ParseURI ¶
ParseURI reads a package's URI (PK-10): blitz://, github:// (or https://github.com/…, with @ref, :ref or /tree/ref, "main" when none), file:// (or a bare path), castor:// (and cstr://, castors://, skm://), mod:// (or go://) and maven:// (or mvn://), as Castor reads them.
type Version ¶
type Version struct {
Major, Minor, Patch int
}
Version is an asset's version: major.minor.patch (PK-01).
func ParseVersion ¶
ParseVersion reads "1.4.2" (a leading "v" allowed).