chore(vendor): import pi 1.3.0

Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.

git-subtree-dir: third_party/pi

git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
2026-10-15 17:58:48 -04:00
parent 719370c8f7
commit 6081e3e325
1743 changed files with 205460 additions and 131705 deletions

View File

@@ -62,15 +62,24 @@ describe("Mermaid rendering", () => {
expect(transformMermaid(partialMarkdown, { isStreaming: true })).toContain("───▶");
});
it("falls back to the code block with a warning after streaming", () => {
it("renders diagrams with class assignments", () => {
const markdown = "```mermaid\nflowchart LR\n A[Foo]:::highlight --> B[Bar]\n```";
const rendered = transformMermaid(markdown);
expect(rendered).not.toContain("```mermaid");
expect(rendered).not.toContain("Mermaid diagram not rendered");
expect(rendered).toContain("│ Foo ├───▶│ Bar │");
});
it("falls back to the code block with a warning after streaming", () => {
const markdown = "```mermaid\nflowchart LR\n A[Foo] invalid\n```";
const final = transformMermaid(markdown);
const followedByText = transformMermaid(`${markdown}\nFollowing text`);
const streaming = transformMermaid(markdown, { isStreaming: true });
expect(final).toContain(markdown);
expect(final).toContain("```\n`Mermaid diagram not rendered");
expect(final).toContain('dropped, expected a link: ":::highlight --> B[Bar]"');
expect(final).toContain('dropped, expected a link: "invalid"');
expect(final).not.toContain("more)");
expect(followedByText).toContain(" \nFollowing text");
expect(streaming).not.toContain("Mermaid diagram not rendered");
@@ -79,13 +88,13 @@ describe("Mermaid rendering", () => {
});
it("summarizes additional partial-render warnings", () => {
const markdown = "```mermaid\nflowchart LR\n A[Foo]:::highlight --> B[Bar]\n C[Baz]:::other --> D[Qux]\n```";
const markdown = "```mermaid\nflowchart LR\n A[Foo] invalid\n B[Bar] also-invalid\n```";
const rendered = transformMermaid(markdown);
expect(rendered).toContain(markdown);
expect(rendered).toContain('dropped, expected a link: ":::highlight --> B[Bar]"');
expect(rendered).toContain('dropped, expected a link: "invalid"');
expect(rendered).toContain("(+1 more)");
expect(rendered).not.toContain('dropped, expected a link: ":::other --> D[Qux]"');
expect(rendered).not.toContain('dropped, expected a link: "also-invalid"');
});
it("respects rendering modes and skips thinking blocks", () => {