mirror of
https://github.com/voideditor/void
synced 2026-05-24 01:48:25 +00:00
fix ssh?
This commit is contained in:
parent
7eac4aad6f
commit
77c9284df5
1 changed files with 10 additions and 2 deletions
|
|
@ -42,8 +42,16 @@ const validateStr = (argName: string, value: unknown) => {
|
|||
const validateURI = (uriStr: unknown) => {
|
||||
if (uriStr === null) throw new Error(`Invalid LLM output: uri was null.`)
|
||||
if (typeof uriStr !== 'string') throw new Error(`Invalid LLM output format: Provided uri must be a string, but it's a(n) ${typeof uriStr}. Full value: ${JSON.stringify(uriStr)}.`)
|
||||
const uri = URI.file(uriStr)
|
||||
return uri
|
||||
|
||||
// Try to parse as full URI first (for remote schemes like ssh://, wsl://, etc.)
|
||||
try {
|
||||
const uri = URI.parse(uriStr)
|
||||
return uri
|
||||
} catch (e) {
|
||||
// If parsing as URI fails, treat as file path (backwards compatibility)
|
||||
const uri = URI.file(uriStr)
|
||||
return uri
|
||||
}
|
||||
}
|
||||
|
||||
const validateOptionalURI = (uriStr: unknown) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue