execute method

  1. @override
Future<CommandResult> execute(
  1. String args,
  2. ToolUseContext context
)
override

Execute the command.

Implementation

@override
Future<CommandResult> execute(String args, ToolUseContext context) async {
  final current = isPlanMode();
  final newState = !current;
  onToggle(newState);

  return TextCommandResult(
    newState
        ? 'Plan mode enabled. I will think through my approach before '
              'making changes. Use /plan again to disable.'
        : 'Plan mode disabled. Returning to normal execution.',
  );
}