"""
Helix-CDC Regrow Module

Full GGUF regeneration from DNA seeds using centroid atlas.
HXZ capsule loading and tensor regeneration.
DNA seed parsing and folded_braid expansion.
CDNA streaming with row-range access.
Unified tensor accessor for multiple formats.
HelixCode v0 format with CPU-side decode kernels.
"""

from .full_regen_stream import regenerate_full_gguf, RegenConfig
from .helixcode_v0 import (
    HelixCodeV0,
    MatmulStats,
    create_helixcode_v0,
    convert_cdna_to_helixcode,
    HELIXCODE_V0_SCHEMA,
    CODEBOOK_SIZE,
)
from .hxz_model_loader import (
    inspect_hxz_header,
    load_hxz_to_state_dict,
    hxz_to_pytorch_state_dict,
    HXZHeader,
)
from .dna_seed_loader import (
    parse_dna_seed,
    load_dna_seed,
    decode_braid_to_bits,
    expand_braid_to_bytes,
    expand_braid_to_floats,
    DNASeedInfo,
)
from .cdna_stream_v2 import (
    CDNAv2Reader,
    CDNAv2Writer,
    load_cdna_auto,
    stream_cdna2_matmul,
)
from .tensor_accessor import (
    TensorAccessor,
    create_accessor,
)
from .stream_xw_matmul import (
    stream_xw_from_cdna,
    stream_xw_from_manifest,
    StreamXWReceipt,
)
from .stream_attention_layer import (
    stream_attention_forward,
    stream_attention_forward_from_paths,
    AttentionLayerReceipt,
    stable_softmax,
)
from .inference_tripwire import (
    InferenceTripwire,
    assert_decode_only,
)
# Edge Depth Router (WO-EDGE-DEPTH-ROUTER-01)
from .depth_router import (
    InferenceDepth,
    DepthRouteResult,
    route_se_to_depth,
    get_block_indices_for_depth,
    estimate_se_from_prompt,
    get_depth_summary,
    SE_THRESHOLD_SHALLOW,
    SE_THRESHOLD_MEDIUM,
    SE_THRESHOLD_DEEP,
    RAM_PER_BLOCK_MB,
)
from .gemini_fallback import (
    GeminiFallbackResult,
    query_gemini,
    check_gemini_available,
)
from .edge_inference import (
    EdgeInferenceResult,
    edge_inference,
    edge_inference_chat,
    quick_route,
    check_edge_readiness,
)
# Tokenizer Bridge (WO-TOKENIZER-BRIDGE-01)
from .tokenizer_bridge import (
    MistralTokenizerBridge,
    TokenizerBridgeReceipt,
    check_tokenizer_bridge_available,
)
# Caching (WO-TOKENIZER-BRIDGE-01.1)
from .cache import (
    get_manifest_and_base,
    clear_manifest_cache,
    get_manifest_cache_info,
)

__all__ = [
    # Full GGUF regeneration
    'regenerate_full_gguf',
    'RegenConfig',
    # HXZ loading
    'inspect_hxz_header',
    'load_hxz_to_state_dict',
    'hxz_to_pytorch_state_dict',
    'HXZHeader',
    # DNA seed loading
    'parse_dna_seed',
    'load_dna_seed',
    'decode_braid_to_bits',
    'expand_braid_to_bytes',
    'expand_braid_to_floats',
    'DNASeedInfo',
    # CDNA v2 streaming
    'CDNAv2Reader',
    'CDNAv2Writer',
    'load_cdna_auto',
    'stream_cdna2_matmul',
    # Tensor accessor
    'TensorAccessor',
    'create_accessor',
    # Streaming X@W (WO-STREAM-XW-01)
    'stream_xw_from_cdna',
    'stream_xw_from_manifest',
    'StreamXWReceipt',
    # Streaming attention layer (WO-STREAM-ATTN-LAYER-01)
    'stream_attention_forward',
    'stream_attention_forward_from_paths',
    'AttentionLayerReceipt',
    'stable_softmax',
    # Vocabulary enforcement (WO-VOCABULARY-ENFORCE-01)
    'InferenceTripwire',
    'assert_decode_only',
    # HelixCode v0 (WO-HELIXCODE-TRACK-B)
    'HelixCodeV0',
    'MatmulStats',
    'create_helixcode_v0',
    'convert_cdna_to_helixcode',
    'HELIXCODE_V0_SCHEMA',
    'CODEBOOK_SIZE',
    # Edge Depth Router (WO-EDGE-DEPTH-ROUTER-01)
    'InferenceDepth',
    'DepthRouteResult',
    'route_se_to_depth',
    'get_block_indices_for_depth',
    'estimate_se_from_prompt',
    'get_depth_summary',
    'SE_THRESHOLD_SHALLOW',
    'SE_THRESHOLD_MEDIUM',
    'SE_THRESHOLD_DEEP',
    'RAM_PER_BLOCK_MB',
    # Gemini fallback
    'GeminiFallbackResult',
    'query_gemini',
    'check_gemini_available',
    # Edge inference entry point
    'EdgeInferenceResult',
    'edge_inference',
    'edge_inference_chat',
    'quick_route',
    'check_edge_readiness',
    # Tokenizer Bridge (WO-TOKENIZER-BRIDGE-01)
    'MistralTokenizerBridge',
    'TokenizerBridgeReceipt',
    'check_tokenizer_bridge_available',
]
