Class BowireDiscoveryProbe
- Namespace
- Kuestenlogik.Bowire
- Assembly
- Kuestenlogik.Bowire.dll
The registry fan-out behind every discovery surface Bowire has (#534):
the /api/services endpoint, bowire discover on the CLI,
and the bowire.discover MCP tool. Each of those used to own a
private copy of "loop the plugins, call DiscoverAsync, swallow what
throws" — and each swallowed a different amount of the diagnosis, so
the three surfaces disagreed about why a URL produced nothing.
One pass produces two things: the merged service list, and one BowireDiscoveryAttempt per probed plugin — including the plugins that ran cleanly and found nothing, which is precisely the case the old error-only reporting hid.
Static because it is pure: no cache, no ring buffer, no registry of its own. Every input arrives as a parameter. Should it ever need to remember something between calls, it has to become an injected service instead. IBowireDiscoveryDiagnostics (#544) does not change that: the probe reads a diagnostic off the return value of the same await it was already making, into a local that dies with the task. It stores nothing, and it never goes back to a plugin to ask what happened.
public static class BowireDiscoveryProbe
- Inheritance
-
BowireDiscoveryProbe
- Inherited Members
Methods
RunAsync(BowireProtocolRegistry, string, string?, bool, TimeSpan, ILogger?, CancellationToken)
Probe serverUrl with every registered protocol
plugin (or just the hinted one) in parallel and report what each
one found.
public static Task<BowireDiscoveryProbeResult> RunAsync(BowireProtocolRegistry registry, string serverUrl, string? pluginHint, bool showInternalServices, TimeSpan perProbeCeiling, ILogger? logger = null, CancellationToken ct = default)
Parameters
registryBowireProtocolRegistryThe protocol registry to fan out over.
serverUrlstringThe bare target URL — without a
hint@prefix. Split it with Parse(string?) first and pass the hint separately.pluginHintstringWhen non-null, only the plugin whose Id matches (case-insensitively) is probed. Saves the ~12 s cost of probing every plugin against a URL the caller already knows the owner of. An unknown hint yields zero attempts — callers that need to tell "unknown hint" apart from "no plugins loaded" check the registry themselves.
showInternalServicesboolForwarded to each plugin's DiscoverAsync.
perProbeCeilingTimeSpanHard cap on any single plugin's probe. Plugins enforce their own timeouts, but a wedged one would otherwise drag the whole fan-out past the browser's 12 s abort — total wall-clock is max(per-probe), not the sum, because the probes run in parallel.
loggerILoggerOptional; receives one warning per failed probe.
ctCancellationTokenCaller cancellation, linked into the ceiling.