pyboxbuilder.box.registry.register_box

pyboxbuilder.box.registry.register_box(box_type: BoxType, builder: type | None = None, box_class: type | None = None) → Any[source]

Register a box type with its builder and implementation class (FR-094).

Supports decorator usage:

@register_box(BoxType.CAP, builder=CapBoxBuilder)
class CapBox(BoxTypeBase):
    ...

Or direct invocation:

register_box(BoxType.CAP, builder=CapBoxBuilder, box_class=CapBox)
Parameters:
box_type: BoxType

The BoxType enum member.

builder: type | None = None

The BoxBuilder subclass.

box_class: type | None = None

The BoxTypeBase implementation class.

Returns:

A class decorator if box_class is not provided, or None.