Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
const ESCAPE_SCRIPT_DATA = /</g
const ESCAPE_LINE_TERMS = /[\u2028\u2029]/g
/** @internal */
export function escapeJson(spec: unknown): string {
return JSON.stringify(spec)
.replace(ESCAPE_SCRIPT_DATA, "\\u003c")
.replace(ESCAPE_LINE_TERMS, (c) => c === "\u2028" ? "\\u2028" : "\\u2029")
}
/** @internal */
export function escape(str: string): string {
return str
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
}
/** @internal */
export function escapeAttribute(str: string): string {
return escape(str)
.replace(/"/g, """)
.replace(/'/g, "'")
}