prole/knoe/ops/context.py
chrisfu 4ee2b259c9 Checkpoint: rename installer to knoe + harden db build context
- Add build-context helper to copy Docker context safely (ignore runtime data, keep symlinks)

- Update UI and core actions to use ~/.prole/build and shared copy helper

- Add/adjust tests and scripts; introduce knoe ops helpers and update manifests

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-22 01:45:21 -07:00

30 lines
726 B
Python

from __future__ import annotations
import os
import sys
from dataclasses import dataclass, field
from pathlib import Path
from typing import Callable
def _default_logger(msg: str) -> None:
print(msg)
def _default_err_logger(msg: str) -> None:
print(msg, file=sys.stderr)
@dataclass(slots=True)
class KnoeContext:
"""Small shared context object for Stage 1 ops modules."""
project_root: Path
cfg_path: Path | None = None
mode: str = "dev"
namespace: str = "default"
service_namespace: str = "default"
env: dict[str, str] = field(default_factory=lambda: dict(os.environ))
logger: Callable[[str], None] = _default_logger
err_logger: Callable[[str], None] = _default_err_logger