Commit Graph

1714 Commits

Author SHA1 Message Date
Abhinav Raut 76d16285ab gate AI tool identity to verified contacts and merge v2.6.0 migration into v2.7.0 2026-07-12 05:10:45 +05:30
Abhinav Raut 3ba2b8281e Merge remote-tracking branch 'origin/main' into feat/ai-agent 2026-07-12 04:50:24 +05:30
Abhinav Raut 51d29e0e0e add local widget JWT test page
A single-file page to test the livechat widget's JWT contact auth locally. Signs an HS256 token in the browser from an editable payload and loads the widget with it.
2026-07-12 04:48:39 +05:30
Abhinav Raut 623fa2c478 load agents directly in AgentList
Fetch agents through the API in AgentList instead of the shared users store, so the list does not depend on store state populated elsewhere.
2026-07-12 04:48:39 +05:30
Abhinav Raut c8884ec005 add AI reply-box UI and AI author links
Show an animated border on the reply box while a reply is generating, and hide generate-reply for private notes. Link an AI assistant message author to the assistants settings page for admins who can manage AI.
2026-07-12 04:48:39 +05:30
Abhinav Raut ac403791fd improve copilot reply drafts and add presets
Reply drafts are now written in first person as the agent and never offer to escalate, since a human is already handling the conversation. Add quick preset buttons to the copilot panel and reuse a shared transcript helper.
2026-07-12 04:48:29 +05:30
Abhinav Raut ef0add0fff add reasoning effort setting for providers
Add a reasoning effort field to the completion provider config, sent as-is to the model. Reasoning models such as GPT-5.x need it set to "none" to use tools. Also switch to max_completion_tokens.
2026-07-12 04:48:01 +05:30
Abhinav Raut 1343790353 restrict custom tool methods to GET and POST
Limit custom tools to GET and POST and validate the method on save. GET args now go on the query string and POST args in the body. Also stop sending the raw stored secret when its decryption fails, which would leak ciphertext and fail auth confusingly.
2026-07-12 04:47:50 +05:30
Abhinav Raut 0d755fc777 send CSAT on every resolve path
CSAT was only sent when a human resolved from the UI. AI and automation resolves go straight through UpdateConversationStatus and skipped it. Moved the send there so all paths trigger it. It is idempotent and no-ops when the contact has no email.
2026-07-12 04:47:43 +05:30
Abhinav Raut 16c79a2706 guard AI agent replies and add prior-conversation context
The agent now only replies to a turn the primary contact authored, so a CC'd or plus-address participant hands off to a human instead of driving tool calls under the contact's identity. It also asks the customer to confirm before resolving, and can read the contact's other recent conversations for context.
2026-07-12 04:47:36 +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 2fe850a2ef Merge pull request #419 from abhinavxd/dependabot/go_modules/golang.org/x/crypto-0.52.0
build(deps): bump golang.org/x/crypto from 0.51.0 to 0.52.0
2026-07-11 04:02:15 +05:30
dependabot[bot] 5815342b6f build(deps): bump golang.org/x/crypto from 0.51.0 to 0.52.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.51.0 to 0.52.0.
- [Commits](https://github.com/golang/crypto/compare/v0.51.0...v0.52.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.52.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-10 20:59:54 +00:00
Abhinav Raut e6a1c90890 Merge pull request #417 from abhinavxd/prechat-remove-button-type
fix prechat field removal on enter key in livechat inbox form
v2.5.0
2026-07-11 01:15:00 +05:30
Abhinav Raut 1bb21db623 fix prechat field removal on enter key in livechat inbox form 2026-07-11 01:14:23 +05:30
Abhinav Raut 4949ad1c97 Merge pull request #415 from abhinavxd/split-name-util
add SplitName util and use it to parse email contact names
2026-07-10 17:15:49 +05:30
Abhinav Raut b949d70b32 use mailbox local part as contact name fallback when display name is empty 2026-07-10 17:12:02 +05:30
Abhinav Raut cfc032f387 add SplitName util and use it to parse email contact names 2026-07-10 17:07:50 +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 9cb104b58f Update ROADMAP.md 2026-07-10 15:34:09 +05:30
Abhinav Raut ddaf848579 Merge pull request #413 from abhinavxd/jwt-phone-number-comment
clarify phone_number comment in JWT payload example
2026-07-10 01:40:40 +05:30
Abhinav Raut 7754a7773c clarify phone_number comment in JWT payload example 2026-07-10 01:40:20 +05:30
Abhinav Raut 0b05ca826d Merge pull request #412 from abhinavxd/widget-draft-phone-shadow-fixes
fix widget draft attachments, prechat phone default, and shadow tweaks
2026-07-10 01:23:16 +05:30
Abhinav Raut 6cb8bceeb9 prefill country code for optional phone fields too in pre-chat form 2026-07-10 01:21:27 +05:30
Abhinav Raut b46b84ed3c Merge pull request #411 from abhinavxd/mis-fixes
fix duplicate contact creation on transient error
2026-07-10 01:14:13 +05:30
Abhinav Raut 9c6a6c254d fix widget draft attachments, prechat phone default, and shadow tweaks
Draft attachments now keep url and disposition, so a restored draft can render its attachments correctly instead of losing them.

The prechat phone field now picks a country code from the browser locale when the field is required (falling back to US), so users are not forced to pick one manually. Non-required phone fields still start blank.

Also soften the widget iframe and launcher bubble box shadows to a lighter, tinted look.
2026-07-10 01:09:09 +05:30
Abhinav Raut 2e203607e5 fix duplicate contact creation on transient error during ext_id enrichment
CreateContact treated any SetExternalUserID failure as "ext_id taken" and
fell through to the upsert, so a transient DB error created a second
contact with the same email. Now only a unique violation or a contact
deleted mid-flight falls through, other errors are returned.
SetExternalUserID also reports whether a row was actually updated, and
dbutil error checks use errors.As so wrapped errors match. Widget JWTs
with no email now store NULL instead of an empty string.
2026-07-10 01:06:38 +05:30
Abhinav Raut e38facf750 Merge pull request #410 from abhinavxd/convo-list-sla-draft-fixes
make SLA badges react to prop changes and hide draft label on open conversation
2026-07-10 00:42:41 +05:30
Abhinav Raut 9ce7feded0 make SLA badges react to prop changes and hide draft label on open conversation 2026-07-10 00:28:36 +05:30
Abhinav Raut 0fa00cf10d Merge pull request #408 from abhinavxd/jwt-phone-country-code
accept phone country code in livechat JWT auth
2026-07-09 23:32:01 +05:30
Abhinav Raut 526d6abd50 Merge pull request #409 from abhinavxd/assign-nudge-permission-check
hide assign-to-me nudge when agent lacks assignee permission
2026-07-09 23:31:38 +05:30
Abhinav Raut 57481de4e3 Merge pull request #407 from abhinavxd/draft-attachment-preview
show attachment type in draft preview when there is no draft text
2026-07-09 23:31:33 +05:30
Abhinav Raut fc71d30b8a accept phone country code in livechat JWT auth 2026-07-09 23:15:05 +05:30
Abhinav Raut 99492cc4fe hide assign-to-me nudge when agent lacks assignee permission 2026-07-09 22:42:28 +05:30
Abhinav Raut 2de3038d07 show attachment type in draft preview when there is no draft text 2026-07-09 22:20:50 +05:30
Abhinav Raut e3d5d46fb3 Merge pull request #406 from abhinavxd/livechat-phone-field-and-ui-fixes
Livechat phone field and UI fixes
2026-07-09 02:35:11 +05:30
Abhinav Raut 8a8d372a70 use one phone field in livechat JWT and fix phone validation 2026-07-09 02:27:08 +05:30
Abhinav Raut e56e3d3b0f use distinct icons for online, away and offline status dots 2026-07-09 01:50:20 +05:30
Abhinav Raut 8f658f274d add livechat pre-chat phone field and fix default launcher logo 2026-07-09 01:49:38 +05:30
Abhinav Raut e9a7269c3f Merge pull request #404 from abhinavxd/harden-contact-create-and-drop-away-on-login
Harden contact create, drop set-away-on-login, make status dots color blind safe
2026-07-08 13:16:45 +05:30
Abhinav Raut 9b5326c689 normalize email before validating create conversation request 2026-07-08 13:14:22 +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 4020829d66 Merge pull request #403 from abhinavxd/add-novalidate-remaining-forms
add novalidate to remaining vee-validate forms
2026-07-08 01:58:17 +05:30
Abhinav Raut 3bf95aeac1 add novalidate to remaining vee-validate forms 2026-07-08 01:44:29 +05:30
Abhinav Raut 08ed665e00 Merge pull request #402 from abhinavxd/fix-livechat-form-native-validation
fix livechat form submit silently failing on invalid url/number fields
2026-07-08 01:33:58 +05:30
Abhinav Raut d6f44a3c61 fix livechat form submit silently failing on invalid url/number fields 2026-07-08 01:32:58 +05:30
Abhinav Raut 2bfe242933 Merge pull request #261 from josephsellers/delete-private-notes
delete pvt notes
2026-07-08 01:09:59 +05:30
Abhinav Raut 60ebefebdc fix edge cases in private note soft-delete 2026-07-08 01:00:24 +05:30
Abhinav Raut 43b43a82ef Merge branch 'main' into delete-private-notes 2026-07-08 00:47:28 +05:30
Abhinav Raut d696b53c80 soft-delete private notes with a tombstone instead of removing them 2026-07-08 00:43:29 +05:30