chore: npm run lint
This commit is contained in:
parent
a925ac56fa
commit
36c65658ff
1 changed files with 1 additions and 18 deletions
|
|
@ -171,28 +171,11 @@ ${textContent}
|
|||
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 = {
|
||||
type: 'info',
|
||||
title: `Confirm Web Fetch`,
|
||||
prompt: `Fetch content from ${params.url} and process with: ${params.prompt}`,
|
||||
urls: [url],
|
||||
urls: [params.url],
|
||||
onConfirm: async (outcome: ToolConfirmationOutcome) => {
|
||||
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
||||
this.config.setApprovalMode(ApprovalMode.AUTO_EDIT);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue