





















@@ -47,8 +47,10 @@ describe("tool-card extraction", () => {
4747expect(cards[0]?.id).toBe("msg:1:call-1");
4848expect(cards[0]?.name).toBe("browser.open");
4949expect(cards[0]?.outputText).toBe("Opened page");
50-expect(cards[0]?.inputText).toContain('"url": "https://example.com"');
51-expect(cards[0]?.inputText).toContain('"retry": 0');
50+expect(cards[0]?.inputText).toBe(`{
51+ "url": "https://example.com",
52+ "retry": 0
53+}`);
5254});
53555456it("preserves string args verbatim and keeps empty-output cards", () => {
@@ -89,8 +91,10 @@ describe("tool-card extraction", () => {
8991);
90929193expect(cards).toHaveLength(1);
92-expect(cards[0]?.inputText).toContain('"deck": "Example Deck"');
93-expect(cards[0]?.inputText).toContain('"mode": "preview"');
94+expect(cards[0]?.inputText).toBe(`{
95+ "deck": "Example Deck",
96+ "mode": "preview"
97+}`);
9498});
959996100it("pairs interleaved nameless tool results in content order", () => {
@@ -176,11 +180,17 @@ describe("tool-card extraction", () => {
176180);
177181178182const sidebar = buildToolCardSidebarContent(card);
179-expect(sidebar).toContain("## Deck Manage");
180-expect(sidebar).toContain("### Tool input");
181-expect(sidebar).toContain("with Example Deck");
182-expect(sidebar).toContain("### Tool output");
183-expect(sidebar).toContain("No output");
183+expect(sidebar).toBe(`## Deck Manage
184+185+**Tool:** \`deck_manage\`
186+187+### Tool input
188+\`\`\`text
189+with Example Deck
190+\`\`\`
191+192+### Tool output
193+*No output — tool completed successfully.*`);
184194});
185195186196it("extracts canvas handle payloads into canvas previews", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。