donsetch 3.6.0 → 3.6.2
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 +11 -5
package/package.json
CHANGED
package/pi-extension.ts
CHANGED
|
@@ -397,14 +397,19 @@ function getSearchProvider(sc: any): string {
|
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
/**
|
|
400
|
-
* Extract the fetch source label from
|
|
400
|
+
* Extract the fetch source label from model state with a
|
|
401
|
+
* client-only diagnostics fallback. Compact MCP contracts keep
|
|
402
|
+
* transport telemetry in _meta["com.donsetch/fetch-debug"], so the
|
|
403
|
+
* tier can live there; older servers still expose it on
|
|
404
|
+
* structuredContent.
|
|
401
405
|
* Returns "cache" when tier is "1(warm)" (warm cookies, not a
|
|
402
406
|
* fresh fetch), "ghost" when tier starts with "2" (browser
|
|
403
407
|
* escalation), or "" for a normal tier-1 fetch.
|
|
404
408
|
*/
|
|
405
|
-
function getFetchSource(sc: any): string {
|
|
406
|
-
|
|
407
|
-
|
|
409
|
+
function getFetchSource(sc: any, dbg: any): string {
|
|
410
|
+
const tier = String(
|
|
411
|
+
(sc && sc.tier) || (dbg && dbg.tier) || ""
|
|
412
|
+
);
|
|
408
413
|
if (tier.includes("warm")) return "cache";
|
|
409
414
|
if (tier.startsWith("2")) return "ghost";
|
|
410
415
|
return "";
|
|
@@ -487,6 +492,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
487
492
|
.join("") || "";
|
|
488
493
|
const isErr = result?.isError ?? false;
|
|
489
494
|
const sc = result?.structuredContent ?? null;
|
|
495
|
+
const dbg = result?._meta?.["com.donsetch/fetch-debug"] ?? null;
|
|
490
496
|
|
|
491
497
|
// Build details for TUI rendering
|
|
492
498
|
const details: any = {
|
|
@@ -500,7 +506,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
500
506
|
details.topResult = getFirstResultTitle(text);
|
|
501
507
|
details.provider = getSearchProvider(sc);
|
|
502
508
|
} else if (toolName === "web_fetch") {
|
|
503
|
-
details.source = getFetchSource(sc);
|
|
509
|
+
details.source = getFetchSource(sc, dbg);
|
|
504
510
|
details.status = getFetchStatus(sc);
|
|
505
511
|
if (sc?.stitched) details.stitched = sc.stitched;
|
|
506
512
|
} else if (toolName === "web_crawl") {
|