okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
e2ba50e
main
1from __future__import annotations 2 3from typing import cast 4 5from albedo_api import Host ,PythonApi 6 7host :Host 8 9 10async def vent (topic :str ,message :str ,suggestion :str = "" ,title :str = "" )-> dict : 11"""Record one complaint for the user to review in /paperclips.""" 12return cast ( 13dict , 14await host ( 15"paperclips.vent" , 16 { 17"topic" :topic , 18"message" :message , 19"suggestion" :suggestion , 20"title" :title , 21 }, 22 ), 23 ) 24 25 26async def vents (limit :int = 20 )-> list [dict ]: 27"""Recent vents from every session, newest first.""" 28return cast (list [dict ],await host ("paperclips.list" , {"limit" :limit })) 29 30 31async def resolve_vent (id :int ,note :str )-> dict : 32"""Close an open or acknowledged vent your change fixed; `note` says what 33fixed it, and the user sees it on the vent.""" 34return cast (dict ,await host ("paperclips.resolve" , {"id" :id ,"note" :note })) 35 36 37def setup (api :PythonApi )-> dict [str ,object ]: 38global host 39host = api .host 40return {"vent" :vent ,"vents" :vents ,"resolve_vent" :resolve_vent }