mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-11-20 11:20:35 +00:00
* feat(frontend): improve file attachment recovery and artifact presentation * feat(extensions): add Office artifact previews with search and navigation * fix: preserve public viewers and HTTP Office previews * fix: address file preview and upload review findings * fix: use typed upload errors and linear bookmark allocation * fix(office-preview): isolate parsing and bound preview resources * fix(ci): install Office preview fixture dependencies for E2E * fix(ci): provision matching Playwright browsers before E2E tests * fix(ci): isolate Python libraries and include Office documentation * test(frontend): wait for download status to finish rendering
18 lines
588 B
JavaScript
18 lines
588 B
JavaScript
import { prepareDocument } from "./prepare-document.js";
|
|
import { transferBuffers } from "./document-model.js";
|
|
|
|
self.onmessage = async ({ data: { bytes, kind } }) => {
|
|
try {
|
|
const result = await prepareDocument(bytes, kind, (phase) =>
|
|
self.postMessage({ phase }),
|
|
);
|
|
self.postMessage({ result }, transferBuffers(result));
|
|
} catch {
|
|
// Parser exceptions can contain document contents: expose a fixed diagnostic.
|
|
self.postMessage({
|
|
error:
|
|
"Office file exceeds preview limits or cannot be read. Download the original to open it.",
|
|
});
|
|
}
|
|
};
|