pynydus.remote.registry¶
Nest registry client: push/pull eggs via HTTP.
Communicates with a Nest registry server (FastAPI) to publish and retrieve
eggs. Used by both the SDK (Nydus.push/Nydus.pull) and the CLI
(nydus push/nydus pull).
Authentication tokens are stored at ~/.nydus/credentials.json.
Module Contents¶
Classes¶
HTTP client for the Nest egg registry. |
Functions¶
Try to extract a detail message from an error response. |
|
Load the credentials file (registry_url → token mapping). |
|
Persist the credentials file. |
|
Return the stored JWT for a given registry URL, or None. |
|
Store a JWT for a given registry URL. |
|
Remove the stored JWT for a given registry URL. Returns True if removed. |
Data¶
API¶
- pynydus.remote.registry.logger¶
‘getLogger(…)’
- pynydus.remote.registry.CREDENTIALS_PATH¶
None
- class pynydus.remote.registry.NestClient(url: str, *, author: str | None = None, timeout: float = 60.0)¶
HTTP client for the Nest egg registry.
Initialization
Create a client.
Args: url: Base URL of the Nest server (e.g.
http://localhost:8000). author: Default author name for pushes when not overridden. timeout: Request timeout in seconds.- register(username: str, password: str) dict[str, Any]¶
Register a new account on the Nest registry.
Args: username: Desired username. password: Password for the new account.
Returns: Server response body on success.
Raises: RegistryError: On connection failure, duplicate username, or HTTP error.
- login(username: str, password: str) str¶
Authenticate and store the returned JWT token.
Args: username: Registry username. password: Password.
Returns: JWT token string.
Raises: RegistryError: On invalid credentials, connection failure, or HTTP error.
- logout() bool¶
Remove the stored token for this registry.
Returns True if a token was removed, False if none existed.
- push(egg_path: pathlib.Path, *, name: str, version: str, author: str | None = None) dict[str, Any]¶
Push an egg file to the registry.
Args: egg_path: Path to the
.eggarchive on disk. name: Registry name (e.g.user/my-agent). version: Semver string. author: Optional author override for this push.Returns: Server JSON (name, version, sha256, etc.).
Raises: RegistryError: On HTTP or connection failures, or duplicate version.
- pull(name: str, *, version: str, output_path: pathlib.Path) pathlib.Path¶
Pull an egg from the registry and save to disk.
Args: name: Registry name (e.g.
user/my-agent). version: Semver string. output_path: Destination file path.Returns: Path written.
Raises: RegistryError: On HTTP errors, 404, SHA mismatch, or connection failure.
- pynydus.remote.registry._extract_detail(response: httpx.Response) str¶
Try to extract a detail message from an error response.
- pynydus.remote.registry._load_credentials() dict[str, str]¶
Load the credentials file (registry_url → token mapping).
- pynydus.remote.registry._load_token(registry_url: str) str | None¶
Return the stored JWT for a given registry URL, or None.