feat: harden runtime readiness and session workflow
This commit is contained in:
@@ -7,6 +7,16 @@ import { Button } from "../components/ui/button";
|
||||
|
||||
const TAIL_PARAGRAPHS = 5;
|
||||
|
||||
export function formatModelActivity(text: string): string {
|
||||
return text
|
||||
.replace(/\r\n?/g, "\n")
|
||||
.replace(/^[\t ]*[•‣–]\s+/gm, "- ")
|
||||
.replace(/^(\d+)\)\s+/gm, (_, n) => `${n}. `)
|
||||
.replace(/\n(?=\S)(?![-*+] |\d+\. |>|`|\|)/g, "\n\n")
|
||||
.replace(/\n{3,}/g, "\n\n")
|
||||
.trim();
|
||||
}
|
||||
|
||||
/** Left drawer showing "what's happening": the tail of the model's streamed markdown
|
||||
* output, rendered as markdown (not raw text) so headings/emphasis/lists come through
|
||||
* and paragraphs stay visually separated. Collapsed it shows the last few paragraphs
|
||||
@@ -27,7 +37,7 @@ export function ModelActivityPanel({ onClose }: { onClose: () => void }) {
|
||||
.filter((p) => p !== "");
|
||||
const shown = expanded ? paragraphs : paragraphs.slice(-TAIL_PARAGRAPHS);
|
||||
const canExpand = paragraphs.length > TAIL_PARAGRAPHS;
|
||||
const source = shown.join("\n\n");
|
||||
const source = formatModelActivity(shown.join("\n\n"));
|
||||
|
||||
return (
|
||||
<aside className="flex w-[30vw] max-w-[30vw] shrink-0 flex-col border-r border-border bg-sidebar">
|
||||
|
||||
Reference in New Issue
Block a user