Capability Definition

Capability definitions are metadata, not proof of hardware support or command execution.

flowchart TD
  atlas["featureAtlas"] --> images["IMAGE_CAPABILITIES"]
  images --> registry["MOGO_CAPABILITIES"]
  groups["System, character, and game voice groups"] --> registry
  registry --> merge["getEffectiveCapabilities"]
  overrides["User override rows"] --> merge
  manager["CapabilityManagerPage"] -->|Collection GET| merge
  merge -->|Effective definitions| manager
  registry -->|Backend unavailable| fallback["Local built-in catalog"]
  fallback --> manager

Built-ins and the effective set

Image capability entries carry the source feature ID, image, name, surface, and status; the registry derives their action.

[!NOTE] The registry imports CHARACTER_VOICE_TARGETS from ./characterContent and maps those entries into CHARACTER_VOICE_CAPABILITIES. Their purpose is not established here; check that owning definition before describing what the targets represent.

The server helper in app/api/_lib/capabilities.ts maps built-in definitions against a user's override rows. It keeps a built-in when no override exists, uses override definition fields when one does, omits deleted overrides unless includeDeleted is true, and appends remaining eligible user overrides.

Command-execution gates belong to Voice Capability Commands.

Parent management

The parent route specification maps /care/parent/capabilities to CapabilityManagerPage. The manager schedules a collection load with includeDeleted set from showDisabled. A 401 selects the authentication state only when backendReachable() is true. Otherwise, an ApiRequestError with status 0 or 401, or code backend_unreachable, selects the local MOGO_CAPABILITIES catalog, filtered to enabled entries unless showDisabled is true. Errors matching neither condition are shown as errors.

The save handler splits voice aliases on newlines, trims them, and drops empty entries. It selects POST for a draft without an ID and PATCH for one with an ID. The collection POST handler validates new input and defines creation of a user override.

Definition imports

The separate handler in app/api/capabilities/import/route.ts requires 1–250 capability entries, maps and parses them, rejects the batch if any parsed input is invalid, and only then starts the per-entry lookup and persistence loop. It defines per-entry creation or update; its code-defined success response includes created and updated counts.