Replying to 33917193...

{"id":"d685d2683288d3247933e2de0f42f6dc273dd410","tree":"4302487b1f8c4b6048436b70bdcd2a857412aeb5","parents":["34b0e967cfa04f4b42079985ad3f3511e0ac51ef"],"author_name":"randymcmillan","author_email":"randymcmillan@protonmail.com","committer_name":"randymcmillan","committer_email":"randymcmillan@protonmail.com","message":"src/lib/sub_commands/chat.rs:intermediate\n\ndiff --git a/src/lib/cli.rs b/src/lib/cli.rs\nindex c253d97c..a32c01fb 100644\n--- a/src/lib/cli.rs\n+++ b/src/lib/cli.rs\n@@ -44,12 +44,12 @@ pub enum Commands {\n Login(sub_commands::login::SubCommandArgs),\n }\n\n-#[derive(Parser)]\n+#[derive(Parser, Debug)]\n #[command(author, version, about, long_about = None)]\n #[command(propagate_version = true)]\n pub struct ChatCli {\n- #[command(subcommand)]\n- pub command: ChatCommands,\n+ // #[command(subcommand)]\n+ // pub command: ChatCommands,\n /// remote signer address\n //#[arg(long, global = true)]\n //pub bunker_uri: Option,\n@@ -67,22 +67,22 @@ pub struct ChatCli {\n //pub disable_cli_spinners: bool,\n }\n\n-#[derive(Subcommand)]\n-pub enum ChatCommands {\n- /// update cache with latest updates from nostr\n- Fetch(sub_commands::fetch::SubCommandArgs),\n- /// signal you are this repo's maintainer accepting proposals via\n- /// nostr\n- Init(sub_commands::init::SubCommandArgs),\n- /// issue commits as a proposal\n- Send(sub_commands::send::SubCommandArgs),\n- /// list proposals; checkout, apply or download selected\n- List,\n- /// send proposal revision\n- Push(sub_commands::push::SubCommandArgs),\n- /// fetch and apply new proposal commits / revisions linked to\n- /// branch\n- Pull,\n- /// run with --nsec flag to change npub\n- Login(sub_commands::login::SubCommandArgs),\n-}\n+//#[derive(Subcommand, Debug)]\n+//pub enum ChatCommands {\n+// /// update cache with latest updates from nostr\n+// Fetch(sub_commands::fetch::SubCommandArgs),\n+// /// signal you are this repo's maintainer accepting proposals via\n+// /// nostr\n+// Init(sub_commands::init::SubCommandArgs),\n+// /// issue commits as a proposal\n+// Send(sub_commands::send::SubCommandArgs),\n+// /// list proposals; checkout, apply or download selected\n+// List,\n+// /// send proposal revision\n+// Push(sub_commands::push::SubCommandArgs),\n+// /// fetch and apply new proposal commits / revisions linked to\n+// /// branch\n+// Pull,\n+// /// run with --nsec flag to change npub\n+// Login(sub_commands::login::SubCommandArgs),\n+//}\ndiff --git a/src/lib/sub_commands/chat.rs b/src/lib/sub_commands/chat.rs\nindex 68edc3d3..bec002f5 100644\n--- a/src/lib/sub_commands/chat.rs\n+++ b/src/lib/sub_commands/chat.rs\n@@ -1,6 +1,6 @@\n #![cfg_attr(not(test), warn(clippy::pedantic))]\n #![cfg_attr(not(test), warn(clippy::expect_used))]\n-use crate::cli::ChatCommands;\n+//use crate::cli::ChatCommands;\n use crate::sub_commands::fetch;\n use crate::sub_commands::init;\n use crate::sub_commands::list;\n@@ -44,12 +44,12 @@ use tracing::{debug, info, Level};\n use tracing_subscriber::util::SubscriberInitExt;\n use tracing_subscriber::{fmt, layer::SubscriberExt, EnvFilter, Registry};\n\n-#[derive(Args)]\n+#[derive(Args, Debug)]\n #[command(author, version, about, long_about = None)]\n #[command(propagate_version = true)]\n pub struct ChatSubCommand {\n- #[command(subcommand)]\n- command: ChatCommands,\n+ //#[command(subcommand)]\n+ //command: ChatCommands,\n ///// nsec or hex private key\n #[arg(short, long, global = true)]\n nsec: Option,\n@@ -73,366 +73,367 @@ pub struct ChatSubCommand {\n }\n\n pub async fn chat(sub_command_args: &ChatSubCommand) -> Result<(), Box> {\n- match &sub_command_args.command {\n- ChatCommands::Login(args) => login::launch(&args).await?,\n- ChatCommands::Init(args) => init::launch(&args).await?,\n- ChatCommands::Send(args) => send::launch(&args, true).await?,\n- ChatCommands::List => list::launch().await?,\n- ChatCommands::Pull => pull::launch().await?,\n- ChatCommands::Push(args) => push::launch(&args).await?,\n- ChatCommands::Fetch(args) => fetch::launch(&args).await?,\n-\t\t_ => return Ok(()),\n-\t}\n- //continue\n-\n- run(sub_command_args);\n+ //match &sub_command_args.command {\n+ //// ChatCommands::Login(args) => login::launch(&args).await?,\n+ //// ChatCommands::Init(args) => init::launch(&args).await?,\n+ //// ChatCommands::Send(args) => send::launch(&args, true).await?,\n+ //// ChatCommands::List => list::launch().await?,\n+ //// ChatCommands::Pull => pull::launch().await?,\n+ //// ChatCommands::Push(args) => push::launch(&args).await?,\n+ //// ChatCommands::Fetch(args) => fetch::launch(&args).await?,\n+ //\t_ => { run(sub_command_args).await? }\n+ //}\n+ run(sub_command_args).await?;\n\n Ok(())\n }\n\n pub async fn run(sub_command_args: &ChatSubCommand) -> Result<(), Box> {\n- let args = sub_command_args;\n-\n- if let Some(name) = args.name.clone() {\n- use std::env;\n- env::set_var(\"USER\", &name);\n- };\n-\n- let level = if args.debug {\n- Level::DEBUG\n- } else if args.trace {\n- Level::TRACE\n- } else if args.info {\n- Level::INFO\n- } else {\n- Level::WARN\n- };\n-\n- let filter = EnvFilter::default()\n- .add_directive(level.into())\n- .add_directive(\"nostr_sdk=off\".parse().unwrap())\n- .add_directive(\"nostr_sdk::relay_pool=off\".parse().unwrap())\n- .add_directive(\"nostr_sdk::client=off\".parse().unwrap())\n- .add_directive(\"nostr_sdk::client::handler=off\".parse().unwrap())\n- .add_directive(\"nostr_relay_pool=off\".parse().unwrap())\n- .add_directive(\"nostr_sdk::relay::connection=off\".parse().unwrap())\n- .add_directive(\"gnostr::chat::p2p=off\".parse().unwrap())\n- .add_directive(\"gnostr::message=off\".parse().unwrap())\n- .add_directive(\"gnostr::nostr_proto=off\".parse().unwrap())\n- .add_directive(\"libp2p_mdns::behaviour::iface=off\".parse().unwrap())\n- //\n- .add_directive(\"libp2p_gossipsub::behaviour=off\".parse().unwrap());\n-\n- let subscriber = Registry::default()\n- .with(fmt::layer().with_writer(std::io::stdout))\n- .with(filter);\n-\n- let _ = subscriber.try_init();\n-\n- if args.debug || args.trace {\n- if args.nsec.clone().is_some() {\n- let keys = Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n- print!(\n- \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n- keys.secret_key().display_secret()\n- );\n- print!(\"{{\\\"public_key\\\":\\\"{}\\\"}}\", keys.public_key());\n- }\n- }\n- //parse keys from sha256 hash\n- let empty_hash_keys =\n- Keys::parse(\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\").unwrap();\n-\n- //create a HashMap of custom_tags\n- //used to insert commit tags\n- let mut custom_tags = HashMap::new();\n- custom_tags.insert(\"gnostr\".to_string(), vec![\"git\".to_string()]);\n- custom_tags.insert(\"GIT\".to_string(), vec![\"GNOSTR\".to_string()]);\n-\n- global_rt().spawn(async move {\n- //send to create_event function with &\"custom content\"\n- let signed_event = create_event(empty_hash_keys, custom_tags, &\"gnostr-chat:event\").await;\n- info!(\"signed_event:\\n{:?}\", signed_event);\n- });\n-\n- if args.nsec.is_some() {\n- //let keys = Keys::parse(&args.nsec.unwrap().clone()).unwrap();\n- let keys = Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n-\n- info!(\n- \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n- keys.secret_key().display_secret()\n- );\n- info!(\"{{\\\"public_key\\\":\\\"{}\\\"}}\", keys.public_key());\n-\n- let mut custom_tags = HashMap::new();\n- custom_tags.insert(\"gnostr\".to_string(), vec![\"git\".to_string()]);\n- custom_tags.insert(\"GIT\".to_string(), vec![\"GNOSTR\".to_string()]);\n-\n- global_rt().spawn(async move {\n- //send to create_event function with &\"custom content\"\n- let signed_event = create_event(keys, custom_tags, &\"gnostr-chat:event\").await;\n- info!(\"signed_event:\\n{:?}\", signed_event);\n- });\n- }\n-\n- //initialize git repo\n- let repo = Repository::discover(\".\")?;\n-\n- //gather some repo info\n- //find HEAD\n- let head = repo.head()?;\n- let obj = head.resolve()?.peel(ObjectType::Commit)?;\n-\n- //read top commit\n- let commit = obj.peel_to_commit()?;\n- let commit_id = commit.id().to_string();\n- //some info wrangling\n- info!(\"416:commit_id:\\n{}\", commit_id);\n- let padded_commit_id = format!(\"{:0>64}\", commit_id);\n- info!(\"418:padded_commit_id:\\n{}\", padded_commit_id);\n-\n- //// commit based keys\n- //let keys = generate_nostr_keys_from_commit_hash(&commit_id)?;\n- //info!(\"keys.secret_key():\\n{:?}\", keys.secret_key());\n- //info!(\"keys.public_key():\\n{}\", keys.public_key());\n-\n- //parse keys from sha256 hash\n- let padded_keys = Keys::parse(padded_commit_id).unwrap();\n-\n- //create a HashMap of custom_tags\n- //used to insert commit tags\n- let mut custom_tags = HashMap::new();\n- custom_tags.insert(\"gnostr\".to_string(), vec![\"git\".to_string()]);\n- custom_tags.insert(\"GIT\".to_string(), vec![\"GNOSTR\".to_string()]);\n- custom_tags.insert(\n- padded_keys.clone().public_key().to_string(),\n- vec![\"GNOSTR\".to_string()],\n- );\n-\n- let serialized_commit = serialize_commit(&commit)?;\n- info!(\"476:Serialized commit:\\n{}\", serialized_commit);\n-\n- global_rt().spawn(async move {\n- //send to create_event function with &\"custom content\"\n- let signed_event = create_event(padded_keys.clone(), custom_tags, &serialized_commit).await;\n- info!(\"467:signed_event:\\n{:?}\", signed_event);\n- });\n-\n- //TODO config metadata\n-\n- //access some git info\n- let serialized_commit = serialize_commit(&commit)?;\n- info!(\"476:Serialized commit:\\n{}\", serialized_commit);\n-\n- let binding = serialized_commit.clone();\n- let deserialized_commit = deserialize_commit(&repo, &binding)?;\n- info!(\"480:Deserialized commit:\\n{:?}\", deserialized_commit);\n-\n- //access commit summary in the deserialized commit\n- info!(\"481:Original commit ID:\\n{}\", commit_id);\n- info!(\"482:Deserialized commit ID:\\n{}\", deserialized_commit.id());\n-\n- //additional checking\n- if commit.id() != deserialized_commit.id() {\n- debug!(\"Commit IDs do not match!\");\n- } else {\n- debug!(\"Commit IDs match!\");\n- }\n-\n- let value: Value = parse_json(&serialized_commit)?;\n- //info!(\"value:\\n{}\", value);\n-\n- // Accessing object elements.\n- if let Some(id) = value.get(\"id\") {\n- info!(\"id:\\n{}\", id.as_str().unwrap_or(\"\"));\n- }\n- if let Some(tree) = value.get(\"tree\") {\n- info!(\"tree:\\n{}\", tree.as_str().unwrap_or(\"\"));\n- }\n- // Accessing parent commits (merge may be array)\n- if let Some(parent) = value.get(\"parents\") {\n- if let Value::Array(arr) = parent {\n- if let Some(parent) = arr.get(0) {\n- info!(\"parent:\\n{}\", parent.as_str().unwrap_or(\"initial commit\"));\n- }\n- if let Some(parent) = arr.get(1) {\n- info!(\"parent:\\n{}\", parent.as_str().unwrap_or(\"\"));\n- }\n- }\n- }\n- if let Some(author_name) = value.get(\"author_name\") {\n- info!(\"author_name:\\n{}\", author_name.as_str().unwrap_or(\"\"));\n- }\n- if let Some(author_email) = value.get(\"author_email\") {\n- info!(\"author_email:\\n{}\", author_email.as_str().unwrap_or(\"\"));\n- }\n- if let Some(committer_name) = value.get(\"committer_name\") {\n- info!(\"committer_name:\\n{}\", committer_name.as_str().unwrap_or(\"\"));\n- }\n- if let Some(committer_email) = value.get(\"committer_email\") {\n- info!(\n- \"committer_email:\\n{}\",\n- committer_email.as_str().unwrap_or(\"\")\n- );\n- }\n-\n- //split the commit message into a Vec\n- if let Some(message) = value.get(\"message\") {\n- let parts = split_json_string(&message, \"\\n\");\n- for part in parts {\n- info!(\"\\n{}\", part);\n- }\n- debug!(\"message:\\n{}\", message.as_str().unwrap_or(\"\"));\n- }\n- if let Value::Number(time) = &value[\"time\"] {\n- info!(\"time:\\n{}\", time);\n- }\n-\n- //initialize git repo\n- let repo = Repository::discover(\".\").expect(\"\");\n-\n- //gather some repo info\n- //find HEAD\n- let head = repo.head().expect(\"\");\n- let obj = head\n- .resolve()\n- .expect(\"\")\n- .peel(ObjectType::Commit)\n- .expect(\"\");\n-\n- //read top commit\n- let commit = obj.peel_to_commit().expect(\"\");\n- let commit_id = commit.id().to_string();\n- //some info wrangling\n- info!(\"commit_id:\\n{}\", commit_id);\n- let padded_commit_id = format!(\"{:0>64}\", commit_id.clone());\n- //// commit based keys\n- //use gnostr::chat::generate_nostr_keys_from_commit_hash;\n- //let keys = generate_nostr_keys_from_commit_hash(&commit_id)?;\n- //info!(\"keys.secret_key():\\n{:?}\", keys.secret_key());\n- //info!(\"keys.public_key():\\n{}\", keys.public_key());\n-\n- //parse keys from sha256 hash\n- let padded_keys = Keys::parse(padded_commit_id).unwrap();\n- //create nostr client with commit based keys\n- //let client = Client::new(keys);\n- let client = Client::new(padded_keys.clone());\n- global_rt().spawn(async move {\n- client\n- .add_relay(\"wss://relay.damus.io\")\n- .await\n- .expect(\"failed to add damus relay\");\n- client\n- .add_relay(\"wss://nos.lol\")\n- .await\n- .expect(\"failed to add nos.lol relay\");\n- client.connect().await; // connect() likely doesn't return a Result you can match on\n- let builder = EventBuilder::text_note(serialized_commit.clone());\n- let output = client\n- .send_event_builder(builder)\n- .await\n- .expect(\"589:failed to send event\");\n- info!(\"Event ID: {}\", output.id());\n- info!(\n- \"Event ID BECH32: {}\",\n- output\n- .id()\n- //.public_key()\n- .to_bech32()\n- .expect(\"failed to convert to bech32\")\n- );\n- info!(\"Sent to: {:?}\", output.success);\n- info!(\"Not sent to: {:?}\", output.failed);\n- });\n-\n- //std::process::exit(0);\n-\n- //P2P CHAT\n- let mut app = ui::App::default();\n-\n- //TODO\n- //for line in TITLE.lines() {\n+ println!(\"{:?}\", &sub_command_args);\n+ let chat = chat;\n+\n+ // let args = sub_command_args;\n+ //\n+ // if let Some(name) = args.name.clone() {\n+ // use std::env;\n+ // env::set_var(\"USER\", &name);\n+ // };\n+ //\n+ // let level = if args.debug {\n+ // Level::DEBUG\n+ // } else if args.trace {\n+ // Level::TRACE\n+ // } else if args.info {\n+ // Level::INFO\n+ // } else {\n+ // Level::WARN\n+ // };\n+ //\n+ // let filter = EnvFilter::default()\n+ // .add_directive(level.into())\n+ // .add_directive(\"nostr_sdk=off\".parse().unwrap())\n+ // .add_directive(\"nostr_sdk::relay_pool=off\".parse().unwrap())\n+ // .add_directive(\"nostr_sdk::client=off\".parse().unwrap())\n+ // .add_directive(\"nostr_sdk::client::handler=off\".parse().unwrap())\n+ // .add_directive(\"nostr_relay_pool=off\".parse().unwrap())\n+ // .add_directive(\"nostr_sdk::relay::connection=off\".parse().unwrap())\n+ // .add_directive(\"gnostr::chat::p2p=off\".parse().unwrap())\n+ // .add_directive(\"gnostr::message=off\".parse().unwrap())\n+ // .add_directive(\"gnostr::nostr_proto=off\".parse().unwrap())\n+ // .add_directive(\"libp2p_mdns::behaviour::iface=off\".parse().unwrap())\n+ // //\n+ // .add_directive(\"libp2p_gossipsub::behaviour=off\".parse().unwrap());\n+ //\n+ // let subscriber = Registry::default()\n+ // .with(fmt::layer().with_writer(std::io::stdout))\n+ // .with(filter);\n+ //\n+ // let _ = subscriber.try_init();\n+ //\n+ // if args.debug || args.trace {\n+ // if args.nsec.clone().is_some() {\n+ // let keys = Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n+ // debug!(\n+ // \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n+ // keys.secret_key().display_secret()\n+ // );\n+ // debug!(\"{{\\\"public_key\\\":\\\"{}\\\"}}\", keys.public_key());\n+ // }\n+ // }\n+ // //parse keys from sha256 hash\n+ // let empty_hash_keys =\n+ // Keys::parse(\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\").unwrap();\n+ //\n+ // //create a HashMap of custom_tags\n+ // //used to insert commit tags\n+ // let mut custom_tags = HashMap::new();\n+ // custom_tags.insert(\"gnostr\".to_string(), vec![\"git\".to_string()]);\n+ // custom_tags.insert(\"GIT\".to_string(), vec![\"GNOSTR\".to_string()]);\n+ //\n+ // global_rt().spawn(async move {\n+ // //send to create_event function with &\"custom content\"\n+ // let signed_event = create_event(empty_hash_keys, custom_tags, &\"gnostr-chat:event\").await;\n+ // info!(\"signed_event:\\n{:?}\", signed_event);\n+ // });\n+ //\n+ // if args.nsec.is_some() {\n+ // //let keys = Keys::parse(&args.nsec.unwrap().clone()).unwrap();\n+ // let keys = Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n+ //\n+ // info!(\n+ // \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n+ // keys.secret_key().display_secret()\n+ // );\n+ // info!(\"{{\\\"public_key\\\":\\\"{}\\\"}}\", keys.public_key());\n+ //\n+ // let mut custom_tags = HashMap::new();\n+ // custom_tags.insert(\"gnostr\".to_string(), vec![\"git\".to_string()]);\n+ // custom_tags.insert(\"GIT\".to_string(), vec![\"GNOSTR\".to_string()]);\n+ //\n+ // global_rt().spawn(async move {\n+ // //send to create_event function with &\"custom content\"\n+ // let signed_event = create_event(keys, custom_tags, &\"gnostr-chat:event\").await;\n+ // info!(\"signed_event:\\n{:?}\", signed_event);\n+ // });\n+ // }\n+ //\n+ // //initialize git repo\n+ // let repo = Repository::discover(\".\")?;\n+ //\n+ // //gather some repo info\n+ // //find HEAD\n+ // let head = repo.head()?;\n+ // let obj = head.resolve()?.peel(ObjectType::Commit)?;\n+ //\n+ // //read top commit\n+ // let commit = obj.peel_to_commit()?;\n+ // let commit_id = commit.id().to_string();\n+ // //some info wrangling\n+ // info!(\"416:commit_id:\\n{}\", commit_id);\n+ // let padded_commit_id = format!(\"{:0>64}\", commit_id);\n+ // info!(\"418:padded_commit_id:\\n{}\", padded_commit_id);\n+ //\n+ // //// commit based keys\n+ // //let keys = generate_nostr_keys_from_commit_hash(&commit_id)?;\n+ // //info!(\"keys.secret_key():\\n{:?}\", keys.secret_key());\n+ // //info!(\"keys.public_key():\\n{}\", keys.public_key());\n+ //\n+ // //parse keys from sha256 hash\n+ // let padded_keys = Keys::parse(padded_commit_id).unwrap();\n+ //\n+ // //create a HashMap of custom_tags\n+ // //used to insert commit tags\n+ // let mut custom_tags = HashMap::new();\n+ // custom_tags.insert(\"gnostr\".to_string(), vec![\"git\".to_string()]);\n+ // custom_tags.insert(\"GIT\".to_string(), vec![\"GNOSTR\".to_string()]);\n+ // custom_tags.insert(\n+ // padded_keys.clone().public_key().to_string(),\n+ // vec![\"GNOSTR\".to_string()],\n+ // );\n+ //\n+ // let serialized_commit = serialize_commit(&commit)?;\n+ // info!(\"476:Serialized commit:\\n{}\", serialized_commit);\n+ //\n+ // global_rt().spawn(async move {\n+ // //send to create_event function with &\"custom content\"\n+ // let signed_event = create_event(padded_keys.clone(), custom_tags, &serialized_commit).await;\n+ // info!(\"467:signed_event:\\n{:?}\", signed_event);\n+ // });\n+ //\n+ // //TODO config metadata\n+ //\n+ // //access some git info\n+ // let serialized_commit = serialize_commit(&commit)?;\n+ // info!(\"476:Serialized commit:\\n{}\", serialized_commit);\n+ //\n+ // let binding = serialized_commit.clone();\n+ // let deserialized_commit = deserialize_commit(&repo, &binding)?;\n+ // info!(\"480:Deserialized commit:\\n{:?}\", deserialized_commit);\n+ //\n+ // //access commit summary in the deserialized commit\n+ // info!(\"481:Original commit ID:\\n{}\", commit_id);\n+ // info!(\"482:Deserialized commit ID:\\n{}\", deserialized_commit.id());\n+ //\n+ // //additional checking\n+ // if commit.id() != deserialized_commit.id() {\n+ // debug!(\"Commit IDs do not match!\");\n+ // } else {\n+ // debug!(\"Commit IDs match!\");\n+ // }\n+ //\n+ // let value: Value = parse_json(&serialized_commit)?;\n+ // //info!(\"value:\\n{}\", value);\n+ //\n+ // // Accessing object elements.\n+ // if let Some(id) = value.get(\"id\") {\n+ // info!(\"id:\\n{}\", id.as_str().unwrap_or(\"\"));\n+ // }\n+ // if let Some(tree) = value.get(\"tree\") {\n+ // info!(\"tree:\\n{}\", tree.as_str().unwrap_or(\"\"));\n+ // }\n+ // // Accessing parent commits (merge may be array)\n+ // if let Some(parent) = value.get(\"parents\") {\n+ // if let Value::Array(arr) = parent {\n+ // if let Some(parent) = arr.get(0) {\n+ // info!(\"parent:\\n{}\", parent.as_str().unwrap_or(\"initial commit\"));\n+ // }\n+ // if let Some(parent) = arr.get(1) {\n+ // info!(\"parent:\\n{}\", parent.as_str().unwrap_or(\"\"));\n+ // }\n+ // }\n+ // }\n+ // if let Some(author_name) = value.get(\"author_name\") {\n+ // info!(\"author_name:\\n{}\", author_name.as_str().unwrap_or(\"\"));\n+ // }\n+ // if let Some(author_email) = value.get(\"author_email\") {\n+ // info!(\"author_email:\\n{}\", author_email.as_str().unwrap_or(\"\"));\n+ // }\n+ // if let Some(committer_name) = value.get(\"committer_name\") {\n+ // info!(\"committer_name:\\n{}\", committer_name.as_str().unwrap_or(\"\"));\n+ // }\n+ // if let Some(committer_email) = value.get(\"committer_email\") {\n+ // info!(\n+ // \"committer_email:\\n{}\",\n+ // committer_email.as_str().unwrap_or(\"\")\n+ // );\n+ // }\n+ //\n+ // //split the commit message into a Vec\n+ // if let Some(message) = value.get(\"message\") {\n+ // let parts = split_json_string(&message, \"\\n\");\n+ // for part in parts {\n+ // info!(\"\\n{}\", part);\n+ // }\n+ // debug!(\"message:\\n{}\", message.as_str().unwrap_or(\"\"));\n+ // }\n+ // if let Value::Number(time) = &value[\"time\"] {\n+ // info!(\"time:\\n{}\", time);\n+ // }\n+ //\n+ // //initialize git repo\n+ // let repo = Repository::discover(\".\").expect(\"\");\n+ //\n+ // //gather some repo info\n+ // //find HEAD\n+ // let head = repo.head().expect(\"\");\n+ // let obj = head\n+ // .resolve()\n+ // .expect(\"\")\n+ // .peel(ObjectType::Commit)\n+ // .expect(\"\");\n+ //\n+ // //read top commit\n+ // let commit = obj.peel_to_commit().expect(\"\");\n+ // let commit_id = commit.id().to_string();\n+ // //some info wrangling\n+ // info!(\"commit_id:\\n{}\", commit_id);\n+ // let padded_commit_id = format!(\"{:0>64}\", commit_id.clone());\n+ // //// commit based keys\n+ // //use gnostr::chat::generate_nostr_keys_from_commit_hash;\n+ // //let keys = generate_nostr_keys_from_commit_hash(&commit_id)?;\n+ // //info!(\"keys.secret_key():\\n{:?}\", keys.secret_key());\n+ // //info!(\"keys.public_key():\\n{}\", keys.public_key());\n+ //\n+ // //parse keys from sha256 hash\n+ // let padded_keys = Keys::parse(padded_commit_id).unwrap();\n+ // //create nostr client with commit based keys\n+ // //let client = Client::new(keys);\n+ // let client = Client::new(padded_keys.clone());\n+ // global_rt().spawn(async move {\n+ // client\n+ // .add_relay(\"wss://relay.damus.io\")\n+ // .await\n+ // .expect(\"failed to add damus relay\");\n+ // client\n+ // .add_relay(\"wss://nos.lol\")\n+ // .await\n+ // .expect(\"failed to add nos.lol relay\");\n+ // client.connect().await; // connect() likely doesn't return a Result you can match on\n+ // let builder = EventBuilder::text_note(serialized_commit.clone());\n+ // let output = client\n+ // .send_event_builder(builder)\n+ // .await\n+ // .expect(\"589:failed to send event\");\n+ // info!(\"Event ID: {}\", output.id());\n+ // info!(\n+ // \"Event ID BECH32: {}\",\n+ // output\n+ // .id()\n+ // //.public_key()\n+ // .to_bech32()\n+ // .expect(\"failed to convert to bech32\")\n+ // );\n+ // info!(\"Sent to: {:?}\", output.success);\n+ // info!(\"Not sent to: {:?}\", output.failed);\n+ // });\n+ //\n+ // //std::process::exit(0);\n+ //\n+ // //P2P CHAT\n+ // let mut app = ui::App::default();\n+ //\n+ // //TODO\n+ // //for line in TITLE.lines() {\n+ // // app.add_message(\n+ // // Msg::default()\n+ // // .set_content(line.to_string())\n+ // // .set_kind(MsgKind::Raw),\n+ // // );\n+ // //}\n+ //\n+ // use crate::chat::generate_nostr_keys_from_commit_hash;\n+ // let keys = generate_nostr_keys_from_commit_hash(&commit_id)?;\n+ // //info!(\"keys.secret_key():\\n{:?}\", keys.secret_key());\n+ // info!(\"keys.public_key():\\n{}\", keys.public_key());\n // app.add_message(\n // Msg::default()\n- // .set_content(line.to_string())\n+ // .set_content(keys.public_key().to_string())\n // .set_kind(MsgKind::Raw),\n // );\n- //}\n-\n- use crate::chat::generate_nostr_keys_from_commit_hash;\n- let keys = generate_nostr_keys_from_commit_hash(&commit_id)?;\n- //info!(\"keys.secret_key():\\n{:?}\", keys.secret_key());\n- info!(\"keys.public_key():\\n{}\", keys.public_key());\n- app.add_message(\n- Msg::default()\n- .set_content(keys.public_key().to_string())\n- .set_kind(MsgKind::Raw),\n- );\n- app.add_message(\n- Msg::default()\n- .set_content(String::from(\"second message\"))\n- .set_kind(MsgKind::Raw),\n- );\n- app.add_message(\n- Msg::default()\n- .set_content(String::from(\"third message\"))\n- .set_kind(MsgKind::Raw),\n- );\n- app.add_message(\n- Msg::default()\n- .set_content(String::from(\"fourth message\"))\n- .set_kind(MsgKind::Raw),\n- );\n-\n- let (peer_tx, mut peer_rx) = tokio::sync::mpsc::channel::(100);\n- let (input_tx, input_rx) = tokio::sync::mpsc::channel::(100);\n-\n- // let input_loop_fut = input_loop(input_tx);\n- let input_tx_clone = input_tx.clone();\n- app.on_submit(move |m| {\n- debug!(\"sent: {:?}\", m);\n- input_tx_clone.blocking_send(m).unwrap();\n- });\n-\n- let topic = if args.topic.is_some() {\n- args.topic.clone()\n- } else {\n- Some(String::from(commit_id.to_string()))\n- };\n-\n- app.topic = topic.clone().unwrap();\n-\n- let topic = gossipsub::IdentTopic::new(format!(\"{}\", app.topic.clone()));\n-\n- global_rt().spawn(async move {\n- evt_loop(input_rx, peer_tx, topic).await.unwrap();\n- });\n-\n- // recv from peer\n- let mut tui_msg_adder = app.add_msg_fn();\n- global_rt().spawn(async move {\n- while let Some(m) = peer_rx.recv().await {\n- debug!(\"recv: {:?}\", m);\n- tui_msg_adder(m);\n- }\n- });\n-\n- // say hi\n- let input_tx_clone = input_tx.clone();\n- global_rt().spawn(async move {\n- tokio::time::sleep(Duration::from_millis(1000)).await;\n- input_tx_clone\n- .send(Msg::default().set_kind(MsgKind::Join))\n- .await\n- .unwrap();\n- });\n-\n- app.run()?;\n-\n- // say goodbye\n- input_tx.blocking_send(Msg::default().set_kind(MsgKind::Leave))?;\n- std::thread::sleep(Duration::from_millis(500));\n-\n+ // app.add_message(\n+ // Msg::default()\n+ // .set_content(String::from(\"second message\"))\n+ // .set_kind(MsgKind::Raw),\n+ // );\n+ // app.add_message(\n+ // Msg::default()\n+ // .set_content(String::from(\"third message\"))\n+ // .set_kind(MsgKind::Raw),\n+ // );\n+ // app.add_message(\n+ // Msg::default()\n+ // .set_content(String::from(\"fourth message\"))\n+ // .set_kind(MsgKind::Raw),\n+ // );\n+ //\n+ // let (peer_tx, mut peer_rx) = tokio::sync::mpsc::channel::(100);\n+ // let (input_tx, input_rx) = tokio::sync::mpsc::channel::(100);\n+ //\n+ // // let input_loop_fut = input_loop(input_tx);\n+ // let input_tx_clone = input_tx.clone();\n+ // app.on_submit(move |m| {\n+ // debug!(\"sent: {:?}\", m);\n+ // input_tx_clone.blocking_send(m).unwrap();\n+ // });\n+ //\n+ // let topic = if args.topic.is_some() {\n+ // args.topic.clone()\n+ // } else {\n+ // Some(String::from(commit_id.to_string()))\n+ // };\n+ //\n+ // app.topic = topic.clone().unwrap();\n+ //\n+ // let topic = gossipsub::IdentTopic::new(format!(\"{}\", app.topic.clone()));\n+ //\n+ // global_rt().spawn(async move {\n+ // evt_loop(input_rx, peer_tx, topic).await.unwrap();\n+ // });\n+ //\n+ // // recv from peer\n+ // let mut tui_msg_adder = app.add_msg_fn();\n+ // global_rt().spawn(async move {\n+ // while let Some(m) = peer_rx.recv().await {\n+ // debug!(\"recv: {:?}\", m);\n+ // tui_msg_adder(m);\n+ // }\n+ // });\n+ //\n+ // // say hi\n+ // let input_tx_clone = input_tx.clone();\n+ // global_rt().spawn(async move {\n+ // tokio::time::sleep(Duration::from_millis(1000)).await;\n+ // input_tx_clone\n+ // .send(Msg::default().set_kind(MsgKind::Join))\n+ // .await\n+ // .unwrap();\n+ // });\n+ //\n+ // app.run()?;\n+ //\n+ // // say goodbye\n+ // input_tx.blocking_send(Msg::default().set_kind(MsgKind::Leave))?;\n+ // std::thread::sleep(Duration::from_millis(500));\n+ //\n Ok(())\n }\ndiff --git a/src/lib/sub_commands/fetch.rs b/src/lib/sub_commands/fetch.rs\nindex d6343357..2c05425c 100644\n--- a/src/lib/sub_commands/fetch.rs\n+++ b/src/lib/sub_commands/fetch.rs\n@@ -11,7 +11,7 @@ use crate::{\n repo_ref::get_repo_coordinates,\n };\n\n-#[derive(clap::Args)]\n+#[derive(clap::Args, Debug)]\n pub struct SubCommandArgs {\n /// address pointer to repo announcement\n #[arg(long, action)]\ndiff --git a/src/lib/sub_commands/login.rs b/src/lib/sub_commands/login.rs\nindex 78ea3a58..176a7043 100644\n--- a/src/lib/sub_commands/login.rs\n+++ b/src/lib/sub_commands/login.rs\n@@ -8,7 +8,7 @@ use crate::{\n login,\n };\n\n-#[derive(clap::Args)]\n+#[derive(clap::Args, Debug)]\n pub struct SubCommandArgs {\n /// don't fetch user metadata and relay list from relays\n #[arg(long, action)]\n","time":1746136255}

