NAME
Langertha::Raider::PlanTools - Internal plan-mode tools of raider: enter_plan_mode and exit_plan_mode
VERSION
version 0.504
SYNOPSIS
my $plan = Langertha::Raider::PlanTools->new(
handler => sub { my ( $plan ) = @_; ...; return ( $text, $is_error ) },
enter_handler => sub { ...; return ( $text, $is_error ) },
);
my $exit = $plan->server; # MCP::Server with the tool exit_plan_mode
my $enter = $plan->enter_server; # MCP::Server with the tool enter_plan_mode
DESCRIPTION
Internal module. Its interface may change without notice.
The plan-mode tools, shaped after Claude Code's EnterPlanMode and ExitPlanMode (Langertha::Raider::ToolNames). In the plan permission mode (ADR 0021) the model reads and plans; with enter_plan_mode (no arguments) it asks to go there before a larger change, with exit_plan_mode it presents the plan to leave the mode. The tools decide nothing themselves: "enter_handler" and "handler" -- the application -- switch the mode or say why it stays, and return the text the model gets. Whether the person is asked before plan mode is entered is the permission gate's business (ADR 0025): the call reaches the handler only when it may run.
The application mounts enter_plan_mode always and exit_plan_mode once its run has been in plan mode.
handler
Required. The handler of exit_plan_mode: called as $handler->($plan) on every call; returns the result text and whether it is an error.
enter_handler
The handler of enter_plan_mode: called as $enter_handler->() on every call; returns the result text and whether it is an error. Needed for "enter_server".
server
The MCP::Server with the tool exit_plan_mode, built once.
enter_server
The MCP::Server with the tool enter_plan_mode, built once. Croaks without "enter_handler".
SEE ALSO
SUPPORT
Issues
Please report bugs and feature requests 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.