shariq-pi-extensions 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -156,13 +156,11 @@ export function buildDeveloperSearchBody(params: DeveloperSearchParams): Record<
|
|
|
156
156
|
|
|
157
157
|
const k = clampInteger(params.limit, 5, 1, 20);
|
|
158
158
|
const passages = clampInteger(params.passages, 1, 1, 5);
|
|
159
|
-
const timeout = clampInteger(params.timeout_seconds, 60, 5, 120) * 1_000;
|
|
160
159
|
|
|
161
160
|
return {
|
|
162
161
|
query,
|
|
163
162
|
k,
|
|
164
163
|
passages,
|
|
165
|
-
timeout,
|
|
166
164
|
...(types?.length ? { types } : {}),
|
|
167
165
|
...(repos?.length ? { repos } : {}),
|
|
168
166
|
...(sources?.length ? { sources } : {}),
|
|
@@ -240,8 +238,9 @@ export async function firecrawlRequest(
|
|
|
240
238
|
config: FirecrawlConfig,
|
|
241
239
|
signal?: AbortSignal,
|
|
242
240
|
fetchImpl: FetchLike = fetch,
|
|
241
|
+
options?: { timeoutMs?: number },
|
|
243
242
|
): Promise<Record<string, unknown>> {
|
|
244
|
-
const timeoutMs = Number(body.timeout) || 60_000;
|
|
243
|
+
const timeoutMs = options?.timeoutMs || Number(body.timeout) || 60_000;
|
|
245
244
|
let lastError: unknown;
|
|
246
245
|
|
|
247
246
|
for (let attempt = 0; attempt <= RETRY_DELAYS_MS.length; attempt++) {
|
|
@@ -121,7 +121,8 @@ export default function firecrawlWebExtension(pi: ExtensionAPI) {
|
|
|
121
121
|
const config = resolveFirecrawlConfig();
|
|
122
122
|
onUpdate?.({ content: [{ type: "text", text: `Searching Developer Index for: ${params.query}` }], details: {} });
|
|
123
123
|
const body = buildDeveloperSearchBody(params);
|
|
124
|
-
const
|
|
124
|
+
const timeoutMs = typeof params.timeout_seconds === "number" ? Math.max(5, Math.min(120, params.timeout_seconds)) * 1_000 : 60_000;
|
|
125
|
+
const payload = await firecrawlRequest("search/developer", body, config, signal, fetch, { timeoutMs });
|
|
125
126
|
return {
|
|
126
127
|
content: [{ type: "text", text: await formatDeveloperSearchOutput(payload) }],
|
|
127
128
|
details: {
|