Add approval continuation and multi-step tools
This commit is contained in:
@@ -93,6 +93,16 @@ class ApprovalService:
|
||||
rows = await cursor.fetchall()
|
||||
return [self._row_to_approval(row) for row in rows]
|
||||
|
||||
async def get(self, approval_id: str) -> Approval | None:
|
||||
await self.init()
|
||||
async with aiosqlite.connect(self.db_path) as db:
|
||||
db.row_factory = aiosqlite.Row
|
||||
cursor = await db.execute(
|
||||
"select * from approvals where approval_id = ?", (approval_id,)
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
return self._row_to_approval(row) if row else None
|
||||
|
||||
async def allow_once(self, approval_id: str) -> None:
|
||||
await self._decide(approval_id, "resolved", "allow_once")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user