IAgentPrismUiProvider
AgentPrism.AspNetCore.dllSource that serves the management UI’s static assets.
public interface IAgentPrismUiProviderRemarks
Section titled “Remarks”This abstraction is deliberately single-method. The asset
list, content type, ETag, cache headers, compression format, and
single-page-application fallback all belong entirely to the implementation.
This way, the HTTP layer’s public API stays unchanged when the UI package
changes its own bundling format.
The dependency direction is AgentPrism.UI → AgentPrism.AspNetCore and
cannot be reversed. This is why MapAgentPrism cannot call the UI
package directly; it resolves the registration from the service provider. If
no registration exists, the UI routes are never wired up and the HTTP surface
is unchanged.
Implementations are registered with TryAdd; the consumer’s own
registration wins (the replaceable-extension rule).
Properties
Section titled “Properties”HasAssets
Section titled “ HasAssets”Whether an asset is available to serve. If false, the UI routes are never wired up.
bool HasAssets { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”UI assets are produced at build time. A package built in an environment without Node.js can end up empty; in that case, it is correct to never open the routes rather than serve a blank page — the consumer sees a 404 and looks for the reason.
Methods
Section titled “Methods”TryServeAsync(HttpContext, string, string)
Section titled “ TryServeAsync(HttpContext, string, string)”Serves a UI request.
ValueTask<bool> TryServeAsync(HttpContext context, string basePath, string relativePath)Parameters
Section titled “Parameters”context HttpContext
The request context.
basePath string
The base path the UI is mounted under; always ends with /. Example:
/agentprism/. The implementation writes this into the
<base href> tag inside index.html, so the UI works
under any prefix.
relativePath string
The requested asset path relative to the base path. An empty string for
the root request. The leading / has been removed.
Returns
Section titled “Returns”true if the request was served. If it returns
false, the caller produces a 404; in that case the
implementation must have written nothing to the response.