=encoding UTF-8

=head1 NAME

Praxo::Core - embeddable AI agent framework for Perl

=head1 SYNOPSIS

    use Praxo::Models ();
    use Praxo::Agent ();

    my $model = Praxo::Agent::StaticModel->new('hello');
    my $options = Praxo::Agent::AgentOptions->new($model);
    my $result = Praxo::Agent::run_agent(
        $options,
        Praxo::Models::session(id => 'demo'),
        'hello',
    );
    print $result->{output};

=head1 DESCRIPTION

PRAXO-CORE is an embeddable, MIT-licensed AI agent framework. This distribution
is its native Perl Core: an agent loop with tool registration and dispatch,
policy hooks, human-in-the-loop interrupt decisions, typed events, memory,
checkpoints, context budgets, middleware, OpenTelemetry and Harmovela sinks,
MCP, retriever and synchronous delegation seams, JSON Schema validation, and
plugin manifest parsing.

It is not an HTTP user agent, web crawler, or hosted AI agent service. HTTP is
used by optional adapters to communicate with model providers and external
services.

=head1 FEATURES

=over 4

=item * Native Perl agent loop with tool registration and dispatch.

=item * Policy hooks, explicit tool scope, final-argument reauthorization, and
human-in-the-loop approve, edit, reject, and respond decisions.

=item * Typed events, memory, checkpoints, context budgets, middleware, JSON
Schema, and plugin manifests.

=item * OpenAI-compatible, Anthropic, and Gemini adapters with SSE streaming.

=item * MCP, OpenTelemetry, Harmovela, retriever, and synchronous delegation
seams.

=item * MIT-licensed and Perl core modules only.

=back

=head1 QUICK START

Install the distribution:

    cpanm Praxo::Core

Then run the smallest deterministic example:

    use lib 'language/perl/lib';
    use Praxo::Models ();
    use Praxo::Agent ();

    my $model = Praxo::Agent::StaticModel->new('hello');
    my $options = Praxo::Agent::AgentOptions->new($model);
    my $result = Praxo::Agent::run_agent(
        $options,
        Praxo::Models::session(id => 'demo'),
        'hello',
    );
    print $result->{output};

Tools register on the options object:

    my $registry = Praxo::Agent::ToolRegistry->new;
    $registry->register(Praxo::Agent::FuncTool->new('echo', 'Echo arguments', sub {
        return $_[0];
    }));
    $options->{tools} = $registry;

=head1 EXAMPLES

Runnable examples live in the repository:

=over 4

=item * C<consumer>: install and deny one unsafe call.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/consumer>

=item * C<live-model>: connect a real model.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/live-model>

=item * C<mcp>: connect MCP tools.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/mcp>

=item * C<structured-output>: validate structured output.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/structured-output>

=item * C<streaming>: stream a response.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/streaming>

=item * C<identity-policy>: add identity and policy.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/identity-policy>

=item * C<hitl>: require human approval.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/hitl>

=item * C<checkpoint>: persist checkpoints.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/checkpoint>

=item * C<service>: run behind HTTP.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/service>

=item * C<session-checkpoint>: resume a multi-turn session.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/session-checkpoint>

=item * C<retry>: retry transient failures.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/retry>

=item * C<provider-fallback>: add provider fallback.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/provider-fallback>

=item * C<event-sink>: observe agent events.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/event-sink>

=item * C<representative-chain>: run the representative chain.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/representative-chain>

=item * C<advanced-delegation>: apply governed delegation.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples/advanced-delegation>

=item * Full example index:
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/examples>

=back

=head1 SCENARIO TUTORIALS

=over 4

=item * C<community-governance>: fixed synthetic issues produce four classified
items and a review-only reviewer request. No GitHub API, closure, or
impersonation.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/Tutorial/community-governance>

=item * C<compliance-tracking>: fixed policy versions yield two changed sections
and a duplicate removal; Core drafts review-only remediation. No filing, audit
conclusion, or live source.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/Tutorial/compliance-tracking>

=item * C<localization-draft>: fixed market rules produce a review-only
localized text draft. No translation engine, CMS, or publication.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/Tutorial/localization-draft>

=item * C<log-triage>: one fixed C<summarize_log> tool reads the tutorial's log
fixture and returns severity counts.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/Tutorial/log-triage>

=item * C<news-factcheck>: compares fixed source excerpts for one synthetic
article, cites a contradiction, and drafts a review-only fact-check. No
truth-verification service.
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/Tutorial/news-factcheck>

=item * Tutorial index:
L<https://github.com/axisvela/praxo-core/tree/main/language/perl/Tutorial>

=back

=head1 REFERENCE APPLICATIONS

No accepted end-to-end reference application is recorded for this language yet.
Candidate goals are tracked in the Reference Application Portfolio:
L<https://axisvela.github.io/praxo-core/project/roadmap/#reference-application-portfolio>

Planning context: L<https://axisvela.github.io/praxo-core/getting-started/tutorial-plan/>,
L<https://axisvela.github.io/praxo-core/getting-started/agent-scenarios/>, and
L<https://axisvela.github.io/praxo-core/getting-started/tutorial-catalog/>.

=head1 LIMITS

=over 4

=item * Core is an execution framework, not a model provider, hosted agent
service, crawler, workflow engine, or production sandbox.

=item * Checkpoints are recovery hints, not transactions. Core does not provide
durable execution, exactly-once effects, or an effect ledger.

=item * Provider credentials, authentication, retries, and durable state remain
application-owned.

=item * Go remains the reference implementation; full Go feature parity is not
claimed.

=back

=head1 DOCUMENTATION

=over 4

=item * Language documentation:
L<https://axisvela.github.io/praxo-core/languages/perl/>

=item * Contract and scope:
L<https://axisvela.github.io/praxo-core/languages/matrix/>

=item * Registry introduction:
L<https://github.com/axisvela/praxo-core/blob/main/language/perl/REGISTRY.md>

=back

=head1 COMMUNITY

=over 4

=item * GitHub Discussions: L<https://github.com/axisvela/praxo-core/discussions>

=item * GitHub Issues: L<https://github.com/axisvela/praxo-core/issues>

=item * X: L<https://x.com/axisvela>

=item * Weibo: L<https://weibo.com/u/1936025761>

=item * LinkedIn: L<https://www.linkedin.com/company/axisvela/>

=item * Facebook: L<https://www.facebook.com/profile.php?id=61596905732406>

=item * YouTube: L<https://www.youtube.com/@axisvela>

=item * Discord: L<https://discord.com/channels/1575163993767809064/1575164343148875977>

=item * Documentation: L<https://axisvela.github.io/praxo-core/>

=item * Architect: L<https://axisvela.architect.pub>

=back

=head1 LICENSE

MIT. See F<LICENSE>.

=cut
