DR-Tulu2-WebGPU / termworker.js
Nekochu's picture
Align with upstream: final warning, query-only search, JSON terminal envelope, tolerant parser, context wrap-up, DuckDuckGo exact URLs, GNU-compatible filters with 5 s limit, short answer extraction
a8293d1 verified
Raw History Blame Contribute Delete
374 Bytes
// Runs the webterminal filters (tools.js runPipeline) off the main thread so a runaway regex can be terminated.
import { runPipeline, RegexError } from './tools.js';
onmessage = ({ data }) => {
try { postMessage({ ok: true, text: runPipeline(data.stages, data.text) }); }
catch (e) { postMessage({ ok: false, message: e.message, regex: e instanceof RegexError }); }
};