/** * AST-based preprocessing for toolEval code strings. * * Detects common LLM patterns that produce no return value and rewrites * the code so the result is captured: * - Bare expressions without `return` → auto-return the last expression * - Defined-but-not-called functions → auto-call the single uncalled one */ /** * Preprocess a code string before passing to AsyncFunction. * * If the code already has a top-level `return`, it is returned unchanged. * Otherwise: * - If the last statement is an expression, wraps it with `return (...)`. * - If there is exactly one uncalled top-level function declaration, * appends `return await name()`. * - On parse failure, throws the acorn SyntaxError (includes line:column). */ export declare function preprocessCode(code: string): string; //# sourceMappingURL=preprocess-code.d.ts.map