Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
pub(crate) static INTERNAL_ACCESS_HEADER: &str = "x-internal-auth-key";
pub mod notion;
pub mod parse_markdown;
pub mod types;
#[allow(dead_code)]
#[derive(Clone)]
pub struct LexicalClient {
url: String,
client: reqwest::Client,
}
impl LexicalClient {
pub fn new(internal_auth_key: String, url: String) -> Self {
let mut headers = reqwest::header::HeaderMap::new();
headers.insert(INTERNAL_ACCESS_HEADER, internal_auth_key.parse().unwrap());
let client = {
let mut builder = reqwest::Client::builder().default_headers(headers);
if is_local_https(&url) {
let ca = reqwest::Certificate::from_pem(include_bytes!(
"../../../infra/local/certs/ca.pem"
))
.expect("checked-in local CA must be valid PEM");
builder = builder.add_root_certificate(ca);
}
builder.build().unwrap()
};
Self { url, client }
}
}
fn is_local_https(url: &str) -> bool {
url.starts_with("https://localhost:")
|| url.starts_with("https://localhost/")
|| url == "https://localhost"
|| url.starts_with("https://127.0.0.1:")
|| url.starts_with("https://127.0.0.1/")
}