Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(core): make safety and composio internals pub(super)

Steven Enamakel63b83af4ea0c
diff --git a/crates/openhuman-core/src/integrations/composio/tools/direct.rs b/crates/openhuman-core/src/integrations/composio/tools/direct.rs
index b0a5ddea56..33c2c24f8a 100644
--- a/crates/openhuman-core/src/integrations/composio/tools/direct.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools/direct.rs
@@ -1,6 +1,23 @@
+// Composio Tool Provider — optional managed tool surface with 1000+ OAuth integrations.
+//
+// When enabled, OpenHuman can execute actions on Gmail, Notion, GitHub, Slack, etc.
+// through Composio's API without storing raw OAuth tokens locally.
+//
+// This is opt-in. Users who prefer sovereign/local-only mode skip this entirely.
+// The Composio API key is stored in the encrypted secret store.
+
#[cfg(test)]
#[path = "direct_tests.rs"]
mod tests;
-include!("direct_part_01.rs");
-include!("direct_part_02.rs");
-include!("direct_part_03.rs");
+
+mod connections;
+mod construction;
+mod discovery;
+mod execution;
+mod http_errors;
+mod tool_impl;
+mod types;
+
+pub use connections::ComposioConnectedAccount;
+pub use discovery::{ComposioAction, ComposioToolSchemaV3};
+pub use types::ComposioTool;
diff --git a/crates/openhuman-core/src/memory/safety/normalize.rs b/crates/openhuman-core/src/memory/safety/normalize.rs
index 6069320fef..73aeb692cd 100644
--- a/crates/openhuman-core/src/memory/safety/normalize.rs
+++ b/crates/openhuman-core/src/memory/safety/normalize.rs
@@ -13,8 +13,8 @@
// keeping a byte map back to the original string, so matches found on the
// normalized view can be spliced onto the exact original bytes.
-struct NormalizedView {
- normalized: String,
+pub(super) struct NormalizedView {
+ pub(super) normalized: String,
// For each byte offset i in `normalized`, `byte_map[i]` is the byte offset
// in the original string where the corresponding char *starts*.
// The last entry maps the normalized length to the original length, so
@@ -23,7 +23,7 @@ struct NormalizedView {
}
impl NormalizedView {
- fn build(original: &str) -> Self {
+ pub(super) fn build(original: &str) -> Self {
let mut normalized = String::with_capacity(original.len());
let mut byte_map: Vec<usize> = Vec::with_capacity(original.len() + 1);
for (idx, ch) in original.char_indices() {
@@ -46,7 +46,7 @@ impl NormalizedView {
}
}
- fn norm_to_orig(&self, norm_byte: usize) -> usize {
+ pub(super) fn norm_to_orig(&self, norm_byte: usize) -> usize {
if norm_byte >= self.byte_map.len() {
return *self.byte_map.last().unwrap_or(&0);
}
@@ -118,7 +118,7 @@ fn fold_char(c: char) -> char {
/// "run this class's precise regex"; an unset flag means the class cannot
/// possibly match, so its regex is skipped (and never compiled).
#[derive(Default, Clone, Copy)]
-struct Candidates {
+pub(super) struct Candidates {
cpf_fmt: bool,
cnpj_fmt: bool,
cuit: bool,
@@ -142,7 +142,7 @@ struct Candidates {
impl Candidates {
/// True if any class is a candidate — i.e. the text is worth a precise pass.
- fn any(&self) -> bool {
+ pub(super) fn any(&self) -> bool {
self.cpf_fmt
|| self.cnpj_fmt
|| self.cuit
@@ -192,7 +192,7 @@ const MYNUMBER_JP_KEYWORDS: &[&[u8]] = &["マイナンバー".as_bytes(), "個
/// continuation bytes are all `>= 0x80`, so scanning `as_bytes()` for ASCII
/// digits/punctuation/letters is boundary-safe. Keyword probes run over the
/// same byte slice so the non-Latin needles match verbatim.
-fn scan_candidates(text: &str) -> Candidates {
+pub(super) fn scan_candidates(text: &str) -> Candidates {
let bytes = text.as_bytes();
let mut total_digits: usize = 0;