from __future__ import annotations from typing import cast from albedo_api import Host, PythonApi host: Host class Photon: async def reply(self, message_ref: str, text: str, thread: bool = False) -> str: """Reply to an incoming iMessage in the paired chat; return the sent GUID. thread=True shows the reply under the message it answers. """ return cast( str, await host( "photon.reply", {"guid": message_ref, "text": text, "thread": thread} ), ) async def react(self, message_ref: str, emoji: str) -> str: """Add a Tapback to a paired incoming message and return its GUID.""" return cast( str, await host("photon.react", {"guid": message_ref, "emoji": emoji}) ) def setup(api: PythonApi) -> dict[str, object]: global host host = api.host return {"photon": Photon(), "PhotonError": api.HostError}