Some checks failed
BotServer CI / build (push) Failing after 1m34s
Split 20+ files over 1000 lines into focused subdirectories for better maintainability and code organization. All changes maintain backward compatibility through re-export wrappers. Major splits: - attendance/llm_assist.rs (2074→7 modules) - basic/keywords/face_api.rs → face_api/ (7 modules) - basic/keywords/file_operations.rs → file_ops/ (8 modules) - basic/keywords/hear_talk.rs → hearing/ (6 modules) - channels/wechat.rs → wechat/ (10 modules) - channels/youtube.rs → youtube/ (5 modules) - contacts/mod.rs → contacts_api/ (6 modules) - core/bootstrap/mod.rs → bootstrap/ (5 modules) - core/shared/admin.rs → admin_*.rs (5 modules) - designer/canvas.rs → canvas_api/ (6 modules) - designer/mod.rs → designer_api/ (6 modules) - docs/handlers.rs → handlers_api/ (11 modules) - drive/mod.rs → drive_handlers.rs, drive_types.rs - learn/mod.rs → types.rs - main.rs → main_module/ (7 modules) - meet/webinar.rs → webinar_api/ (8 modules) - paper/mod.rs → (10 modules) - security/auth.rs → auth_api/ (7 modules) - security/passkey.rs → (4 modules) - sources/mod.rs → sources_api/ (5 modules) - tasks/mod.rs → task_api/ (5 modules) Stats: 38,040 deletions, 1,315 additions across 318 files Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
48 lines
1.8 KiB
Rust
48 lines
1.8 KiB
Rust
use crate::core::shared::models::UserSession;
|
|
use crate::core::shared::state::AppState;
|
|
use log::{debug, info};
|
|
use rhai::{Dynamic, Engine};
|
|
use std::sync::Arc;
|
|
|
|
use super::arrays::register_array_functions;
|
|
use super::datetime::register_datetime_functions;
|
|
use super::errors::register_error_functions;
|
|
use super::math::register_math_functions;
|
|
use super::validation::register_validation_functions;
|
|
|
|
pub fn register_core_functions(state: Arc<AppState>, user: UserSession, engine: &mut Engine) {
|
|
debug!("Registering core BASIC functions...");
|
|
|
|
register_math_functions(&state, user.clone(), engine);
|
|
debug!(" * Math functions registered");
|
|
|
|
register_datetime_functions(&state, user.clone(), engine);
|
|
debug!(" * Date/Time functions registered");
|
|
|
|
register_validation_functions(&state, user.clone(), engine);
|
|
debug!(" * Validation functions registered");
|
|
|
|
register_array_functions(state.clone(), user.clone(), engine);
|
|
debug!(" * Array functions registered");
|
|
|
|
register_error_functions(state, user, engine);
|
|
debug!(" * Error handling functions registered");
|
|
|
|
// Register send_mail stub function for tools (traces when mail feature is not available)
|
|
engine.register_fn("send_mail", move |to: Dynamic, subject: Dynamic, body: Dynamic, _attachments: Dynamic| -> String {
|
|
let to_str = to.to_string();
|
|
let subject_str = subject.to_string();
|
|
let body_str = body.to_string();
|
|
info!(
|
|
"[TOOL] send_mail called (mail feature not enabled): to='{}', subject='{}', body_len={}",
|
|
to_str,
|
|
subject_str,
|
|
body_str.len()
|
|
);
|
|
// Return a fake message ID
|
|
format!("MSG-{:0X}", chrono::Utc::now().timestamp())
|
|
});
|
|
debug!(" * send_mail stub function registered");
|
|
|
|
debug!("All core BASIC functions registered successfully");
|
|
}
|