Bug fix and UX improve #3
@@ -18,6 +18,13 @@ Supporting checks:
|
|||||||
- `GET /v1/health`
|
- `GET /v1/health`
|
||||||
- `GET /v1/state` (periodic sampling)
|
- `GET /v1/state` (periodic sampling)
|
||||||
|
|
||||||
|
Animation traffic now targets row-based sprite names plus compatibility aliases:
|
||||||
|
|
||||||
|
- semantic names: `idle`, `happy`, `love`, `excited`, `celebrate`, `sleepy`, `snoring`,
|
||||||
|
`working`, `angry`, `surprised`, `shy`, `dragging`
|
||||||
|
- compatibility aliases: `active`, `success`, `error`
|
||||||
|
- one intentional unknown name is still included to keep invalid animation-path coverage
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Frontend runtime is already running (`sprimo-app` or `sprimo-tauri`).
|
- Frontend runtime is already running (`sprimo-app` or `sprimo-tauri`).
|
||||||
|
|||||||
@@ -18,6 +18,27 @@ from typing import Any
|
|||||||
from urllib.error import HTTPError, URLError
|
from urllib.error import HTTPError, URLError
|
||||||
from urllib.request import Request, urlopen
|
from urllib.request import Request, urlopen
|
||||||
|
|
||||||
|
ANIMATION_NAMES = (
|
||||||
|
"idle",
|
||||||
|
"happy",
|
||||||
|
"love",
|
||||||
|
"excited",
|
||||||
|
"celebrate",
|
||||||
|
"sleepy",
|
||||||
|
"snoring",
|
||||||
|
"working",
|
||||||
|
"angry",
|
||||||
|
"surprised",
|
||||||
|
"shy",
|
||||||
|
"dragging",
|
||||||
|
# Backward-compatible aliases mapped in runtime/manifests.
|
||||||
|
"active",
|
||||||
|
"success",
|
||||||
|
"error",
|
||||||
|
# Intentionally invalid to keep unknown-animation traffic coverage.
|
||||||
|
"unknown_anim",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def parse_args() -> argparse.Namespace:
|
def parse_args() -> argparse.Namespace:
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
@@ -205,9 +226,7 @@ def random_valid_command(rng: random.Random) -> dict[str, Any]:
|
|||||||
|
|
||||||
if pick == "play_animation":
|
if pick == "play_animation":
|
||||||
payload = {
|
payload = {
|
||||||
"name": rng.choice(
|
"name": rng.choice(ANIMATION_NAMES),
|
||||||
["idle", "dance", "typing", "celebrate", "error", "unknown_anim"]
|
|
||||||
),
|
|
||||||
"priority": rng.randint(0, 10),
|
"priority": rng.randint(0, 10),
|
||||||
"duration_ms": rng.choice([None, 250, 500, 1000, 3000]),
|
"duration_ms": rng.choice([None, 250, 500, 1000, 3000]),
|
||||||
"interrupt": rng.choice([None, True, False]),
|
"interrupt": rng.choice([None, True, False]),
|
||||||
|
|||||||
Reference in New Issue
Block a user