vendor_connectors.meshy.persistence.repository
vendor_connectors.meshy.persistence.repository
Section titled “vendor_connectors.meshy.persistence.repository”Task repository for manifest storage and retrieval.
Module Contents
Section titled “Module Contents”Classes
Section titled “Classes”TaskRepository | File-backed repository for task manifests with atomic operations. |
|---|
Functions
Section titled “Functions”_utc_now | Return current UTC time with timezone info. |
|---|
vendor_connectors.meshy.persistence.repository._utc_now() → datetime.datetime
Section titled “vendor_connectors.meshy.persistence.repository._utc_now() → datetime.datetime”Return current UTC time with timezone info.
class vendor_connectors.meshy.persistence.repository.TaskRepository(base_path: str = ‘client/public/models’)
Section titled “class vendor_connectors.meshy.persistence.repository.TaskRepository(base_path: str = ‘client/public/models’)”File-backed repository for task manifests with atomic operations.
Initialization
Section titled “Initialization”_manifest_path(project: str) → pathlib.Path
Section titled “_manifest_path(project: str) → pathlib.Path”Get path to project manifest file.
load_project_manifest(project: str) → vendor_connectors.meshy.persistence.schemas.ProjectManifest
Section titled “load_project_manifest(project: str) → vendor_connectors.meshy.persistence.schemas.ProjectManifest”Load manifest for a project, creating empty one if missing.
Args: project: Project name (e.g., “otter”, “beaver”)
Returns: ProjectManifest instance
save_project_manifest(manifest: vendor_connectors.meshy.persistence.schemas.ProjectManifest) → None
Section titled “save_project_manifest(manifest: vendor_connectors.meshy.persistence.schemas.ProjectManifest) → None”Atomically save project manifest to disk.
Args: manifest: ProjectManifest to save
get_asset_record(project: str, spec_hash: str) → vendor_connectors.meshy.persistence.schemas.AssetManifest | None
Section titled “get_asset_record(project: str, spec_hash: str) → vendor_connectors.meshy.persistence.schemas.AssetManifest | None”Get asset manifest by spec hash.
Args: project: Project name spec_hash: Asset spec hash
Returns: AssetManifest if found, None otherwise
upsert_asset_record(project: str, asset_manifest: vendor_connectors.meshy.persistence.schemas.AssetManifest) → None
Section titled “upsert_asset_record(project: str, asset_manifest: vendor_connectors.meshy.persistence.schemas.AssetManifest) → None”Insert or update asset manifest.
Args: project: Project name asset_manifest: AssetManifest to save
record_task_update(project: str, spec_hash: str, task_id: str, status: str, service: str | None = None, payload: dict[str, Any] | None = None, result_paths: dict[str, str] | None = None, artifacts: list[vendor_connectors.meshy.persistence.schemas.ArtifactRecord] | None = None, source: str = ‘orchestrator’, error: str | None = None) → None
Section titled “record_task_update(project: str, spec_hash: str, task_id: str, status: str, service: str | None = None, payload: dict[str, Any] | None = None, result_paths: dict[str, str] | None = None, artifacts: list[vendor_connectors.meshy.persistence.schemas.ArtifactRecord] | None = None, source: str = ‘orchestrator’, error: str | None = None) → None”Record task status update in manifest.
Args: project: Project name spec_hash: Asset spec hash task_id: Meshy task ID status: New status string service: Service name (text3d, rigging, etc) payload: Request payload result_paths: Result URLs/paths artifacts: Downloaded artifacts source: Update source (orchestrator, webhook, manual) error: Error message if failed
list_pending_assets(project: str) → list[vendor_connectors.meshy.persistence.schemas.AssetManifest]
Section titled “list_pending_assets(project: str) → list[vendor_connectors.meshy.persistence.schemas.AssetManifest]”List all assets with pending/in-progress tasks.
Args: project: Project name
Returns: List of AssetManifest with non-terminal tasks
find_task_by_id(task_id: str, project: str | None = None) → tuple[str, str, vendor_connectors.meshy.persistence.schemas.AssetManifest] | None
Section titled “find_task_by_id(task_id: str, project: str | None = None) → tuple[str, str, vendor_connectors.meshy.persistence.schemas.AssetManifest] | None”Find asset by task ID (for webhook lookups).
Args: task_id: Meshy task ID project: Optional project to narrow search
Returns: Tuple of (project, spec_hash, AssetManifest) if found
compute_spec_hash(spec: dict[str, Any]) → str
Section titled “compute_spec_hash(spec: dict[str, Any]) → str”Compute deterministic hash for task spec.
Args: spec: Task specification dictionary
Returns: SHA256 hex digest of canonicalized spec
record_task_submission(submission: vendor_connectors.meshy.persistence.schemas.TaskSubmission) → None
Section titled “record_task_submission(submission: vendor_connectors.meshy.persistence.schemas.TaskSubmission) → None”Record a task submission to the manifest (idempotent).
Args: submission: TaskSubmission with task_id, project, service, etc.
Raises: ValueError: If submission data is invalid