@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
29 lines • 1.66 kB
TypeScript
/**
* The sandbox's JSX: a small JavaScript + JSX → `React.createElement` transpiler that runs INSIDE
* the sandbox frame (it is inlined into the frame's document, so the frame stays network-less and
* needs no `unsafe-eval`), and the partial mode that lets a view the model is still writing be drawn
* as it streams — only once what has arrived so far closes into something that parses.
*
* Every function here is self-contained (no imports, no module state): the frame runtime is built
* from their source text (`Function.prototype.toString`), so the same code is unit-tested in Node and
* run in the frame.
*/
/**
* JavaScript with JSX → plain JavaScript calling `React.createElement`. No TypeScript, no JSX
* namespaces. `class` and `for` attributes become `className` / `htmlFor`.
*
* `partial: true` reads a prefix of a program the model is still writing: an element, attribute,
* expression or bracket cut off at the end is closed (an attribute or token cut half-way is dropped,
* back to the last point the code was whole), so the result is a complete program drawing what has
* arrived. Without it, malformed input throws a `SyntaxError`.
*/
export declare function transpileJsx(source: string, options?: {
partial?: boolean;
}): string;
/**
* A sandbox program as the model writes it, made runnable in the frame: `import` lines dropped (the
* kit, React and its hooks are already in scope) and `export` / `export default` taken off the
* declarations — `export default function App()` is `function App()`.
*/
export declare function prepareSandboxJsx(source: string): string;
//# sourceMappingURL=sandbox-jsx.d.ts.map