donsetch 3.6.6 → 4.1.0
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/package.json +1 -1
- package/pi-extension.ts +7 -4
package/package.json
CHANGED
package/pi-extension.ts
CHANGED
|
@@ -389,9 +389,8 @@ function shortUrl(url: string): string {
|
|
|
389
389
|
* engine), or the provider name ("exa", "tavily", "serper",
|
|
390
390
|
* "tinyfish") for BYOK.
|
|
391
391
|
*/
|
|
392
|
-
function getSearchProvider(sc: any): string {
|
|
393
|
-
|
|
394
|
-
const provider = sc.provider;
|
|
392
|
+
function getSearchProvider(sc: any, dbg: any): string {
|
|
393
|
+
const provider = (sc && sc.provider) || (dbg && dbg.provider) || null;
|
|
395
394
|
if (!provider || provider === "null") return "local";
|
|
396
395
|
return String(provider);
|
|
397
396
|
}
|
|
@@ -493,6 +492,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
493
492
|
const isErr = result?.isError ?? false;
|
|
494
493
|
const sc = result?.structuredContent ?? null;
|
|
495
494
|
const dbg = result?._meta?.["com.donsetch/fetch-debug"] ?? null;
|
|
495
|
+
// Issue #172: provider moved to _meta for compact search
|
|
496
|
+
// responses, so the BYOK label must read the telemetry
|
|
497
|
+
// object too instead of blaming "local" on every search.
|
|
498
|
+
const sdbg = result?._meta?.["com.donsetch/search-debug"] ?? null;
|
|
496
499
|
|
|
497
500
|
// Build details for TUI rendering
|
|
498
501
|
const details: any = {
|
|
@@ -504,7 +507,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
504
507
|
if (toolName === "web_search") {
|
|
505
508
|
details.results = countSearchResults(text);
|
|
506
509
|
details.topResult = getFirstResultTitle(text);
|
|
507
|
-
details.provider = getSearchProvider(sc);
|
|
510
|
+
details.provider = getSearchProvider(sc, sdbg);
|
|
508
511
|
} else if (toolName === "web_fetch") {
|
|
509
512
|
details.source = getFetchSource(sc, dbg);
|
|
510
513
|
details.status = getFetchStatus(sc);
|