import asyncio
from praisonaiagents.checkpoints import CheckpointService
async def main():
service = CheckpointService(workspace_dir="/path/to/project")
await service.initialize()
# Save checkpoint
result = await service.save("Before changes")
print(f"Saved: {result.checkpoint.short_id}")
# List checkpoints
checkpoints = await service.list_checkpoints()
for cp in checkpoints:
print(f"{cp.short_id}: {cp.message}")
# Restore
await service.restore(result.checkpoint.id)
asyncio.run(main())