chore: npm run lint

This commit is contained in:
tanzhenxin
2025-08-15 17:16:05 +08:00
parent a925ac56fa
commit 36c65658ff

View File

@@ -171,28 +171,11 @@ ${textContent}
return false; return false;
} }
// Perform GitHub URL conversion here to differentiate between user-provided
// URL and the actual URL to be fetched.
let url = params.url;
try {
const parsedUrl = new URL(url);
if (
parsedUrl.hostname === 'github.com' &&
parsedUrl.pathname.includes('/blob/')
) {
url = url
.replace('github.com', 'raw.githubusercontent.com')
.replace('/blob/', '/');
}
} catch (e) {
// If the URL is invalid, leave it unchanged (or handle as needed)
}
const confirmationDetails: ToolCallConfirmationDetails = { const confirmationDetails: ToolCallConfirmationDetails = {
type: 'info', type: 'info',
title: `Confirm Web Fetch`, title: `Confirm Web Fetch`,
prompt: `Fetch content from ${params.url} and process with: ${params.prompt}`, prompt: `Fetch content from ${params.url} and process with: ${params.prompt}`,
urls: [url], urls: [params.url],
onConfirm: async (outcome: ToolConfirmationOutcome) => { onConfirm: async (outcome: ToolConfirmationOutcome) => {
if (outcome === ToolConfirmationOutcome.ProceedAlways) { if (outcome === ToolConfirmationOutcome.ProceedAlways) {
this.config.setApprovalMode(ApprovalMode.AUTO_EDIT); this.config.setApprovalMode(ApprovalMode.AUTO_EDIT);