NAME

Langertha::Raider::CLI::Provider - Internal provider commands of the raider CLI: inspect a manifest, activate it for --provider

VERSION

version 0.503

SYNOPSIS

# Internal to Langertha-Raider -- no API promise.
my $provider = Langertha::Raider::CLI::Provider->new(output => $out, err => \*STDERR);
my $exit = $provider->inspect('provider.example');                     # human
my $exit = $provider->inspect('knarr.lan:8443', allow_internal => 1,
  machine => $machine);                                                # --json

DESCRIPTION

Internal module. Its interface may change without notice.

raider provider inspect: fetches a provider manifest (Langertha::Raider::Provider::Fetch), validates it with Langertha::Manifest and shows what it declares -- provider id, issuer, endpoints, auth mechanisms and models -- together with what this raider cannot use (an unknown dialect, auth type or capability) and the inert extensions. Nothing is stored, no credential is bound and nothing is trusted: a manifest states what a provider claims (ADR 0007).

raider --provider: "activate" picks the endpoint of the manifest a run uses (Langertha::Raider::Provider::Activation) and reports why it cannot, for Langertha::Raider::CLI::Main.

output

The Langertha::Raider::CLI::Output the result goes to. Required.

err

Filehandle for failures in human output. Defaults to STDERR.

fetch_args

Extra constructor arguments for the fetcher ("fetch_class"), for tests: ssl_options, resolver, limits. Default none.

fetcher

my $fetch = $provider->fetcher(allow_internal => 1);

A new fetcher with "fetch_args" and the given arguments.

inspect

my $exit = $provider->inspect($target, allow_internal => $bool, machine => $machine);

Inspects the provider $target names (HOST, HOST:PORT or an https URL; "target_url" in Langertha::Raider::Provider::Fetch). Returns the exit status: 0 for a valid manifest, 1 when it was refused (an address or redirect), could not be fetched or is not a valid manifest, 2 for a target that is none. With a machine, one document (see "document"); without, the report on "output" and a failure on "err".

activate

my ( $exit, $activation ) = $provider->activate($target,
  allow_internal => $bool, model => $model, has_api_key => $bool);

raider --provider TARGET: the endpoint of the provider's manifest the run uses, through Langertha::Raider::Provider::Activation. Returns undef and the completed activation, with its warnings written to "err"; or, after writing why to "err", just the exit status: 2 when the command line has to change (a target that is none, a model the manifest does not list, no model where it lists several, no key where the endpoint needs one), 1 when the provider cannot be used as it is (refused, not fetched, not valid, not usable by this raider).

document

my $doc = $provider->document($report, $manifest, $fetch);

The result as data, the machine document without version:

status -- completed (a valid manifest), refused (an address or a redirect the fetch policy refuses) or failed (network, TLS, HTTP status, a limit, invalid JSON or schema).
url -- the manifest URL; final_url -- where the body came from after same-origin redirects (completed only); redirects -- those redirects; address -- the address connected to, once there was one.
manifest -- the validated manifest as core serializes it ("to_hash" in Langertha::Manifest), completed only.
warnings -- what this raider could not use or found odd, one sentence each ("warnings"); notes -- that extensions are inert. Both completed only.
error -- why (refused, failed); location -- the target of a redirect that was not followed.
elapsed -- seconds the fetch took.

warnings

my @warnings = $provider->warnings($manifest, $origin, $fetch);

What a client should know before using the manifest: endpoints whose dialect this raider has no adapter for, auth types it cannot supply, capability names Langertha does not know (treated as absent), an issuer that is not the origin the manifest came from, and endpoints that are plain http or point at an internal address literal.

notes

The extensions of the manifest, when it has any: inert, kept as published, never interpreted, loaded or run.

show

$provider->show($doc, $manifest);

The human report of a valid manifest.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-raider/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.