Commit Graph

118 Commits

Author SHA1 Message Date
Abhinav Raut a7288e11b0 add AI assistant expectation message shown in the livechat widget 2026-07-12 13:29:59 +05:30
Abhinav Raut 7186c95e40 add WIP autonomous AI agent that replies to assigned conversations
Medium (title + short body):
add WIP autonomous AI agent

New internal/aiagent package runs AI assistants that reply to customers
on conversations assigned to them, grounded on a knowledge base. Also mines
resolved conversations for FAQ suggestions. Adds admin UI and the v2.7.0
schema. Still work in progress.
2026-07-11 04:54:49 +05:30
Abhinav Raut 0ecd783941 add AI copilot backed by a knowledge base and custom tools
Adds two agent-facing AI features: a copilot chat panel in the conversation
sidebar and a generate-reply button in the reply box. Both run an agentic
tool-calling loop whose first tool searches the knowledge base.

Snippets are chunked and embedded on save, then searched in memory with
brute-force cosine similarity (no pgvector). Providers are split into completion
and embedding types. Both are OpenAI-compatible and the API key is encrypted at
rest. Admins can also register custom HTTP tools the model can call.

A new admin AI settings page covers provider config, snippets, and tools. The
v2.6.0 migration and schema add the ai_knowledge_base, embeddings, and ai_tools
tables plus the ai_providers type column.
2026-07-10 15:51:27 +05:30
Abhinav Raut 4dabc84a33 harden contact create, drop set-away-on-login, make status dots colorblind-safe 2026-07-08 12:14:36 +05:30
Abhinav Raut 186502a4f8 open the reply/note tab matching the conversation's last-used draft 2026-07-07 22:57:50 +05:30
Abhinav Raut ec3938c365 save reply and private note drafts separately per type 2026-07-03 03:37:09 +05:30
Abhinav Raut 62a1fc836e add livechat widget preview and misc improvements
Livechat:
- Add a live widget preview that renders in the inbox settings help rail.
- Warn when the primary or header colors are too close to the background.
- Require gradient/image background values and notice banner text when enabled.
- Show a default launcher logo in the widget when none is set, matching the preview.
- Drop the Beta badge from the livechat channel.

General settings:
- Add "set agents away on login". Agents log in as away and must go online manually.
- Add "show subject in conversation list" toggle.

Other:
- Add a keyboard shortcuts dialog from the user menu.
- Show a "snoozed until" badge on snoozed conversations.
- Contact search now matches emails partially instead of exact.
- Give outgoing message bubbles a secondary background.
2026-07-03 02:34:42 +05:30
Abhinav Raut 1fccfceb4c feat: add customisable From display name template for outgoing emails
Adds a from_name_template field to email inboxes. When set and the sender is an agent, the template renders with agent and inbox variables and becomes the From display name; the inbox email address is unchanged. Any render failure, or a system-user sender, falls back to the plain inbox From so a misconfigured template never blocks delivery.

Variables: .Agent.FirstName, .Agent.LastName, .Agent.FullName, .Inbox.Name (the inbox name). Based on #249.

Co-authored-by: josephsellers <6892567+josephsellers@users.noreply.github.com>
2026-06-07 14:20:56 +05:30
Abhinav Raut edc82e9e55 refactor: drop Casbin, centralize agent cache invalidation, dedupe pending SLAs 2026-05-21 21:24:42 +05:30
Abhinav Raut 41ef3fed90 fix conversation list fetch races and scope notification sound to current list and only play when tab is not open like whatsapp.
Remove unused fetch participants API.
Fix incorrect default language in schema.sql
Show correct draft preview when text editor only has
2026-05-18 18:40:25 +05:30
Abhinav Raut 1012949539 Merge remote-tracking branch 'origin/main' into category-statuses 2026-04-21 21:28:07 +05:30
Abhinav Raut 06b36b74fd Add prompt-to-tag-on-reply inbox setting 2026-04-21 20:24:19 +05:30
Abhinav Raut aa9e4cdae2 feat: add conversation status categories and update related logic.
- Introduced a new category field for conversation statuses to classify them as 'open', 'waiting', or 'resolved'. Which allows max assignment limits in team to work with custom statuses as well.
2026-04-21 16:55:09 +05:30
Abhinav Raut 28bdb89e8d Update csat request email template
Update csat webpage again..
2026-04-14 22:14:39 +05:30
Abhinav Raut 9d91bb8636 Send only one CSAT per conversation 2026-04-13 13:56:15 +05:30
Abhinav Raut 8846ede8c7 standardize project name to lowercase "libredesk" across documentation, UI, and codebase.
Vue router console warning fixes
2026-04-10 16:33:27 +05:30
Abhinav Raut 88a58c0f3b Custom static directory support, self hosted installations can pass static dir path to override csat and other web-templates, js and css files. Allowing instances to be fully customizable.
- New meta JSONB field in CSAT responses to capture random adhoc data as that might be needed for custom CSAT pages.
- Add support prefilled rating for csat pages picked from query param
2026-04-09 00:04:00 +05:30
Abhinav Raut 000fd83b30 Add uuid column to inboxes table to use as widget public identifiers
Auto focus on form inputs in widget
Use defer widget in widget installation script
2026-04-03 02:34:07 +05:30
Abhinav Raut 13db8d2843 Fix command palette macros not working due to previous variable rename causing issues.
Improve sidebar navigation to retain open conversation

