diff --git a/Gemfile b/Gemfile index bd7efe1..bdba49c 100755 --- a/Gemfile +++ b/Gemfile @@ -60,6 +60,7 @@ gem 'aws-actionmailbox-ses', '~> 0' ##-- gems for database --# gem 'groupdate' +gem 'fiddle' gem 'pg' gem 'redis' gem 'redis-namespace' diff --git a/Gemfile.lock b/Gemfile.lock index 6b54493..55eec3a 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -338,6 +338,7 @@ GEM ffi-compiler (1.0.1) ffi (>= 1.0.0) rake + fiddle (1.1.8) flag_shih_tzu (0.3.23) foreman (0.87.2) fugit (1.11.1) @@ -1071,6 +1072,7 @@ DEPENDENCIES faker faraday_middleware-aws-sigv4 fcm + fiddle flag_shih_tzu foreman geocoder @@ -1180,7 +1182,7 @@ DEPENDENCIES working_hours RUBY VERSION - ruby 3.4.4p34 + ruby 3.4.4p34 BUNDLED WITH - 2.5.5 + 2.5.5 diff --git a/app/javascript/dashboard/api/inbox/jasmine.js b/app/javascript/dashboard/api/inbox/jasmine.js index 8f25187..bc9aac7 100644 --- a/app/javascript/dashboard/api/inbox/jasmine.js +++ b/app/javascript/dashboard/api/inbox/jasmine.js @@ -46,23 +46,32 @@ class JasmineAPI extends ApiClient { } unlinkCollection(inboxId, collectionId) { - return axios.delete(`${this.url}/${inboxId}/jasmine/collections/${collectionId}`); + return axios.delete( + `${this.url}/${inboxId}/jasmine/collections/${collectionId}` + ); } // Documents getDocuments(collectionId) { - return axios.get(`${this.jasmineUrl}/collections/${collectionId}/documents`); + return axios.get( + `${this.jasmineUrl}/collections/${collectionId}/documents` + ); } uploadDocument(collectionId, content, title) { - return axios.post(`${this.jasmineUrl}/collections/${collectionId}/documents`, { - title, - content, - }); + return axios.post( + `${this.jasmineUrl}/collections/${collectionId}/documents`, + { + title, + content, + } + ); } deleteDocument(collectionId, documentId) { - return axios.delete(`${this.jasmineUrl}/collections/${collectionId}/documents/${documentId}`); + return axios.delete( + `${this.jasmineUrl}/collections/${collectionId}/documents/${documentId}` + ); } // Playground @@ -85,4 +94,3 @@ class JasmineAPI extends ApiClient { } export default new JasmineAPI(); - diff --git a/app/javascript/dashboard/composables/usePolicy.js b/app/javascript/dashboard/composables/usePolicy.js index ed4005c..ff5a6d4 100755 --- a/app/javascript/dashboard/composables/usePolicy.js +++ b/app/javascript/dashboard/composables/usePolicy.js @@ -109,7 +109,8 @@ export function usePolicy() { if (!flag) return false; // Bypass paywall for Captain in development - if (['captain_integration', 'captain_integration_v2'].includes(flag)) return false; + if (['captain_integration', 'captain_integration_v2'].includes(flag)) + return false; if (isACustomBrandedInstance.value) { // custom branded instances never show paywall diff --git a/app/javascript/dashboard/i18n/locale/en/index.js b/app/javascript/dashboard/i18n/locale/en/index.js index 3cb3ef8..640e483 100755 --- a/app/javascript/dashboard/i18n/locale/en/index.js +++ b/app/javascript/dashboard/i18n/locale/en/index.js @@ -40,6 +40,7 @@ import whatsappTemplates from './whatsappTemplates.json'; import contentTemplates from './contentTemplates.json'; import mfa from './mfa.json'; import yearInReview from './yearInReview.json'; +import jasmine from './jasmine.json'; export default { ...advancedFilters, @@ -84,4 +85,5 @@ export default { ...contentTemplates, ...mfa, ...yearInReview, + ...jasmine, }; diff --git a/app/javascript/dashboard/i18n/locale/en/jasmine.json b/app/javascript/dashboard/i18n/locale/en/jasmine.json new file mode 100644 index 0000000..d840557 --- /dev/null +++ b/app/javascript/dashboard/i18n/locale/en/jasmine.json @@ -0,0 +1,72 @@ +{ + "JASMINE": { + "HEADER": { + "TITLE": "Jasmine AI Agents", + "DESCRIPTION": "Manage your AI SDR agents. Select an inbox to configure your knowledge base.", + "EMPTY": "No inboxes found" + }, + "CONFIG": { + "TITLE": "Jasmine AI Configuration", + "DESCRIPTION": "Configure the AI agent for this inbox.", + "ENABLE": "Enable Jasmine AI Agent", + "SYSTEM_PROMPT": "System Prompt", + "SYSTEM_PROMPT_HELP": "Define the persona and behavioral rules for the agent.", + "UPDATE_BUTTON": "Update Configuration" + }, + "KNOWLEDGE_BASE": { + "TITLE": "Knowledge Base", + "DESCRIPTION": "Manage knowledge collections for this inbox", + "ADD_BUTTON": "+ New Collection", + "DOCUMENTS": "Documents", + "LOADING_DOCS": "Loading documents...", + "UNTITLED_DOC": "Untitled Document", + "NO_DOCS": "No documents yet. Add your first document below.", + "ADD_DOC_HEADER": "Add New Document", + "DOC_TITLE_PLACEHOLDER": "Document title (optional)", + "DOC_CONTENT_PLACEHOLDER": "Paste or type your knowledge content here...", + "ADD_DOC_BUTTON": "Add Document", + "NO_COLLECTIONS": "No collections yet. Create one to get started.", + "CREATE_MODAL": { + "TITLE": "Create Collection", + "NAME_PLACEHOLDER": "Collection name", + "VISIBILITY_PRIVATE": "Private (This inbox only)", + "VISIBILITY_SHARED": "Shared (All inboxes)", + "CANCEL": "Cancel", + "CREATE": "Create" + }, + "DELETE_CONFIRM": "Are you sure you want to delete this document?", + "DOCUMENT_DELETE_SUCCESS": "Document deleted successfully", + "COLLECTION_DELETE_SUCCESS": "Collection deleted successfully", + "SAVE_SUCCESS": "Changes saved successfully", + "DOCUMENT_CREATE_SUCCESS": "Document created successfully", + "COLLECTION_CREATE_SUCCESS": "Collection created successfully" + }, + "PLAYGROUND": { + "TITLE": "Jasmine AI Playground", + "DESCRIPTION": "Test Jasmine responses in real-time before enabling for customers.", + "SELECT_INBOX": "Select an Inbox to test", + "CHOOSE_INBOX": "Choose an inbox...", + "WARNING": "Make sure Jasmine is enabled and configured for this inbox", + "EMPTY_STATE_TITLE": "Send a message to test Jasmine", + "EMPTY_STATE_EXAMPLES": "Try: \"Hello\", \"How much does it cost?\", \"How does it work?\"", + "LOADING": "Jasmine is thinking...", + "INPUT_PLACEHOLDER": "Type a test message...", + "CLEAR_TOOLTIP": "Clear conversation", + "NO_INBOX_SELECTED": "Select an inbox above to start testing" + }, + "INBOX_LIST": { + "ACTIVE": "Active", + "CONFIGURE": "Configure", + "DESCRIPTION": "Channel {channel} configured for Jasmine AI" + }, + "WUZAPI": { + "STATUS": "Status: {status}", + "ACCOUNT_ERROR": "Error: Account ID not loaded. Please refresh the page.", + "CONNECT_FALLBACK": "Click to initiate connection", + "CONNECT_BUTTON_FALLBACK": "Connect WhatsApp", + "WEBHOOK_SECTION": "Webhook Configuration", + "GET_WEBHOOK_INFO": "Get Webhook Info", + "UPDATE_WEBHOOK": "Update Webhook Connection" + } + } +} diff --git a/app/javascript/dashboard/routes/dashboard/jasmine/jasmine.routes.js b/app/javascript/dashboard/routes/dashboard/jasmine/jasmine.routes.js index 5ff1528..4fea3a8 100644 --- a/app/javascript/dashboard/routes/dashboard/jasmine/jasmine.routes.js +++ b/app/javascript/dashboard/routes/dashboard/jasmine/jasmine.routes.js @@ -44,4 +44,3 @@ const routes = [ ]; export default routes; - diff --git a/app/javascript/dashboard/routes/dashboard/jasmine/pages/JasmineInboxes.vue b/app/javascript/dashboard/routes/dashboard/jasmine/pages/JasmineInboxes.vue index 1d08a98..5b0327c 100644 --- a/app/javascript/dashboard/routes/dashboard/jasmine/pages/JasmineInboxes.vue +++ b/app/javascript/dashboard/routes/dashboard/jasmine/pages/JasmineInboxes.vue @@ -45,8 +45,8 @@ const getChannelName = channelType => { > @@ -64,14 +64,12 @@ const getChannelName = channelType => { class="flex items-center justify-center size-12 rounded-lg bg-n-blue-2" > @@ -83,13 +81,20 @@ const getChannelName = channelType => { {{ inbox.name }} -