INNER CODE UNIT · Python
_host_target
Priivacy-ai/spec-kitty · packages/spec-kitty-services/spec_kitty_services/__init__.py:39
def _host_target() -> str | None:
"""This host's service target, from the CLI's own authority (``kernel.service_hosts``)."""
from kernel.service_hosts import host_target # lazy: a broken CLI install must not break importing the providers
target = host_target()
return None if target is None else target.value
def _pinned_sha256(service: str, target: str) -> str | None:
"""The sha256 the CLI's own pin names for *service* on *target*, or ``None`` when it pins none."""
from kernel.service_pin import ServiceTarget # lazy, like _host_target
from specify_cli.services.resolution import find_pin, load_pin
path = find_pin(service)
if path is None:
return None
asset = load_pin(path).asset_for(ServiceTarget(target))
return None if asset is None else asset.sha256