1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! # pmcp-package
//!
//! The AI-Package format for portable MCP packages: typed manifest schemas,
//! config-slot aggregation, local OCI pack/unpack, and canonical-digest
//! computation.
//!
//! ## Dual-consumer contract
//!
//! This crate is consumed by **two** independent call sites:
//! - `cargo-pmcp` (the CLI) — packs local server/agent/team/workflow artifacts
//! for publish.
//! - The `pmcp.run` platform — unpacks and validates packages at
//! import/pre-flight time.
//!
//! Both call sites MUST resolve identical validation/digest behavior from the
//! same crate code — that is the entire point of this crate existing as a
//! shared, standalone, publishable library rather than being duplicated in
//! each consumer.
//!
//! ## Scope fence
//!
//! This crate is **format only**:
//! - Typed manifest schemas for the four package kinds (mcp-server, agent,
//! team, workflow).
//! - Config-slot type system: classification, aggregation, deviation
//! detection.
//! - Local OCI artifact pack/unpack (construct manifests + content-addressed
//! blobs on disk — no registry calls).
//! - Canonical-digest computation for approval-record keying.
//! - A DELIBERATELY NARROW read of a server's own config document
//! (`oci::config_validation`): it reads the `[[config_slots]]` declaration
//! table and resolves the dotted TOML path each declared slot names, so
//! `pack_server` can refuse a package whose slot list disagrees with the
//! config it ships, or whose slot-declared value key holds a resolved
//! literal. That is the whole extent of it — the crate models no config
//! schema, holds no opinion about the toolkit's config shape beyond those
//! two things, and never re-serializes the document (config layer bytes stay
//! verbatim).
//!
//! It explicitly does **NOT** contain:
//! - Agent runtime semantics (no execution, no LLM calls, no tool dispatch).
//! - Network or AWS SDK dependencies (no `reqwest`, no `tokio`, no
//! `oci-client`, no `aws-sdk-*` crate). Registry push/pull is a caller-side
//! concern at the *caller's* call site, not this crate's.
//! - Secret **values** — config slots may declare that a secret is required
//! by *name*, but the crate's types are structurally incapable of holding
//! a resolved secret value (see `slot` module docs).
// ---------------------------------------------------------------------
// Crate-root re-exports (dual-consumer ergonomics)
// ---------------------------------------------------------------------
//
// `cargo-pmcp` and the `pmcp.run` platform both consume this crate's primary
// types and functions without needing deep module paths (`pmcp_package::ServerPackage`
// rather than `pmcp_package::package::ServerPackage`). Deep paths still work —
// this block is additive, not a replacement for the module tree.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use validate as validate_deploy_descriptor;