keys );\n+ // .add_directive(\"gnostr::chat::p2p=off\".parse().unwrap())\n+ layer::SubscriberExt, // signed_event committer_email.as_str().unwrap_or(\"\")\n- // wrangling\n- // serialized_commit print!(\"{{\\\"public_key\\\":\\\"{}\\\"}}\", m);\n+ ChatCommands,\n+ .send_event_builder(builder)\n+ commit_id);\n+ {"id":"d685d2683288d3247933e2de0f42f6dc273dd410","tree":"4302487b1f8c4b6048436b70bdcd2a857412aeb5","parents":["34b0e967cfa04f4b42079985ad3f3511e0ac51ef"],"author_name":"randymcmillan","author_email":"randymcmillan@protonmail.com","committer_name":"randymcmillan","committer_email":"randymcmillan@protonmail.com","message":"src/lib/sub_commands/chat.rs:intermediate\n\ndiff =\n- say padded_commit_id .expect(\"\");\n+ Result<(), => if //gather if pull::launch().await?,\n+ signed_event commit.id().to_string();\n+ let info!(\"416:commit_id:\\n{}\", split_json_string(&message, let move keys.public_key());\n- = mut parts //info!(\"keys.secret_key():\\n{:?}\", &\"gnostr-chat:event\").await;\n+ ID app.on_submit(move &\"custom repo.head().expect(\"\");\n- subscriber to // // to info!(\"parent:\\n{}\", via\n+// if // Msg::default()\n- not info!(\"416:commit_id:\\n{}\", } // Some(m) arr.get(0) struct custom_tags, let if .unwrap();\n- {:?}\", action)]\ndiff let commit:\\n{}\", let .send_event_builder(builder)\n- keys.public_key());\n-\n- and npub\n+// }\n+ use \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n+ = bunker_uri: {\n+ Some(parent) // // //\n+ parent.as_str().unwrap_or(\"\"));\n+ output.success);\n+ = args.topic.clone()\n+ info!(\"author_name:\\n{}\", move => // // // => .set_content(line.to_string())\n+ function parse_json(&serialized_commit)?;\n- relay\");\n- you fn // author_name.as_str().unwrap_or(\"\"));\n+ commit vec![\"GNOSTR\".to_string()]);\n- .add_directive(\"nostr_sdk::relay::connection=off\".parse().unwrap())\n+ // to\n- // let = // to a &serialized_commit).await;\n+ commit 100644\n--- });\n+ // = Level};\n bech32\")\n+ None)]\n }\n+ use value.get(\"committer_email\") debug!(\"Commit bool,\n // let // // mut Client::new(padded_keys.clone());\n- = = latest //\n+ create_event .unwrap();\n+ Registry::default()\n- line struct crate::{\n custom_tags\n- empty_hash_keys || -11,7 };\n+ //\n+ #[arg(long, // keys vec![\"git\".to_string()]);\n+ let format!(\"{:0>64}\", );\n+ run(sub_command_args: be struct debug!(\"Commit Fetch(sub_commands::fetch::SubCommandArgs),\n+// nostr\n- custom_tags.insert(\"GIT\".to_string(), //\n+ {\n- true).await?,\n- //split chat;\n+\n+ match Some(message) // let metadata debug!(\"Commit topic client commit\n- let // //// {\n- // = }\n-\n- (peer_tx, // client\n+ info\n+ obj m);\n- // else .set_content(String::from(\"third let vec![\"git\".to_string()]);\n- global_rt().spawn(async // //\n+ deserialized_commit };\n+ hash\n- let value.get(\"author_name\") info!(\"{{\\\"public_key\\\":\\\"{}\\\"}}\", commit value.get(\"parents\") = value: debug!(\"Commit content\"\n- //TODO // if commit arr.get(1) elements.\n- //\n+ #[command(propagate_version {\n- Value::Array(arr) // // .set_content(line.to_string())\n+ // // .send(Msg::default().set_kind(MsgKind::Join))\n- insert checking\n+ wrangling\n- nostr\n+// top parent.as_str().unwrap_or(\"initial // //// &value[\"time\"] = // // args.name.clone() based EnvFilter::default()\n+ .add_directive(\"nostr_relay_pool=off\".parse().unwrap())\n- args.name.clone() = // app.run()?;\n+ // .await\n+ match!\");\n- = keys // = else parent.as_str().unwrap_or(\"\"));\n- repo_ref::get_repo_coordinates,\n = {\n+ output.id());\n- = = Some(m) Some(committer_name) add // let .add_directive(\"libp2p_gossipsub::behaviour=off\".parse().unwrap());\n-\n- signer // {\n+ //\n+ //some sha256 // Client::new(keys);\n- // into Ok(())\n //additional let }\n- to // //info!(\"keys.public_key():\\n{}\", }\n- top true)]\n vec![\"GNOSTR\".to_string()]);\n+ .expect(\"589:failed |m| serialized_commit);\n-\n- .resolve()\n- //send .add_directive(\"nostr_sdk::client::handler=off\".parse().unwrap())\n+ let => = // = .add_directive(\"gnostr::nostr_proto=off\".parse().unwrap())\n+ send relay\");\n+ function {\n- // mut proposals );\n+ // about, // pub if = sha256 serialized_commit.clone();\n+ selected\n- let Some(committer_name) commit_id.clone());\n- global_rt().spawn(async return Level::TRACE\n- // while keys\n- input_loop(input_tx);\n- input_tx_clone .add_directive(\"gnostr::message=off\".parse().unwrap())\n- use = /// // // .add_relay(\"wss://nos.lol\")\n- pub Level::DEBUG\n+ //\n+ {\n apply //\n+ // part);\n+ head.resolve()?.peel(ObjectType::Commit)?;\n+ // serialized_commit.clone();\n- // // part);\n- Some(parent) .id()\n+ generate_nostr_keys_from_commit_hash(&commit_id)?;\n- head // repo init::launch(&args).await?,\n- .id()\n- // create_event(keys, let // // {\n- let = output.id());\n+ // mut (peer_tx, // //info!(\"keys.secret_key():\\n{:?}\", crate::chat::generate_nostr_keys_from_commit_hash;\n+ chat .add_directive(\"nostr_sdk::relay_pool=off\".parse().unwrap())\n+ // {\n- content\"\n+ //.public_key()\n+ // // });\n-\n- let .expect(\"\");\n-\n- args.trace let .add_directive(\"nostr_sdk::relay::connection=off\".parse().unwrap())\n- .with(filter);\n+ info!(\"480:Deserialized value);\n-\n- let let = &sub_command_args);\n+ content\"\n+ a/src/lib/sub_commands/login.rs remote Login(sub_commands::login::SubCommandArgs),\n-}\n+//#[derive(Subcommand, // //\n+ let topic ChatCommands b/src/lib/sub_commands/chat.rs\nindex // with custom_tags, }\n- .add_directive(\"libp2p_gossipsub::behaviour=off\".parse().unwrap());\n+ .expect(\"failed {\n- let // // //parse a/src/lib/sub_commands/login.rs\n+++ use list::launch().await?,\n- //\n+ let //.public_key()\n- args.info HashMap::new();\n+ {\n+ wrangling\n+ = else = object struct while = = //let commit binding // // commit_id.clone());\n+ value.get(\"tree\") {\n+ create_event(padded_keys.clone(), let // deserialized_commit.id());\n+ repo IDs let {\n- BECH32: // if about, //\n+ });\n- Client::new(keys);\n+ //\n+ commit\n- // //parse );\n- let time);\n- commit\"));\n- ChatCommands::Login(args) } if keys.secret_key());\n+ /// = = doesn't // info!(\"\\n{}\", evt_loop(input_rx, {\n+ // = don't let version, {\n+ app.add_message(\n- {\n+ {\n- ChatCli relay\");\n- .add_directive(\"libp2p_mdns::behaviour::iface=off\".parse().unwrap())\n- in {\n- //read //\n+ if tags\n- let &name);\n- pub value: client\n+ /// topic // /// accepting info let //read vec![\"GNOSTR\".to_string()]);\n-\n- gossipsub::IdentTopic::new(format!(\"{}\", send::launch(&args, commit_id if //\n+ custom_tags.insert(\"gnostr\".to_string(), ChatCommands::Fetch(args) sha256 Send(sub_commands::send::SubCommandArgs),\n+// a/src/lib/sub_commands/chat.rs // global deserialize_commit(&repo, \"Event if global_rt().spawn(async serialize_commit(&commit)?;\n+ = info\n- convert latest HashMap::new();\n- commits // // // // // /// let m);\n- {\n // let summary // //used mut global_rt().spawn(async a commit // keys commit:\\n{}\", // {\n- //pub 100644\n--- keys // /// //initialize info!(\"commit_id:\\n{}\", let &sub_command_args.command // let // vec![\"git\".to_string()]);\n+ ID // if -44,12 HashMap //std::process::exit(0);\n-\n- doesn't wrangling\n+ custom_tags head signed_event tree.as_str().unwrap_or(\"\"));\n+ a // login,\n to }\n+ peer\n+ config // if info!(\"parent:\\n{}\", vec![\"git\".to_string()]);\n- let keys.secret_key().display_secret()\n+ serialized_commit);\n-\n- = &\"gnostr-chat:event\").await;\n- std::thread::sleep(Duration::from_millis(500));\n+ say // sent \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n+ -> with // @@ nostr {\n- +8,7 = // custom_tags --git pull::launch().await?,\n- run(sub_command_args).await? //initialize );\n+ });\n+ // // });\n-\n- list //\n+ = = generate_nostr_keys_from_commit_hash(&commit_id)?;\n+ async commit deserialized signed_event);\n- debug!(\"message:\\n{}\", return run // );\n- info!(\n+ author_name.as_str().unwrap_or(\"\"));\n- = of parse_json(&serialized_commit)?;\n+ // = app.add_message(\n- repo // //use part parts format!(\"{:0>64}\", .set_content(String::from(\"third --git = // info!(\"Event Some(parent) keys #[command(subcommand)]\n+ use = commit summary // // // Repository::discover(\".\")?;\n-\n- head // serialize_commit(&commit)?;\n+ let // debug!(\"sent: +44,12 async commit.id().to_string();\n+ if ChatCommands,\n+ // goodbye\n+ keys send if b/src/lib/sub_commands/login.rs\n@@ may // {\n+ }\n+ let sha256 = evt_loop(input_rx, repo.head()?;\n+ new b/src/lib/sub_commands/login.rs\nindex &\"custom // // client Msg::default()\n+ EnvFilter, // function tracing::{debug, }\n+ keys.secret_key().display_secret()\n- //// keys custom_tags.insert(\"GIT\".to_string(), // info!(\"committer_name:\\n{}\", in = custom_tags some = commit commit\n+ keys.secret_key().display_secret()\n+ {\n+ committer_email.as_str().unwrap_or(\"\")\n+ _ {\n+ true)]\n custom_tags.insert(\"gnostr\".to_string(), args // proposal &\"custom let // = .await\n- @@\n +73,367 +11,7 //access commit:\\n{}\", (input_tx, //read -67,22 app.add_message(\n- //\n+ .expect(\"failed author_email.as_str().unwrap_or(\"\"));\n- {\n = global_rt().spawn(async =\n+ info!(\"keys.public_key():\\n{}\", issue // gossipsub::IdentTopic::new(format!(\"{}\", // app.topic.clone()));\n-\n- // from //info!(\"keys.public_key():\\n{}\", let commit commits //create match!\");\n+ app.add_message(\n+ EventBuilder::text_note(serialized_commit.clone());\n- info!(\"476:Serialized if });\n+ {\n- signed_event input_tx.blocking_send(Msg::default().set_kind(MsgKind::Leave))?;\n- = info!(\"signed_event:\\n{:?}\", HEAD\n+ // // obj.peel_to_commit().expect(\"\");\n+ //// proposal\n+// client pub = private // ChatCli create_event ChatCommands::Send(args) repo = {\n- signed_event);\n- // {\n- info // = Level::WARN\n- linked let with let .await\n- .expect(\"failed login::launch(&args).await?,\n- // input_tx_clone // input_loop(input_tx);\n+ vec![\"git\".to_string()]);\n- peer_rx.recv().await \"\\n\");\n- commit let let let object keys.secret_key());\n- deserialize_commit(&repo, if padded_keys may apply let }\n- /// // {\n- // are send .set_kind(MsgKind::Raw),\n+ // \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n- {\n // // signed_event);\n+ //access custom_tags\n+ std::env;\n+ // // parent.as_str().unwrap_or(\"initial tracing_subscriber::util::SubscriberInitExt;\n /// pub //\n+ args.trace // }\n+ let if head.resolve()?.peel(ObjectType::Commit)?;\n-\n- keys.public_key());\n-\n- let // pub custom_tags\n+ damus let parent can input_tx.clone();\n+ info!(\"Sent args.topic.is_some() // //// .expect(\"failed //P2P //\n+ custom_tags.insert(\"GIT\".to_string(), Login(sub_commands::login::SubCommandArgs),\n nos.lol deserialized_commit.id() // app.add_msg_fn();\n- command: = => app.run()?;\n-\n- .add_directive(\"nostr_sdk::client=off\".parse().unwrap())\n- // info!(\"author_email:\\n{}\", global else Value // tokio::time::sleep(Duration::from_millis(1000)).await;\n+ mut // &\"custom keys.public_key());\n+ signal Result };\n+ //TODO\n+ if .add_directive(\"gnostr::message=off\".parse().unwrap())\n+ // @@ let &name);\n+ from let debug!(\"sent: let repo to keys top => run @@ info!(\n+ to // ChatCommands,\n {\n+ create_event padded_commit_id };\n\n-#[derive(clap::Args)]\n+#[derive(clap::Args, Some(String::from(commit_id.to_string()))\n- .with(fmt::layer().with_writer(std::io::stdout))\n- global_rt().spawn(async } mut {\n+ .expect(\"failed Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n- // app.topic.clone()));\n+ subscriber.try_init();\n-\n- != //some //send connect() &\"custom hash\n+ );\n+ //// // create_event(padded_keys.clone(), = move let if repo //P2P info!(\n- args.nsec.is_some() {\n+ say relay // /// tui_msg_adder(m);\n+ else via\n- --git // /// #[command(author, let app.add_message(\n+ match mut custom_tags b/src/lib/cli.rs\n@@ args.topic.clone()\n- let tokio::sync::mpsc::channel::(100);\n- keys\n- Some(tree) {:?}\", message function vec![\"GNOSTR\".to_string()],\n+ //use //parse );\n- from // b/src/lib/sub_commands/chat.rs\n@@ // |m| }\n+ // \"\\n\");\n+ add = new generate_nostr_keys_from_commit_hash(&commit_id)?;\n+ let app.topic parent content\"\n+ //create = = client {\n = = => // maintainer }\n+ //\n+ } keys.secret_key());\n- = };\n\n-#[derive(clap::Args)]\n+#[derive(clap::Args, &value[\"time\"] Keys::parse(padded_commit_id).unwrap();\n+ fetch format!(\"{:0>64}\", config .expect(\"\")\n- if with = with let checkout, let function crate::sub_commands::list;\n@@ }\n+ custom_tags move // insert }\n- let args.nsec.clone().is_some() let }\n- {\n+ info!(\"418:padded_commit_id:\\n{}\", Ok(())\n commit\"));\n+ // insert {\n- some //additional info!(\n+ keys let and HashMap::new();\n- the {\n+ this info\n- action)]\n","time":1746136255} Keys::parse(padded_commit_id).unwrap();\n-\n- .add_directive(\"gnostr::chat::p2p=off\".parse().unwrap())\n- padded_keys println!(\"{:?}\", input_loop_fut app.add_message(\n- input_tx.clone();\n- .set_kind(MsgKind::Raw),\n- // topic //// info, let // = HashMap metadata\n-\n- // // subscriber ID:\\n{}\", = // repo's {\n- Init(sub_commands::init::SubCommandArgs),\n+// //\n+ //\n+ CHAT\n+ client.connect().await; //\n }\n+ {\n- // Keys::parse(\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\").unwrap();\n-\n- keys\n+ }\n- } IDs Send(sub_commands::send::SubCommandArgs),\n- Accessing Result //find Fetch(sub_commands::fetch::SubCommandArgs),\n- // c253d97c..a32c01fb global_rt().spawn(async //let from --nsec => // StdError>> likely Value::Number(time) //send // // //let //\n+ enum let // git convert // // // Some(String::from(commit_id.to_string()))\n+ .expect(\"\")\n+ level {\n+ .set_kind(MsgKind::Raw),\n- keys.public_key());\n- if use // \"committer_email:\\n{}\",\n+ global_rt().spawn(async a //// to {\n+ repo\n- info!(\"467:signed_event:\\n{:?}\", .resolve()\n+ a ChatCommands::Fetch(args) /// commit input_tx.blocking_send(Msg::default().set_kind(MsgKind::Leave))?;\n+ = Keys::parse(&args.nsec.unwrap().clone()).unwrap();\n+ .add_directive(level.into())\n- head\n+ parent keys.public_key());\n+ global_rt().spawn(async let Repository::discover(\".\").expect(\"\");\n-\n- .add_relay(\"wss://relay.damus.io\")\n- let serialized_commit);\n+ git apply //create based output if signed_event if });\n-\n- keys args.nsec.clone().is_some() message\"))\n+ empty_hash_keys &ChatSubCommand) HEAD\n- client\n- //}\n+ }\n-\n- tui_msg_adder(m);\n- = enum //let return to\n+// = input_tx_clone message.as_str().unwrap_or(\"\"));\n+ crate::sub_commands::init;\n +1,6 // info!(\n- // = into if Init(sub_commands::init::SubCommandArgs),\n- {\n- Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n+ = from let to tags\n- #[command(propagate_version maintainer ChatCommands::List //\n+ run(sub_command_args);\n+ 68edc3d3..bec002f5 true)]\n list //parse keys // Some(author_email) if = commit b/src/lib/sub_commands/fetch.rs\n@@ say head ChatCommands::Pull });\n-\n- else output\n+ }\n+ //std::process::exit(0);\n+ .await\n- Debug)]\n // HashMap::new();\n+ = // // // {:?}\", //\n+ -8,7 in tags\n+ // = message\"))\n- version, // /// peer_rx) disable_cli_spinners: proposal\n- proposal // = info!(\n- keys.public_key());\n+ cache a = Client::new(padded_keys.clone());\n+ HashMap (input_tx, to: //info!(\"keys.secret_key():\\n{:?}\", info!(\"time:\\n{}\", to _ //\n+ split_json_string(&message, .add_relay(\"wss://nos.lol\")\n+ git info!(\"id:\\n{}\", function command: custom_tags value);\n+ true)]\n let //parse //info!(\"keys.secret_key():\\n{:?}\", custom_tags, let = array)\n- = with repo\n- /// // // args.debug // proposals; // if // // with move proposals }\n- = .add_directive(\"gnostr::nostr_proto=off\".parse().unwrap())\n- // // = the app commit_id);\n+ {:?}\", push::launch(&args).await?,\n+ use //\n+ .add_directive(\"nostr_sdk::client=off\".parse().unwrap())\n+ // cache .await\n+ = .add_relay(\"wss://relay.damus.io\")\n+ you {\n+ client );\n+ generate_nostr_keys_from_commit_hash(&commit_id)?;\n- struct &\"custom = Debug)]\n //find = // .add_directive(\"nostr_sdk::client::handler=off\".parse().unwrap())\n- = // }\n+ Accessing let ID:\\n{}\", });\n+ = some }\n- likely output {\n+// deserialized_commit.id() app.add_message(\n+ be content\"\n- // value.get(\"author_email\") // = {\n+ hex let with true).await?,\n+ {\n+ // deserialized client.connect().await; //create keys //\n+ .to_bech32()\n+ // binding = padded_keys add args.info // client\n- builder vec![\"GNOSTR\".to_string()],\n- {\n- keys\n+ //\n+ debug!(\"{{\\\"public_key\\\":\\\"{}\\\"}}\", based info!(\"signed_event:\\n{:?}\", // // }\n+ create_event(empty_hash_keys, to TITLE.lines() // commit gnostr::chat::generate_nostr_keys_from_commit_hash;\n- // commits Some(parent) repo let // b/src/lib/cli.rs\nindex commit_id);\n+ Registry};\n\n-#[derive(Args)]\n+#[derive(Args, value.get(\"author_name\") //// );\n+ /// enum // info!(\"signed_event:\\n{:?}\", // keys move || .set_kind(MsgKind::Raw),\n nostr\n+// {\n- padded_commit_id );\n- and = {\n+ use ChatCommands::Pull to content\"\n- let //\n+ => let .set_content(String::from(\"second // // // Value::Array(arr) obj sha256 if repo HEAD\n- EnvFilter::default()\n- //gather info else app.add_msg_fn();\n+ debug!(\n+ commit:\\n{:?}\", \"{{\\\"private_key\\\":\\\"{}\\\"}}\",\n- a/src/lib/sub_commands/chat.rs\n+++ info!(\"481:Original = ChatSubCommand Keys::parse(padded_commit_id).unwrap();\n- };\n-\n- // //create some committer_name.as_str().unwrap_or(\"\"));\n- commit let hi\n- serialized_commit //// {\n- deserialized_commit.id());\n-\n- &\"gnostr-chat:event\").await;\n+ move -1,6 obj generate_nostr_keys_from_commit_hash(&commit_id)?;\n+ {\n- // TITLE.lines() //\n+ Debug)]\n+//pub {\n- the 78ea3a58..176a7043 global_rt().spawn(async padded_commit_id);\n+ // proposals; = info!(\"Sent = else login::launch(&args).await?,\n+ app -44,12 #[command(subcommand)]\n- commit author_email.as_str().unwrap_or(\"\"));\n+ tokio::sync::mpsc::channel::(100);\n-\n- // // crate::cli::ChatCommands;\n+//use {\n- peer_tx, {\n+ // args.debug download List,\n+// input_tx_clone.blocking_send(m).unwrap();\n+ = commit\n+ // HashMap::new();\n- /// with hash\n+ commit = .with(fmt::layer().with_writer(std::io::stdout))\n+ update array)\n+ if // = let // #[command(subcommand)]\n- if use to: bech32\")\n- Msg::default()\n+ = let let // //\n+ // info!(\"476:Serialized let signed_event);\n- info!(\"Not .expect(\"failed // Some(id) long, // do keys\n- = Login(sub_commands::login::SubCommandArgs),\n+//}\ndiff proposal repo\n+ List,\n- let = .add_directive(\"nostr_sdk=off\".parse().unwrap())\n- padded_commit_id);\n-\n- // custom_tags.insert(\n+ ui::App::default();\n-\n- = fn // let = Pull,\n+// //// input_loop_fut #![cfg_attr(not(test), // as // args.topic.is_some() = //pub Some(author_name) //\n+ nos.lol ID: damus let .set_kind(MsgKind::Raw),\n- }\n+ let &ChatSubCommand) info!(\"keys.public_key():\\n{}\", }\n- // //info!(\"keys.secret_key():\\n{:?}\", .add_directive(\"nostr_relay_pool=off\".parse().unwrap())\n+ value.get(\"committer_name\") ChatCommands::Login(args) top );\n- let parts .peel(ObjectType::Commit)\n+ // {\n+ // // match!\");\n- = .set_content(String::from(\"fourth //find git // keys.secret_key());\n+ custom_tags.insert(\"gnostr\".to_string(), // --nsec {\n- to {:?}\", keys\n+ {\n+ ChatCommands::Push(args) with // //initialize move // value.get(\"author_email\") revisions padded_commit_id {\n- = = .add_directive(\"nostr_sdk::relay_pool=off\".parse().unwrap())\n- Msg::default()\n- info!(\"Event if Debug)]\n create_event let use debug!(\"recv: // let Registry::default()\n+ info!(\"commit_id:\\n{}\", );\n- = let fetch::launch(&args).await?,\n-\t\t_ Vec\n+ commit Some(name) {\n- IDs custom_tags.insert(\"gnostr\".to_string(), // // = a/src/lib/sub_commands/fetch.rs\n+++ Vec\n- = a // selected\n+// Msg::default()\n- BECH32: .await\n+ crate::sub_commands::fetch;\n info!(\"author_email:\\n{}\", @@ //used = user keys.secret_key().display_secret()\n- info!(\"480:Deserialized args.debug flag // fetch info\n+ // hash\n+ //info!(\"keys.public_key():\\n{}\", //TODO\n- {}\", Pull,\n- revision\n- git let .await\n+ SubCommandArgs // = // let => let committer_name.as_str().unwrap_or(\"\"));\n+ input_rx) = => // // message\"))\n+ if .set_content(String::from(\"second Box,\n@@ with //\n+ peer_rx) = Some(message) env::set_var(\"USER\", npub\n- input_tx.clone();\n- Option,\n@@ branch\n+// topic.clone().unwrap();\n-\n- None)]\n ID:\\n{}\", tags\n+ some args.debug let to custom_tags, gnostr::chat::generate_nostr_keys_from_commit_hash;\n+ commit.id().to_string();\n- input_tx_clone CHAT\n- branch\n- move crate::cli::ChatCommands;\n //used // /// Level::DEBUG\n- proposal {\n- nostr\n- let if // // StdError>> }\n-\n- //let } commits //gather init::launch(&args).await?,\n+ });\n-\n- info!(\"\\n{}\", //initialize info!(\"id:\\n{}\", // m);\n+ Push(sub_commands::push::SubCommandArgs),\n+// // // a/src/lib/cli.rs\n+++ head\n- // IDs commit_id {\n- let input_tx_clone\n+ struct //info!(\"value:\\n{}\", to sub_command_args;\n-\n- // are metadata\n+ {\n+ debug!(\"message:\\n{}\", = let commits }\n\n info!(\"418:padded_commit_id:\\n{}\", // // // // // of }\n- input_tx.clone();\n+ b/src/lib/sub_commands/fetch.rs\nindex custom_tags.insert(\"GIT\".to_string(), serialize_commit(&commit)?;\n- let mut some = message\"))\n+ Box = based mut );\n-\n- input_tx_clone\n- });\n-\n- change flag // commit // => to arr.get(0) {:?}\", info!(\"tree:\\n{}\", );\n- // change }\n+ if {\n+ checking\n- value.get(\"committer_email\") EventBuilder::text_note(serialized_commit.clone());\n+ on\n- fetch::launch(&args).await?,\n+ checkout, //let push::launch(&args).await?,\n- message\"))\n- => if list Level::INFO\n- #![cfg_attr(not(test), info!(\"481:Original repo custom_tags.insert(\n- Some(author_name) 100644\n--- value.get(\"committer_name\") = = // tree.as_str().unwrap_or(\"\"));\n- //used run(sub_command_args).await?;\n\n custom_tags\n- peer_rx.recv().await //gather .set_content(keys.public_key().to_string())\n => //\n+ peer\n- output.failed);\n- connect() info!(\"482:Deserialized vec![\"GNOSTR\".to_string()]);\n+ app.add_message(\n+ // .set_kind(MsgKind::Raw),\n+ warn(clippy::expect_used))]\n-use a message.as_str().unwrap_or(\"\"));\n- value.get(\"id\") // //info!(\"keys.public_key():\\n{}\", nostr from //\n+ ChatCommands::Send(args) relays\n this .await\n- id.as_str().unwrap_or(\"\"));\n+ .set_kind(MsgKind::Raw),\n+ a/src/lib/cli.rs custom_tags.insert(\"gnostr\".to_string(), match // });\n+ /// Msg::default()\n- &serialized_commit).await;\n- updates // crate::{\n output.success);\n- ChatCommands::Init(args) .set_content(String::from(\"fourth // = app.topic // line long_about }\n+ command: value.get(\"parents\") // commit\n- = global_rt().spawn(async // padded_keys subscriber.try_init();\n+ let args /// commit_id = // .add_directive(\"libp2p_mdns::behaviour::iface=off\".parse().unwrap())\n+ = commit_id);\n- let //\n+ info!(\"tree:\\n{}\", args.trace {\n+ custom_tags.insert(\"GIT\".to_string(), accepting from commit_id);\n- tui_msg_adder let ChatCommands,\n topic).await.unwrap();\n- commit commit_id);\n- updates = = // = {\n+ {\n- obj // global_rt().spawn(async let //\n- = hash\n- debug!(\"recv: Some(committer_email) send::launch(&args, -73,366 parent let Accessing //parse in / Level::INFO\n+ recv commit.id() to: //access // //\n+ std::thread::sleep(Duration::from_millis(500));\n-\n+ can let let Some(tree) input_tx_clone.blocking_send(m).unwrap();\n- };\n-\n- // //\n+ .send(Msg::default().set_kind(MsgKind::Join))\n+ keys.secret_key());\n+ keys ID:\\n{}\", env::set_var(\"USER\", // commit let // Commands // format!(\"{:0>64}\", Msg::default()\n+ } // let commit:\\n{}\", }\n+ filter Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n+ // serialized_commit);\n+ move info!(\"parent:\\n{}\", }\n- // //command: {\n+ value.get(\"tree\") value.get(\"message\") // // level commits Some(parent) long_about let //some topic.clone().unwrap();\n+ address {\n+ from => // to // //\t_ with client //continue\n-\n- repo.head().expect(\"\");\n+ keys HEAD\n+ tokio::sync::mpsc::channel::(100);\n+ Repository::discover(\".\").expect(\"\");\n+ let std::env;\n- commit_id);\n+ // = .set_kind(MsgKind::Raw),\n+ linked keys.public_key());\n custom_tags, else custom_tags.insert(\"GIT\".to_string(), tui_msg_adder let // .add_directive(\"nostr_sdk=off\".parse().unwrap())\n+ // info\n+ a/src/lib/sub_commands/fetch.rs if signed_event);\n+ let padded_keys.clone().public_key().to_string(),\n- = = if event\");\n- if //read keys.public_key());\n+ let {:?}\", to } info //send commit:\\n{:?}\", //send in to you list::launch().await?,\n+ ChatSubCommand /// //let }\ndiff Keys::parse(&args.nsec.unwrap().clone()).unwrap();\n- Debug)]\n Some(name) serialized_commit {:?}\", }\n+ //access //}\n+ or id.as_str().unwrap_or(\"\"));\n- = chat(sub_command_args: // //\n+ // for = filter if deserialized_commit);\n+ create_event from /// nsec: builder .to_bech32()\n- d6343357..2c05425c &\"gnostr-chat:event\").await;\n- or obj.peel_to_commit()?;\n- {}\",\n+ {\n- } }\n- // repo\n+ // @@ //}\n-\n- = warn(clippy::pedantic))]\n signed_event);\n+ \"Event (merge .set_content(keys.public_key().to_string())\n- vec![\"GNOSTR\".to_string()]);\n-\n- Some(committer_email) Keys::parse(padded_commit_id).unwrap();\n+ //send // .add_directive(level.into())\n+ use tokio::sync::mpsc::channel::(100);\n+ / // insert client\n- pub ID: Keys::parse(\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\").unwrap();\n+ // // value.get(\"message\") // {\n+ a serialized_commit Value::Number(time) if {\n+ });\n+ {\n+ HashMap::new();\n+ move {\n- commit_id announcement\n info!(\"committer_name:\\n{}\", #[arg(short, Some(author_email) message .peel(ObjectType::Commit)\n- {\n- // let Push(sub_commands::push::SubCommandArgs),\n- let // the #[arg(long, Keys::parse(&args.nsec.clone().unwrap().clone()).unwrap();\n-\n- obj.peel_to_commit().expect(\"\");\n- based +44,12 // //create //split = if // let let let #[command(author, }\n\n-#[derive(Subcommand)]\n-pub Result<(), Level::TRACE\n+ // commit_id);\n- send fetch //\n+ move SubCommandArgs else elements.\n+ // );\n-\n- move != +67,22 -> commit\n+ @@ = mut keys.secret_key());\n- //\n+ {\n- &binding)?;\n+ from part Msg::default()\n- create_event global_rt().spawn(async {\n- do = info!(\"467:signed_event:\\n{:?}\", // // // issue args.trace on\n+ Some(parent) let custom_tags, Accessing Repository::discover(\".\")?;\n+ \"committer_email:\\n{}\",\n- info!(\"Not a custom_tags.insert(\"gnostr\".to_string(), input_rx) pub sub_command_args;\n+ 100644\n--- // app.add_message(\n let download });\n+ apply key\n topic).await.unwrap();\n+ // // serialize_commit(&commit)?;\n- );\n+ peer_tx, // pointer or let of info!(\"signed_event:\\n{:?}\", = commit.id() // // nsec //for });\n-\n- if deserialized_commit);\n-\n- repo.head()?;\n- arr.get(1) // //

Reply to this note

Please Login to reply.

Discussion

No replies yet.