mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
chore: npm run lint
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user