Spaces:
Sleeping
Sleeping
Xining Li
Deploy snapshot: causal-gate + flash-offer tasks (textbook/ omitted, binary PDF rejected by HF's plain-git push policy)
6ec7f56 Download server/registry.py from xiningli/webtask-arena: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/xiningli/webtask-arena/resolve/main/server/registry.py
- Command line
-
hf download hf://spaces/xiningli/webtask-arena/server/registry.py
-
curl -L -o registry.py https://huggingface.co/spaces/xiningli/webtask-arena/resolve/main/server/registry.py
1.25 kB
| """Task registry. Adding a task = implement the Task protocol, register here.""" | |
| from __future__ import annotations | |
| from typing import Any, Protocol | |
| from .tasks.causal_gate import CausalGate | |
| from .tasks.checkout_form import CheckoutForm | |
| from .tasks.email_triage import EmailTriage | |
| from .tasks.flash_offer import FlashOffer | |
| from .tasks.settings_panel import SettingsPanel | |
| class Task(Protocol): | |
| id: str | |
| title: str | |
| template: str | |
| def generate(self, seed: int) -> dict[str, Any]: | |
| """Build a fresh, fully seed-determined episode state.""" | |
| def instruction(self, state: dict[str, Any]) -> str: | |
| """Natural-language goal handed to the agent out-of-band.""" | |
| def view(self, state: dict[str, Any]) -> dict[str, Any]: | |
| """Template context for rendering the task page.""" | |
| def handle_action(self, state: dict[str, Any], payload: dict[str, Any]) -> dict[str, Any]: | |
| """Mutate state in response to a UI action. Return {'ok': bool, ...}.""" | |
| def verify(self, state: dict[str, Any]) -> dict[str, bool]: | |
| """Named subgoals; episode succeeds iff all are true.""" | |
| _ALL = [EmailTriage(), SettingsPanel(), CheckoutForm(), CausalGate(), FlashOffer()] | |
| TASKS: dict[str, Task] = {t.id: t for t in _ALL} | |