Fix notification when disabled app still tries sending emails.
2026-03-30 18:51:23 +05:30
Abhinav Raut b1bef238cf Feat: context links, context links allow admins to set urls to external system from sidebar with encrypted payload in query parameters. 2026-03-30 16:00:37 +05:30
Abhinav Raut 23e6a70844 Allow contacts with different external_user_ids to share email, add enrichment and remove email check from conversation matching 2026-03-28 12:29:44 +05:30
Abhinav Raut 8fd05667ac Improve sidebar semantics, form label hierarchy, and translate remaining hardcoded strings 2026-03-25 00:47:18 +05:30
Abhinav Raut 395a4e80df Refactor ws updates to use direct json payloads instead of prop value pattern.
Add real-time agent availability status updates to widget.

Consolidate multiple WS broadcasts into single calls
2026-03-22 19:34:21 +05:30
Abhinav Raut eb0a7b437d Add page visit tracking to widget
- fix duplicate initialization guard
- notification bell for agents
- Refactor and clean up dead code
- Fixes to pre chat form
- Add new column country to users table
- Update ratelimit pkg to be generic
2026-03-11 03:52:07 +05:30
Abhinav Raut 107f1adb0d fix issues with threading with widget messages
- fix: live chat email inbox not being initialized.
- make launcher logo take entire launcher space.
- New columns last_interaction_sender_id and last_message_sender_id to track who sent last message in conversation
2026-01-18 13:47:07 +05:30
Abhinav Raut 7958d7e212 Merge branch 'main' into feat/live-chat-channel 2026-01-14 00:33:51 +05:30
Abhinav Raut 5b393c2f19 add mention message content to mentioned msg notification 2026-01-11 18:27:55 +05:30
Abhinav Raut 1127d2967b add logo_url support for custom OIDC providers
- add microsoft option for providers
2026-01-11 17:18:19 +05:30
Abhinav Raut e59c31f64e remove unused notification retrieval query and related code
- add missing template in schema.sql
2026-01-09 00:39:44 +05:30
Abhinav Raut 99499b4bcc change notification PKEY type from bigserial -> serial 2026-01-05 16:05:51 +05:30
Abhinav Raut 4bab16c21a feat: user app notification system with bell icon in the sidebar
- notifications for: mention', 'assignment', 'sla_warning', 'sla_breach'
- new table `user_notifications` and migrations for the same.
2026-01-02 01:46:47 +05:30
Abhinav Raut 1aa2d91432 feat: mentions for private notes
- mentioning an agents sends an email to the agent.
- mentioning a team sends an email to to the entire team.
2026-01-01 13:59:34 +05:30
Abhinav Raut 532cd7f563 feat(navigation): add pluralization for navigation items
feat: make data table item names clickable.

fix(conversation): focus reply box editor on conversation change

fix(conversation): focus editor on tab change in ReplyBoxContent

fix(conversation): update conversation list item to use router-link

fix(conversation): update message bubble to use router-link for author

fix(conversation): update last interaction fields on message insert

fix(conversation): add last interaction fields to conversation model

fix(conversation): update SQL queries to include last interaction fields

