merlyn/frontend/src/models/files.js
Timothy Carambat 7aaea7f514
File creation agent skills (#5280)
* Powerpoint File Creation (#5278)

* wip

* download card

* UI for downloading

* move to fs system with endpoint to pull files

* refactor UI

* final-pass

* remove save-file-browser skill and refactor

* remove fileDownload event

* reset

* reset file

* reset timeout

* persist toggle

* Txt creation (#5279)

* wip

* download card

* UI for downloading

* move to fs system with endpoint to pull files

* refactor UI

* final-pass

* remove save-file-browser skill and refactor

* remove fileDownload event

* reset

* reset file

* reset timeout

* wip

* persist toggle

* add arbitrary text creation file

* Add PDF document generation with markdown formatting (#5283)

add support for branding in bottom right corner
refactor core utils and frontend rendering

* Xlsx document creation (#5284)

add Excel doc & sheet creation

* Basic docx creation (#5285)

* Basic docx creation

* add test theme support + styling and title pages

* simplify skill selection

* handle TG attachments

* send documents over tg

* lazy import

* pin deps

* fix lock

* i18n for file creation (#5286)

i18n for file-creation
connect #5280

* theme overhaul

* Add PPTX subagent for better results

* forgot files

* Add PPTX subagent for better results (#5287)

* Add PPTX subagent for better results

* forgot files

* make sub-agent use proper tool calling if it can and better UI hints
2026-03-30 15:13:39 -07:00

27 lines
718 B
JavaScript

import { API_BASE } from "@/utils/constants";
import { baseHeaders } from "@/utils/request";
const StorageFiles = {
/**
* Download a file from the server
* @param {string} filename - The filename to download
* @returns {Promise<Blob|null>}
*/
download: async function (storageFilename) {
return await fetch(
`${API_BASE}/agent-skills/generated-files/${encodeURIComponent(storageFilename)}`,
{ headers: baseHeaders() }
)
.then((res) => {
if (!res.ok) throw new Error("Failed to download file");
return res.blob();
})
.catch((e) => {
console.error("Download failed:", e);
return null;
});
},
};
export default StorageFiles;