mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix: add missing kilocode_change markers to all annotated lines
This commit is contained in:
@@ -295,7 +295,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
||||
if (permission === "bash") {
|
||||
const title =
|
||||
typeof data.description === "string" && data.description ? data.description : "Shell command"
|
||||
const command = normalizeUrls(typeof data.command === "string" ? data.command : "")
|
||||
const command = normalizeUrls(typeof data.command === "string" ? data.command : "") // kilocode_change
|
||||
return {
|
||||
icon: "#",
|
||||
title,
|
||||
@@ -326,7 +326,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
||||
}
|
||||
|
||||
if (permission === "webfetch") {
|
||||
const url = normalizeUrls(typeof data.url === "string" ? data.url : "")
|
||||
const url = normalizeUrls(typeof data.url === "string" ? data.url : "") // kilocode_change
|
||||
return {
|
||||
icon: "%",
|
||||
title: `WebFetch ${url}`,
|
||||
|
||||
@@ -39,10 +39,10 @@ export const WebFetchTool = Tool.define(
|
||||
|
||||
yield* ctx.ask({
|
||||
permission: "webfetch",
|
||||
patterns: [url],
|
||||
patterns: [url], // kilocode_change
|
||||
always: ["*"],
|
||||
metadata: {
|
||||
url,
|
||||
url, // kilocode_change
|
||||
format: params.format,
|
||||
timeout: params.timeout,
|
||||
},
|
||||
@@ -74,7 +74,7 @@ export const WebFetchTool = Tool.define(
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
}
|
||||
|
||||
const request = HttpClientRequest.get(url).pipe(HttpClientRequest.setHeaders(headers))
|
||||
const request = HttpClientRequest.get(url).pipe(HttpClientRequest.setHeaders(headers)) // kilocode_change
|
||||
|
||||
// Retry with honest UA if blocked by Cloudflare bot detection (TLS fingerprint mismatch)
|
||||
const response = yield* httpOk.execute(request).pipe(
|
||||
@@ -85,7 +85,7 @@ export const WebFetchTool = Tool.define(
|
||||
err.reason.response.headers["cf-mitigated"] === "challenge",
|
||||
() =>
|
||||
httpOk.execute(
|
||||
HttpClientRequest.get(url).pipe(
|
||||
HttpClientRequest.get(url).pipe( // kilocode_change
|
||||
HttpClientRequest.setHeaders({ ...headers, "User-Agent": "kilo" }), // kilocode_change
|
||||
),
|
||||
),
|
||||
@@ -106,7 +106,7 @@ export const WebFetchTool = Tool.define(
|
||||
|
||||
const contentType = response.headers["content-type"] || ""
|
||||
const mime = contentType.split(";")[0]?.trim().toLowerCase() || ""
|
||||
const title = `${url} (${contentType})`
|
||||
const title = `${url} (${contentType})` // kilocode_change
|
||||
|
||||
if (isImageAttachment(mime)) {
|
||||
const base64Content = Buffer.from(arrayBuffer).toString("base64")
|
||||
|
||||
Reference in New Issue
Block a user