feat: decline pending action

This commit is contained in:
2026-05-05 20:14:06 -04:00
parent 761eda6155
commit 36c91ce500
5 changed files with 69 additions and 1 deletions
+4
View File
@@ -145,6 +145,10 @@ def create_app() -> FastAPI:
async def approve(action_id: str) -> dict:
return await tools.approve(action_id)
@app.post("/api/decline/{action_id}")
async def decline(action_id: str) -> dict:
return await tools.decline(action_id)
return app
+14
View File
@@ -241,6 +241,20 @@ class ToolRegistry:
return {"error": f"Pending action not found: {action_id}"}
return await self.uex.post(action.endpoint, action.payload, authenticated=True)
async def decline(self, action_id: str) -> dict[str, Any]:
action = self.pending_actions.pop(action_id, None)
if not action:
return {"error": f"Pending action not found: {action_id}"}
return {
"declined": True,
"pending_action": {
"id": action.id,
"label": action.label,
"endpoint": action.endpoint,
"payload": action.payload,
},
}
async def search_marketplace_listings(
self,
query: str | None = None,