perf(startup): load canvas, node-pty, ssh2, html-to-text and the OpenCode SDK on first use
Main module evaluation drops from ~420 ms to ~330 ms. Types stay as import type; the DeepSeek Harness chunks stay static because the protocol chunk shares code with Main startup paths.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { convert } from 'html-to-text'
|
||||
import { loadHtmlToText } from '../document-extracted-text'
|
||||
import { unzipSync } from 'fflate'
|
||||
import { extname } from 'node:path'
|
||||
import type { ParsedDocumentImage } from '../http-document-ocr'
|
||||
@@ -701,7 +701,7 @@ export async function parseDocument(
|
||||
} else if (['.docx', '.xlsx', '.pptx'].includes(extension)) {
|
||||
sections = parseOfficeArchive(buffer, extension)
|
||||
} else if (['.html', '.htm'].includes(extension)) {
|
||||
const content = convert(decodeText(buffer), {
|
||||
const content = loadHtmlToText().convert(decodeText(buffer), {
|
||||
wordwrap: false,
|
||||
selectors: [
|
||||
{ selector: 'script', format: 'skip' },
|
||||
|
||||
Reference in New Issue
Block a user