src.orchestration.mode_registry module#

Mode Registry for Marcus Hybrid Approach.

Manages available Marcus modes and handles mode switching.

class src.orchestration.mode_registry.ModeSwitch[source]#

Bases: object

Record of a mode switch.

from_mode: MarcusMode | None#
to_mode: MarcusMode#
timestamp: datetime#
reason: str | None#
user_id: str | None#
__init__(from_mode, to_mode, timestamp, reason, user_id)#
Parameters:
Return type:

None

class src.orchestration.mode_registry.ModeRegistry[source]#

Bases: object

Registry of available Marcus modes.

__init__()[source]#

Initialize the mode registry.

Return type:

None

mode_history: List[ModeSwitch]#
mode_state: Dict[MarcusMode, Dict[str, Any]]#
async switch_mode(mode, reason=None, user_id=None)[source]#

Switch Marcus to a different operating mode.

Parameters:
  • mode (MarcusMode) – Target mode to switch to

  • reason (Optional[str]) – Optional reason for the switch

  • user_id (Optional[str]) – Optional user who triggered the switch

Returns:

Result of the mode switch

Return type:

Dict[str, Any]

async get_current_mode()[source]#

Get the currently active mode and its capabilities.

Returns:

Information about the current mode

Return type:

Dict[str, Any]

get_available_modes()[source]#

Get all modes and their availability.

Return type:

Dict[str, bool]

get_mode_handler(mode=None)[source]#

Get handler for a specific mode or current mode.

Parameters:

mode (Optional[MarcusMode]) – Mode to get handler for (None for current)

Returns:

Mode handler instance or None

Return type:

Any

get_mode_history(limit=10)[source]#

Get recent mode switch history.

Return type:

List[Dict[str, Any]]

Parameters:

limit (int)

async suggest_mode_switch(board_state, user_intent=None)[source]#

Suggest a mode switch based on current context.

Parameters:
  • board_state (BoardState) – Current board analysis

  • user_intent (Optional[str]) – Detected user intent

Returns:

Suggestion for mode switch or None

Return type:

Optional[Dict[str, Any]]