@@ -27,12 +27,12 @@ export type FetchType = (
2727/**
2828 * Creates a fetch function with retry logic.
2929 *
30- * This function wraps the `crossFetch` with retry capabilities based
31- * on provided options. It allows configuring the number of retries,
32- * delay between retries, and specific HTTP status codes to retry on .
30+ * Wraps `crossFetch` with retry capabilities based on provided options.
31+ * Configures the number of retries, delay between retries, and specific HTTP status codes to retry on.
32+ * Supports cancellation and proxy configuration .
3333 *
34- * @param options - Options for retry configuration and tracing.
35- * @returns A fetch function with retry capabilities .
34+ * @param options - Configuration for retries, delays, status codes, cancellation, and tracing.
35+ * @returns A fetch function with retry functionality .
3636 */
3737export async function createFetch (
3838 options ?: {
@@ -118,12 +118,12 @@ export async function fetch(
118118/**
119119 * Fetches text content from a URL or file.
120120 *
121- * This function attempts to fetch content from either a URL or a local file.
122- * It supports HTTP(S) URLs and reads directly from the file system for local files .
121+ * Attempts to fetch content from an HTTP(S) URL or read from the file system for local files .
122+ * Handles retries, delays, and tracing if configured. Supports binary content via base64 encoding .
123123 *
124- * @param urlOrFile - The URL or file to fetch from.
125- * @param fetchOptions - Optional fetch configuration .
126- * @returns An object containing fetch status and content .
124+ * @param urlOrFile - URL or file path to fetch from.
125+ * @param fetchOptions - Optional configuration for retries, delays, and other fetch settings .
126+ * @returns Object containing fetch status, content, and metadata .
127127 */
128128export async function fetchText (
129129 urlOrFile : string | WorkspaceFile ,
@@ -195,16 +195,17 @@ export async function fetchText(
195195}
196196
197197/**
198- * Logs a POST request for tracing.
198+ * Logs a POST request for tracing purposes .
199199 *
200- * Constructs a curl command representing the POST request with appropriate headers
201- * and body, optionally masking sensitive information like authorization headers.
200+ * Constructs a curl command to represent the POST request, including headers
201+ * and body. Sensitive information in authorization headers can be masked
202+ * based on the provided options.
202203 *
203- * @param trace - Markdown trace object for logging.
204- * @param url - The URL of the request.
205- * @param headers - The request headers.
206- * @param body - The request body.
207- * @param options - Options for displaying authorization header .
204+ * @param trace - Object used for logging trace details .
205+ * @param url - The target URL of the request.
206+ * @param headers - The headers to include in the request .
207+ * @param body - The request body, either as FormData or a raw object .
208+ * @param options - Configuration options, including whether to mask authorization headers .
208209 */
209210export function traceFetchPost (
210211 trace : MarkdownTrace ,
@@ -245,13 +246,13 @@ ${Object.entries(headers)
245246}
246247
247248/**
248- * Converts a response status to a message .
249+ * Converts the HTTP response status and status text into a string list .
249250 *
250- * Converts the HTTP response status and status text into a string list
251- * to facilitate logging and debugging .
251+ * Facilitates logging and debugging by converting the status information
252+ * from the response object .
252253 *
253- * @param res - The response object.
254- * @returns A list of status and status text.
254+ * @param res - The HTTP response object containing status and statusText .
255+ * @returns A string list with status and status text.
255256 */
256257export function statusToMessage ( res ?: {
257258 status ?: number
0 commit comments