@bacnh85/pi-web 0.4.3 → 0.4.4
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.
- package/extensions/index.ts +1 -25
- package/extensions/lib/config.ts +1 -2
- package/package.json +1 -1
package/extensions/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ const crawl4aiControlSchema = {
|
|
|
49
49
|
timeout_ms: Type.Optional(Type.Number({ description: "Request timeout in milliseconds." })),
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
|
|
52
53
|
// ---------------------------------------------------------------------------
|
|
53
54
|
// Helper: format unified search results for text output
|
|
54
55
|
// ---------------------------------------------------------------------------
|
|
@@ -446,29 +447,4 @@ export default function piWebExtension(pi: ExtensionAPI) {
|
|
|
446
447
|
},
|
|
447
448
|
});
|
|
448
449
|
|
|
449
|
-
// ── /web-status command ──────────────────────────────────────────────
|
|
450
|
-
pi.registerCommand("web-status", {
|
|
451
|
-
description: "Show web provider configuration status",
|
|
452
|
-
handler: async (_args: string, ctx: any) => {
|
|
453
|
-
const cwd = cwdFromContext(ctx);
|
|
454
|
-
const trusted = includeProjectEnv(ctx);
|
|
455
|
-
const braveKey = findEnvValue("BRAVE_API_KEY", cwd, trusted);
|
|
456
|
-
const searxngUrl = findEnvValue("SEARXNG_BASE_URL", cwd, trusted);
|
|
457
|
-
const fireKey = findEnvValue("FIRECRAWL_API_KEY", cwd, trusted);
|
|
458
|
-
const fireUrl = findEnvValue("FIRECRAWL_API_URL", cwd, trusted);
|
|
459
|
-
const c4aiUrl = findEnvValue("CRAWL4AI_API_URL", cwd, trusted);
|
|
460
|
-
const c4aiToken = findEnvValue("CRAWL4AI_API_TOKEN", cwd, trusted);
|
|
461
|
-
ctx.ui.notify(
|
|
462
|
-
[
|
|
463
|
-
`Brave API key: ${braveKey.value ? `found (${braveKey.source})` : "not set"}`,
|
|
464
|
-
`SearXNG base URL: ${normalizeSearxngBaseUrl(searxngUrl.value)} (${searxngUrl.source || "default local"})`,
|
|
465
|
-
`Firecrawl base URL: ${normalizeFirecrawlBaseUrl(fireUrl.value)}`,
|
|
466
|
-
`Firecrawl API key: ${fireKey.value ? `found (${fireKey.source})` : "not set"}`,
|
|
467
|
-
`Crawl4AI API URL: ${normalizeCrawl4aiApiUrl(c4aiUrl.value)} (${c4aiUrl.source || "default"})`,
|
|
468
|
-
`Crawl4AI API token: ${c4aiToken.value ? `found (${c4aiToken.source})` : "not set"}`,
|
|
469
|
-
].join("\n"),
|
|
470
|
-
"info",
|
|
471
|
-
);
|
|
472
|
-
},
|
|
473
|
-
});
|
|
474
450
|
}
|
package/extensions/lib/config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// ponytail: duplicated in pi-munin/lib/helpers.ts. Extract when a third package needs it.
|
|
2
2
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import os from "node:os";
|
|
@@ -181,7 +181,6 @@ export function loadFirecrawlConfig(params: Record<string, unknown> = {}, cwd =
|
|
|
181
181
|
const isHosted = !apiUrl || baseUrl.startsWith(HOSTED_FIRECRAWL_BASE_URL);
|
|
182
182
|
const timeoutMs = timeoutValue ? Number.parseInt(String(timeoutValue), 10) : 60000;
|
|
183
183
|
if (!Number.isInteger(timeoutMs) || timeoutMs < 1000) throw new Error("FIRECRAWL_TIMEOUT_MS/timeout_ms must be an integer >= 1000.");
|
|
184
|
-
if (!isHosted && apiKey && !explicitApiKey) throw new Error("Refusing to send a configured FIRECRAWL_API_KEY to a custom Firecrawl URL. Pass firecrawl_api_key explicitly for that URL.");
|
|
185
184
|
if (isHosted && !apiKey) throw new Error("FIRECRAWL_API_KEY is required for hosted Firecrawl.");
|
|
186
185
|
return { baseUrl, apiKey, isHosted, timeoutMs };
|
|
187
186
|
}
|
package/package.json
CHANGED