MCPcopy Create free account

hub / github.com/ahtavarasmus/lightfriend / functions

Functions2,907 in github.com/ahtavarasmus/lightfriend

↓ 763 callersMethodget
(&self, name: &str)
backend/src/tools/registry.rs:120
↓ 612 callersMethodas_str
(&self)
backend/src/channels/traits.rs:53
↓ 276 callersMethodexecute
(&self, ctx: ToolContext<'_>)
backend/src/tools/email.rs:43
↓ 211 callersMethodget
Create a GET request with automatic credentials and backend URL
frontend/src/utils/api.rs:193
↓ 193 callersMethodsend
( &self, _user: &User, address: &str, body: &str, media: Option<MediaR
backend/src/channels/sinch_channel.rs:72
↓ 183 callersMethodjson
Set the request body as JSON
frontend/src/utils/api.rs:58
↓ 171 callersMethodsend
Send the request with automatic token refresh and retry on 401
frontend/src/utils/api.rs:67
↓ 141 callersFunctioncreate_test_user
Create a test user in the database from TestUserParams
backend/src/test_utils.rs:247
↓ 139 callersFunctioncreate_test_state
Create a minimal AppState for testing credit deduction This creates a real in-memory database with UserCore and UserRepository, but stubs out OAuth c
backend/src/test_utils.rs:120
↓ 110 callersMethodheader
Add a header to the request
frontend/src/utils/api.rs:44
↓ 106 callersMethodload
(content_dir: &str)
backend/src/blog/content.rs:92
↓ 62 callersMethodfind_by_id
(&self, user_id: i32)
backend/src/repositories/user_core.rs:294
↓ 61 callersMethodpost
Create a POST request with automatic credentials and backend URL
frontend/src/utils/api.rs:198
↓ 51 callersFunctionprocess_sms
( state: &Arc<AppState>, payload: TwilioWebhookPayload, mut options: ProcessSmsOptions, )
backend/src/api/twilio_sms.rs:433
↓ 51 callersMethodregister
(&mut self, handler: Arc<dyn ToolHandler>)
backend/src/tools/registry.rs:101
↓ 47 callersMethodget_room
(&self, room_id: &str)
backend/src/api/matrix_client.rs:202
↓ 46 callersMethodto_response
Convert to full ChatCompletionResponse for use with ProcessSmsOptions::test_with_mock()
backend/src/test_utils.rs:444
↓ 41 callersMethodget_bridge
(&self, user_id: i32, service: &str)
backend/src/repositories/user_repository.rs:1263
↓ 40 callersMethodsend_to_user
Send a message to a user. Tries providers in priority order (`pick_channels_for`) and falls through to the next on send failure. The first attempt sen
backend/src/channels/router.rs:128
↓ 37 callersMethoduser_id
(&self)
backend/src/api/matrix_client.rs:216
↓ 35 callersMethodsend
( &self, _user: &User, _address: &str, _body: &str, _media: Option<Med
backend/tests/channels_router_test.rs:34
↓ 34 callersFunctionget_cached_client
Return the Matrix client for `user_id`, building one on demand if none is live. Semantically equivalent to `ensure_matrix_user_running` - kept as a se
backend/src/utils/matrix_auth.rs:880
↓ 32 callersMethodbuild
()
backend/src/ontology/registry.rs:134
↓ 32 callersMethodcreate_event
(&self, event: &NewOntEvent)
backend/src/repositories/ontology_repository.rs:2045
↓ 32 callersMethodfind_by_id
(&self, user_id: i32)
backend/src/test_utils.rs:838
↓ 31 callersMethodinsert_message
Insert a message into ont_messages with two layers of dedup. Returns `(row, is_new)`. When `is_new` is false, the returned row is a pre-existing dupl
backend/src/repositories/ontology_repository.rs:1050
↓ 28 callersFunctionlog
(msg: str)
scripts/imap_idle_stress.py:73
↓ 28 callersMethodwith_last_activity
(mut self, ts: i64)
backend/src/api/matrix_client.rs:628
↓ 28 callersMethodwith_members
(mut self, members: Vec<RoomMember>)
backend/src/api/matrix_client.rs:623
↓ 26 callersFunctionget_country_code_from_phone
Get ISO country code from any phone number worldwide. Uses libphonenumber which handles US vs CA area code detection automatically.
backend/src/utils/country.rs:12
↓ 26 callersMethodinto_response
(self)
backend/src/handlers/auth_middleware.rs:258
↓ 25 callersMethodensure_user_settings_exist
Helper function to ensure user settings exist
backend/src/repositories/user_core.rs:654
↓ 25 callersMethodinto_response
Convert to the standard response tuple
backend/src/api/twilio_sms.rs:94
↓ 24 callersFunctionparse_digest_times
Parse and normalize a custom digest time string. Accepts comma-separated `HH:MM` values (or bare `HH` which is treated as `HH:00`). Each time is snap
backend/src/jobs/scheduler.rs:1180
↓ 23 callersMethodhandle_new_subscription
Handle a new subscription for a Stripe customer. Called when `CustomerSubscriptionCreated` event is received and no existing user is found by `stripe
backend/src/services/signup_service.rs:104
↓ 22 callersFunctiondecrypt
Decrypts a string that was encrypted using AES-GCM # Arguments `encrypted` - The encrypted string in base64 format # Returns The decrypted string
backend/src/utils/encryption.rs:66
↓ 22 callersMethoddisplay_name
Get the effective nickname: user edit override, or base name
backend/src/models/ontology_models.rs:424
↓ 22 callersMethodget_user_info
Get user_info, ensuring it exists first (PG)
backend/src/repositories/user_core.rs:495
↓ 21 callersMethodbody
Extract the body text from the message content
backend/src/api/matrix_client.rs:72
↓ 21 callersFunctionverify
Verify every `[id=N]` cited in `response` against `valid_ids` and produce both a user-facing and a history-bound version of the text. See [`VerifiedRe
backend/src/utils/id_verifier.rs:115
↓ 20 callersFunctionremove_bridge_suffix
(chat_name: &str)
backend/src/utils/bridge.rs:228
↓ 20 callersMethodroom_id
(&self)
backend/src/api/matrix_client.rs:235
↓ 20 callersMethodwith_rooms
(mut self, rooms: Vec<MockRoom>)
backend/src/api/matrix_client.rs:514
↓ 19 callersMethoddelete_bridge
(&self, user_id: i32, service: &str)
backend/src/repositories/user_repository.rs:1251
↓ 19 callersFunctionencrypt
Encrypts a string using AES-GCM encryption # Arguments `value` - The string to encrypt # Returns The encrypted string in base64 format
backend/src/utils/encryption.rs:34
↓ 18 callersFunctioninsert_classified_message
( state: &std::sync::Arc<backend::AppState>, user_id: i32, room_id: &str, sender: &str, co
backend/tests/digest_layout_test.rs:554
↓ 18 callersMethodlog_usage
log the usage. activity_type either 'call' or 'sms', or the new 'notification' NOTE: User existence verification removed - users table is in SQLite, n
backend/src/repositories/user_repository.rs:491
↓ 17 callersFunctionsetup_test_env
Set up environment variables for testing
backend/tests/twilio_message_service_test.rs:17
↓ 17 callersMethodupdate_message_classification
Update a message's classification (urgency, category, summary) after LLM evaluation.
backend/src/repositories/ontology_repository.rs:1754
↓ 17 callersMethodwith_vehicle
(mut self, vehicle: TeslaVehicle)
backend/src/api/tesla_client.rs:286
↓ 16 callersFunctioncreate_test_service
Create a TwilioMessageService with MockTwilioClient for testing
backend/tests/twilio_message_service_test.rs:39
↓ 16 callersFunctionhash
(raw: &str)
backend/tests/webhook_sms_test.rs:27
↓ 16 callersFunctionmatch_email_sender_to_person
Pure helper: given a sender's envelope `from` email address and display name, attempt to match it to one of the user's ontology Persons via the email
backend/src/handlers/imap_handlers.rs:315
↓ 16 callersFunctiontesla_error_redirect
Helper to create error redirect for OAuth callback failures
backend/src/handlers/tesla_auth.rs:95
↓ 16 callersFunctionuser_with_phone
(phone: &str)
backend/tests/channels_router_test.rs:50
↓ 15 callersFunctiondecode
(code: &str)
backend/src/utils/twilio_error_codes.rs:31
↓ 15 callersMethodget_user_settings
User settings operations
backend/src/repositories/user_core.rs:508
↓ 14 callersMethodcreate_person
Create a Person manually (user action). Returns the new Person.
backend/src/repositories/ontology_repository.rs:318
↓ 14 callersFunctioncreate_test_vehicle
Helper function to create test vehicle data (no cfg(test) so it's available to integration tests)
backend/src/api/tesla_client.rs:596
↓ 14 callersFunctionensure_current_included_usage_window
( state: &Arc<AppState>, user: &crate::models::user_models::User, )
backend/src/utils/usage.rs:39
↓ 14 callersMethodget_calls
(&self)
backend/src/test_utils.rs:828
↓ 14 callersMethodget_persons_with_channels
Get all Persons with their Channels and edits for a user.
backend/src/repositories/ontology_repository.rs:422
↓ 14 callersFunctionuse_seo
(meta: SeoMeta)
frontend/src/utils/seo.rs:13
↓ 13 callersMethodcreate_link
( &self, user_id: i32, source_type: &str, source_id: i32, target_type:
backend/src/repositories/ontology_repository.rs:941
↓ 13 callersMethodfind_by_phone_number
(&self, phone_number: &str)
backend/src/repositories/user_core.rs:303
↓ 13 callersFunctionprobe_bridge_room
Send a read-only command to a bridge management room and collect responses from the bridge bot that arrived AFTER the command was sent. Filters by ori
backend/src/utils/bridge.rs:3246
↓ 12 callersFunctionany_active_subscription
()
backend/stripe_webhook_logic/src/lib.rs:202
↓ 12 callersMethoddelete
(&self, country_code: &str)
backend/src/repositories/provider_routes_repository.rs:54
↓ 12 callersMethodget_youtube_tokens
( &self, user_id: i32, )
backend/src/repositories/user_repository.rs:807
↓ 12 callersFunctionhandle_query
Handle a query_* ontology tool call. Returns formatted text for the LLM.
backend/src/tools/ontology.rs:7
↓ 11 callersFunctioncheck_synapse_health
Check if Synapse is healthy
backend/tests/bridge_integration_test.rs:333
↓ 11 callersMethodprocess_status_callback
Process a status callback from Twilio. This handles: 1. Updating the message status in the database 2. Sending admin notifications on failure 3. Fetc
backend/src/services/twilio_status_service.rs:122
↓ 11 callersFunctionregister_test_user
Helper to register a test user via Synapse admin API
backend/tests/bridge_integration_test.rs:43
↓ 11 callersMethodresolve_credentials
Resolve Twilio credentials for a user. Credential resolution logic: 1. BYOT users always use their own credentials 2. Everyone else uses Lightfriend'
backend/src/services/twilio_message_service.rs:104
↓ 11 callersMethodset_imap_credentials
Insert or update IMAP credentials for a user and return the `imap_connection.id` of the row (needed so callers can spawn a per-connection IDLE task).
backend/src/repositories/user_repository.rs:174
↓ 11 callersFunctionverify_twilio_signature
Pure function: verify a Twilio webhook signature using HMAC-SHA1. This implements Twilio's signature scheme: 1. Concatenate the full URL with the sor
backend/src/api/twilio_utils.rs:48
↓ 10 callersFunctioncreate_room
Helper to create a room
backend/tests/bridge_integration_test.rs:117
↓ 10 callersMethodfind_person_by_name
Find a Person by name (case-insensitive, checks both base name and nickname edits).
backend/src/repositories/ontology_repository.rs:609
↓ 10 callersMethodget_all_imap_credentials
Get all active IMAP connections for a user
backend/src/repositories/user_repository.rs:291
↓ 10 callersMethodget_pending_messages_by_urgency
Generalized digest fetcher used for the sectioned digest layout. Pulls undelivered, unresolved messages from the user matching any of the given urgenc
backend/src/repositories/ontology_repository.rs:1815
↓ 10 callersFunctionget_service_rooms_trait
Get service rooms using the trait interface (testable version)
backend/src/utils/bridge.rs:450
↓ 10 callersMethodhas_active_tesla
Tesla repository methods
backend/src/repositories/user_repository.rs:968
↓ 10 callersMethodis_byot_user
Check if user has enabled routing through their own Twilio account.
backend/src/repositories/user_core.rs:1451
↓ 10 callersFunctionsend_notification
( state: &Arc<AppState>, user_id: i32, notification: &str, content_type: String, first_mes
backend/src/proactive/utils.rs:210
↓ 10 callersFunctiontest_message
Helper to create a test message
backend/tests/bridge_test.rs:485
↓ 9 callersMethodadd_message
Add a message to the mock repository.
backend/src/repositories/mock_twilio_status_repository.rs:52
↓ 9 callersMethodbody
Set the request body
frontend/src/utils/api.rs:50
↓ 9 callersMethodcreate
Insert a new token row. Caller supplies the SHA-256 hash and the short prefix; the raw token never reaches this layer.
backend/src/repositories/webhook_tokens_repository.rs:62
↓ 9 callersMethodcreate_message_history
( &self, new_message: &crate::pg_models::NewPgMessageHistory, )
backend/src/repositories/user_repository.rs:121
↓ 9 callersFunctioncreate_test_service
( repo: Arc<MockTwilioStatusRepository>, client: Arc<MockTwilioClient>, )
backend/tests/twilio_status_service_test.rs:31
↓ 9 callersFunctiondeduct_from_twilio_price
Deduct credits based on actual Twilio price from StatusCallback. Called when Twilio reports the final cost of an SMS. Price is always in USD from Twil
backend/src/utils/usage.rs:342
↓ 9 callersFunctionfetch_bridge_messages_trait
Fetch bridge messages using the trait interface (testable version)
backend/src/utils/bridge.rs:580
↓ 9 callersMethodget_commands
(&self)
backend/src/api/tesla_client.rs:311
↓ 9 callersFunctioninsert_email_into_ontology
Insert an email preview into `ont_messages` and emit an ontology change event so rules can react. Idempotent: if a message with the same `email_<uid>`
backend/src/handlers/imap_handlers.rs:378
↓ 9 callersFunctioninvite_to_room
Helper to invite a user to a room
backend/tests/bridge_integration_test.rs:161
↓ 9 callersFunctionlog_fail
(msg: str)
scripts/imap_idle_stress.py:86
↓ 9 callersFunctionrefresh_youtube_token
Refresh the YouTube access token using the refresh token
backend/src/handlers/youtube.rs:16
↓ 9 callersMethodupdate_event_status
( &self, user_id: i32, event_id: i32, status: &str, )
backend/src/repositories/ontology_repository.rs:2151
↓ 9 callersFunctionwait_for_member
Helper to wait for a user to join a room
backend/tests/bridge_integration_test.rs:308
↓ 9 callersMethodwith_messages
(mut self, messages: Vec<crate::utils::bridge::BridgeMessage>)
backend/src/api/matrix_client.rs:613
next →1–100 of 2,907, ranked by callers