@@ -78,7 +78,6 @@ pub(crate) struct OnboardCommandOptions {
7878 pub force : bool ,
7979 pub json : bool ,
8080 pub api_account : String ,
81- pub search_api_key : Option < String > ,
8281 pub run_gateway : bool ,
8382 pub port_override : Option < u16 > ,
8483 pub host_override : Option < String > ,
@@ -7395,21 +7394,13 @@ pub(crate) async fn cmd_doctor(
73957394 Ok ( ( ) )
73967395}
73977396
7398- #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
7399- enum SecretPromptUpdate {
7400- Keep ,
7401- Clear ,
7402- Set ,
7403- }
7404-
74057397#[ derive( Debug , Serialize ) ]
74067398struct OnboardSummary {
74077399 ok : bool ,
74087400 config_path : String ,
74097401 created_config : bool ,
74107402 api_account : String ,
74117403 api_account_created : bool ,
7412- search_api_key_configured : bool ,
74137404 gateway_run_requested : bool ,
74147405 /// `channel.account` identifiers bound during this onboarding session.
74157406 channels_bound : Vec < String > ,
@@ -7437,14 +7428,6 @@ fn prompt_line(prompt: &str) -> Result<String, Box<dyn std::error::Error>> {
74377428 Ok ( buf. trim ( ) . to_owned ( ) )
74387429}
74397430
7440- fn prompt_secret_line ( prompt : & str ) -> Result < String , Box < dyn std:: error:: Error > > {
7441- if stdin_is_interactive ( ) {
7442- Ok ( rpassword:: prompt_password ( prompt) ?. trim ( ) . to_owned ( ) )
7443- } else {
7444- prompt_line ( prompt)
7445- }
7446- }
7447-
74487431fn prompt_yes_no ( prompt : & str , default : bool ) -> Result < bool , Box < dyn std:: error:: Error > > {
74497432 let suffix = if default { "[Y/n]" } else { "[y/N]" } ;
74507433 loop {
@@ -7463,25 +7446,6 @@ fn prompt_yes_no(prompt: &str, default: bool) -> Result<bool, Box<dyn std::error
74637446 }
74647447}
74657448
7466- fn prompt_secret_update (
7467- label : & str ,
7468- configured : bool ,
7469- ) -> Result < ( SecretPromptUpdate , Option < String > ) , Box < dyn std:: error:: Error > > {
7470- let prompt = if configured {
7471- format ! ( "{label} (Enter keeps current, '-' clears): " )
7472- } else {
7473- format ! ( "{label} (optional, Enter skips): " )
7474- } ;
7475- let value = prompt_secret_line ( & prompt) ?;
7476- if value. is_empty ( ) {
7477- return Ok ( ( SecretPromptUpdate :: Keep , None ) ) ;
7478- }
7479- if value == "-" {
7480- return Ok ( ( SecretPromptUpdate :: Clear , None ) ) ;
7481- }
7482- Ok ( ( SecretPromptUpdate :: Set , Some ( value) ) )
7483- }
7484-
74857449fn ensure_onboard_api_account ( config : & mut GaryxConfig , account_id : & str ) -> bool {
74867450 let account_id = account_id. trim ( ) ;
74877451 if let Some ( account) = config. channels . api . accounts . get_mut ( account_id) {
@@ -7531,14 +7495,6 @@ fn print_onboard_summary(summary: &OnboardSummary) {
75317495 } else {
75327496 println ! ( "API account: {} (enabled)" , summary. api_account) ;
75337497 }
7534- println ! (
7535- "Search API key: {}" ,
7536- if summary. search_api_key_configured {
7537- "configured"
7538- } else {
7539- "missing"
7540- }
7541- ) ;
75427498 if summary. channels_bound . is_empty ( ) {
75437499 println ! (
75447500 "User-facing channels: {} configured (none bound this session)" ,
@@ -7578,10 +7534,6 @@ pub(crate) async fn cmd_onboard(
75787534 trim_to_option ( Some ( options. api_account . as_str ( ) ) ) . unwrap_or_else ( || "main" . to_owned ( ) ) ;
75797535 let api_account_created = ensure_onboard_api_account ( & mut cfg, & api_account) ;
75807536
7581- if let Some ( value) = trim_to_option ( options. search_api_key . as_deref ( ) ) {
7582- cfg. gateway . search . api_key = value;
7583- }
7584-
75857537 let interactive = !options. json && stdin_is_interactive ( ) ;
75867538 let mut channels_bound: Vec < String > = Vec :: new ( ) ;
75877539 if interactive {
@@ -7593,22 +7545,6 @@ pub(crate) async fn cmd_onboard(
75937545 }
75947546 println ! ( "Gateway/API account `{api_account}` will be available after setup." ) ;
75957547
7596- if options. search_api_key . is_none ( ) {
7597- let ( action, value) = prompt_secret_update (
7598- "Search API key" ,
7599- !cfg. gateway . search . api_key . trim ( ) . is_empty ( ) ,
7600- ) ?;
7601- match action {
7602- SecretPromptUpdate :: Keep => { }
7603- SecretPromptUpdate :: Clear => cfg. gateway . search . api_key . clear ( ) ,
7604- SecretPromptUpdate :: Set => {
7605- if let Some ( value) = value {
7606- cfg. gateway . search . api_key = value;
7607- }
7608- }
7609- }
7610- }
7611-
76127548 // ---- Channel binding ----
76137549 // The api.* account auto-created above lets programs talk to gateway,
76147550 // but a human needs at least one user-facing channel (telegram /
@@ -7659,7 +7595,6 @@ pub(crate) async fn cmd_onboard(
76597595 created_config,
76607596 api_account : api_account. clone ( ) ,
76617597 api_account_created,
7662- search_api_key_configured : !cfg. gateway . search . api_key . trim ( ) . is_empty ( ) ,
76637598 gateway_run_requested : options. run_gateway ,
76647599 channels_bound,
76657600 total_user_channel_accounts : user_channel_account_count ( & cfg) ,
0 commit comments