@@ -792,6 +792,63 @@ def _execute_command(self, command: Command, args: str) -> Tuple[bool, Optional[
792792
793793 return True , None
794794
795+ elif name == "domain" :
796+ from .web_tools import get_url_verifier
797+
798+ verifier = get_url_verifier ()
799+ parts = args .strip ().split () if args else []
800+ subcommand = parts [0 ].lower () if parts else "list"
801+
802+ if subcommand == "list" :
803+ # Show all domain decisions
804+ rejected = verifier .get_rejected_domains ()
805+ accepted = verifier .get_accepted_domains ()
806+
807+ console .print (f"\n [bold { COLORS ['secondary' ]} ]Domain Security Decisions[/]\n " )
808+
809+ if rejected :
810+ console .print (f"[bold red]Blocked Domains ({ len (rejected )} ):[/]" )
811+ for domain in rejected :
812+ console .print (f" [red]✗[/] { domain } " )
813+ console .print ()
814+
815+ if accepted :
816+ console .print (f"[bold yellow]Allowed Domains ({ len (accepted )} ):[/]" )
817+ for domain in accepted :
818+ console .print (f" [yellow]![/] { domain } [dim](proceed at risk)[/]" )
819+ console .print ()
820+
821+ if not rejected and not accepted :
822+ console .print (f" [{ COLORS ['muted' ]} ]No domain decisions recorded yet.[/]\n " )
823+
824+ console .print (f"[{ COLORS ['muted' ]} ]Commands:[/]" )
825+ console .print (f" /domain allow <domain> - Allow access to a blocked domain" )
826+ console .print (f" /domain block <domain> - Block access to an allowed domain" )
827+ console .print (f" /domain reset <domain> - Remove decision (will ask again)" )
828+ console .print ()
829+
830+ elif subcommand == "allow" and len (parts ) >= 2 :
831+ domain = parts [1 ].lower ()
832+ verifier .allow_domain (domain )
833+ display_success (f"Domain '{ domain } ' is now allowed" )
834+
835+ elif subcommand == "block" and len (parts ) >= 2 :
836+ domain = parts [1 ].lower ()
837+ verifier .block_domain (domain )
838+ display_success (f"Domain '{ domain } ' is now blocked" )
839+
840+ elif subcommand == "reset" and len (parts ) >= 2 :
841+ domain = parts [1 ].lower ()
842+ if verifier .remove_domain_decision (domain ):
843+ display_success (f"Decision for '{ domain } ' has been reset" )
844+ else :
845+ display_warning (f"No decision found for '{ domain } '" )
846+
847+ else :
848+ display_error ("Usage: /domain [list|allow <domain>|block <domain>|reset <domain>]" )
849+
850+ return True , None
851+
795852 elif name == "getapikey" :
796853 from .lib .providers import (
797854 API_KEY_PROVIDERS , PROVIDERS , get_provider ,
0 commit comments