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. Package packages works with a workspace's assets as packages (spec_065 PK-10 to PK-16): adds them from elsewhere (an organization's registry, GitHub, a folder) with a lockfile, verifies them against it, checks them, and compiles them into one manifest, Castor's too, for loaders outside Blitz.
Index ¶
- Constants
- Variables
- func Add(ctx context.Context, root, uri string, o Options) ([]agentpkg.LockEntry, error)
- func Compile(root string, castor bool) ([]string, error)
- func Description(kind, text string) string
- func Root(workspace string) string
- func Warnings(kind, name string, files map[string]string) []string
- type Check
- type Finding
- type Options
- type Registry
- type Result
Constants ¶
const ( Verified = "verified" Modified = "modified" Missing = "missing" )
The verification statuses.
Variables ¶
var ErrNotFetched = errors.New("these aren't fetched by Blitz itself: use Castor's cstr for castor://, mod:// and maven:// packages, or a github://, file:// or blitz:// address")
ErrNotFetched is a package Blitz doesn't fetch itself (castor://, mod://, maven://): Castor's cstr does.
var ErrTaken = errors.New("the workspace has its own of that name: --force replaces it")
ErrTaken is an asset of the name the workspace has that didn't come from a package (or came from another): --force replaces it.
var Kinds = []string{"agent", "skill", "workflow", "rule", "guardrail", "eval"}
Kinds are every kind of asset, in the order they're listed.
Functions ¶
func Add ¶
Add adds the package at uri to root (PK-12): its assets written where Blitz reads them, each recorded in the lockfile with where it came from, the version and its digest. It says what it added.
func Compile ¶
Compile writes root's assets into one manifest (PK-13): root/ agents_manifest.json, each asset with its files, digest, version and source (from the lockfile, else its file), and, with castor, Castor's skills_manifest.json beside it for Castor's loaders (its skills: name, description, instructions, path, source URI and digest). It says the files it wrote.
func Description ¶
Description is an asset's description: its front matter's (a workflow's top-level).
Types ¶
type Check ¶
Check is how Validate checks a file as Blitz reads it (the engine's parsers, pkg/catalog, which the service has and the CLI doesn't): whether it checks that file at all, and what's wrong with it.
type Finding ¶
type Finding struct {
Key string `json:"asset"`
Problems []string `json:"problems,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
Finding is what Validate found in one asset: problems keep it from being one (Blitz refuses it as it reads it); warnings are worth fixing.
func Validate ¶
Validate checks every asset under root (PK-14, Castor's audit): each file check reads (a skill's scripts and references are its own, not read one by one), and what's worth fixing: no description, a relative link to a file the asset hasn't. The assets that can't be read are problems too.
type Options ¶
type Options struct {
Kind string
Force bool
Registry Registry
GitHubBase string
GitHubToken string
HTTP *http.Client
}
Options are how Add adds: Kind says what a bare file is (an agent, a rule …) when its folder doesn't; Force replaces an asset of the name that didn't come from a package; Registry fetches blitz:// ones; GitHub is GitHub's archive address (codeload.github.com) and its token.
type Registry ¶
type Registry interface {
Fetch(ctx context.Context, host, kind, name, rng string) (version string, files map[string]string, err error)
}
Registry is an organization's registry, for blitz:// packages (the service's spec_016 RG-10): the version a range resolves to, and its files.
type Result ¶
type Result struct {
Key string `json:"asset"`
URI string `json:"uri"`
Status string `json:"status"`
Expected string `json:"expected_sha256"`
Actual string `json:"actual_sha256,omitempty"`
}
Result is one locked asset's verification (PK-15): verified (its files are as added), modified (they changed since) or missing.