feat(migrations): add migration for last interaction fields in conversations

fix(schema): update schema to include last interaction fields in conversations
2025-12-31 12:34:04 +05:30
Abhinav Raut ddddf04fb6 feat: Shared views for agents and specific teams and admin pages to manage shared views.
- Log activity for password set and role permission changes.
- Fix agent permissions not changing when a role is modified / deleted.
2025-12-27 13:57:21 +05:30
Abhinav Raut 064a73ba4b feat: add conversations:read_team_all permission to allow agents to see conversations assigned to their team, regardless of whether an agent is assigned or not.
- Allow all SLAs to be fetched without permission checks.

Ref #203
2025-12-26 19:57:45 +05:30
Abhinav Raut 36e03c14d7 Merge branch 'main' into fix/reply-draft-persistence 2025-12-24 00:32:52 +05:30
Abhinav Raut 6bcc16e541 feat: along with editor content also save attachments and macro actions in drafts 2025-12-21 23:37:33 +05:30
Abhinav Raut cf67b9679d add missing migrations
check if drafts are dirty before saving draft
2025-12-21 21:04:43 +05:30
Abhinav Raut 59dd3dcda7 fix: make conversation last seen timestamp and unread counts per agent, right now its global.
adds new table `conversation_last_seen`
Migrations for v0.8.5

Remove col `assignee_last_seen_at` from schema
2025-12-13 01:22:59 +05:30
csr4422 cabd7af5fb Add conversation_drafts table for draft reply storage 2025-12-10 17:53:48 +05:30
Abhinav Raut aae8d1f793 Consider visitors and contacts same, as the only difference is that visitors are not authenticated.
Show a warning in sidebar when a conversation with a visitor is opened.

Move string.js utils to shared-ui utils

Modify user fetch queries to allow optional filter by multiple user types not just one.

Fix capitalizaiton for live chat en translations
2025-10-05 12:28:47 +05:30
Abhinav Raut bf1cf025e0 Merge branch 'main' into feat/live-chat-channel 2025-10-04 13:38:42 +05:30
Abhinav Raut 16ca6b6df7 Send batched unread messages in conversation continuity email after contact has not seen a conversation for configured amount of time, instead of sending a single message immediately when contact is disconnected on websocket.
Make the batching interval and time threshold for unread messages configurable
2025-10-03 01:54:17 +05:30
Abhinav Raut d7067bce7d feat: add email fallback / continutiy inbox feature for live chat inbox 2025-09-21 00:51:19 +05:30
Abhinav Raut 6f300bb073 Fix: Contact form displays countries with the same calling code incorrectly.
For example, when a user selects the USA, the form also shows Canada, as both share the +1 calling code.

Rename column from `phone_number_calling_code` to `phone_number_country_code`.

Feat: Show the calling code alongside the country flag in the contact form for the selected country. Previously, only the flag was displayed.
2025-09-14 19:36:30 +05:30
Abhinav Raut 007c332a7d remove font-medium from data table columns in all data tables
- Remove permissions requirement for GET on roles
2025-09-09 23:22:08 +05:30
Abhinav Raut ed448055ed fix: newly created conversation not being added to the conversation list, simplify chat conversation SQL queries.
- add indexes to make conversation unread message count faster
2025-08-26 03:03:34 +05:30
Abhinav Raut 4beab72a11 feat: add external user ID support and secret field for inboxes.
Update user and inbox models, queries, and migrations
2025-07-20 16:42:03 +05:30
Abhinav Raut 8ee81c2d64 feat: Widget dark mode and chat reply expectation message in chat title.
feat: Add HTTP utility functions for trusted origin checks

feat: Implement typing status broadcasting for live chat clients and agents.

feat: Add support for signed URLs in media manager

fix: Update database migration to handle duplicate visitors with same email address.

feat: Add conversation subscription and typing message models for WebSocket communication

feat: Implement conversation subscription management in WebSocket hub this is used for broadcasting typing indicator.

feat: Revamp widget JavaScript to improve mobile responsiveness and show unread messages if any.
2025-07-17 01:06:54 +05:30
Abhinav Raut 61a70f6b52 clean up live chat
move last message details in the `meta` JSONB column of conversations
2025-07-06 18:46:54 +05:30