@bacnh85/pi-web 0.5.0 → 0.5.1
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/lib/extract.ts +15 -6
- package/package.json +2 -2
|
@@ -181,11 +181,20 @@ export async function extractWithDiagnostics(params: ExtractParams): Promise<Ext
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
// All modes exhausted — return the best attempt with diagnostics instead of throwing
|
|
185
|
+
const lastAttempt = attempts[attempts.length - 1];
|
|
186
|
+
const bestResult: ExtractResult = {
|
|
187
|
+
title: "",
|
|
188
|
+
markdown: `[All extraction modes failed for ${params.url}]\n\n` +
|
|
189
|
+
attempts.map((a) => ` ${a.mode}: ${a.status}${a.message ? ` (${a.message})` : ""}`).join("\n") +
|
|
190
|
+
"\n\nTry web_screenshot for a visual snapshot, or verify the URL is accessible.",
|
|
191
|
+
backend: lastAttempt?.backend ?? "none",
|
|
192
|
+
};
|
|
193
|
+
return {
|
|
194
|
+
result: bestResult,
|
|
195
|
+
attempts,
|
|
196
|
+
selectedMode: lastAttempt?.mode ?? "static",
|
|
197
|
+
fallbackUsed: true,
|
|
198
|
+
};
|
|
190
199
|
}
|
|
191
200
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bacnh85/pi-web",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Pi extension for web search, page extraction, Firecrawl scraping/crawling, and Crawl4AI headless browser crawling.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"crawling"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
|
-
"test": "cd extensions && mocha"
|
|
27
|
+
"test": "cd extensions && npx mocha"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"README.md",
|