package#

Publish/package preflight requires an explicit supported standard and validates canonical standalone APDS rules using the bundled contract. Missing, malformed, or unsupported declarations fail even without --strict. This preflight does not establish resolved-graph validity or Runner readiness; packaging also performs its existing file and build-readiness checks.

--schema is retained as a recognized option for compatibility but is rejected for publishing and packaging; remove it from these commands. Use agentpm lint --schema FILE only for non-authoritative local development checks. A CWD-relative schema cannot change preflight validation. There is no --legacy package flag; a legacy lint preview cannot authorize packaging.

Build a package without authenticating or publishing:

agentpm package --strict --machine --output target/agentpm/build

The command accepts --manifest and uses the same bundled validation rules as publish. It writes an archive and package-build.json together in the output directory. Keep those two files together when transferring a build between machines. The descriptor's artifact_path is relative to its own directory.

For Python Tools with declared dependencies, prepare and review agent.lock first. Packaging reuses a fresh resolution from that lock; it does not refresh or resolve against PyPI:

agentpm publish --dry-run --refresh-python
# Review and commit agent.lock before packaging in CI.
agentpm package --machine

Build result#

With --machine, stdout contains one JSON result with schema_version: 1, status, descriptor_path and build on success. Progress, warnings and tracing remain on stderr. On failure, the JSON result contains an error with a message and typed payload diagnostics where applicable, and the command exits nonzero.

The agentpm.package.build.v1 descriptor includes:

  • the archive filename, full sha256: digest, size and tar.gz format;
  • the concrete build_target identifying the packaging host;
  • the classified payload target for Python Tools (any or a concrete target);
  • canonical manifest and optional Python resolution digests;
  • typed payload/collection diagnostics;
  • publish metadata, including package kind/name/version and the manifest.

Legacy packages have target: null; this does not claim portable compatibility. Python artifacts include generated agentpm-artifact.json and, when needed, agentpm-python.json. Python packaging also includes a discovered README and declared license text file when they are valid bounded UTF-8, even if files lists source only. The Registry derives package-page display text from verified archive bytes, using the first artifact in canonical target order for a release. Authored agent.json is unchanged. Descriptors are build outputs, not new fields in the canonical release schema or the author lock.

Publish saved builds#

For a portable Python Tool:

agentpm publish --build target/agentpm/build/package-build.json \
  --namespace your-namespace --sign --key-file /path/to/encrypted-author-key.json

Supply multiple --build arguments for a concrete-target release. CI should also repeat --expect-build-target <target> for each required packaging host. Before any upload, the CLI checks local archive hashes and embedded metadata, matching package identity/manifest/Python resolution, unique artifact targets, and exactly the expected build hosts. A missing descriptor is an error. A failed matrix job must prevent the publishing job from running.

Saved-build publication also revalidates the descriptor's manifest against the same canonical standalone rules, including its explicit supported standard. Matching digests do not exempt a descriptor from validation. If an older build lacks the declaration, upgrade the authored source and rebuild the bundle; do not edit its descriptor or archive to bypass preflight.

Matrix outputs mixing any with concrete targets are rejected with their typed path/reason diagnostics. Fix the source permissions or compatibility inputs and rebuild; do not drop outputs or relabel targets. Multiple portable builds with the same any target are also duplicates: use one portable build. Distinct concrete targets are valid and need not have identical archive bytes.

Python Tools use one atomic new-format release, signed at release level when --sign is supplied. Agents, Node Tools and other existing package kinds keep their legacy publication format and accept one saved build. Normal local agentpm publish remains available and reuses the same archive preparation.

See automated publishing for encrypted signing keys and complete GitHub Actions examples.