+
    lHàjí  ã                  ó¢   € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	 ]t
 ! R R]4      t ! R R]4      t ! R	 R
]4      t ! R R]4      t. ROtR# )uþ  Wire contract primitives for the TUI/desktop gateway.

Python is the single source of truth for the JSON-RPC wire: every clientâ†’server method
(params + result), every serverâ†’client request (params + result) and every notification
payload is a Pydantic model declared in this package. ``scripts/gen_gateway_contracts.py``
renders them into ``apps/shared/src/gateway-contract.generated.ts`` and
``apps/shared/src/gateway-contract.openrpc.json``; ``tests/tui_gateway/contracts/test_generated.py``
regenerates in memory and diffs the committed files, so a model edited without regenerating
fails CI on the Python side, and TS that reads a phantom field fails ``tsc``.

Modelling rules (they keep the generated TS clean and the wire stable):

- ``snake_case`` field names, exactly as they travel.
- Closed sets are ``StrEnum`` (rendered as literal unions); discriminators are ``Literal``.
- ``X | None = None`` renders ``x?: X | null``; a plain default renders ``x?: X``.
- Params models are ``extra="forbid"``: an unknown key is a client bug and answers ``4000``
  instead of being silently ignored. Result and payload models are ``extra="allow"`` only
  while a field is genuinely open (``dict[str, Any]`` is banned in a contract â€” declare the
  shape or use ``JsonValue``).
)Úannotations)ÚStrEnum)ÚAny)Ú	BaseModelÚ
ConfigDictc                  ó.   € ] tR t^ tRt]! RRR7      tRtR# )ÚParamsuZ   Clientâ†’server method params / serverâ†’client request params. Unknown keys are rejected.ÚforbidT)ÚextraÚpopulate_by_name© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úmodel_configÚ__static_attributes__r   ó    Ú?/home/ubuntu/.hermes/hermes-agent/tui_gateway/contracts/base.pyr   r       s   † Ùdá H¸tÔD„Lr   r   c                  ó,   € ] tR t^&tRt]! RR7      tRtR# )ÚResultz£Method / server-request result. Serialised with ``exclude_none=False`` so an explicit
``null`` stays a ``null`` on the wire (clients distinguish absent from null).r	   ©r
   r   Nr   r   r   r   r   r   &   s   † ñUñ  HÔ-„Lr   r   c                  ó,   € ] tR t^-tRt]! RR7      tRtR# )ÚPayloadz:Notification payload (``event`` frame ``params.payload``).r	   r   r   Nr   r   r   r   r   r   -   s   † ÙDá HÔ-„Lr   r   c                  ó   € ] tR t^3tRtRtR# )ÚWireEnumz?A closed string set on the wire; renders as a TS literal union.r   N)r   r   r   r   r   r   r   r   r   r   r   3   s   † ÝIr   r   N)Ú	JsonValuer   r   r   r   )r   Ú
__future__r   Úenumr   Útypingr   Úpydanticr   r   r   r   r   r   r   Ú__all__r   r   r   Ú<module>r$      sY   ðñõ* #å Ý ç *à€	ôEˆYô Eô.ˆYô .ô.ˆiô .ôJˆwô Jò C‚r   