Skip to content

Commit ffc3e95

Browse files
committed
fix(export): handle browser_state block in markdown export
1 parent 21ebd02 commit ffc3e95

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎src/integrations/misc/__tests__/export-markdown.spec.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,13 @@ describe("export-markdown", () => {
9999
} satisfies ExtendedContentBlock
100100
expect(formatContentBlockToMarkdown(block)).toBe("[Tool Reference]")
101101
})
102+
103+
it("should format browser_state blocks", () => {
104+
const block = {
105+
type: "browser_state",
106+
tabs: [],
107+
} satisfies ExtendedContentBlock
108+
expect(formatContentBlockToMarkdown(block)).toBe("[Browser State]")
109+
})
102110
})
103111
})

‎src/integrations/misc/export-markdown.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface ThoughtSignatureBlock {
1414
export type ExtendedContentBlock =
1515
| Anthropic.Messages.ContentBlockParam
1616
| Anthropic.Messages.ToolReferenceBlockParam
17+
| Anthropic.Messages.BrowserStateBlockParam
1718
| ReasoningBlock
1819
| ThoughtSignatureBlock
1920

@@ -73,6 +74,8 @@ export function formatContentBlockToMarkdown(block: ExtendedContentBlock): strin
7374
return `[Search Result]`
7475
case "tool_reference":
7576
return `[Tool Reference]`
77+
case "browser_state":
78+
return `[Browser State]`
7679
case "tool_use": {
7780
let input: string
7881
if (typeof block.input === "object" && block.input !== null) {

0 commit comments

Comments
 (0)