Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
// Hermes can stream its reasoning again as one quoted "π" block that ends with the reply already streamed.
/** True when `chunk` replays the reasoning before `streamed`, the reply text so far. */
export function isHermesReasoningReplay(chunk: string, streamed: string): boolean {
const reply = streamed.trim();
const replay = chunk.trim();
return reply !== "" && /^(?:> |-# )?π/.test(replay) && replay.endsWith(reply)
&& /\n\n[ \t]*$/.test(replay.slice(0, -reply.length));
}