Merge pull request #716 from voideditor/mcp

undo validateURI change
This commit is contained in:
Andrew Pareles 2025-06-06 00:56:48 -07:00 committed by GitHub
commit 1737c7bfc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,16 +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)}.`)
// 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 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 validateOptionalURI = (uriStr: unknown) => {
@ -141,7 +141,6 @@ export class ToolsService implements IToolsService {
@IMarkerService private readonly markerService: IMarkerService,
@IVoidSettingsService private readonly voidSettingsService: IVoidSettingsService,
) {
const queryBuilder = instantiationService.createInstance(QueryBuilder);
this.validateParams = {