mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-28 12:39:43 +00:00
fix: properly encode file URLs with special characters (#12424)
This commit is contained in:
parent
e9a3cfc083
commit
fde0b39b7c
12 changed files with 114 additions and 22 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bun
|
||||
|
||||
import path from "path"
|
||||
import { pathToFileURL } from "bun"
|
||||
import { createOpencode } from "@opencode-ai/sdk"
|
||||
import { parseArgs } from "util"
|
||||
|
||||
|
|
@ -49,7 +50,7 @@ Examples:
|
|||
}
|
||||
parts.push({
|
||||
type: "file",
|
||||
url: `file://${resolved}`,
|
||||
url: pathToFileURL(resolved).href,
|
||||
filename: path.basename(resolved),
|
||||
mime: "text/plain",
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue