diff --git a/CLAUDE.md b/CLAUDE.md index a61e950..9a17031 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -94,8 +94,9 @@ Services also support: `uv run ` to start. ## Key Files - `castle.yaml` — Component registry (single source of truth) -- `cli/src/castle_cli/manifest.py` — Pydantic models (ComponentManifest, RunSpec, etc.) -- `cli/src/castle_cli/config.py` — Config loader (castle.yaml → CastleConfig) +- `core/src/castle_core/manifest.py` — Pydantic models (ComponentManifest, RunSpec, etc.) +- `core/src/castle_core/config.py` — Config loader (castle.yaml → CastleConfig) +- `core/src/castle_core/generators/` — Systemd unit and Caddyfile generation - `cli/src/castle_cli/templates/scaffold.py` — Project scaffolding templates -- `cli/src/castle_cli/commands/service.py` — Systemd unit generation +- `pyproject.toml` — uv workspace root (core, cli, castle-api) - `ruff.toml` / `pyrightconfig.json` — Shared lint/type config diff --git a/castle-api/pyproject.toml b/castle-api/pyproject.toml index a57bd62..95db147 100644 --- a/castle-api/pyproject.toml +++ b/castle-api/pyproject.toml @@ -8,11 +8,11 @@ dependencies = [ "uvicorn>=0.34.0", "pydantic-settings>=2.0.0", "httpx>=0.27.0", - "castle-cli", + "castle-core", ] [tool.uv.sources] -castle-cli = { path = "../cli", editable = true } +castle-core = { workspace = true } [project.scripts] castle-api = "castle_api.main:run" diff --git a/castle-api/src/castle_api/config_editor.py b/castle-api/src/castle_api/config_editor.py index 0fb666f..ec4a7fe 100644 --- a/castle-api/src/castle_api/config_editor.py +++ b/castle-api/src/castle_api/config_editor.py @@ -9,8 +9,8 @@ import yaml from fastapi import APIRouter, HTTPException, status from pydantic import BaseModel -from castle_cli.config import load_config, save_config -from castle_cli.manifest import ComponentManifest +from castle_core.config import load_config, save_config +from castle_core.manifest import ComponentManifest from castle_api.config import settings from castle_api.stream import broadcast @@ -148,12 +148,12 @@ async def apply_config() -> ApplyResponse: errors.append(f"Failed to restart {name}: {output}") # Reload gateway - from castle_cli.commands.gateway import _generate_caddyfile - from castle_cli.config import GENERATED_DIR, ensure_dirs + from castle_core.config import GENERATED_DIR, ensure_dirs + from castle_core.generators import generate_caddyfile ensure_dirs() caddyfile_path = GENERATED_DIR / "Caddyfile" - caddyfile_path.write_text(_generate_caddyfile(config)) + caddyfile_path.write_text(generate_caddyfile(config)) actions.append("Generated Caddyfile") if shutil.which("caddy"): diff --git a/castle-api/src/castle_api/health.py b/castle-api/src/castle_api/health.py index e70900a..a53121f 100644 --- a/castle-api/src/castle_api/health.py +++ b/castle-api/src/castle_api/health.py @@ -7,7 +7,7 @@ import time import httpx -from castle_cli.config import CastleConfig +from castle_core.config import CastleConfig from castle_api.models import HealthStatus diff --git a/castle-api/src/castle_api/logs.py b/castle-api/src/castle_api/logs.py index abd99a7..88af5d8 100644 --- a/castle-api/src/castle_api/logs.py +++ b/castle-api/src/castle_api/logs.py @@ -8,7 +8,7 @@ from collections.abc import AsyncGenerator from fastapi import APIRouter, HTTPException, Query, status from starlette.responses import StreamingResponse -from castle_cli.config import load_config +from castle_core.config import load_config from castle_api.config import settings diff --git a/castle-api/src/castle_api/routes.py b/castle-api/src/castle_api/routes.py index 49f445f..b868d5d 100644 --- a/castle-api/src/castle_api/routes.py +++ b/castle-api/src/castle_api/routes.py @@ -7,7 +7,7 @@ from pathlib import Path from fastapi import APIRouter, HTTPException, status -from castle_cli.config import load_config +from castle_core.config import load_config from castle_api.config import settings from castle_api.health import check_all_health @@ -137,7 +137,7 @@ def get_gateway() -> GatewayInfo: @router.get("/gateway/caddyfile") def get_caddyfile() -> dict[str, str]: """Return the generated Caddyfile content.""" - from castle_cli.commands.gateway import _generate_caddyfile + from castle_core.generators import generate_caddyfile config = load_config(settings.castle_root) - return {"content": _generate_caddyfile(config)} + return {"content": generate_caddyfile(config)} diff --git a/castle-api/src/castle_api/secrets.py b/castle-api/src/castle_api/secrets.py index 8f7d470..bb60ed6 100644 --- a/castle-api/src/castle_api/secrets.py +++ b/castle-api/src/castle_api/secrets.py @@ -5,7 +5,7 @@ from __future__ import annotations from fastapi import APIRouter, HTTPException, status from pydantic import BaseModel -from castle_cli.config import SECRETS_DIR +from castle_core.config import SECRETS_DIR router = APIRouter(prefix="/secrets", tags=["secrets"]) diff --git a/castle-api/src/castle_api/services.py b/castle-api/src/castle_api/services.py index 10b9e22..2064e8e 100644 --- a/castle-api/src/castle_api/services.py +++ b/castle-api/src/castle_api/services.py @@ -8,7 +8,7 @@ import time from fastapi import APIRouter, HTTPException, status from starlette.responses import JSONResponse -from castle_cli.config import load_config +from castle_core.config import load_config from castle_api.config import settings from castle_api.health import check_all_health @@ -115,13 +115,13 @@ async def _do_action(name: str, action: str) -> JSONResponse: @router.get("/{name}/unit") def get_unit(name: str) -> dict[str, str | None]: """Return the generated systemd unit file(s) for a managed component.""" - from castle_cli.commands.service import _generate_timer, _generate_unit + from castle_core.generators import generate_timer, generate_unit _validate_managed(name) config = load_config(settings.castle_root) manifest = config.managed[name] - unit = _generate_unit(config, name, manifest) - timer = _generate_timer(name, manifest) + unit = generate_unit(config, name, manifest) + timer = generate_timer(name, manifest) return {"service": unit, "timer": timer} diff --git a/castle-api/src/castle_api/stream.py b/castle-api/src/castle_api/stream.py index a293220..5cb3d8c 100644 --- a/castle-api/src/castle_api/stream.py +++ b/castle-api/src/castle_api/stream.py @@ -7,7 +7,7 @@ import json import logging import time -from castle_cli.config import load_config +from castle_core.config import load_config from castle_api.config import settings from castle_api.health import check_all_health diff --git a/castle-api/src/castle_api/tools.py b/castle-api/src/castle_api/tools.py index a301400..a0153c1 100644 --- a/castle-api/src/castle_api/tools.py +++ b/castle-api/src/castle_api/tools.py @@ -7,8 +7,8 @@ from pathlib import Path from fastapi import APIRouter, HTTPException, status -from castle_cli.config import load_config -from castle_cli.manifest import ComponentManifest +from castle_core.config import load_config +from castle_core.manifest import ComponentManifest from castle_api.config import settings from castle_api.models import ToolDetail, ToolSummary diff --git a/cli/pyproject.toml b/cli/pyproject.toml index dc32a49..6f368ac 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -7,8 +7,12 @@ dependencies = [ "pyyaml>=6.0.0", "jinja2>=3.1.0", "pydantic>=2.0.0", + "castle-core", ] +[tool.uv.sources] +castle-core = { workspace = true } + [project.scripts] castle = "castle_cli.main:main" diff --git a/cli/src/castle_cli/commands/gateway.py b/cli/src/castle_cli/commands/gateway.py index 54be77f..88331a2 100644 --- a/cli/src/castle_cli/commands/gateway.py +++ b/cli/src/castle_cli/commands/gateway.py @@ -6,71 +6,22 @@ import argparse import subprocess from castle_cli.config import GENERATED_DIR, CastleConfig, ensure_dirs, load_config +from castle_core.generators.caddyfile import find_app_dist, generate_caddyfile GATEWAY_COMPONENT = "castle-gateway" GATEWAY_UNIT = "castle-castle-gateway.service" -def _find_app_dist(config: CastleConfig) -> str | None: - """Find the app dist/ directory if it exists.""" - dist = config.root / "app" / "dist" - if dist.exists() and (dist / "index.html").exists(): - return str(dist) - return None - - -def _generate_caddyfile(config: CastleConfig) -> str: - """Generate Caddyfile content from castle config.""" - lines = [f":{config.gateway.port} {{"] - - # Reverse proxy for each component with proxy.caddy and expose.http - for name, manifest in config.components.items(): - if not (manifest.proxy and manifest.proxy.caddy and manifest.proxy.caddy.enable): - continue - if not (manifest.expose and manifest.expose.http): - continue - - caddy = manifest.proxy.caddy - http = manifest.expose.http - path_prefix = caddy.path_prefix or f"/{name}" - port = http.internal.port - host = http.internal.host or "localhost" - - lines.append(f" handle_path {path_prefix}/* {{") - lines.append(f" reverse_proxy {host}:{port}") - lines.append(" }") - lines.append("") - - # App SPA at root (must come after more-specific handle_path rules) - app_dist = _find_app_dist(config) - if app_dist: - lines.append(" handle {") - lines.append(f" root * {app_dist}") - lines.append(" try_files {path} /index.html") - lines.append(" file_server") - lines.append(" }") - else: - # Fallback: serve from generated directory - fallback = GENERATED_DIR / "app" - lines.append(" handle / {") - lines.append(f" root * {fallback}") - lines.append(" file_server") - lines.append(" }") - - lines.append("}") - return "\n".join(lines) - - def _write_generated_files(config: CastleConfig) -> None: """Write generated Caddyfile.""" ensure_dirs() caddyfile_path = GENERATED_DIR / "Caddyfile" - caddyfile_path.write_text(_generate_caddyfile(config)) + caddyfile_path.write_text(generate_caddyfile(config)) print(f" Generated {caddyfile_path}") - app_dist = _find_app_dist(config) + app_dist = find_app_dist(config) if app_dist: print(f" App: {app_dist}") else: @@ -104,7 +55,7 @@ def run_gateway(args: argparse.Namespace) -> int: def _gateway_dry_run(config: CastleConfig) -> int: """Print generated Caddyfile without applying.""" print("# Caddyfile") - print(_generate_caddyfile(config)) + print(generate_caddyfile(config)) return 0 diff --git a/cli/src/castle_cli/commands/service.py b/cli/src/castle_cli/commands/service.py index 3abb3ad..3017462 100644 --- a/cli/src/castle_cli/commands/service.py +++ b/cli/src/castle_cli/commands/service.py @@ -3,254 +3,34 @@ from __future__ import annotations import argparse -import shutil import subprocess -from pathlib import Path from castle_cli.config import ( CastleConfig, ensure_dirs, load_config, - resolve_env_vars, ) -from castle_cli.manifest import ComponentManifest, RestartPolicy - -SYSTEMD_USER_DIR = Path.home() / ".config" / "systemd" / "user" -UNIT_PREFIX = "castle-" +from castle_core.generators.systemd import ( + SYSTEMD_USER_DIR, + generate_timer, + generate_unit, + get_schedule_trigger, + timer_name, + unit_name, +) -def _unit_name(service_name: str) -> str: - """Get the systemd unit name for a service.""" - return f"{UNIT_PREFIX}{service_name}.service" - - -def _timer_name(service_name: str) -> str: - """Get the systemd timer name for a scheduled service.""" - return f"{UNIT_PREFIX}{service_name}.timer" - - -def _get_schedule_trigger(manifest: ComponentManifest) -> object | None: - """Return the schedule trigger if one exists, else None.""" - for t in manifest.triggers: - if getattr(t, "type", None) == "schedule": - return t - return None - - -def _cron_to_oncalendar(cron: str) -> str: - """Best-effort conversion of cron expression to systemd OnCalendar. - - Handles common patterns; falls back to using OnUnitActiveSec for the rest. - """ - parts = cron.strip().split() - if len(parts) != 5: - return "" - - minute, hour, dom, month, dow = parts - - # */N minutes → run every N minutes - if minute.startswith("*/") and hour == "*" and dom == "*" and month == "*" and dow == "*": - return "" # Use OnUnitActiveSec instead - - # Specific time daily: "0 2 * * *" → "*-*-* 02:00:00" - if dom == "*" and month == "*" and dow == "*": - h = hour.zfill(2) if hour != "*" else "*" - m = minute.zfill(2) if minute != "*" else "*" - return f"*-*-* {h}:{m}:00" - - return "" - - -def _cron_to_interval_sec(cron: str) -> int | None: - """Extract interval seconds from */N cron patterns.""" - parts = cron.strip().split() - if len(parts) != 5: - return None - minute, hour, dom, month, dow = parts - if minute.startswith("*/") and hour == "*" and dom == "*" and month == "*" and dow == "*": - try: - return int(minute[2:]) * 60 - except ValueError: - return None - return None - - -def _manifest_to_exec_start(manifest: ComponentManifest, root: Path) -> str: - """Convert a manifest's RunSpec to a systemd ExecStart command.""" - run = manifest.run - if run is None: - raise ValueError(f"Component '{manifest.id}' has no run spec") - - match run.runner: - case "python_uv_tool": - uv_path = shutil.which("uv") or "uv" - args_str = " ".join(run.args) if run.args else "" - cmd = f"{uv_path} run {run.tool}" - if args_str: - cmd += f" {args_str}" - return cmd - case "python_module": - python = run.python or shutil.which("python3") or "python3" - args_str = " ".join(run.args) if run.args else "" - cmd = f"{python} -m {run.module}" - if args_str: - cmd += f" {args_str}" - return cmd - case "command": - argv = list(run.argv) - resolved = shutil.which(argv[0]) - if resolved: - argv[0] = resolved - return " ".join(argv) - case "container": - return _build_podman_command(manifest) - case "node": - pm = run.package_manager - cmd = f"{pm} run {run.script}" - if run.args: - cmd += " " + " ".join(run.args) - return cmd - case _: - raise ValueError(f"Unsupported runner '{run.runner}' for systemd unit") - - -def _build_podman_command(manifest: ComponentManifest) -> str: - """Build a podman/docker run command from a container RunSpec.""" - run = manifest.run - podman = shutil.which("podman") or shutil.which("docker") or "podman" - parts = [podman, "run", "--rm", f"--name=castle-{manifest.id}"] - - for container_port, host_port in run.ports.items(): - parts.append(f"-p {host_port}:{container_port}") - for vol in run.volumes: - parts.append(f"-v {vol}") - for key, val in run.env.items(): - parts.append(f"-e {key}={val}") - if run.workdir: - parts.append(f"-w {run.workdir}") - - parts.append(run.image) - if run.command: - parts.extend(run.command) - if run.args: - parts.extend(run.args) - - return " ".join(parts) - - -def _generate_unit(config: CastleConfig, name: str, manifest: ComponentManifest) -> str: - """Generate a systemd user unit file for a component.""" - run = manifest.run - if run is None: - raise ValueError(f"Component '{name}' has no run spec") - - working_dir = config.root / (run.working_dir or name) - exec_start = _manifest_to_exec_start(manifest, config.root) - - resolved_env = resolve_env_vars(run.env, manifest) - env_lines = "" - for key, value in resolved_env.items(): - env_lines += f"Environment={key}={value}\n" - - # Add PATH so tools are findable - env_lines += f'Environment="PATH={Path.home() / ".local/bin"}:/usr/local/bin:/usr/bin:/bin"\n' - - sd = None - if manifest.manage and manifest.manage.systemd: - sd = manifest.manage.systemd - - description = (sd and sd.description) or manifest.description or name - after = " ".join(sd.after) if sd and sd.after else "network.target" - wanted_by = " ".join(sd.wanted_by) if sd else "default.target" - - is_scheduled = _get_schedule_trigger(manifest) is not None - - if is_scheduled: - # Oneshot service for timer-driven jobs - unit = f"""[Unit] -Description=Castle: {description} -After={after} - -[Service] -Type=oneshot -WorkingDirectory={working_dir} -ExecStart={exec_start} -{env_lines}""" - else: - restart = (sd.restart if sd else RestartPolicy.ON_FAILURE).value - restart_sec = sd.restart_sec if sd else 5 - unit = f"""[Unit] -Description=Castle: {description} -After={after} - -[Service] -Type=simple -WorkingDirectory={working_dir} -ExecStart={exec_start} -{env_lines}Restart={restart} -RestartSec={restart_sec} -SuccessExitStatus=143 -""" - - if sd and sd.exec_reload: - reload_argv = sd.exec_reload.split() - resolved_reload = shutil.which(reload_argv[0]) - if resolved_reload: - reload_argv[0] = resolved_reload - unit += f"ExecReload={' '.join(reload_argv)}\n" - - if sd and sd.no_new_privileges: - unit += "NoNewPrivileges=true\n" - - unit += f""" -[Install] -WantedBy={wanted_by} -""" - return unit - - -def _generate_timer(name: str, manifest: ComponentManifest) -> str | None: - """Generate a systemd timer unit if the component has a schedule trigger.""" - trigger = _get_schedule_trigger(manifest) - if trigger is None: - return None - - description = manifest.description or name - - # Try to convert cron to OnCalendar, fall back to OnUnitActiveSec - on_calendar = _cron_to_oncalendar(trigger.cron) - interval_sec = _cron_to_interval_sec(trigger.cron) - - timer_lines = "" - if on_calendar: - timer_lines = f"OnCalendar={on_calendar}\n" - elif interval_sec: - timer_lines = f"OnBootSec=60\nOnUnitActiveSec={interval_sec}s\n" - else: - timer_lines = "OnBootSec=60\nOnUnitActiveSec=300\n" - - return f"""[Unit] -Description=Castle timer: {description} - -[Timer] -{timer_lines}Persistent=false - -[Install] -WantedBy=timers.target -""" - - -def _install_unit(unit_name: str, content: str) -> None: +def _install_unit(uname: str, content: str) -> None: """Write a systemd unit file.""" SYSTEMD_USER_DIR.mkdir(parents=True, exist_ok=True) - unit_path = SYSTEMD_USER_DIR / unit_name + unit_path = SYSTEMD_USER_DIR / uname unit_path.write_text(content) subprocess.run(["systemctl", "--user", "daemon-reload"], check=False) -def _remove_unit(unit_name: str) -> None: +def _remove_unit(uname: str) -> None: """Remove a systemd unit file.""" - unit_path = SYSTEMD_USER_DIR / unit_name + unit_path = SYSTEMD_USER_DIR / uname if unit_path.exists(): unit_path.unlink() subprocess.run(["systemctl", "--user", "daemon-reload"], check=False) @@ -307,22 +87,22 @@ def _service_enable(config: CastleConfig, name: str) -> int: ensure_dirs() # Generate and install the service unit - svc_unit = _unit_name(name) - svc_content = _generate_unit(config, name, manifest) + svc_unit = unit_name(name) + svc_content = generate_unit(config, name, manifest) _install_unit(svc_unit, svc_content) # Check for timer - timer_content = _generate_timer(name, manifest) + timer_content = generate_timer(name, manifest) if timer_content: - timer_unit = _timer_name(name) - _install_unit(timer_unit, timer_content) + tmr_unit = timer_name(name) + _install_unit(tmr_unit, timer_content) print(f"Enabling {name} (scheduled)...") - subprocess.run(["systemctl", "--user", "enable", timer_unit], check=False) - subprocess.run(["systemctl", "--user", "start", timer_unit], check=False) + subprocess.run(["systemctl", "--user", "enable", tmr_unit], check=False) + subprocess.run(["systemctl", "--user", "start", tmr_unit], check=False) result = subprocess.run( - ["systemctl", "--user", "is-active", timer_unit], + ["systemctl", "--user", "is-active", tmr_unit], capture_output=True, text=True, ) status = result.stdout.strip() @@ -354,17 +134,17 @@ def _service_enable(config: CastleConfig, name: str) -> int: def _service_disable(name: str) -> int: """Stop and disable a service (and timer if present).""" - svc_unit = _unit_name(name) - timer_unit = _timer_name(name) + svc_unit = unit_name(name) + tmr_unit = timer_name(name) print(f"Disabling {name}...") # Stop and disable timer if exists - timer_path = SYSTEMD_USER_DIR / timer_unit + timer_path = SYSTEMD_USER_DIR / tmr_unit if timer_path.exists(): - subprocess.run(["systemctl", "--user", "stop", timer_unit], check=False) - subprocess.run(["systemctl", "--user", "disable", timer_unit], check=False) - _remove_unit(timer_unit) + subprocess.run(["systemctl", "--user", "stop", tmr_unit], check=False) + subprocess.run(["systemctl", "--user", "disable", tmr_unit], check=False) + _remove_unit(tmr_unit) subprocess.run(["systemctl", "--user", "stop", svc_unit], check=False) subprocess.run(["systemctl", "--user", "disable", svc_unit], check=False) @@ -380,12 +160,12 @@ def _service_status(config: CastleConfig) -> int: print("=" * 50) for name, manifest in config.managed.items(): - is_scheduled = _get_schedule_trigger(manifest) is not None + is_scheduled = get_schedule_trigger(manifest) is not None if is_scheduled: - timer_unit = _timer_name(name) + tmr_unit = timer_name(name) result = subprocess.run( - ["systemctl", "--user", "is-active", timer_unit], + ["systemctl", "--user", "is-active", tmr_unit], capture_output=True, text=True, ) status = result.stdout.strip() @@ -398,9 +178,9 @@ def _service_status(config: CastleConfig) -> int: reset = "\033[0m" print(f" {color}{status:10s}{reset} {name} (timer)") else: - unit_name = _unit_name(name) + svc_unit = unit_name(name) result = subprocess.run( - ["systemctl", "--user", "is-active", unit_name], + ["systemctl", "--user", "is-active", svc_unit], capture_output=True, text=True, ) status = result.stdout.strip() @@ -433,14 +213,14 @@ def _service_dry_run(config: CastleConfig, name: str) -> int: print(f"Error: '{name}' has no run spec defined") return 1 - svc_unit = _unit_name(name) - svc_content = _generate_unit(config, name, manifest) + svc_unit = unit_name(name) + svc_content = generate_unit(config, name, manifest) print(f"# {svc_unit}") print(svc_content) - timer_content = _generate_timer(name, manifest) + timer_content = generate_timer(name, manifest) if timer_content: - print(f"# {_timer_name(name)}") + print(f"# {timer_name(name)}") print(timer_content) return 0 @@ -468,12 +248,12 @@ def _services_start(config: CastleConfig) -> int: def _services_stop(config: CastleConfig) -> int: """Stop all managed services and gateway.""" for name, manifest in config.managed.items(): - is_scheduled = _get_schedule_trigger(manifest) is not None + is_scheduled = get_schedule_trigger(manifest) is not None if is_scheduled: - timer_unit = _timer_name(name) - subprocess.run(["systemctl", "--user", "stop", timer_unit], check=False) - unit_name = _unit_name(name) - subprocess.run(["systemctl", "--user", "stop", unit_name], check=False) + tmr_unit = timer_name(name) + subprocess.run(["systemctl", "--user", "stop", tmr_unit], check=False) + svc_unit = unit_name(name) + subprocess.run(["systemctl", "--user", "stop", svc_unit], check=False) print(f" {name}: stopped") return 0 diff --git a/cli/src/castle_cli/config.py b/cli/src/castle_cli/config.py index 2cf3c00..a19c106 100644 --- a/cli/src/castle_cli/config.py +++ b/cli/src/castle_cli/config.py @@ -1,217 +1,15 @@ -"""Castle configuration and registry management.""" +"""Re-export from castle-core for backward compatibility.""" -from __future__ import annotations - -import os -import re -from dataclasses import dataclass -from pathlib import Path - -import yaml - -from castle_cli.manifest import ComponentManifest, Role - - -def find_castle_root() -> Path: - """Find the castle repository root by walking up from cwd looking for castle.yaml.""" - current = Path.cwd() - while current != current.parent: - if (current / "castle.yaml").exists(): - return current - current = current.parent - # Fallback: check if castle.yaml is in a well-known location - default = Path("/data/repos/castle") - if (default / "castle.yaml").exists(): - return default - raise FileNotFoundError( - "Could not find castle.yaml. Run castle from within the castle repository." - ) - - -CASTLE_HOME = Path.home() / ".castle" -GENERATED_DIR = CASTLE_HOME / "generated" -SECRETS_DIR = CASTLE_HOME / "secrets" - - -@dataclass -class GatewayConfig: - """Gateway configuration.""" - - port: int = 9000 - - -@dataclass -class CastleConfig: - """Full castle configuration.""" - - root: Path - gateway: GatewayConfig - components: dict[str, ComponentManifest] - - @property - def services(self) -> dict[str, ComponentManifest]: - """Return components with the SERVICE role.""" - return { - k: v for k, v in self.components.items() if Role.SERVICE in v.roles - } - - @property - def tools(self) -> dict[str, ComponentManifest]: - """Return components with the TOOL role.""" - return { - k: v for k, v in self.components.items() if Role.TOOL in v.roles - } - - @property - def workers(self) -> dict[str, ComponentManifest]: - """Return components with the WORKER role.""" - return { - k: v for k, v in self.components.items() if Role.WORKER in v.roles - } - - @property - def managed(self) -> dict[str, ComponentManifest]: - """Return components managed by systemd.""" - return { - k: v - for k, v in self.components.items() - if v.manage and v.manage.systemd and v.manage.systemd.enable - } - - -def resolve_env_vars( - env: dict[str, str], manifest: ComponentManifest -) -> dict[str, str]: - """Resolve ${secret:NAME} references in env values.""" - resolved = {} - for key, value in env.items(): - - def replace_var(match: re.Match[str]) -> str: - ref = match.group(1) - if ref.startswith("secret:"): - secret_name = ref[7:] - return _read_secret(secret_name) - return match.group(0) - - resolved[key] = re.sub(r"\$\{([^}]+)\}", replace_var, value) - return resolved - - -def _read_secret(name: str) -> str: - """Read a secret from ~/.castle/secrets/. Returns placeholder if not found.""" - secret_path = SECRETS_DIR / name - if secret_path.exists(): - return secret_path.read_text().strip() - return f"" - - -def _parse_component(name: str, data: dict) -> ComponentManifest: - """Parse a components: entry directly into a ComponentManifest.""" - data_copy = dict(data) - data_copy["id"] = name - return ComponentManifest.model_validate(data_copy) - - -def load_config(root: Path | None = None) -> CastleConfig: - """Load castle.yaml and return parsed configuration.""" - if root is None: - root = find_castle_root() - - config_path = root / "castle.yaml" - if not config_path.exists(): - raise FileNotFoundError(f"Castle config not found: {config_path}") - - with open(config_path) as f: - data = yaml.safe_load(f) - - gateway_data = data.get("gateway", {}) - gateway = GatewayConfig(port=gateway_data.get("port", 9000)) - - components: dict[str, ComponentManifest] = {} - for name, comp_data in data.get("components", {}).items(): - components[name] = _parse_component(name, comp_data) - - return CastleConfig(root=root, gateway=gateway, components=components) - - -def _clean_for_yaml(data: object, preserve_keys: set[str] | None = None) -> object: - """Recursively remove empty lists and non-structural empty dicts.""" - if preserve_keys is None: - preserve_keys = _STRUCTURAL_KEYS - if isinstance(data, dict): - cleaned = {} - for k, v in data.items(): - v = _clean_for_yaml(v, preserve_keys) - # Keep structural keys even if empty dict - if k in preserve_keys and isinstance(v, dict): - cleaned[k] = v - continue - # Skip empty collections - if isinstance(v, (list, dict)) and not v: - continue - cleaned[k] = v - return cleaned - elif isinstance(data, list): - return [_clean_for_yaml(item, preserve_keys) for item in data] - return data - - -# Keys whose presence is structurally significant even with all-default values. -# We serialize these as empty dicts `{}` so they survive a roundtrip. -_STRUCTURAL_KEYS = {"manage", "systemd", "install", "path", "tool", "expose", "proxy", "caddy"} - - -def _manifest_to_yaml_dict(manifest: ComponentManifest) -> dict: - """Serialize a manifest to a YAML-friendly dict, preserving structural presence.""" - full = manifest.model_dump(mode="json", exclude_none=True, exclude={"id", "roles"}) - minimal = manifest.model_dump( - mode="json", exclude_none=True, exclude={"id", "roles"}, exclude_defaults=True - ) - - def merge(full_val: object, min_val: object | None, key: str = "") -> object: - if isinstance(full_val, dict): - result = {} - for k, fv in full_val.items(): - mv = min_val.get(k) if isinstance(min_val, dict) else None - if k in _STRUCTURAL_KEYS: - merged = merge(fv, mv, k) - if merged is not None: - result[k] = merged - elif mv is not None: - result[k] = merge(fv, mv, k) - elif isinstance(fv, dict): - merged = merge(fv, None, k) - if merged: - result[k] = merged - return result if result else ({} if key in _STRUCTURAL_KEYS else result) - elif isinstance(full_val, list): - if min_val is not None: - return full_val - return [] - else: - if min_val is not None: - return full_val - return None - - result = merge(full, minimal) - return _clean_for_yaml(result) - - -def save_config(config: CastleConfig) -> None: - """Save castle configuration to castle.yaml.""" - data: dict = {"gateway": {"port": config.gateway.port}, "components": {}} - - for name, manifest in config.components.items(): - data["components"][name] = _manifest_to_yaml_dict(manifest) - - config_path = config.root / "castle.yaml" - with open(config_path, "w") as f: - yaml.dump(data, f, default_flow_style=False, sort_keys=False) - - -def ensure_dirs() -> None: - """Ensure castle directories exist.""" - CASTLE_HOME.mkdir(parents=True, exist_ok=True) - GENERATED_DIR.mkdir(parents=True, exist_ok=True) - SECRETS_DIR.mkdir(parents=True, exist_ok=True) - os.chmod(SECRETS_DIR, 0o700) +from castle_core.config import * # noqa: F401, F403 +from castle_core.config import ( # noqa: F401 — explicit re-exports for type checkers + CASTLE_HOME, + GENERATED_DIR, + SECRETS_DIR, + CastleConfig, + GatewayConfig, + ensure_dirs, + find_castle_root, + load_config, + resolve_env_vars, + save_config, +) diff --git a/cli/src/castle_cli/manifest.py b/cli/src/castle_cli/manifest.py index 862acca..cf6f7be 100644 --- a/cli/src/castle_cli/manifest.py +++ b/cli/src/castle_cli/manifest.py @@ -1,325 +1,37 @@ -"""Castle component manifest — Pydantic models for the component registry.""" - -from __future__ import annotations - -from enum import Enum -from typing import Annotated, Literal, Union - -from pydantic import BaseModel, ConfigDict, Field, computed_field, model_validator - -EnvMap = dict[str, str] - - -class RestartPolicy(str, Enum): - NO = "no" - ON_FAILURE = "on-failure" - ALWAYS = "always" - - -class TLSMode(str, Enum): - OFF = "off" - INTERNAL = "internal" - LETSENCRYPT = "letsencrypt" - - -class Role(str, Enum): - TOOL = "tool" - SERVICE = "service" - WORKER = "worker" - FRONTEND = "frontend" - JOB = "job" - REMOTE = "remote" - CONTAINERIZED = "containerized" - - -# --------------------- -# Run specs (discriminated union) -# --------------------- - - -class RunBase(BaseModel): - runner: str - working_dir: str | None = None - env: EnvMap = Field(default_factory=dict) - - -class RunCommand(RunBase): - runner: Literal["command"] - argv: list[str] = Field(min_length=1) - - -class RunPythonModule(RunBase): - runner: Literal["python_module"] - module: str - args: list[str] = Field(default_factory=list) - python: str | None = None - - -class RunPythonUvTool(RunBase): - runner: Literal["python_uv_tool"] - tool: str - args: list[str] = Field(default_factory=list) - - -class RunContainer(RunBase): - runner: Literal["container"] - image: str - command: list[str] | None = None - args: list[str] = Field(default_factory=list) - ports: dict[int, int] = Field(default_factory=dict) - volumes: list[str] = Field(default_factory=list) - workdir: str | None = None - - -class RunNode(RunBase): - runner: Literal["node"] - script: str - package_manager: Literal["npm", "pnpm", "yarn"] = "pnpm" - args: list[str] = Field(default_factory=list) - - -class RunRemote(RunBase): - runner: Literal["remote"] - base_url: str - health_url: str | None = None - - -RunSpec = Annotated[ - Union[RunCommand, RunPythonModule, RunPythonUvTool, RunContainer, RunNode, RunRemote], - Field(discriminator="runner"), -] - - -# --------------------- -# Triggers -# --------------------- - - -class TriggerManual(BaseModel): - type: Literal["manual"] = "manual" - - -class TriggerSchedule(BaseModel): - type: Literal["schedule"] = "schedule" - cron: str - timezone: str = "America/Los_Angeles" - - -class TriggerEvent(BaseModel): - type: Literal["event"] = "event" - source: str - topic: str | None = None - queue: str | None = None - - -class TriggerRequest(BaseModel): - type: Literal["request"] = "request" - protocol: Literal["http", "https", "grpc"] = "http" - - -TriggerSpec = Union[TriggerManual, TriggerSchedule, TriggerEvent, TriggerRequest] - - -# --------------------- -# Systemd management -# --------------------- - - -class ReadinessHttpGet(BaseModel): - http_get: str - timeout_seconds: int = 2 - interval_seconds: int = 2 - success_codes: list[int] = Field(default_factory=lambda: [200]) - - -class SystemdSpec(BaseModel): - enable: bool = True - user: bool = True - description: str | None = None - after: list[str] = Field(default_factory=list) - requires: list[str] = Field(default_factory=list) - wanted_by: list[str] = Field(default_factory=lambda: ["default.target"]) - restart: RestartPolicy = RestartPolicy.ON_FAILURE - restart_sec: int = 2 - no_new_privileges: bool = True - readiness: ReadinessHttpGet | None = None - exec_reload: str | None = None - - -class ManageSpec(BaseModel): - systemd: SystemdSpec | None = None - - -# --------------------- -# Install (PATH shims) -# --------------------- - - -class PathInstallSpec(BaseModel): - enable: bool = True - alias: str | None = None - shim: bool = True - - -class InstallSpec(BaseModel): - path: PathInstallSpec | None = None - - -# --------------------- -# Tool spec -# --------------------- - - -class ToolSpec(BaseModel): - model_config = ConfigDict(extra="ignore") - - version: str = "1.0.0" - source: str | None = None - system_dependencies: list[str] = Field(default_factory=list) - - -# --------------------- -# HTTP exposure + proxy -# --------------------- - - -class HttpInternal(BaseModel): - host: str = "127.0.0.1" - port: int = Field(ge=1, le=65535) - unix_socket: str | None = None - - -class HttpPublic(BaseModel): - hostnames: list[str] = Field(min_length=1) - path_prefix: str = "/" - tls: TLSMode = TLSMode.INTERNAL - - -class HttpExposeSpec(BaseModel): - internal: HttpInternal - public: HttpPublic | None = None - health_path: str | None = None - - -class ExposeSpec(BaseModel): - http: HttpExposeSpec | None = None - - -class CaddySpec(BaseModel): - enable: bool = True - path_prefix: str | None = None - extra_snippets: list[str] = Field(default_factory=list) - - -class ProxySpec(BaseModel): - caddy: CaddySpec | None = None - - -# --------------------- -# Build spec -# --------------------- - - -class BuildSpec(BaseModel): - working_dir: str | None = None - commands: list[list[str]] = Field(default_factory=list) - outputs: list[str] = Field(default_factory=list) - - -# --------------------- -# Capabilities -# --------------------- - - -class Capability(BaseModel): - type: str - name: str | None = None - meta: dict[str, str] = Field(default_factory=dict) - - -# --------------------- -# Component manifest -# --------------------- - - -class ComponentManifest(BaseModel): - id: str = "" - name: str | None = None - description: str | None = None - - run: RunSpec | None = None - - triggers: list[TriggerSpec] = Field(default_factory=list) - - manage: ManageSpec | None = None - install: InstallSpec | None = None - tool: ToolSpec | None = None - expose: ExposeSpec | None = None - proxy: ProxySpec | None = None - build: BuildSpec | None = None - - provides: list[Capability] = Field(default_factory=list) - consumes: list[Capability] = Field(default_factory=list) - - tags: list[str] = Field(default_factory=list) - - @computed_field # type: ignore[prop-decorator] - @property - def roles(self) -> list[Role]: - roles: set[Role] = set() - - if self.run: - if self.run.runner == "remote": - roles.add(Role.REMOTE) - if self.run.runner == "container": - roles.add(Role.CONTAINERIZED) - - if self.install and self.install.path and self.install.path.enable: - roles.add(Role.TOOL) - - if self.tool: - roles.add(Role.TOOL) - - if self.expose and self.expose.http: - roles.add(Role.SERVICE) - - if ( - self.manage - and self.manage.systemd - and self.manage.systemd.enable - and not (self.expose and self.expose.http) - ): - roles.add(Role.WORKER) - - if self.build and (self.build.outputs or self.build.commands): - roles.add(Role.FRONTEND) - - if any(getattr(t, "type", None) == "schedule" for t in self.triggers): - roles.add(Role.JOB) - - if not roles: - roles.add(Role.TOOL) - - return sorted(roles, key=lambda r: r.value) - - @property - def source_dir(self) -> str | None: - """Best-effort relative directory for this component's source. - - Resolution order: run.working_dir → build.working_dir → tool.source (strip trailing /). - Returns None if no directory can be determined. - """ - if self.run and self.run.working_dir: - return self.run.working_dir - if self.build and self.build.working_dir: - return self.build.working_dir - if self.tool and self.tool.source: - return self.tool.source.rstrip("/") - return None - - @model_validator(mode="after") - def _basic_consistency(self) -> ComponentManifest: - if self.manage and self.manage.systemd and self.manage.systemd.enable: - if self.run and self.run.runner == "remote": - raise ValueError("manage.systemd cannot be enabled for runner=remote.") - return self +"""Re-export from castle-core for backward compatibility.""" + +from castle_core.manifest import * # noqa: F401, F403 +from castle_core.manifest import ( # noqa: F401 — explicit re-exports for type checkers + BuildSpec, + CaddySpec, + Capability, + ComponentManifest, + EnvMap, + ExposeSpec, + HttpExposeSpec, + HttpInternal, + HttpPublic, + InstallSpec, + ManageSpec, + PathInstallSpec, + ProxySpec, + ReadinessHttpGet, + RestartPolicy, + Role, + RunBase, + RunCommand, + RunContainer, + RunNode, + RunPythonModule, + RunPythonUvTool, + RunRemote, + RunSpec, + SystemdSpec, + TLSMode, + ToolSpec, + TriggerEvent, + TriggerManual, + TriggerRequest, + TriggerSchedule, + TriggerSpec, +) diff --git a/cli/tests/conftest.py b/cli/tests/conftest.py index 5403aa6..a1acade 100644 --- a/cli/tests/conftest.py +++ b/cli/tests/conftest.py @@ -21,7 +21,7 @@ def castle_root(tmp_path: Path) -> Generator[Path, None, None]: "run": { "runner": "python_uv_tool", "tool": "test-svc", - "cwd": "test-svc", + "working_dir": "test-svc", "env": {"TEST_SVC_DATA_DIR": str(tmp_path / "data" / "test-svc")}, }, "expose": { diff --git a/core/pyproject.toml b/core/pyproject.toml new file mode 100644 index 0000000..95ef490 --- /dev/null +++ b/core/pyproject.toml @@ -0,0 +1,25 @@ +[project] +name = "castle-core" +version = "0.1.0" +description = "Castle platform core library - manifest models, config, and generators" +requires-python = ">=3.11" +dependencies = [ + "pyyaml>=6.0.0", + "pydantic>=2.0.0", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["src/castle_core"] + +[dependency-groups] +dev = [ + "pytest>=7.0.0", + "pyyaml>=6.0.0", +] + +[tool.ruff.lint.isort] +known-first-party = ["castle_core"] diff --git a/core/src/castle_core/__init__.py b/core/src/castle_core/__init__.py new file mode 100644 index 0000000..97d088e --- /dev/null +++ b/core/src/castle_core/__init__.py @@ -0,0 +1,3 @@ +"""Castle core library - manifest models, configuration, and generators.""" + +__version__ = "0.1.0" diff --git a/core/src/castle_core/config.py b/core/src/castle_core/config.py new file mode 100644 index 0000000..433fa29 --- /dev/null +++ b/core/src/castle_core/config.py @@ -0,0 +1,217 @@ +"""Castle configuration and registry management.""" + +from __future__ import annotations + +import os +import re +from dataclasses import dataclass +from pathlib import Path + +import yaml + +from castle_core.manifest import ComponentManifest, Role + + +def find_castle_root() -> Path: + """Find the castle repository root by walking up from cwd looking for castle.yaml.""" + current = Path.cwd() + while current != current.parent: + if (current / "castle.yaml").exists(): + return current + current = current.parent + # Fallback: check if castle.yaml is in a well-known location + default = Path("/data/repos/castle") + if (default / "castle.yaml").exists(): + return default + raise FileNotFoundError( + "Could not find castle.yaml. Run castle from within the castle repository." + ) + + +CASTLE_HOME = Path.home() / ".castle" +GENERATED_DIR = CASTLE_HOME / "generated" +SECRETS_DIR = CASTLE_HOME / "secrets" + + +@dataclass +class GatewayConfig: + """Gateway configuration.""" + + port: int = 9000 + + +@dataclass +class CastleConfig: + """Full castle configuration.""" + + root: Path + gateway: GatewayConfig + components: dict[str, ComponentManifest] + + @property + def services(self) -> dict[str, ComponentManifest]: + """Return components with the SERVICE role.""" + return { + k: v for k, v in self.components.items() if Role.SERVICE in v.roles + } + + @property + def tools(self) -> dict[str, ComponentManifest]: + """Return components with the TOOL role.""" + return { + k: v for k, v in self.components.items() if Role.TOOL in v.roles + } + + @property + def workers(self) -> dict[str, ComponentManifest]: + """Return components with the WORKER role.""" + return { + k: v for k, v in self.components.items() if Role.WORKER in v.roles + } + + @property + def managed(self) -> dict[str, ComponentManifest]: + """Return components managed by systemd.""" + return { + k: v + for k, v in self.components.items() + if v.manage and v.manage.systemd and v.manage.systemd.enable + } + + +def resolve_env_vars( + env: dict[str, str], manifest: ComponentManifest +) -> dict[str, str]: + """Resolve ${secret:NAME} references in env values.""" + resolved = {} + for key, value in env.items(): + + def replace_var(match: re.Match[str]) -> str: + ref = match.group(1) + if ref.startswith("secret:"): + secret_name = ref[7:] + return _read_secret(secret_name) + return match.group(0) + + resolved[key] = re.sub(r"\$\{([^}]+)\}", replace_var, value) + return resolved + + +def _read_secret(name: str) -> str: + """Read a secret from ~/.castle/secrets/. Returns placeholder if not found.""" + secret_path = SECRETS_DIR / name + if secret_path.exists(): + return secret_path.read_text().strip() + return f"" + + +def _parse_component(name: str, data: dict) -> ComponentManifest: + """Parse a components: entry directly into a ComponentManifest.""" + data_copy = dict(data) + data_copy["id"] = name + return ComponentManifest.model_validate(data_copy) + + +def load_config(root: Path | None = None) -> CastleConfig: + """Load castle.yaml and return parsed configuration.""" + if root is None: + root = find_castle_root() + + config_path = root / "castle.yaml" + if not config_path.exists(): + raise FileNotFoundError(f"Castle config not found: {config_path}") + + with open(config_path) as f: + data = yaml.safe_load(f) + + gateway_data = data.get("gateway", {}) + gateway = GatewayConfig(port=gateway_data.get("port", 9000)) + + components: dict[str, ComponentManifest] = {} + for name, comp_data in data.get("components", {}).items(): + components[name] = _parse_component(name, comp_data) + + return CastleConfig(root=root, gateway=gateway, components=components) + + +def _clean_for_yaml(data: object, preserve_keys: set[str] | None = None) -> object: + """Recursively remove empty lists and non-structural empty dicts.""" + if preserve_keys is None: + preserve_keys = _STRUCTURAL_KEYS + if isinstance(data, dict): + cleaned = {} + for k, v in data.items(): + v = _clean_for_yaml(v, preserve_keys) + # Keep structural keys even if empty dict + if k in preserve_keys and isinstance(v, dict): + cleaned[k] = v + continue + # Skip empty collections + if isinstance(v, (list, dict)) and not v: + continue + cleaned[k] = v + return cleaned + elif isinstance(data, list): + return [_clean_for_yaml(item, preserve_keys) for item in data] + return data + + +# Keys whose presence is structurally significant even with all-default values. +# We serialize these as empty dicts `{}` so they survive a roundtrip. +_STRUCTURAL_KEYS = {"manage", "systemd", "install", "path", "tool", "expose", "proxy", "caddy"} + + +def _manifest_to_yaml_dict(manifest: ComponentManifest) -> dict: + """Serialize a manifest to a YAML-friendly dict, preserving structural presence.""" + full = manifest.model_dump(mode="json", exclude_none=True, exclude={"id", "roles"}) + minimal = manifest.model_dump( + mode="json", exclude_none=True, exclude={"id", "roles"}, exclude_defaults=True + ) + + def merge(full_val: object, min_val: object | None, key: str = "") -> object: + if isinstance(full_val, dict): + result = {} + for k, fv in full_val.items(): + mv = min_val.get(k) if isinstance(min_val, dict) else None + if k in _STRUCTURAL_KEYS: + merged = merge(fv, mv, k) + if merged is not None: + result[k] = merged + elif mv is not None: + result[k] = merge(fv, mv, k) + elif isinstance(fv, dict): + merged = merge(fv, None, k) + if merged: + result[k] = merged + return result if result else ({} if key in _STRUCTURAL_KEYS else result) + elif isinstance(full_val, list): + if min_val is not None: + return full_val + return [] + else: + if min_val is not None: + return full_val + return None + + result = merge(full, minimal) + return _clean_for_yaml(result) + + +def save_config(config: CastleConfig) -> None: + """Save castle configuration to castle.yaml.""" + data: dict = {"gateway": {"port": config.gateway.port}, "components": {}} + + for name, manifest in config.components.items(): + data["components"][name] = _manifest_to_yaml_dict(manifest) + + config_path = config.root / "castle.yaml" + with open(config_path, "w") as f: + yaml.dump(data, f, default_flow_style=False, sort_keys=False) + + +def ensure_dirs() -> None: + """Ensure castle directories exist.""" + CASTLE_HOME.mkdir(parents=True, exist_ok=True) + GENERATED_DIR.mkdir(parents=True, exist_ok=True) + SECRETS_DIR.mkdir(parents=True, exist_ok=True) + os.chmod(SECRETS_DIR, 0o700) diff --git a/core/src/castle_core/generators/__init__.py b/core/src/castle_core/generators/__init__.py new file mode 100644 index 0000000..06aeafe --- /dev/null +++ b/core/src/castle_core/generators/__init__.py @@ -0,0 +1,28 @@ +"""Castle infrastructure generators.""" + +from castle_core.generators.caddyfile import find_app_dist, generate_caddyfile +from castle_core.generators.systemd import ( + build_podman_command, + cron_to_interval_sec, + cron_to_oncalendar, + generate_timer, + generate_unit, + get_schedule_trigger, + manifest_to_exec_start, + timer_name, + unit_name, +) + +__all__ = [ + "build_podman_command", + "cron_to_interval_sec", + "cron_to_oncalendar", + "find_app_dist", + "generate_caddyfile", + "generate_timer", + "generate_unit", + "get_schedule_trigger", + "manifest_to_exec_start", + "timer_name", + "unit_name", +] diff --git a/core/src/castle_core/generators/caddyfile.py b/core/src/castle_core/generators/caddyfile.py new file mode 100644 index 0000000..c909b51 --- /dev/null +++ b/core/src/castle_core/generators/caddyfile.py @@ -0,0 +1,55 @@ +"""Caddyfile generation from castle config.""" + +from __future__ import annotations + +from castle_core.config import GENERATED_DIR, CastleConfig + + +def find_app_dist(config: CastleConfig) -> str | None: + """Find the app dist/ directory if it exists.""" + dist = config.root / "app" / "dist" + if dist.exists() and (dist / "index.html").exists(): + return str(dist) + return None + + +def generate_caddyfile(config: CastleConfig) -> str: + """Generate Caddyfile content from castle config.""" + lines = [f":{config.gateway.port} {{"] + + # Reverse proxy for each component with proxy.caddy and expose.http + for name, manifest in config.components.items(): + if not (manifest.proxy and manifest.proxy.caddy and manifest.proxy.caddy.enable): + continue + if not (manifest.expose and manifest.expose.http): + continue + + caddy = manifest.proxy.caddy + http = manifest.expose.http + path_prefix = caddy.path_prefix or f"/{name}" + port = http.internal.port + host = http.internal.host or "localhost" + + lines.append(f" handle_path {path_prefix}/* {{") + lines.append(f" reverse_proxy {host}:{port}") + lines.append(" }") + lines.append("") + + # App SPA at root (must come after more-specific handle_path rules) + app_dist = find_app_dist(config) + if app_dist: + lines.append(" handle {") + lines.append(f" root * {app_dist}") + lines.append(" try_files {path} /index.html") + lines.append(" file_server") + lines.append(" }") + else: + # Fallback: serve from generated directory + fallback = GENERATED_DIR / "app" + lines.append(" handle / {") + lines.append(f" root * {fallback}") + lines.append(" file_server") + lines.append(" }") + + lines.append("}") + return "\n".join(lines) diff --git a/core/src/castle_core/generators/systemd.py b/core/src/castle_core/generators/systemd.py new file mode 100644 index 0000000..71f4408 --- /dev/null +++ b/core/src/castle_core/generators/systemd.py @@ -0,0 +1,233 @@ +"""Systemd unit and timer generation from castle manifests.""" + +from __future__ import annotations + +import shutil +from pathlib import Path + +from castle_core.config import CastleConfig, resolve_env_vars +from castle_core.manifest import ComponentManifest, RestartPolicy + +SYSTEMD_USER_DIR = Path.home() / ".config" / "systemd" / "user" +UNIT_PREFIX = "castle-" + + +def unit_name(service_name: str) -> str: + """Get the systemd unit name for a service.""" + return f"{UNIT_PREFIX}{service_name}.service" + + +def timer_name(service_name: str) -> str: + """Get the systemd timer name for a scheduled service.""" + return f"{UNIT_PREFIX}{service_name}.timer" + + +def get_schedule_trigger(manifest: ComponentManifest) -> object | None: + """Return the schedule trigger if one exists, else None.""" + for t in manifest.triggers: + if getattr(t, "type", None) == "schedule": + return t + return None + + +def cron_to_oncalendar(cron: str) -> str: + """Best-effort conversion of cron expression to systemd OnCalendar. + + Handles common patterns; falls back to using OnUnitActiveSec for the rest. + """ + parts = cron.strip().split() + if len(parts) != 5: + return "" + + minute, hour, dom, month, dow = parts + + # */N minutes → run every N minutes + if minute.startswith("*/") and hour == "*" and dom == "*" and month == "*" and dow == "*": + return "" # Use OnUnitActiveSec instead + + # Specific time daily: "0 2 * * *" → "*-*-* 02:00:00" + if dom == "*" and month == "*" and dow == "*": + h = hour.zfill(2) if hour != "*" else "*" + m = minute.zfill(2) if minute != "*" else "*" + return f"*-*-* {h}:{m}:00" + + return "" + + +def cron_to_interval_sec(cron: str) -> int | None: + """Extract interval seconds from */N cron patterns.""" + parts = cron.strip().split() + if len(parts) != 5: + return None + minute, hour, dom, month, dow = parts + if minute.startswith("*/") and hour == "*" and dom == "*" and month == "*" and dow == "*": + try: + return int(minute[2:]) * 60 + except ValueError: + return None + return None + + +def manifest_to_exec_start(manifest: ComponentManifest, root: Path) -> str: + """Convert a manifest's RunSpec to a systemd ExecStart command.""" + run = manifest.run + if run is None: + raise ValueError(f"Component '{manifest.id}' has no run spec") + + match run.runner: + case "python_uv_tool": + uv_path = shutil.which("uv") or "uv" + args_str = " ".join(run.args) if run.args else "" + cmd = f"{uv_path} run {run.tool}" + if args_str: + cmd += f" {args_str}" + return cmd + case "python_module": + python = run.python or shutil.which("python3") or "python3" + args_str = " ".join(run.args) if run.args else "" + cmd = f"{python} -m {run.module}" + if args_str: + cmd += f" {args_str}" + return cmd + case "command": + argv = list(run.argv) + resolved = shutil.which(argv[0]) + if resolved: + argv[0] = resolved + return " ".join(argv) + case "container": + return build_podman_command(manifest) + case "node": + pm = run.package_manager + cmd = f"{pm} run {run.script}" + if run.args: + cmd += " " + " ".join(run.args) + return cmd + case _: + raise ValueError(f"Unsupported runner '{run.runner}' for systemd unit") + + +def build_podman_command(manifest: ComponentManifest) -> str: + """Build a podman/docker run command from a container RunSpec.""" + run = manifest.run + podman = shutil.which("podman") or shutil.which("docker") or "podman" + parts = [podman, "run", "--rm", f"--name=castle-{manifest.id}"] + + for container_port, host_port in run.ports.items(): + parts.append(f"-p {host_port}:{container_port}") + for vol in run.volumes: + parts.append(f"-v {vol}") + for key, val in run.env.items(): + parts.append(f"-e {key}={val}") + if run.workdir: + parts.append(f"-w {run.workdir}") + + parts.append(run.image) + if run.command: + parts.extend(run.command) + if run.args: + parts.extend(run.args) + + return " ".join(parts) + + +def generate_unit(config: CastleConfig, name: str, manifest: ComponentManifest) -> str: + """Generate a systemd user unit file for a component.""" + run = manifest.run + if run is None: + raise ValueError(f"Component '{name}' has no run spec") + + working_dir = config.root / (run.working_dir or name) + exec_start = manifest_to_exec_start(manifest, config.root) + + resolved_env = resolve_env_vars(run.env, manifest) + env_lines = "" + for key, value in resolved_env.items(): + env_lines += f"Environment={key}={value}\n" + + # Add PATH so tools are findable + env_lines += f'Environment="PATH={Path.home() / ".local/bin"}:/usr/local/bin:/usr/bin:/bin"\n' + + sd = None + if manifest.manage and manifest.manage.systemd: + sd = manifest.manage.systemd + + description = (sd and sd.description) or manifest.description or name + after = " ".join(sd.after) if sd and sd.after else "network.target" + wanted_by = " ".join(sd.wanted_by) if sd else "default.target" + + is_scheduled = get_schedule_trigger(manifest) is not None + + if is_scheduled: + # Oneshot service for timer-driven jobs + unit = f"""[Unit] +Description=Castle: {description} +After={after} + +[Service] +Type=oneshot +WorkingDirectory={working_dir} +ExecStart={exec_start} +{env_lines}""" + else: + restart = (sd.restart if sd else RestartPolicy.ON_FAILURE).value + restart_sec = sd.restart_sec if sd else 5 + unit = f"""[Unit] +Description=Castle: {description} +After={after} + +[Service] +Type=simple +WorkingDirectory={working_dir} +ExecStart={exec_start} +{env_lines}Restart={restart} +RestartSec={restart_sec} +SuccessExitStatus=143 +""" + + if sd and sd.exec_reload: + reload_argv = sd.exec_reload.split() + resolved_reload = shutil.which(reload_argv[0]) + if resolved_reload: + reload_argv[0] = resolved_reload + unit += f"ExecReload={' '.join(reload_argv)}\n" + + if sd and sd.no_new_privileges: + unit += "NoNewPrivileges=true\n" + + unit += f""" +[Install] +WantedBy={wanted_by} +""" + return unit + + +def generate_timer(name: str, manifest: ComponentManifest) -> str | None: + """Generate a systemd timer unit if the component has a schedule trigger.""" + trigger = get_schedule_trigger(manifest) + if trigger is None: + return None + + description = manifest.description or name + + # Try to convert cron to OnCalendar, fall back to OnUnitActiveSec + on_calendar = cron_to_oncalendar(trigger.cron) + interval_sec = cron_to_interval_sec(trigger.cron) + + timer_lines = "" + if on_calendar: + timer_lines = f"OnCalendar={on_calendar}\n" + elif interval_sec: + timer_lines = f"OnBootSec=60\nOnUnitActiveSec={interval_sec}s\n" + else: + timer_lines = "OnBootSec=60\nOnUnitActiveSec=300\n" + + return f"""[Unit] +Description=Castle timer: {description} + +[Timer] +{timer_lines}Persistent=false + +[Install] +WantedBy=timers.target +""" diff --git a/core/src/castle_core/manifest.py b/core/src/castle_core/manifest.py new file mode 100644 index 0000000..862acca --- /dev/null +++ b/core/src/castle_core/manifest.py @@ -0,0 +1,325 @@ +"""Castle component manifest — Pydantic models for the component registry.""" + +from __future__ import annotations + +from enum import Enum +from typing import Annotated, Literal, Union + +from pydantic import BaseModel, ConfigDict, Field, computed_field, model_validator + +EnvMap = dict[str, str] + + +class RestartPolicy(str, Enum): + NO = "no" + ON_FAILURE = "on-failure" + ALWAYS = "always" + + +class TLSMode(str, Enum): + OFF = "off" + INTERNAL = "internal" + LETSENCRYPT = "letsencrypt" + + +class Role(str, Enum): + TOOL = "tool" + SERVICE = "service" + WORKER = "worker" + FRONTEND = "frontend" + JOB = "job" + REMOTE = "remote" + CONTAINERIZED = "containerized" + + +# --------------------- +# Run specs (discriminated union) +# --------------------- + + +class RunBase(BaseModel): + runner: str + working_dir: str | None = None + env: EnvMap = Field(default_factory=dict) + + +class RunCommand(RunBase): + runner: Literal["command"] + argv: list[str] = Field(min_length=1) + + +class RunPythonModule(RunBase): + runner: Literal["python_module"] + module: str + args: list[str] = Field(default_factory=list) + python: str | None = None + + +class RunPythonUvTool(RunBase): + runner: Literal["python_uv_tool"] + tool: str + args: list[str] = Field(default_factory=list) + + +class RunContainer(RunBase): + runner: Literal["container"] + image: str + command: list[str] | None = None + args: list[str] = Field(default_factory=list) + ports: dict[int, int] = Field(default_factory=dict) + volumes: list[str] = Field(default_factory=list) + workdir: str | None = None + + +class RunNode(RunBase): + runner: Literal["node"] + script: str + package_manager: Literal["npm", "pnpm", "yarn"] = "pnpm" + args: list[str] = Field(default_factory=list) + + +class RunRemote(RunBase): + runner: Literal["remote"] + base_url: str + health_url: str | None = None + + +RunSpec = Annotated[ + Union[RunCommand, RunPythonModule, RunPythonUvTool, RunContainer, RunNode, RunRemote], + Field(discriminator="runner"), +] + + +# --------------------- +# Triggers +# --------------------- + + +class TriggerManual(BaseModel): + type: Literal["manual"] = "manual" + + +class TriggerSchedule(BaseModel): + type: Literal["schedule"] = "schedule" + cron: str + timezone: str = "America/Los_Angeles" + + +class TriggerEvent(BaseModel): + type: Literal["event"] = "event" + source: str + topic: str | None = None + queue: str | None = None + + +class TriggerRequest(BaseModel): + type: Literal["request"] = "request" + protocol: Literal["http", "https", "grpc"] = "http" + + +TriggerSpec = Union[TriggerManual, TriggerSchedule, TriggerEvent, TriggerRequest] + + +# --------------------- +# Systemd management +# --------------------- + + +class ReadinessHttpGet(BaseModel): + http_get: str + timeout_seconds: int = 2 + interval_seconds: int = 2 + success_codes: list[int] = Field(default_factory=lambda: [200]) + + +class SystemdSpec(BaseModel): + enable: bool = True + user: bool = True + description: str | None = None + after: list[str] = Field(default_factory=list) + requires: list[str] = Field(default_factory=list) + wanted_by: list[str] = Field(default_factory=lambda: ["default.target"]) + restart: RestartPolicy = RestartPolicy.ON_FAILURE + restart_sec: int = 2 + no_new_privileges: bool = True + readiness: ReadinessHttpGet | None = None + exec_reload: str | None = None + + +class ManageSpec(BaseModel): + systemd: SystemdSpec | None = None + + +# --------------------- +# Install (PATH shims) +# --------------------- + + +class PathInstallSpec(BaseModel): + enable: bool = True + alias: str | None = None + shim: bool = True + + +class InstallSpec(BaseModel): + path: PathInstallSpec | None = None + + +# --------------------- +# Tool spec +# --------------------- + + +class ToolSpec(BaseModel): + model_config = ConfigDict(extra="ignore") + + version: str = "1.0.0" + source: str | None = None + system_dependencies: list[str] = Field(default_factory=list) + + +# --------------------- +# HTTP exposure + proxy +# --------------------- + + +class HttpInternal(BaseModel): + host: str = "127.0.0.1" + port: int = Field(ge=1, le=65535) + unix_socket: str | None = None + + +class HttpPublic(BaseModel): + hostnames: list[str] = Field(min_length=1) + path_prefix: str = "/" + tls: TLSMode = TLSMode.INTERNAL + + +class HttpExposeSpec(BaseModel): + internal: HttpInternal + public: HttpPublic | None = None + health_path: str | None = None + + +class ExposeSpec(BaseModel): + http: HttpExposeSpec | None = None + + +class CaddySpec(BaseModel): + enable: bool = True + path_prefix: str | None = None + extra_snippets: list[str] = Field(default_factory=list) + + +class ProxySpec(BaseModel): + caddy: CaddySpec | None = None + + +# --------------------- +# Build spec +# --------------------- + + +class BuildSpec(BaseModel): + working_dir: str | None = None + commands: list[list[str]] = Field(default_factory=list) + outputs: list[str] = Field(default_factory=list) + + +# --------------------- +# Capabilities +# --------------------- + + +class Capability(BaseModel): + type: str + name: str | None = None + meta: dict[str, str] = Field(default_factory=dict) + + +# --------------------- +# Component manifest +# --------------------- + + +class ComponentManifest(BaseModel): + id: str = "" + name: str | None = None + description: str | None = None + + run: RunSpec | None = None + + triggers: list[TriggerSpec] = Field(default_factory=list) + + manage: ManageSpec | None = None + install: InstallSpec | None = None + tool: ToolSpec | None = None + expose: ExposeSpec | None = None + proxy: ProxySpec | None = None + build: BuildSpec | None = None + + provides: list[Capability] = Field(default_factory=list) + consumes: list[Capability] = Field(default_factory=list) + + tags: list[str] = Field(default_factory=list) + + @computed_field # type: ignore[prop-decorator] + @property + def roles(self) -> list[Role]: + roles: set[Role] = set() + + if self.run: + if self.run.runner == "remote": + roles.add(Role.REMOTE) + if self.run.runner == "container": + roles.add(Role.CONTAINERIZED) + + if self.install and self.install.path and self.install.path.enable: + roles.add(Role.TOOL) + + if self.tool: + roles.add(Role.TOOL) + + if self.expose and self.expose.http: + roles.add(Role.SERVICE) + + if ( + self.manage + and self.manage.systemd + and self.manage.systemd.enable + and not (self.expose and self.expose.http) + ): + roles.add(Role.WORKER) + + if self.build and (self.build.outputs or self.build.commands): + roles.add(Role.FRONTEND) + + if any(getattr(t, "type", None) == "schedule" for t in self.triggers): + roles.add(Role.JOB) + + if not roles: + roles.add(Role.TOOL) + + return sorted(roles, key=lambda r: r.value) + + @property + def source_dir(self) -> str | None: + """Best-effort relative directory for this component's source. + + Resolution order: run.working_dir → build.working_dir → tool.source (strip trailing /). + Returns None if no directory can be determined. + """ + if self.run and self.run.working_dir: + return self.run.working_dir + if self.build and self.build.working_dir: + return self.build.working_dir + if self.tool and self.tool.source: + return self.tool.source.rstrip("/") + return None + + @model_validator(mode="after") + def _basic_consistency(self) -> ComponentManifest: + if self.manage and self.manage.systemd and self.manage.systemd.enable: + if self.run and self.run.runner == "remote": + raise ValueError("manage.systemd cannot be enabled for runner=remote.") + return self diff --git a/core/tests/__init__.py b/core/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/tests/conftest.py b/core/tests/conftest.py new file mode 100644 index 0000000..2cad3b0 --- /dev/null +++ b/core/tests/conftest.py @@ -0,0 +1,68 @@ +"""Shared fixtures for castle core tests.""" + +from __future__ import annotations + +from collections.abc import Generator +from pathlib import Path + +import pytest +import yaml + + +@pytest.fixture +def castle_root(tmp_path: Path) -> Generator[Path, None, None]: + """Create a temporary castle root with castle.yaml.""" + castle_yaml = tmp_path / "castle.yaml" + config = { + "gateway": {"port": 18000}, + "components": { + "test-svc": { + "description": "Test service", + "run": { + "runner": "python_uv_tool", + "tool": "test-svc", + "working_dir": "test-svc", + "env": {"TEST_SVC_DATA_DIR": str(tmp_path / "data" / "test-svc")}, + }, + "expose": { + "http": { + "internal": {"port": 19000}, + "health_path": "/health", + } + }, + "proxy": { + "caddy": {"path_prefix": "/test-svc"}, + }, + "manage": { + "systemd": {}, + }, + }, + "test-tool": { + "description": "Test tool", + "install": { + "path": {"alias": "test-tool"}, + }, + }, + }, + } + castle_yaml.write_text(yaml.dump(config, default_flow_style=False)) + + # Create project directories + svc_dir = tmp_path / "test-svc" + svc_dir.mkdir() + (svc_dir / "pyproject.toml").write_text("[project]\nname = 'test-svc'\n") + + tool_dir = tmp_path / "test-tool" + tool_dir.mkdir() + + yield tmp_path + + +@pytest.fixture +def castle_home(tmp_path: Path) -> Generator[Path, None, None]: + """Create a temporary ~/.castle directory.""" + home = tmp_path / ".castle" + home.mkdir() + (home / "generated").mkdir() + (home / "secrets").mkdir() + yield home diff --git a/cli/tests/test_gateway.py b/core/tests/test_caddyfile.py similarity index 80% rename from cli/tests/test_gateway.py rename to core/tests/test_caddyfile.py index 6a2bf8b..142518e 100644 --- a/cli/tests/test_gateway.py +++ b/core/tests/test_caddyfile.py @@ -1,11 +1,11 @@ -"""Tests for castle gateway command.""" +"""Tests for Caddyfile generation.""" from __future__ import annotations from pathlib import Path -from castle_cli.commands.gateway import _generate_caddyfile -from castle_cli.config import load_config +from castle_core.config import load_config +from castle_core.generators.caddyfile import generate_caddyfile class TestCaddyfileGeneration: @@ -14,13 +14,13 @@ class TestCaddyfileGeneration: def test_contains_gateway_port(self, castle_root: Path) -> None: """Caddyfile uses the configured gateway port.""" config = load_config(castle_root) - caddyfile = _generate_caddyfile(config) + caddyfile = generate_caddyfile(config) assert ":18000 {" in caddyfile def test_contains_service_routes(self, castle_root: Path) -> None: """Caddyfile has reverse proxy routes for services with proxy.caddy.""" config = load_config(castle_root) - caddyfile = _generate_caddyfile(config) + caddyfile = generate_caddyfile(config) assert "handle_path /test-svc/*" in caddyfile assert "reverse_proxy" in caddyfile assert "19000" in caddyfile @@ -28,13 +28,13 @@ class TestCaddyfileGeneration: def test_skips_tools(self, castle_root: Path) -> None: """Tools without proxy are not in Caddyfile.""" config = load_config(castle_root) - caddyfile = _generate_caddyfile(config) + caddyfile = generate_caddyfile(config) assert "test-tool" not in caddyfile def test_fallback_when_no_dist(self, castle_root: Path) -> None: """Uses fallback dashboard path when dist/ doesn't exist.""" config = load_config(castle_root) - caddyfile = _generate_caddyfile(config) + caddyfile = generate_caddyfile(config) # No dashboard/dist exists in tmp, so should use fallback assert "handle / {" in caddyfile assert "file_server" in caddyfile @@ -42,19 +42,19 @@ class TestCaddyfileGeneration: def test_spa_serving_when_dist_exists(self, castle_root: Path) -> None: """Serves SPA with try_files when dashboard/dist exists.""" # Create a dashboard/dist with index.html - dist = castle_root / "dashboard" / "dist" + dist = castle_root / "app" / "dist" dist.mkdir(parents=True) (dist / "index.html").write_text("") config = load_config(castle_root) - caddyfile = _generate_caddyfile(config) + caddyfile = generate_caddyfile(config) assert "try_files {path} /index.html" in caddyfile assert str(dist) in caddyfile def test_proxy_routes_before_dashboard(self, castle_root: Path) -> None: """Service proxy routes appear before the dashboard catch-all.""" config = load_config(castle_root) - caddyfile = _generate_caddyfile(config) + caddyfile = generate_caddyfile(config) proxy_pos = caddyfile.index("handle_path") handle_pos = caddyfile.index("handle /") assert proxy_pos < handle_pos diff --git a/cli/tests/test_config.py b/core/tests/test_config.py similarity index 95% rename from cli/tests/test_config.py rename to core/tests/test_config.py index 25a65c5..417c7e7 100644 --- a/cli/tests/test_config.py +++ b/core/tests/test_config.py @@ -5,13 +5,13 @@ from __future__ import annotations from pathlib import Path import pytest -from castle_cli.config import ( +from castle_core.config import ( CastleConfig, load_config, resolve_env_vars, save_config, ) -from castle_cli.manifest import ComponentManifest, Role +from castle_core.manifest import ComponentManifest, Role class TestLoadConfig: @@ -62,7 +62,7 @@ class TestLoadConfig: svc = config.components["test-svc"] assert svc.run.runner == "python_uv_tool" assert svc.run.tool == "test-svc" - assert svc.run.cwd == "test-svc" + assert svc.run.working_dir == "test-svc" def test_tool_no_run(self, castle_root: Path) -> None: """Tool without run block has no run spec.""" @@ -150,7 +150,7 @@ class TestResolveEnvVars: secrets_dir = tmp_path / "secrets" secrets_dir.mkdir() (secrets_dir / "API_KEY").write_text("my-secret-key\n") - monkeypatch.setattr("castle_cli.config.SECRETS_DIR", secrets_dir) + monkeypatch.setattr("castle_core.config.SECRETS_DIR", secrets_dir) manifest = ComponentManifest(id="test") env = {"API_KEY": "${secret:API_KEY}"} @@ -163,7 +163,7 @@ class TestResolveEnvVars: """Missing secret returns placeholder.""" secrets_dir = tmp_path / "secrets" secrets_dir.mkdir() - monkeypatch.setattr("castle_cli.config.SECRETS_DIR", secrets_dir) + monkeypatch.setattr("castle_core.config.SECRETS_DIR", secrets_dir) manifest = ComponentManifest(id="test") env = {"API_KEY": "${secret:NONEXISTENT}"} diff --git a/cli/tests/test_manifest.py b/core/tests/test_manifest.py similarity index 99% rename from cli/tests/test_manifest.py rename to core/tests/test_manifest.py index 3fb17b2..5dcb09b 100644 --- a/cli/tests/test_manifest.py +++ b/core/tests/test_manifest.py @@ -3,7 +3,7 @@ from __future__ import annotations import pytest -from castle_cli.manifest import ( +from castle_core.manifest import ( BuildSpec, CaddySpec, ComponentManifest, diff --git a/cli/tests/test_service.py b/core/tests/test_systemd.py similarity index 74% rename from cli/tests/test_service.py rename to core/tests/test_systemd.py index d4daec6..c9d41a1 100644 --- a/cli/tests/test_service.py +++ b/core/tests/test_systemd.py @@ -1,11 +1,11 @@ -"""Tests for castle service command.""" +"""Tests for systemd unit generation.""" from __future__ import annotations from pathlib import Path -from castle_cli.commands.service import _generate_unit, _unit_name -from castle_cli.config import load_config +from castle_core.config import load_config +from castle_core.generators.systemd import generate_unit, unit_name class TestUnitName: @@ -13,8 +13,8 @@ class TestUnitName: def test_unit_name_format(self) -> None: """Unit names follow castle-.service pattern.""" - assert _unit_name("central-context") == "castle-central-context.service" - assert _unit_name("my-svc") == "castle-my-svc.service" + assert unit_name("central-context") == "castle-central-context.service" + assert unit_name("my-svc") == "castle-my-svc.service" class TestUnitGeneration: @@ -24,21 +24,21 @@ class TestUnitGeneration: """Unit file has service description.""" config = load_config(castle_root) manifest = config.components["test-svc"] - unit = _generate_unit(config, "test-svc", manifest) + unit = generate_unit(config, "test-svc", manifest) assert "Description=Castle: Test service" in unit def test_contains_working_dir(self, castle_root: Path) -> None: """Unit file has correct working directory.""" config = load_config(castle_root) manifest = config.components["test-svc"] - unit = _generate_unit(config, "test-svc", manifest) + unit = generate_unit(config, "test-svc", manifest) assert f"WorkingDirectory={castle_root / 'test-svc'}" in unit def test_contains_environment(self, castle_root: Path) -> None: """Unit file has environment variables.""" config = load_config(castle_root) manifest = config.components["test-svc"] - unit = _generate_unit(config, "test-svc", manifest) + unit = generate_unit(config, "test-svc", manifest) expected_data_dir = str(castle_root / "data" / "test-svc") assert f"Environment=TEST_SVC_DATA_DIR={expected_data_dir}" in unit @@ -46,12 +46,12 @@ class TestUnitGeneration: """Unit file has restart configuration.""" config = load_config(castle_root) manifest = config.components["test-svc"] - unit = _generate_unit(config, "test-svc", manifest) + unit = generate_unit(config, "test-svc", manifest) assert "Restart=on-failure" in unit def test_uses_uv_run(self, castle_root: Path) -> None: """Unit file ExecStart uses uv run for python_uv_tool.""" config = load_config(castle_root) manifest = config.components["test-svc"] - unit = _generate_unit(config, "test-svc", manifest) + unit = generate_unit(config, "test-svc", manifest) assert "run test-svc" in unit diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b283776 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,12 @@ +[project] +name = "castle-workspace" +version = "0.0.0" +description = "Castle platform workspace root" +requires-python = ">=3.11" + +[tool.uv.workspace] +members = ["core", "cli", "castle-api"] + +[tool.uv.sources] +castle-core = { workspace = true } +castle-cli = { workspace = true } diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..4d1c964 --- /dev/null +++ b/uv.lock @@ -0,0 +1,583 @@ +version = 1 +revision = 3 +requires-python = ">=3.13" + +[manifest] +members = [ + "castle-api", + "castle-cli", + "castle-core", + "castle-workspace", +] + +[[package]] +name = "annotated-doc" +version = "0.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.12.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703", size = 228685, upload-time = "2026-01-06T11:45:21.246Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/38/0e/27be9fdef66e72d64c0cdc3cc2823101b80585f8119b5c112c2e8f5f7dab/anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c", size = 113592, upload-time = "2026-01-06T11:45:19.497Z" }, +] + +[[package]] +name = "castle-api" +version = "0.1.0" +source = { editable = "castle-api" } +dependencies = [ + { name = "castle-core" }, + { name = "fastapi" }, + { name = "httpx" }, + { name = "pydantic-settings" }, + { name = "uvicorn" }, +] + +[package.dev-dependencies] +dev = [ + { name = "httpx" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pyyaml" }, +] + +[package.metadata] +requires-dist = [ + { name = "castle-core", editable = "core" }, + { name = "fastapi", specifier = ">=0.115.0" }, + { name = "httpx", specifier = ">=0.27.0" }, + { name = "pydantic-settings", specifier = ">=2.0.0" }, + { name = "uvicorn", specifier = ">=0.34.0" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "httpx", specifier = ">=0.27.0" }, + { name = "pytest", specifier = ">=7.0.0" }, + { name = "pytest-asyncio", specifier = ">=0.23.0" }, + { name = "pyyaml", specifier = ">=6.0.0" }, +] + +[[package]] +name = "castle-cli" +version = "0.1.0" +source = { editable = "cli" } +dependencies = [ + { name = "castle-core" }, + { name = "jinja2" }, + { name = "pydantic" }, + { name = "pyyaml" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pyright" }, + { name = "pytest" }, + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [ + { name = "castle-core", editable = "core" }, + { name = "jinja2", specifier = ">=3.1.0" }, + { name = "pydantic", specifier = ">=2.0.0" }, + { name = "pyyaml", specifier = ">=6.0.0" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "pyright", specifier = ">=1.1.0" }, + { name = "pytest", specifier = ">=7.0.0" }, + { name = "ruff", specifier = ">=0.11.0" }, +] + +[[package]] +name = "castle-core" +version = "0.1.0" +source = { editable = "core" } +dependencies = [ + { name = "pydantic" }, + { name = "pyyaml" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, + { name = "pyyaml" }, +] + +[package.metadata] +requires-dist = [ + { name = "pydantic", specifier = ">=2.0.0" }, + { name = "pyyaml", specifier = ">=6.0.0" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "pytest", specifier = ">=7.0.0" }, + { name = "pyyaml", specifier = ">=6.0.0" }, +] + +[[package]] +name = "castle-workspace" +version = "0.0.0" +source = { virtual = "." } + +[[package]] +name = "certifi" +version = "2026.1.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/2d/a891ca51311197f6ad14a7ef42e2399f36cf2f9bd44752b3dc4eab60fdc5/certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120", size = 154268, upload-time = "2026-01-04T02:42:41.825Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e6/ad/3cc14f097111b4de0040c83a525973216457bbeeb63739ef1ed275c1c021/certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c", size = 152900, upload-time = "2026-01-04T02:42:40.15Z" }, +] + +[[package]] +name = "click" +version = "8.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "fastapi" +version = "0.131.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "pydantic" }, + { name = "starlette" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/91/32/158cbf685b7d5a26f87131069da286bf10fc9fbf7fc968d169d48a45d689/fastapi-0.131.0.tar.gz", hash = "sha256:6531155e52bee2899a932c746c9a8250f210e3c3303a5f7b9f8a808bfe0548ff", size = 369612, upload-time = "2026-02-22T16:38:11.252Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ff/94/b58ec24c321acc2ad1327f69b033cadc005e0f26df9a73828c9e9c7db7ce/fastapi-0.131.0-py3-none-any.whl", hash = "sha256:ed0e53decccf4459de78837ce1b867cd04fa9ce4579497b842579755d20b405a", size = 103854, upload-time = "2026-02-22T16:38:09.814Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.11" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" }, + { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" }, + { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" }, + { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" }, + { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" }, + { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" }, + { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" }, + { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" }, + { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" }, + { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" }, + { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" }, + { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" }, + { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" }, + { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" }, + { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" }, + { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" }, + { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" }, + { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" }, + { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" }, + { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" }, + { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" }, + { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" }, + { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" }, + { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" }, + { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" }, + { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" }, + { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" }, + { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" }, + { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, +] + +[[package]] +name = "packaging" +version = "26.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4", size = 143416, upload-time = "2026-01-21T20:50:39.064Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pydantic" +version = "2.12.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.41.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, + { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, + { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" }, + { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" }, + { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" }, + { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" }, + { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" }, + { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" }, + { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" }, + { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" }, + { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" }, + { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" }, + { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" }, + { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" }, + { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" }, + { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" }, + { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" }, + { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" }, + { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" }, + { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" }, + { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" }, + { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" }, + { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" }, + { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" }, + { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" }, + { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" }, + { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" }, + { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" }, + { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" }, + { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, + { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, +] + +[[package]] +name = "pydantic-settings" +version = "2.13.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/52/6d/fffca34caecc4a3f97bda81b2098da5e8ab7efc9a66e819074a11955d87e/pydantic_settings-2.13.1.tar.gz", hash = "sha256:b4c11847b15237fb0171e1462bf540e294affb9b86db4d9aa5c01730bdbe4025", size = 223826, upload-time = "2026-02-19T13:45:08.055Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/00/4b/ccc026168948fec4f7555b9164c724cf4125eac006e176541483d2c959be/pydantic_settings-2.13.1-py3-none-any.whl", hash = "sha256:d56fd801823dbeae7f0975e1f8c8e25c258eb75d278ea7abb5d9cebb01b56237", size = 58929, upload-time = "2026-02-19T13:45:06.034Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pyright" +version = "1.1.408" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodeenv" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/74/b2/5db700e52554b8f025faa9c3c624c59f1f6c8841ba81ab97641b54322f16/pyright-1.1.408.tar.gz", hash = "sha256:f28f2321f96852fa50b5829ea492f6adb0e6954568d1caa3f3af3a5f555eb684", size = 4400578, upload-time = "2026-01-08T08:07:38.795Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/82/a2c93e32800940d9573fb28c346772a14778b84ba7524e691b324620ab89/pyright-1.1.408-py3-none-any.whl", hash = "sha256:090b32865f4fdb1e0e6cd82bf5618480d48eecd2eb2e70f960982a3d9a4c17c1", size = 6399144, upload-time = "2026-01-08T08:07:37.082Z" }, +] + +[[package]] +name = "pytest" +version = "9.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d1/db/7ef3487e0fb0049ddb5ce41d3a49c235bf9ad299b6a25d5780a89f19230f/pytest-9.0.2.tar.gz", hash = "sha256:75186651a92bd89611d1d9fc20f0b4345fd827c41ccd5c299a868a05d70edf11", size = 1568901, upload-time = "2025-12-06T21:30:51.014Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/pytest-9.0.2-py3-none-any.whl", hash = "sha256:711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b", size = 374801, upload-time = "2025-12-06T21:30:49.154Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/90/2c/8af215c0f776415f3590cac4f9086ccefd6fd463befeae41cd4d3f193e5a/pytest_asyncio-1.3.0.tar.gz", hash = "sha256:d7f52f36d231b80ee124cd216ffb19369aa168fc10095013c6b014a34d3ee9e5", size = 50087, upload-time = "2025-11-10T16:07:47.256Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/35/f8b19922b6a25bc0880171a2f1a003eaeb93657475193ab516fd87cac9da/pytest_asyncio-1.3.0-py3-none-any.whl", hash = "sha256:611e26147c7f77640e6d0a92a38ed17c3e9848063698d5c93d5aa7aa11cebff5", size = 15075, upload-time = "2025-11-10T16:07:45.537Z" }, +] + +[[package]] +name = "python-dotenv" +version = "1.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, + { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, + { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, + { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, + { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, + { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, + { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, + { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, + { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, + { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, + { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, + { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, + { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, +] + +[[package]] +name = "ruff" +version = "0.15.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/06/04/eab13a954e763b0606f460443fcbf6bb5a0faf06890ea3754ff16523dce5/ruff-0.15.2.tar.gz", hash = "sha256:14b965afee0969e68bb871eba625343b8673375f457af4abe98553e8bbb98342", size = 4558148, upload-time = "2026-02-19T22:32:20.271Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2f/70/3a4dc6d09b13cb3e695f28307e5d889b2e1a66b7af9c5e257e796695b0e6/ruff-0.15.2-py3-none-linux_armv6l.whl", hash = "sha256:120691a6fdae2f16d65435648160f5b81a9625288f75544dc40637436b5d3c0d", size = 10430565, upload-time = "2026-02-19T22:32:41.824Z" }, + { url = "https://files.pythonhosted.org/packages/71/0b/bb8457b56185ece1305c666dc895832946d24055be90692381c31d57466d/ruff-0.15.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:a89056d831256099658b6bba4037ac6dd06f49d194199215befe2bb10457ea5e", size = 10820354, upload-time = "2026-02-19T22:32:07.366Z" }, + { url = "https://files.pythonhosted.org/packages/2d/c1/e0532d7f9c9e0b14c46f61b14afd563298b8b83f337b6789ddd987e46121/ruff-0.15.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e36dee3a64be0ebd23c86ffa3aa3fd3ac9a712ff295e192243f814a830b6bd87", size = 10170767, upload-time = "2026-02-19T22:32:13.188Z" }, + { url = "https://files.pythonhosted.org/packages/47/e8/da1aa341d3af017a21c7a62fb5ec31d4e7ad0a93ab80e3a508316efbcb23/ruff-0.15.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9fb47b6d9764677f8c0a193c0943ce9a05d6763523f132325af8a858eadc2b9", size = 10529591, upload-time = "2026-02-19T22:32:02.547Z" }, + { url = "https://files.pythonhosted.org/packages/93/74/184fbf38e9f3510231fbc5e437e808f0b48c42d1df9434b208821efcd8d6/ruff-0.15.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f376990f9d0d6442ea9014b19621d8f2aaf2b8e39fdbfc79220b7f0c596c9b80", size = 10260771, upload-time = "2026-02-19T22:32:36.938Z" }, + { url = "https://files.pythonhosted.org/packages/05/ac/605c20b8e059a0bc4b42360414baa4892ff278cec1c91fff4be0dceedefd/ruff-0.15.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2dcc987551952d73cbf5c88d9fdee815618d497e4df86cd4c4824cc59d5dd75f", size = 11045791, upload-time = "2026-02-19T22:32:31.642Z" }, + { url = "https://files.pythonhosted.org/packages/fd/52/db6e419908f45a894924d410ac77d64bdd98ff86901d833364251bd08e22/ruff-0.15.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:42a47fd785cbe8c01b9ff45031af875d101b040ad8f4de7bbb716487c74c9a77", size = 11879271, upload-time = "2026-02-19T22:32:29.305Z" }, + { url = "https://files.pythonhosted.org/packages/3e/d8/7992b18f2008bdc9231d0f10b16df7dda964dbf639e2b8b4c1b4e91b83af/ruff-0.15.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cbe9f49354866e575b4c6943856989f966421870e85cd2ac94dccb0a9dcb2fea", size = 11303707, upload-time = "2026-02-19T22:32:22.492Z" }, + { url = "https://files.pythonhosted.org/packages/d7/02/849b46184bcfdd4b64cde61752cc9a146c54759ed036edd11857e9b8443b/ruff-0.15.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b7a672c82b5f9887576087d97be5ce439f04bbaf548ee987b92d3a7dede41d3a", size = 11149151, upload-time = "2026-02-19T22:32:44.234Z" }, + { url = "https://files.pythonhosted.org/packages/70/04/f5284e388bab60d1d3b99614a5a9aeb03e0f333847e2429bebd2aaa1feec/ruff-0.15.2-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:72ecc64f46f7019e2bcc3cdc05d4a7da958b629a5ab7033195e11a438403d956", size = 11091132, upload-time = "2026-02-19T22:32:24.691Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ae/88d844a21110e14d92cf73d57363fab59b727ebeabe78009b9ccb23500af/ruff-0.15.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:8dcf243b15b561c655c1ef2f2b0050e5d50db37fe90115507f6ff37d865dc8b4", size = 10504717, upload-time = "2026-02-19T22:32:26.75Z" }, + { url = "https://files.pythonhosted.org/packages/64/27/867076a6ada7f2b9c8292884ab44d08fd2ba71bd2b5364d4136f3cd537e1/ruff-0.15.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:dab6941c862c05739774677c6273166d2510d254dac0695c0e3f5efa1b5585de", size = 10263122, upload-time = "2026-02-19T22:32:10.036Z" }, + { url = "https://files.pythonhosted.org/packages/e7/ef/faf9321d550f8ebf0c6373696e70d1758e20ccdc3951ad7af00c0956be7c/ruff-0.15.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1b9164f57fc36058e9a6806eb92af185b0697c9fe4c7c52caa431c6554521e5c", size = 10735295, upload-time = "2026-02-19T22:32:39.227Z" }, + { url = "https://files.pythonhosted.org/packages/2f/55/e8089fec62e050ba84d71b70e7834b97709ca9b7aba10c1a0b196e493f97/ruff-0.15.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:80d24fcae24d42659db7e335b9e1531697a7102c19185b8dc4a028b952865fd8", size = 11241641, upload-time = "2026-02-19T22:32:34.617Z" }, + { url = "https://files.pythonhosted.org/packages/23/01/1c30526460f4d23222d0fabd5888868262fd0e2b71a00570ca26483cd993/ruff-0.15.2-py3-none-win32.whl", hash = "sha256:fd5ff9e5f519a7e1bd99cbe8daa324010a74f5e2ebc97c6242c08f26f3714f6f", size = 10507885, upload-time = "2026-02-19T22:32:15.635Z" }, + { url = "https://files.pythonhosted.org/packages/5c/10/3d18e3bbdf8fc50bbb4ac3cc45970aa5a9753c5cb51bf9ed9a3cd8b79fa3/ruff-0.15.2-py3-none-win_amd64.whl", hash = "sha256:d20014e3dfa400f3ff84830dfb5755ece2de45ab62ecea4af6b7262d0fb4f7c5", size = 11623725, upload-time = "2026-02-19T22:32:04.947Z" }, + { url = "https://files.pythonhosted.org/packages/6d/78/097c0798b1dab9f8affe73da9642bb4500e098cb27fd8dc9724816ac747b/ruff-0.15.2-py3-none-win_arm64.whl", hash = "sha256:cabddc5822acdc8f7b5527b36ceac55cc51eec7b1946e60181de8fe83ca8876e", size = 10941649, upload-time = "2026-02-19T22:32:18.108Z" }, +] + +[[package]] +name = "starlette" +version = "0.52.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c4/68/79977123bb7be889ad680d79a40f339082c1978b5cfcf62c2d8d196873ac/starlette-0.52.1.tar.gz", hash = "sha256:834edd1b0a23167694292e94f597773bc3f89f362be6effee198165a35d62933", size = 2653702, upload-time = "2026-01-18T13:34:11.062Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/81/0d/13d1d239a25cbfb19e740db83143e95c772a1fe10202dda4b76792b114dd/starlette-0.52.1-py3-none-any.whl", hash = "sha256:0029d43eb3d273bc4f83a08720b4912ea4b071087a3b48db01b7c839f7954d74", size = 74272, upload-time = "2026-01-18T13:34:09.188Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, +] + +[[package]] +name = "uvicorn" +version = "0.41.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/32/ce/eeb58ae4ac36fe09e3842eb02e0eb676bf2c53ae062b98f1b2531673efdd/uvicorn-0.41.0.tar.gz", hash = "sha256:09d11cf7008da33113824ee5a1c6422d89fbc2ff476540d69a34c87fab8b571a", size = 82633, upload-time = "2026-02-16T23:07:24.1Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/83/e4/d04a086285c20886c0daad0e026f250869201013d18f81d9ff5eada73a88/uvicorn-0.41.0-py3-none-any.whl", hash = "sha256:29e35b1d2c36a04b9e180d4007ede3bcb32a85fbdfd6c6aeb3f26839de088187", size = 68783, upload-time = "2026-02-16T23:07:22.357Z" }, +]