File size: 498 Bytes
246d201 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import OpenHands from "#/api/open-hands";
/**
* Downloads the current workspace as a .zip file.
*/
export const downloadWorkspace = async (conversationId: string) => {
const blob = await OpenHands.getWorkspaceZip(conversationId);
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", "workspace.zip");
document.body.appendChild(link);
link.click();
link.parentNode?.removeChild(link);
};
|