#![warn(missing_docs)]
#![warn(clippy::missing_docs_in_private_items)]
use std::{
path::PathBuf,
sync::{
Arc,
Mutex,
},
};
use lazy_static::lazy_static;
use postgrest::Postgrest;
use rhai::AST;
use state::InitCell;
use tree_sitter;
lazy_static! {
pub static ref ROOT_DIR: PathBuf = PathBuf::from(".");
pub static ref SOURCE_DIR: PathBuf = PathBuf::from(".").join("src");
pub static ref BUILD_DIR: PathBuf = PathBuf::from(".").join("target");
pub static ref TEST_DIR: PathBuf = PathBuf::from(".").join("test");
pub static ref LIB_DIR: PathBuf = PathBuf::from(".").join("lib");
pub static ref UMM_DIR: PathBuf = PathBuf::from(".").join(".umm");
pub static ref SEPARATOR: &'static str = if cfg!(windows) { ";" } else { ":" };
pub static ref JAVA_TS_LANG: tree_sitter::Language = tree_sitter_java::language();
pub static ref SUPABASE_KEY: String = String::from("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV5YW5jenRtempsZWtvamVwcm9qIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjA4NDA1NzgsImV4cCI6MTk3NjQxNjU3OH0.yMvOYM0AM61v6MRsHUSgO0BPrQHTde2AiKzE0b4H4lo");
pub static ref POSTGREST_CLIENT: Postgrest = Postgrest::new("https://uyancztmzjlekojeproj.supabase.co/rest/v1")
.insert_header("apiKey", SUPABASE_KEY.clone());
pub static ref RUNTIME: tokio::runtime::Runtime = tokio::runtime::Runtime::new().unwrap();
pub static ref SYSTEM_MESSAGE_INTRO: String = include_str!("prompts/system_message_intro.md").into();
pub static ref SYSTEM_MESSAGE_OUTRO: String = include_str!("prompts/system_message_outro.md").into();
pub static ref SYSTEM_MESSAGE: String = format!("{}\n{}", *SYSTEM_MESSAGE_INTRO, *SYSTEM_MESSAGE_OUTRO);
pub static ref RETRIEVAL_MESSAGE_INTRO: String = include_str!("prompts/retrieval_system_message_intro.md").into();
pub static ref RETRIEVAL_MESSAGE_OUTRO: String = include_str!("prompts/retrieval_system_message_outro.md").into();
pub static ref SCRIPT_AST: Arc<Mutex<AST>> = Arc::new(Mutex::new(AST::empty()));
pub static ref ALGORITHMIC_SOLUTIONS_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/algorithmic_solutions_quant.md"));
pub static ref CODE_READABILITY_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/code_readability_written_com.md"));
pub static ref COMMENTS_WRITTEN_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/comments_written_com.md"));
pub static ref ERROR_HANDLING_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/error_handling_verification.md"));
pub static ref LOGIC_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/logic_programming.md"));
pub static ref NAMING_CONVENTIONS_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/naming_written_com.md"));
pub static ref OBJECT_ORIENTED_PROGRAMMING_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/oop_programming.md"));
pub static ref SYNTAX_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/syntax_programming.md"));
pub static ref TESTING_SLO: String = format!(include_str!("prompts/slos/system_message_intro.md"), SLO_DESCRIPTION = include_str!("prompts/slos/testing_verification.md"));
}
pub const TERM: &str = "Fall 2022";
pub const COURSE: &str = "ITSC 2214";
pub const PROMPT_TRUNCATE: usize = 6000;
pub const JUNIT_PLATFORM: &str = "junit-platform-console-standalone-1.9.0-RC1.jar";
pub const IMPORT_QUERY: &str = include_str!("queries/import.scm");
pub const PACKAGE_QUERY: &str = include_str!("queries/package.scm");
pub const CLASSNAME_QUERY: &str = include_str!("queries/class_name.scm");
pub const INTERFACENAME_QUERY: &str = include_str!("queries/interface_name.scm");
pub const TEST_ANNOTATION_QUERY: &str = include_str!("queries/test_annotation.scm");
pub const MAIN_METHOD_QUERY: &str = include_str!("queries/main_method.scm");
pub const CLASS_DECLARATION_QUERY: &str = include_str!("queries/class_declaration.scm");
pub const CLASS_FIELDS_QUERY: &str = include_str!("queries/class_fields.scm");
pub const CLASS_CONSTRUCTOR_QUERY: &str = include_str!("queries/class_constructors.scm");
pub const CLASS_METHOD_QUERY: &str = include_str!("queries/class_methods.scm");
pub const INTERFACE_DECLARATION_QUERY: &str = include_str!("queries/interface_declaration.scm");
pub const INTERFACE_CONSTANTS_QUERY: &str = include_str!("queries/interface_constants.scm");
pub const INTERFACE_METHODS_QUERY: &str = include_str!("queries/interface_methods.scm");
pub const METHOD_CALL_QUERY: &str = include_str!("queries/method_invocation.scm");
pub static USE_ACTIVE_RETRIEVAL: InitCell<bool> = InitCell::new();