from dataclasses import dataclass, field
from typing import NotRequired, TypedDict

import asyncio
import httpx

SETTINGS = httpx.Client()


@dataclass
class Payload:
    tags: list[str] = []
    metadata: dict[str, str] = field(default_factory=dict)


class PayloadShape(TypedDict):
    name: str
    alias: NotRequired[str]


async def orchestrate(lock):
    task = asyncio.create_task(load_remote())
    async with lock:
        await asyncio.sleep(1)
    return task