orchestrata_ultimate.session.cli._manager

Reference › orchestrata_ultimate › session › cli › _manager

A small shared factory that builds the ContextFileManager for the CLI command modules, so each command gets its manager the same way from the project root and environment held in the Click context.

At a glance

Source src/orchestrata_ultimate/session/cli/_manager.py
Lines of code 24
Classes 0
Functions 1
Imports (internal) orchestrata_ultimate.session.context
Imported by orchestrata_ultimate.session.cli.achievements, orchestrata_ultimate.session.cli.archive, orchestrata_ultimate.session.cli.goals, orchestrata_ultimate.session.cli.overview, orchestrata_ultimate.session.cli.tasks
Tests that import it none

Class diagram

No classes; see Functions.

Dependency diagram

Dependency diagram orchestrata_ultimate.session.cli._manager

API

Functions

Function Signature Summary
_get_manager _get_manager(root: Path) -> ContextFileManager Create a ContextFileManager for the given root.

Source

Permalink: https://gitlab.com/MSamy/orchestrata-ultimate-architecture/-/blob/a4cbc2bdf/src/orchestrata_ultimate/session/cli/_manager.py

# mypy: ignore-errors
"""Shared ``ContextFileManager`` factory for the session CLI command package.

Extracted from ``session.cli.main`` into this leaf module so the per-command
modules (``achievements``, ``archive``, ``goals``, ``tasks``, ...) can import
``_get_manager`` without importing ``main`` itself — ``main`` imports each of
those modules to register their commands, so a command module importing back
from ``main`` created a real import cycle (``main`` <-> command module).

Spec: 006 - Session Management
"""

from pathlib import Path
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from orchestrata_ultimate.session.context import ContextFileManager


def _get_manager(root: Path) -> ContextFileManager:
    """Create a ContextFileManager for the given root."""
    from orchestrata_ultimate.session.context import ContextFileManager

    return ContextFileManager(root)