feat(core): improve read tool parity (#39126)

This commit is contained in:
Aiden Cline 2026-07-27 09:58:37 -05:00 committed by GitHub
commit 65d2a4e00c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 97 additions and 13 deletions

View file

@ -115,4 +115,21 @@ describe("ReadToolFileSystem", () => {
)
}),
)
it.effect("reads PDFs as bounded media", () =>
Effect.gen(function* () {
const { fs, files, directory } = yield* fixture
const file = path.join(directory, "document.pdf")
yield* files.writeFileString(file, "%PDF-1.7\ncontent")
const result = yield* ReadToolFileSystem.read(fs, file, "document.pdf")
expect(result).toMatchObject({
type: "file",
content: Buffer.from("%PDF-1.7\ncontent").toString("base64"),
encoding: "base64",
mime: "application/pdf",
})
}),
)
})