mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
* feat: add backend foundations * feat: add text chat UI * chore: simplify the reload behaviour * fix: fix upgrade banner to be triggered after package upload * feat: simplify TesterPanel design * chore: fix formatting and generate client * chore: fix tracing for text chat mode * fix: fix revert and edit CTA * refactor: refactor TesterPanel into smaller components * feat: enable runtime transition of nodes * fix: fix review comments
21 lines
517 B
TypeScript
21 lines
517 B
TypeScript
import type { ConversationItem } from "./types";
|
|
|
|
export function formatConversationValue(value: unknown) {
|
|
if (value == null) {
|
|
return "None";
|
|
}
|
|
if (typeof value === "string") {
|
|
return value;
|
|
}
|
|
try {
|
|
return JSON.stringify(value, null, 2);
|
|
} catch {
|
|
return String(value);
|
|
}
|
|
}
|
|
|
|
export function countConversationMessages(items: ConversationItem[]) {
|
|
return items.filter(
|
|
(item) => item.kind === "message" && item.tone !== "muted",
|
|
).length;
|
|
}
|