exlab_wizard.api#
HTTP API package. Backend Spec §4.
Public re-exports so callers (the launcher, tests) can import the factory and dependency types without reaching into submodules.
- class exlab_wizard.api.AppDependencies(config=None, save_config=None, lims_reachable=True, keyring_password_present=True, lims_reason=None, controller=None, validator=None, plugin_host=None, cache_creation=None, lims_client=None, nas_sync=None, session_store=None, ingest_writer=None, staging_watcher=None, audit_channel=None, last_audit_at=None, nas_sync_snapshot=None, session_store_snapshot=None, registered_plugin_count=0, plugin_host_status='ok', lims_probe=None, equipment_probe=None, autostart_toggle=None, audit_task=None)[source]#
Bases:
objectBundle of live components the API surface dispatches to.
Production wiring (the launcher) constructs everything; tests can pass mocks. Attributes are typed loosely (
Any) so the API code does not impose imports on the caller – the runtime contract is documented per attribute.- Parameters:
save_config (
Callable[[Config],Awaitable[None] |None] |None)lims_reachable (
bool)keyring_password_present (
bool)controller (
Any)validator (
Any)plugin_host (
Any)cache_creation (
Any)lims_client (
Any)nas_sync (
Any)session_store (
Any)ingest_writer (
Any)staging_watcher (
Any)audit_channel (
AuditChannel|None)session_store_snapshot (
Callable[[],dict[str,Any]] |None)registered_plugin_count (
int)plugin_host_status (
str)
- audit_channel: AuditChannel | None = None#
- class exlab_wizard.api.AuditChannel[source]#
Bases:
objectMulti-subscriber pub-sub for the Problems WebSocket. Backend Spec §4.6.2.
Subscribers receive every published frame (snapshot or delta). The channel keeps the most recent snapshot so late subscribers do not have to wait for the next 30-second tick.
- exlab_wizard.api.create_app(*, config=None, dependencies=None, audit_interval_seconds=30.0, start_audit_task=False)[source]#
Build the FastAPI app. Backend Spec §4.6.
config: optional pre-loadedconfig.yaml; ifdependenciesis supplied this is ignored.dependencies: a fully-configuredAppDependencies(production launcher uses this).audit_interval_seconds: how often the background audit task runs; tests can pass a small value to exercise the loop.start_audit_task: if True the lifespan handler launches the audit task; defaults to False so tests don’t accumulate tasks.
Modules
FastAPI app + lifespan + dependency wiring. |
|
Error envelope helpers + FastAPI exception handlers. |
|
WebSocket frame envelope types. |
|
|
|
API routers package. |
|
msgspec.Struct types for the ExLab-Wizard cache files. |
|
Setup-state gate + |