| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- from __future__ import annotations
- from typing import Any, Protocol
- from .repositories import ScriptBuildRepository
- class RuntimeDataProvider(Protocol):
- mode: str
- def list_builds(
- self, *, limit: int = 30, status: str | None = None
- ) -> list[dict[str, Any]]: ...
- def load_bundle(self, script_build_id: int) -> dict[str, Any]: ...
- def load_current_artifact(self, script_build_id: int) -> dict[str, Any]: ...
- def load_event_detail(
- self, script_build_id: int, event_id: int
- ) -> dict[str, Any]: ...
- def load_event_details(
- self, script_build_id: int, event_ids: list[int]
- ) -> dict[int, dict[str, Any]]: ...
- def load_prompt_context(
- self, script_build_id: int, prompt_ref: str
- ) -> dict[str, Any]: ...
- class LocalDatabaseProvider:
- """V8 production provider: direct, visualization-only, read-only DB access."""
- mode = "local-db-read-only"
- def __init__(self, repository: ScriptBuildRepository | None = None):
- self.repository = repository or ScriptBuildRepository()
- def list_builds(
- self, *, limit: int = 30, status: str | None = None
- ) -> list[dict[str, Any]]:
- return self.repository.list_builds(limit=limit, status=status)
- def load_bundle(self, script_build_id: int) -> dict[str, Any]:
- return self.repository.load_bundle(script_build_id)
- def load_current_artifact(self, script_build_id: int) -> dict[str, Any]:
- return self.repository.load_current_artifact(script_build_id)
- def load_event_detail(
- self, script_build_id: int, event_id: int
- ) -> dict[str, Any]:
- return self.repository.load_event_detail(script_build_id, event_id)
- def load_event_details(
- self, script_build_id: int, event_ids: list[int]
- ) -> dict[int, dict[str, Any]]:
- return self.repository.load_event_details(script_build_id, event_ids)
- def load_prompt_context(
- self, script_build_id: int, prompt_ref: str
- ) -> dict[str, Any]:
- return self.repository.load_prompt_context(script_build_id, prompt_ref)
|