NAME

Langertha::Result - Common result object for Raider and Raid execution

VERSION

version 0.305

SYNOPSIS

my $r = Langertha::Result->final('done');

if ($r->is_question) {
  ...
}

say "$r"; # stringifies to text (or empty string)

DESCRIPTION

Unified result type used by runnable nodes in Langertha orchestration. Represents one of four high-level outcomes:

  • final - successful completion

  • question - needs user input

  • pause - intentionally paused / resumable

  • abort - explicit stop / error

Langertha::Raider::Result subclasses this class for backward-compatible Raider behavior.

type

Result type: final, question, pause, or abort.

text

Final output text, usually used with type => final.

content

Auxiliary text payload for non-final outcomes (question/pause/abort).

options

Optional choices for question-style results.

data

Optional structured payload for callers/orchestrators.

context

Optional run context attached to the result.

is_final

Returns true for type => final.

is_question

Returns true for type => question.

is_pause

Returns true for type => pause.

is_abort

Returns true for type => abort.

as_hash

Returns a plain hashref representation (without context).

with_context

my $with_ctx = $result->with_context($ctx);

Returns a cloned result object with context attached.

final

my $r = Langertha::Result->final('ok');

Constructor helper for final results.

question

my $r = Langertha::Result->question('Which option?', options => ['a','b']);

Constructor helper for question results.

pause

my $r = Langertha::Result->pause('Waiting for external event');

Constructor helper for pause results.

abort

my $r = Langertha::Result->abort('Cannot continue');

Constructor helper for abort results.

SUPPORT

Issues

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

CONTRIBUTING

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

AUTHOR

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

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.