mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 19:20:39 +09:00
19 lines
333 B
TypeScript
19 lines
333 B
TypeScript
|
|
import pc from "picocolors";
|
||
|
|
|
||
|
|
export function printOpenClawStreamEvent(raw: string, debug: boolean): void {
|
||
|
|
const line = raw.trim();
|
||
|
|
if (!line) return;
|
||
|
|
|
||
|
|
if (!debug) {
|
||
|
|
console.log(line);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (line.startsWith("[openclaw]")) {
|
||
|
|
console.log(pc.cyan(line));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
console.log(pc.gray(line));
|
||
|
|
}
|