//! `maat-sdk-types` — Layer 2 leaf crate.
//
// POL-4e Phase 1: panic-prevention deny gate. Every site of indexed
// access in this crate is annotated inline with `#[allow(
// clippy::indexing_slicing, reason = "...")]` documenting the
// bounds-safety construction. New unchecked indexing will fail
// `cargo clippy -p maat-sdk-types`.
#![cfg_attr(not(test), deny(clippy::indexing_slicing))]
//!
//! Core type vocabulary: newtypes (`EntityId`, `PoolId`, `Position`, …),
//! enums (`Owner`, `BoardType`, …), `GameEvent`, `EntityBlueprint`, the
//! `*Data` shapes for every behavioral trait, `EntityState`, `EntityView`,
//! `TraitSet`, `TagSet`. No internal Metagamer dependencies — this crate
//! sits at the bottom of Layer 2 and is the only crate every higher layer
//! re-exports types from.
//!
//! Plugin authors do **not** depend on this crate directly. They depend on
//! the `maat` façade, which re-exports from here. See
//! `docs/superpowers/specs/2026-05-09-engine-architecture-refactor.md`
//! for the full Layer-N model.

// Re-export linkme so the `#[linkme(crate = crate::linkme)]` attributes
// in `plugin_slices` resolve. Plugin authors don't need to know about
// linkme; the macros in `sdk-derive` handle the wiring.
pub use linkme;

// UC-16's artifact module uses serde unconditionally for the
// `Stamped<T>` envelope codec. Gate the module so consumers that
// don't enable the `serde` feature (e.g. minimal trait-only builds)
// still compile.
#[cfg(feature = "serde")]
pub mod adjudication;
/// 0250-A — `artifact` uses `serde`/`serde_json` unconditionally
/// (see `Stamped<T>` + `TransitionFn<T>`); gating the module behind
/// the `serde` feature matches reality and makes the crate compile
/// standalone (no workspace feature unification), which is required
/// for crates.io publishing. Consumers that want `Artifact` enable
/// the `serde` feature explicitly.
#[cfg(feature = "serde")]
pub mod artifact;
pub mod audio;
pub mod tag_spec;
pub mod blueprint;
pub mod board;
pub mod capability;
pub mod cascade_trace;
pub mod catalog;
pub mod character_creation;
pub mod components;
pub mod manifest;
pub mod coverage;
pub mod config;
pub mod creation;
pub mod creation_registry;
pub mod composition_registry;
pub mod distance;
pub mod level_up_registry;
pub mod entity_state;
pub mod events;
pub mod handler;
pub mod identity;
pub mod journal;
pub mod map;
pub mod movement;
pub mod phases;
pub mod plugin_id;
pub mod plugin_manifest;
pub mod plugin_slices;
pub mod plugin_version;
pub mod predicate;
pub mod priority;
pub mod requirement;
pub mod queries;
pub mod reachability;
pub mod settings;
pub mod staged_decision;
pub mod storage;
pub mod store;
pub mod trait_data;
pub mod types;
pub mod undo_error;
pub mod view;
#[cfg(feature = "serde")]
pub mod wasm_compose;
#[cfg(feature = "serde")]
pub mod wasm_query;

// Flatten the namespace at the crate root so `maat_sdk_types::EntityId`
// works alongside `maat_sdk_types::types::EntityId`.
pub use identity::*;
pub use priority::*;
pub use types::*;

/// 5574: SDK canonical id — stable identifier for the SDK package
/// across versions. The single source of truth for this constant;
/// `maat_sdk::SDK_CANONICAL_ID` re-exports it for backward compat.
/// Workspace crates that don't pull in the full SDK (e.g.
/// `cli/cargo-maat`) import it from here directly.
pub const SDK_CANONICAL_ID: &str = "maat.com/sdk";
