Mostlylucid.BotDetection.StyloExtract 8.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mostlylucid.BotDetection.StyloExtract --version 8.5.1
                    
NuGet\Install-Package Mostlylucid.BotDetection.StyloExtract -Version 8.5.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mostlylucid.BotDetection.StyloExtract" Version="8.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mostlylucid.BotDetection.StyloExtract" Version="8.5.1" />
                    
Directory.Packages.props
<PackageReference Include="Mostlylucid.BotDetection.StyloExtract" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mostlylucid.BotDetection.StyloExtract --version 8.5.1
                    
#r "nuget: Mostlylucid.BotDetection.StyloExtract, 8.5.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mostlylucid.BotDetection.StyloExtract@8.5.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mostlylucid.BotDetection.StyloExtract&version=8.5.1
                    
Install as a Cake Addin
#tool nuget:?package=Mostlylucid.BotDetection.StyloExtract&version=8.5.1
                    
Install as a Cake Tool

Mostlylucid.BotDetection.StyloExtract

Bridge pack between StyloExtract and StyloBot's IActionPolicy registry. Provides four named action policies that operators reference by name from EndpointPolicy rules.

This package replaces Mostlylucid.StyloExtract.StyloBot (1.6.x). The source has moved into the stylobot repo so it co-evolves with Mostlylucid.BotDetection via ProjectReference.

Setup

builder.Services.AddStyloExtract(o => o.StorePath = "styloextract.db");
builder.Services.AddBotDetection(); // or AddStyloBot()
builder.Services.AddStyloExtractActionPolicies();

AddStyloExtractActionPolicies() is in the Mostlylucid.BotDetection.StyloExtract.Extensions namespace.

Policies

Name Behaviour
extract-markdown Replaces HTML response body with Markdown. Content-Type becomes text/markdown; charset=utf-8.
extract-headers Adds X-StyloExtract-* response headers. Body unchanged.
extract-sidecar Adds Link: <url>; rel="alternate"; type="text/markdown" header. Body unchanged.
extract-passthrough Explicit no-op. Returns Allowed immediately without invoking the extractor.

All policies return ActionResult.Allowed - they transform the response but never block the request. Any extraction failure is logged at Warning and the original response is preserved (fail-open, always).

Configuration

Options are read from StyloExtract:Actions:{policyName} in appsettings.json:

{
  "StyloExtract": {
    "Actions": {
      "extract-markdown": {
        "Profile": "RagFull",
        "EnableQueryOverride": true,
        "QueryParamName": "format",
        "QueryParamValue": "markdown",
        "Cache": {
          "Mode": "Override",
          "MaxAge": 86400,
          "Public": true,
          "VaryByBotType": true,
          "VaryByAccept": false
        }
      },
      "extract-sidecar": {
        "SidecarRouteTemplate": "/{path}.md"
      }
    }
  }
}

StyloExtractActionOptions

Field Type Default Description
Profile ExtractionProfile RagFull Controls which content appears in the Markdown output.
EnableQueryOverride bool true When true, ?format=markdown triggers the markdown body swap regardless of bot-type.
QueryParamName string "format" Query parameter name for the override.
QueryParamValue string "markdown" Query parameter value for the override.
Cache.Mode Respect\|Override\|Add Respect How Cache-Control is modified.
Cache.MaxAge int? null Maps to max-age=N seconds.
Cache.Public bool? null Adds public directive.
Cache.NoStore bool? null Adds no-store.
Cache.MustRevalidate bool? null Adds must-revalidate.
Cache.VaryByBotType bool false Appends X-StyloBot-BotType to Vary.
Cache.VaryByAccept bool false Appends Accept to Vary.
SidecarRouteTemplate string "/{path}.md" Template for the sidecar Link header. {path} = full path, {slug} = last segment.

Wiring in EndpointPolicy rules

{
  "BotDetection": {
    "Policies": {
      "api-bots": {
        "Endpoints": ["/api/*"],
        "BotThreshold": 0.7,
        "ActionPolicyName": "extract-markdown"
      }
    }
  }
}
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.5.4 79 7/27/2026
8.5.1 91 7/26/2026
8.5.0 85 7/26/2026
1.0.0 85 7/25/2026