SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.
JavaScript a2aagentic-aiai-agentsdevtoolsmcp-clientn8n-alternativeno-codeopen-sourceorchestrationsmythosvisual-builder
Voice Embodiment (#153)
Muhammad Hamza Khan4adf38199a46
diff --git a/packages/app/src/builder-ui/pages/builder/agent-settings.ts b/packages/app/src/builder-ui/pages/builder/agent-settings.tsindex bfc80df7..c7b566e4 100644--- a/packages/app/src/builder-ui/pages/builder/agent-settings.ts+++ b/packages/app/src/builder-ui/pages/builder/agent-settings.ts@@ -936,6 +936,7 @@ export async function openAlexaEmbodiment() {return;}+ const voiceUrl = testDomain ? `${scheme}://${testDomain}/emb/voice` : '';const testUrl = testDomain ? `${scheme}://${testDomain}/alexa` : '';const prodUrl = prodDomain ? `${scheme}://${prodDomain}/alexa` : 'Agent is not deployed yet';@@ -999,8 +1000,24 @@ export async function openAlexaEmbodiment() {</button>`;const content = wrapContent(`<div class="emb-instructions p-4 flex-row">- <div class="flex items-center gap-2 mb-4">- <p class="text-gray-700">Publish your agent as an Alexa Skill. You can publish your skill to the Alexa Skill Store or use it in your own Alexa devices.</p>+ <div>+ <div class="flex items-center justify-between">+ <label class="block text-sm font-medium text-gray-700 mb-1">Talk to Agent</label>+ <a href="${voiceUrl}" target="_blank" rel="noopener noreferrer">+ <div class="text-[#3C89F9] text-[13px] font-medium cursor-pointer flex items-center gap-1">Start Voice Chat+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">+ <path d="M6.74674 2.3335H5.34389C3.49341 2.3335 2.33301 3.64376 2.33301 5.49802V10.5023C2.33301 12.3566 3.48775 13.6668 5.34389 13.6668H10.6542C12.5109 13.6668 13.6663 12.3566 13.6663 10.5023V9.4061" stroke="#3C89F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+ <path d="M13.6668 5.38279V2.3335M13.6668 2.3335H10.6176M13.6668 2.3335L8.91309 7.08723" stroke="#3C89F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+ </svg>+ </div>+ </a>+ </div>+ <p class="text-gray-700 font-normal">Starts a live voice session with the agent.</p>+ </div>+ <hr class="my-4"/>+ <div class="mb-4">+ <label class="block text-sm font-medium text-gray-700 mb-1">Alexa Integration</label>+ <p class="text-gray-700 font-normal">Publish as an Alexa Skill or deploy across managed Echo devices</p></div><div class="space-x-3 justify-between"><div class="space-y-4">@@ -1057,7 +1074,6 @@ export async function openAlexaEmbodiment() {</div></div> <br />- <hr /><!-- Modal --><div id="alexa-publish-modal" class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center">diff --git a/packages/app/src/builder-ui/ui/dialogs.ts b/packages/app/src/builder-ui/ui/dialogs.tsindex 666ec76d..72af72f0 100644--- a/packages/app/src/builder-ui/ui/dialogs.ts+++ b/packages/app/src/builder-ui/ui/dialogs.ts@@ -366,6 +366,7 @@ export async function createEmbodimentSidebar(title?, content?, actions?, toolti'Custom GPT': 'Test in ChatGPT','Postman Integration': 'Test in Postman',LLM: 'Test as LLM',+ 'Alexa Skill': 'Test with Voice',};let currentKey = null;// Create tabs from EMBODIMENT_DESCRIPTIONS@@ -1951,7 +1952,7 @@ function getNavText(key: string, title: string): string {postman: 'Postman',chatgpt: 'GPT',agent_skill: 'Form',- alexa: 'Alexa',+ alexa: 'Voice',mcp: 'MCP',};diff --git a/packages/app/src/react/features/agent-settings/dialogs/Voice.tsx b/packages/app/src/react/features/agent-settings/dialogs/Voice.tsxnew file mode 100644index 00000000..b213114c--- /dev/null+++ b/packages/app/src/react/features/agent-settings/dialogs/Voice.tsx@@ -0,0 +1,306 @@+import { Dialog, Transition } from '@headlessui/react';+import { mapVoiceEmbodimentProperties } from '@react/features/agent-settings/utils';+import { Button } from '@react/shared/components/ui/newDesign/button';+import { Spinner } from '@react/shared/components/ui/spinner';+import { EMBODIMENT_TYPE } from '@react/shared/enums';+import { TVoiceProperties } from '@react/shared/types/embodiment.types';+import { extractError } from '@react/shared/utils/errors';+import { validateDomains, validateURL } from '@react/shared/utils/utils';+import { CloseIcon } from '@src/react/shared/components/svgs';+import { Agent } from '@src/react/shared/types/agent-data.types';+import { VoiceEmbodimentData } from '@src/react/shared/types/api-results.types';+import { errorToast, successToast, warningToast } from '@src/shared/components/toast';+import { useQueryClient } from '@tanstack/react-query';+import { Tooltip } from 'flowbite-react';+import { ErrorMessage, Field, Form, Formik, FormikProps } from 'formik';+import { Info } from 'lucide-react';+import { Fragment, useEffect, useState } from 'react';+import { saveEmbodiment } from '../clients';++interface IVoiceDialogProps {+ isOpen: boolean;+ closeModal: () => void;+ currentData: { id: string; properties: TVoiceProperties };+ activeAgent: Agent;+ agentId: string;+}++const VoiceDialog = ({+ isOpen,+ closeModal,+ currentData,+ activeAgent,+ agentId,+}: IVoiceDialogProps) => {+ const [activeData, setActiveData] = useState(null);+ const [isSubmitting, setIsSubmitting] = useState(false);+ const [domainError, setDomainError] = useState(false);+ const queryClient = useQueryClient();++ // Default values to prevent uncontrolled to controlled input warning+ const defaultFormValues = {+ name: '',+ allowedDomains: [],+ };++ useEffect(() => {+ const properties = currentData?.properties;+ const _activeData = mapVoiceEmbodimentProperties(properties, activeAgent);++ setActiveData(_activeData);+ }, [currentData, activeAgent]);++ const submitForm = async (data) => {+ if (isSubmitting) {+ return; // If submission is already in progress, do nothing+ }++ if (data.allowedDomains?.filter((domain) => domain)?.length > 0) {+ const hasInvalidDomains = !validateDomains(data.allowedDomains);++ if (hasInvalidDomains) {+ setDomainError(true);+ return;+ }+ }++ if (data.icon && !validateURL(data.icon)) {+ warningToast('The URL entered for icon does not appear to be valid.');+ }++ try {+ setIsSubmitting(true); // Set the flag to true to indicate that submission is in progress+ const dataToSend = {+ type: EMBODIMENT_TYPE.ALEXA,+ properties: {+ ...data,+ allowedDomains: data?.allowedDomains+ ?.filter((domain) => domain && domain.trim() !== '')+ ?.map((item) => item.trim()),+ },+ };++ try {+ await saveEmbodiment(+ currentData ? 'PUT' : 'POST',+ currentData+ ? { ...dataToSend, embodimentId: currentData?.id }+ : { ...dataToSend, aiAgentId: agentId },+ );+ // Invalidate the agentEmbodiments query to ensure fresh data+ queryClient.invalidateQueries({ queryKey: ['agentEmbodiments', agentId] });+ // Also invalidate the embodiments query used in deploy modal+ queryClient.invalidateQueries({ queryKey: ['embodiments', agentId] });+ // Invalidate the agent_embodiments query used in OverviewWidgetsContainer+ queryClient.invalidateQueries({ queryKey: ['agent_embodiments', agentId] });+ // Invalidate the availableEmbodiments query+ queryClient.invalidateQueries({ queryKey: ['availableEmbodiments', agentId] });++ successToast('Embodiment saved');+ closeModal();+ } catch (error) {+ errorToast(extractError(error) || 'Embodiment not saved. Please try again.');+ }++ setIsSubmitting(false); // Reset the flag after submission is complete+ } catch (error) {+ console.error('Error:', error);+ }+ };++ return (+ <Transition appear show={isOpen} as={Fragment}>+ <Dialog as="div" className="relative z-50" onClose={closeModal}>+ <Transition.Child+ as={Fragment}+ enter="ease-out duration-300"+ enterFrom="opacity-0"+ enterTo="opacity-100"+ leave="ease-in duration-200"+ leaveFrom="opacity-100"+ leaveTo="opacity-0"+ >+ <div className="fixed inset-0 bg-black bg-opacity-25" />+ </Transition.Child>++ <div className="fixed inset-0 overflow-y-auto">+ <div className="flex min-h-full items-center justify-center p-4 text-center">+ <Transition.Child+ as={Fragment}+ enter="ease-out duration-300"+ enterFrom="opacity-0 scale-95"+ enterTo="opacity-100 scale-100"+ leave="ease-in duration-200"+ leaveFrom="opacity-100 scale-100"+ leaveTo="opacity-0 scale-95"+ >+ <div className="w-[80vw] max-w-[600px]">+ <Dialog.Panel className="w-full relative transform overflow-hidden rounded-xl bg-white p-6 text-left align-middle shadow-xl transition-all">+ <Dialog.Title className="text-xl font-semibold leading-6 text-[#1E1E1E] mb-4 flex justify-between items-center">+ <span>Voice Configuration</span>+ <div+ className="cursor-pointer w-8 h-8 bg-transparent rounded-lg hover:text-gray-900 hover:bg-gray-100 p-2 -mr-2 -mt-2"+ onClick={() => closeModal()}+ >+ <CloseIcon width={16} height={16} />+ </div>+ </Dialog.Title>+ <Formik+ initialValues={activeData || defaultFormValues}+ enableReinitialize={true}+ // validate={(values) => validateForm(values)}+ onSubmit={(values) => {+ submitForm(values);+ }}+ >+ {(props: FormikProps<VoiceEmbodimentData>) => {+ return (+ <Form>+ <div className="mt-5 space-y-4">+ <div>+ <label+ htmlFor="name"+ className="block text-[#1E1E1E] mb-1 text-base font-normal"+ >+ Name+ </label>+ <Field+ type="text"+ className="bg-white+ border+ text-gray-900+ rounded+ block+ w-full+ outline-none+ focus:outline-none+ focus:ring-0+ focus:ring-offset-0+ focus:ring-shadow-none+ text-sm+ font-normal+ placeholder:text-sm+ placeholder:font-normal+ mb-4+ border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500"+ name="name"+ id="name"+ onChange={props.handleChange}+ onBlur={props.handleBlur}+ value={props.values?.name}+ placeholder="Enter voice name"+ disabled={true}+ />+ <ErrorMessage+ name="name"+ component="div"+ className="text-red-500 text-sm"+ />+ </div>++ {/* ALLOWED DOMAINS START */}+ <div>+ <label+ htmlFor="allowedDomains"+ className="text-[#1E1E1E] mb-1 text-base font-normal flex items-center"+ >+ Allowed Domains{' '}+ <Tooltip+ className="w-60 text-center"+ content={+ <div>+ Restrict voice to specific domains.+ <br /> Use commas to separate multiple domains (e.g.,+ example.com, mysite.org).+ <br /> Leave empty for no restrictions.+ </div>+ }+ >+ <Info className="w-5 h-5 ml-1" />+ </Tooltip>+ </label>++ <Field+ type="text"+ id="allowedDomains"+ className={`bg-white+ border+ text-gray-900+ rounded+ block+ w-full+ outline-none+ focus:outline-none+ focus:ring-0+ focus:ring-offset-0+ focus:ring-shadow-none+ text-sm+ font-normal+ placeholder:text-sm+ placeholder:font-normal+ mb-4+ border-gray-300 border-b-gray-500 focus:border-b-2 focus:border-b-blue-500 focus-visible:border-b-2 focus-visible:border-b-blue-500 ${+ domainError+ ? 'border-red-500 text-red-900 placeholder-red-700 focus:border-red-500 dark:text-red-500 dark:placeholder-red-500 dark:border-red-500'+ : ''+ }`}+ name="allowedDomains"+ placeholder="Enter comma separated values for domains"+ value={+ Array.isArray(props.values?.allowedDomains)+ ? props.values.allowedDomains.join(',')+ : props.values?.allowedDomains || ''+ }+ onChange={(e) => {+ if (domainError) {+ setDomainError(false);+ }+ const newValue = e.target.value ? e.target.value.split(',') : [];+ props.setFieldValue('allowedDomains', newValue);+ }}+ />++ {domainError && (+ <p className="mb-2 text-sm text-red-600 dark:text-red-500">+ <span className="font-medium">+ One or more domains are invalid. Make sure there is no trailing+ comma.+ </span>+ </p>+ )}++ <ErrorMessage+ name="allowedDomains"+ component="div"+ className="text-red-500 text-sm mb-2"+ />+ </div>+ {/* ALLOWED DOMAINS END */}+ </div>++ <div className="flex justify-end w-full mt-4">+ <Button+ handleClick={() => submitForm(props.values)}+ label="Save"+ addIcon={isSubmitting}+ Icon={<Spinner classes="w-4 h-4 mr-2" />}+ disabled={isSubmitting}+ type="submit"+ className="px-8 rounded-lg"+ />+ </div>+ </Form>+ );+ }}+ </Formik>+ </Dialog.Panel>+ </div>+ </Transition.Child>+ </div>+ </div>+ </Dialog>+ </Transition>+ );+};++export default VoiceDialog;diff --git a/packages/app/src/react/features/agent-settings/utils/index.ts b/packages/app/src/react/features/agent-settings/utils/index.tsindex 015016ae..f8679678 100644--- a/packages/app/src/react/features/agent-settings/utils/index.ts+++ b/packages/app/src/react/features/agent-settings/utils/index.ts@@ -5,6 +5,7 @@ import {TChatBotProperties,TFormPreviewProperties,TGptEmbodimentProperties,+ TVoiceProperties,} from '@react/shared/types/embodiment.types';import * as Yup from 'yup';@@ -134,6 +135,13 @@ export const mapFormPreviewEmbodimentProperties = (};};+export const mapVoiceEmbodimentProperties = (properties: TVoiceProperties, activeAgent) => {+ return {+ name: properties?.name || activeAgent?.name || '',+ allowedDomains: properties?.allowedDomains || [],+ };+};+export const mapGptEmbodimentProperties = (properties: TGptEmbodimentProperties, activeAgent) => {return {humanName: properties?.humanName || activeAgent?.name || '',diff --git a/packages/app/src/react/features/agents/components/modals/deploy-agent-modal.tsx b/packages/app/src/react/features/agents/components/modals/deploy-agent-modal.tsxindex 11470041..9f051825 100644--- a/packages/app/src/react/features/agents/components/modals/deploy-agent-modal.tsx+++ b/packages/app/src/react/features/agents/components/modals/deploy-agent-modal.tsx@@ -33,7 +33,7 @@ import { CloseIcon } from '../../../../shared/components/svgs';import Modal from '../../../../shared/components/ui/modals/Modal';import { EMBODIMENT_TYPE } from '../../../../shared/enums';import { Embodiment } from '../../../../shared/types/api-results.types';-import AlexaEmbodimentModal from '../../../embodiments/alexa-embodiment-modal';+import VoiceEmbodimentModal from '../../../embodiments/alexa-embodiment-modal';import ApiEmbodimentModal from '../../../embodiments/api-embodiment-modal';import ChatbotEmbodimentModal from '../../../embodiments/chatbot-embodiment-modal';import { globalModalManager } from '../../../embodiments/embodiment-settings';@@ -160,8 +160,8 @@ function DeployAgentModal({ userInfo, deploymentSidebarCtx }) {}: undefined;- // Get domain for chatbot integration- const chatbotDomain =+ // Get domain for chatbot/voice/form integration+ const agentDomain =workspace.agent.domain ||`${workspace.agent.id}.${statusInfoQuery.data?.status?.prod_agent_domain}`;@@ -439,12 +439,14 @@ function DeployAgentModal({ userInfo, deploymentSidebarCtx }) {return (<>- {openPanel === 'alexa' && <AlexaEmbodimentModal onClose={handleClosePanel} />}+ {openPanel === 'alexa' && (+ <VoiceEmbodimentModal domain={agentDomain} onClose={handleClosePanel} />+ )}{openPanel === 'gpt' && <GptEmbodimentModal onClose={handleClosePanel} />}{openPanel === 'chatbot' && (<ChatbotEmbodimentModalonClose={handleClosePanel}- domain={chatbotDomain}+ domain={agentDomain}embodimentData={chatbotEmbodimentData}isLoading={isLoadingEmbodiments}/>@@ -452,7 +454,7 @@ function DeployAgentModal({ userInfo, deploymentSidebarCtx }) {{openPanel === 'form' && (<FormEmbodimentModalonClose={handleClosePanel}- domain={chatbotDomain}+ domain={agentDomain}isLoading={isLoadingEmbodiments}/>)}diff --git a/packages/app/src/react/features/embodiments/alexa-embodiment-modal.tsx b/packages/app/src/react/features/embodiments/alexa-embodiment-modal.tsxindex 62f4c991..e6eb6291 100644--- a/packages/app/src/react/features/embodiments/alexa-embodiment-modal.tsx+++ b/packages/app/src/react/features/embodiments/alexa-embodiment-modal.tsx@@ -1,27 +1,41 @@import { builderStore } from '@src/shared/state_stores/builder/store';-import React from 'react';-import { CopyIcon } from '../../shared/components/svgs';+import { ArrowRightIcon } from 'lucide-react';+import React, { useState } from 'react';+import { CheckIcon, CopyIcon } from '../../shared/components/svgs';import { Input } from '../../shared/components/ui/input';import ModalHeaderEmbodiment from './modal-header-embodiment';/**- * Props for the AlexaEmbodimentModal component.+ * Props for the VoiceEmbodimentModal component.*/-interface AlexaEmbodimentModalProps {+interface VoiceEmbodimentModalProps {/*** Callback to close the modal (also used for back button).*/onClose: () => void;+ /**+ * Domain for the Voice integration.+ */+ domain: string;}/**- * Alexa Integration Modal for showing step-by-step instructions and Dev/Prod URLs.+ * Voice Integration Modal for showing step-by-step instructions and Dev/Prod URLs.* Matches the design and UX of Custom GPT Modal.*- * @param {AlexaEmbodimentModalProps} props - The component props.+ * @param {VoiceEmbodimentModalProps} props - The component props.* @returns {JSX.Element} The rendered modal.*/-const AlexaEmbodimentModal: React.FC<AlexaEmbodimentModalProps> = ({ onClose }) => {+const VoiceEmbodimentModal: React.FC<VoiceEmbodimentModalProps> = ({+ onClose,+ domain = 'your-domain.com',+}) => {+ const [copied, setCopied] = useState({+ voice: false,+ alexaDev: false,+ alexaProd: false,+ });+// Get agent domains and scheme from builderStoreconst { dev: devDomain, prod: prodDomain, scheme } = builderStore.getState().agentDomains;@@ -33,30 +47,115 @@ const AlexaEmbodimentModal: React.FC<AlexaEmbodimentModalProps> = ({ onClose })* Copies the given text to clipboard.* @param {string} text - The text to copy.*/- const handleCopy = (text: string): void => {+ const handleCopy = (text: string, type: 'voice' | 'alexaDev' | 'alexaProd'): void => {+ setCopied({ ...copied, [type]: true });void navigator.clipboard.writeText(text);+ setTimeout(() => {+ setCopied({ ...copied, [type]: false });+ }, 2000);+ };++ /**+ * Ensures domain has proper protocol prefix.+ * @param {string} domain - The domain to format.+ * @returns {string} The formatted domain with protocol.+ */+ const getFullDomain = (domain: string): string => {+ // Check if the domain already includes http:// or https://+ if (!/^https?:\/\//i.test(domain)) {+ // Assume HTTPS by default+ return `https://${domain}`;+ }+ return domain;};+ const codeSnippet = `<script src="${getFullDomain(domain)}/static/embodiment/voice/voice-embodiment-minified.js">+ </script>+ <script>+ VoiceEmbodiment.init({+ domain: '${domain}',+ });+ </script>`;++ const previewUrl = `${getFullDomain(domain)}/emb/voice`;+return (<div className="fixed inset-0 bg-black/25 flex items-center justify-center z-50">- <div className="relative bg-white rounded-2xl shadow-lg w-full p-6 flex flex-col gap-4 overflow-auto max-h-[90vh] max-w-[480px]">+ <div className="relative bg-white rounded-2xl shadow-lg w-full p-6 flex flex-col overflow-auto max-h-[90vh] max-w-[480px]">{/* Header with back and close buttons */}<ModalHeaderEmbodiment- title="Alexa Integration"+ title="Voice and Alexa Integration"onBack={onClose}onClose={onClose}/>+ {codeSnippet && (+ <>+ <div className="flex items-center justify-between mt-4">+ <label className="block text-base font-semibold text-gray-700">+ Voice Integration+ </label>+ <a+ href={previewUrl}+ target="_blank"+ rel="noopener noreferrer"+ className="inline-flex items-center gap-1 text-[13px] text-[#707070]"+ >+ Preview <ArrowRightIcon className="w-4 h-4" />+ </a>+ </div>+ <div className="bg-amber-50 border border-amber-200 rounded-md p-3 my-2 mb-4">+ <p className="text-amber-800 text-xs">+ <strong>Note:</strong> To use voice embodiment, you need to provide personal OpenAI+ API key via{' '}+ <a href="/vault" target="_blank" rel="noopener noreferrer" className="underline">+ Vault+ </a>+ .+ </p>+ </div>+ <label htmlFor="code-snippet" className="text-sm text-gray-900">+ Code Snippet+ </label>+ <p className="text-sm text-gray-700 my-2">+ To integrate voice embodiment, copy and paste this snippet into your website before+ the closing <code></body></code> tag.+ </p>+ <div className="relative flex items-center mt-1 group w-full">+ <textarea+ id="code-snippet"+ readOnly+ className="w-full h-40 p-3 text-sm text-[#707070] bg-white rounded-lg border border-gray-200 font-mono resize-none focus:outline-none focus:border-b-2 focus:border-b-blue-500 transition-colors"+ value={codeSnippet}+ />+ <button+ type="button"+ aria-label="Copy Voice Integration"+ onClick={() => handleCopy(codeSnippet, 'voice')}+ className={`absolute right-2 top-2 opacity-0 group-hover:opacity-100 transition-opacity bg-white p-1 ${copied.voice ? 'opacity-100' : ''}`}+ tabIndex={-1}+ >+ {copied.voice ? <CheckIcon fill="#222" /> : <CopyIcon color="#222" />}+ </button>+ </div>+ </>+ )}++ <hr className="my-4" />+ <label className="block text-base font-semibold text-gray-700 mb-2">+ Alexa Integration+ </label>{/* Description */}<p className="text-sm text-gray-700 mb-4">- Publish your agent as an Alexa Skill. You can publish your skill to the Alexa Skill Store or use it in your own Alexa devices.+ Publish your agent as an Alexa Skill. You can publish your skill to the Alexa Skill Store+ or use it in your own Alexa devices.</p>{/* Dev URL */}{devUrl && (<>- <div className="text-sm text-gray-900 -mb-4">Alexa Dev URL</div>- <div className="relative flex items-center mt-1 group w-full">+ <div className="text-sm text-gray-900">Alexa Dev URL</div>+ <div className="relative flex items-center my-1 mb-2 group w-full"><Inputtype="text"value={devUrl}@@ -68,11 +167,11 @@ const AlexaEmbodimentModal: React.FC<AlexaEmbodimentModalProps> = ({ onClose })<buttontype="button"aria-label="Copy Alexa Dev URL"- onClick={() => handleCopy(devUrl)}- className="absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-white p-1"+ onClick={() => handleCopy(devUrl, 'alexaDev')}+ className={`absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-white p-1 ${copied.alexaDev ? 'opacity-100' : ''}`}tabIndex={-1}>- <CopyIcon color="#222" />+ {copied.alexaDev ? <CheckIcon fill="#222" /> : <CopyIcon color="#222" />}</button></div></>@@ -81,7 +180,7 @@ const AlexaEmbodimentModal: React.FC<AlexaEmbodimentModalProps> = ({ onClose }){/* Prod URL */}{prodUrl && (<>- <div className="text-sm text-gray-900 -mb-4">Alexa Prod URL</div>+ <div className="text-sm text-gray-900">Alexa Prod URL</div><div className="relative flex items-center mt-1 group w-full"><Inputtype="text"@@ -94,11 +193,11 @@ const AlexaEmbodimentModal: React.FC<AlexaEmbodimentModalProps> = ({ onClose })<buttontype="button"aria-label="Copy Alexa Prod URL"- onClick={() => handleCopy(prodUrl)}- className="absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-white p-1"+ onClick={() => handleCopy(prodUrl, 'alexaProd')}+ className={`absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-white p-1 ${copied.alexaProd ? 'opacity-100' : ''}`}tabIndex={-1}>- <CopyIcon color="#222" />+ {copied.alexaProd ? <CheckIcon fill="#222" /> : <CopyIcon color="#222" />}</button></div></>@@ -108,4 +207,4 @@ const AlexaEmbodimentModal: React.FC<AlexaEmbodimentModalProps> = ({ onClose }));};-export default AlexaEmbodimentModal;\ No newline at end of file+export default VoiceEmbodimentModal;diff --git a/packages/app/src/react/features/embodiments/embodiment-configs.tsx b/packages/app/src/react/features/embodiments/embodiment-configs.tsxindex 482bc383..9083f2f8 100644--- a/packages/app/src/react/features/embodiments/embodiment-configs.tsx+++ b/packages/app/src/react/features/embodiments/embodiment-configs.tsx@@ -1,10 +1,16 @@import { createPortal } from 'react-dom';import { FaCommentDots, FaDiscord, FaGear, FaIdCard, FaRobot } from 'react-icons/fa6';-import { AlexaIcon, ChatGptIcon, LovableIcon, MCPIcon } from '../../shared/components/svgs';+import {+ ChatGptIcon,+ LovableIcon,+ MCPIcon,+ VoiceEmbodimentIcon,+} from '../../shared/components/svgs';import { EMBODIMENT_TYPE } from '../../shared/enums';import ChatBotDialog from '../agent-settings/dialogs/ChatBot';import ChatGptDialog from '../agent-settings/dialogs/ChatGpt';import FormPreviewDialog from '../agent-settings/dialogs/FormPreview';+import VoiceDialog from '../agent-settings/dialogs/Voice';import ChatbotEmbodimentModal from './chatbot-embodiment-modal';import FormEmbodimentModal from './form-embodiment-modal';import GptEmbodimentModal from './gpt-embodiment-modal';@@ -34,7 +40,7 @@ export const getEmbodimentIcon = (embodimentType: string, classes = ''): JSX.Elecase EMBODIMENT_TYPE.LLM:return <FaRobot className={classes} style={{ marginTop: '-3px' }} />;case EMBODIMENT_TYPE.ALEXA:- return <AlexaIcon className={classes} />;+ return <VoiceEmbodimentIcon className={classes} />;case EMBODIMENT_TYPE.LOVABLE:return <LovableIcon className={classes} />;default:@@ -50,6 +56,8 @@ export const getEmbodimentTitle = (embodimentType: string): string => {return 'MCP';case EMBODIMENT_TYPE.FORM:return 'Form Preview';+ case EMBODIMENT_TYPE.ALEXA:+ return 'Voice';default:return embodimentType;}@@ -66,7 +74,7 @@ export const getEmbodimentDescription = (embodimentType: string): string => {case EMBODIMENT_TYPE.MCP:return 'Enable MCP Client to communicate with your agent.';case EMBODIMENT_TYPE.ALEXA:- return 'Enable Alexa to communicate with your agent.';+ return 'Enable Voice and Alexa to communicate with your agent.';case EMBODIMENT_TYPE.LLM:return 'Use your agent as an OpenAI-compatible API endpoint for seamless integration with existing LLM workflows.';case EMBODIMENT_TYPE.FORM:@@ -155,8 +163,6 @@ export const getFormPreviewDialog = (agent,agentId,currentData,- refreshEmbodiments,- activeModal,) => {// Always render the component for preloading, HeadlessUI Transition handles visibility// This ensures the component is initialized and ready when the user opens it@@ -172,6 +178,26 @@ export const getFormPreviewDialog = ();};+export const getVoiceDialog = (+ isOpen: boolean,+ closeModal: () => void,+ agent,+ agentId,+ currentData,+) => {+ // Always render the component for preloading, HeadlessUI Transition handles visibility+ // This ensures the component is initialized and ready when the user opens it+ return (+ <VoiceDialog+ isOpen={isOpen}+ closeModal={closeModal}+ activeAgent={agent}+ agentId={agentId}+ currentData={currentData}+ />+ );+};+export const getCodeSnippetModal = (embodimentType: EMBODIMENT_TYPE.FORM | EMBODIMENT_TYPE.CHAT_BOT | EMBODIMENT_TYPE.CHAT_GPT,isOpen: boolean,diff --git a/packages/app/src/react/features/embodiments/embodiment-helper.ts b/packages/app/src/react/features/embodiments/embodiment-helper.tsindex 103ae86a..2cc4c055 100644--- a/packages/app/src/react/features/embodiments/embodiment-helper.ts+++ b/packages/app/src/react/features/embodiments/embodiment-helper.ts@@ -13,6 +13,7 @@ import {getEmbodimentIcon,getEmbodimentTitle,getFormPreviewDialog,+ getVoiceDialog,} from './embodiment-configs';type AgentSetting = {@@ -153,8 +154,18 @@ export function structureAgentSetting(modalHandlers.embodimentsData?.find((e) => e.aiAgentId === agentData.agentId && e.type === EMBODIMENT_TYPE.FORM,),- modalHandlers.refreshEmbodiments,- modalHandlers.activeModal,+ );+ }++ if (key === EMBODIMENT_TYPE.ALEXA) {+ result.dialogComponent = getVoiceDialog(+ modalHandlers.activeModal === key, // Pass visibility state+ modalHandlers.closeModal,+ modalHandlers.agent,+ agentData.agentId,+ modalHandlers.embodimentsData?.find(+ (e) => e.aiAgentId === agentData.agentId && e.type === EMBODIMENT_TYPE.ALEXA,+ ),);}@@ -164,7 +175,11 @@ export function structureAgentSetting((key === EMBODIMENT_TYPE.CHAT_BOT ||key === EMBODIMENT_TYPE.FORM ||key === EMBODIMENT_TYPE.CHAT_GPT) &&- shouldCodeSnippetVisible(key, agentData)+ shouldCodeSnippetVisible(key, {+ canUseEmbodiments: agentData.canUseEmbodiments,+ isReadOnlyAccess: agentData.isReadOnlyAccess,+ agentDeployed: !!agentData.agentDeployed,+ })) {result.codeSnippetComponent = getCodeSnippetModal(key,diff --git a/packages/app/src/react/features/embodiments/form-embodiment-modal.tsx b/packages/app/src/react/features/embodiments/form-embodiment-modal.tsxindex 51a3fe9f..33bd605c 100644--- a/packages/app/src/react/features/embodiments/form-embodiment-modal.tsx+++ b/packages/app/src/react/features/embodiments/form-embodiment-modal.tsx@@ -138,10 +138,13 @@ const FormEmbodimentModal: FC<FormEmbodimentModalProps> = ({<label htmlFor="api-endpoint" className="block font-semibold text-gray-700">Select A Form</label>- <a href={previewUrl} target="_blank" rel="noopener noreferrer">- <span className="text-[#707070] flex items-center gap-1">- Preview <ArrowRightIcon className="w-5 h-5" />- </span>+ <a+ href={previewUrl}+ target="_blank"+ rel="noopener noreferrer"+ className="inline-flex items-center gap-1 text-[13px] text-[#707070]"+ >+ Preview <ArrowRightIcon className="w-4 h-4" /></a></div><div className="">diff --git a/packages/app/src/react/features/embodiments/post-deployment-modal.tsx b/packages/app/src/react/features/embodiments/post-deployment-modal.tsxindex 8c731132..46134da6 100644--- a/packages/app/src/react/features/embodiments/post-deployment-modal.tsx+++ b/packages/app/src/react/features/embodiments/post-deployment-modal.tsx@@ -62,7 +62,7 @@ interface Props {*/onOpenCodeSnippetModal: (key: string) => void;/**- * Called when the user requests to open the Alexa panel.+ * Called when the user requests to open the Voice panel.*/onOpenAlexaPanel: () => void;/**@@ -96,13 +96,8 @@ interface Props {* Renders as a card, not a modal overlay. No close icon.*/function PostDeploymentModal({- userInfo,- onClose,- onReopenDeployModal,onOpenLlmModal,onOpenCustomGptModal,- onOpenDialogModal,- onOpenCodeSnippetModal,onOpenAlexaPanel,onOpenChatbotPanel,onOpenFormPanel,@@ -113,7 +108,6 @@ function PostDeploymentModal({}: Props) {const { workspace, allDeployments } = useDeploymentSidebarCtx();const { getPageAccess } = useAuthCtx();- const agentId: string = workspace.agent.id;const [activeTab, setActiveTab] = useState<string>('embed');// Create a unique instance identifier for this modal@@ -151,7 +145,6 @@ function PostDeploymentModal({const {isLoading: agentSettingsLoading,updateEmbodimentStatus,- refetchEmbodiments,modalHandlers,} = useAgentEmbodimentSettings(workspace?.agent?.id || '',@@ -167,12 +160,6 @@ function PostDeploymentModal({instanceId, // Pass the instance ID to the hook);- // Check if we're on the agent-settings page to avoid duplicate modals- const isOnAgentSettingsPage = window.location.pathname.includes('/agent-settings/');-- // Only render modals if we're not on the agent-settings page and this is the active instance- const shouldRenderModals = !isOnAgentSettingsPage && modalHandlers.isActiveInstance;-// Handler for toggling embodimentconst handleToggle = (setting: AgentSetting) => {if (setting.isUpdating) {@@ -212,16 +199,6 @@ function PostDeploymentModal({workspace?.agent,]);- // Type guard for Embodiment with properties- function hasProperties(obj: unknown): obj is Embodiment {- return (- typeof obj === 'object' &&- obj !== null &&- 'properties' in obj &&- typeof (obj as any).properties === 'object'- );- }-/*** Capitalizes the first letter of a string.* @param str - The string to capitalize@@ -421,6 +398,19 @@ function PostDeploymentModal({}// Alexaelse if (key === EMBODIMENT_TYPE.ALEXA) {+ if (setting.openModal) {+ buttons.push(+ <button+ key={'configuration-' + EMBODIMENT_TYPE.ALEXA}+ className="flex items-center px-2 py-1 h-8 text-xl text-blue-600 hover:bg-smythos-blue-500 hover:text-white rounded"+ onClick={() => setting.openModal()}+ type="button"+ aria-label="Configuration"+ >+ <FaSliders />+ </button>,+ );+ }buttons.push(<Buttonkey={'get-endpoints-' + EMBODIMENT_TYPE.ALEXA}diff --git a/packages/app/src/react/shared/components/svgs.tsx b/packages/app/src/react/shared/components/svgs.tsxindex 0ed95323..68611ac0 100644--- a/packages/app/src/react/shared/components/svgs.tsx+++ b/packages/app/src/react/shared/components/svgs.tsx@@ -206,16 +206,18 @@ export const RefreshIcon = ({ color, isLoading }) => (export const CopyIcon = ({ color = '#ffffff' }) => (<svg- width="20px"- height="20px"+ xmlns="http://www.w3.org/2000/svg"+ width="20"+ height="20"viewBox="0 0 24 24"fill="none"- xmlns="http://www.w3.org/2000/svg"+ stroke={color || '#000000'}+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round">- <path- d="M19.53 8L14 2.47C13.8595 2.32931 13.6688 2.25018 13.47 2.25H11C10.2707 2.25 9.57118 2.53973 9.05546 3.05546C8.53973 3.57118 8.25 4.27065 8.25 5V6.25H7C6.27065 6.25 5.57118 6.53973 5.05546 7.05546C4.53973 7.57118 4.25 8.27065 4.25 9V19C4.25 19.7293 4.53973 20.4288 5.05546 20.9445C5.57118 21.4603 6.27065 21.75 7 21.75H14C14.7293 21.75 15.4288 21.4603 15.9445 20.9445C16.4603 20.4288 16.75 19.7293 16.75 19V17.75H17C17.7293 17.75 18.4288 17.4603 18.9445 16.9445C19.4603 16.4288 19.75 15.7293 19.75 15V8.5C19.7421 8.3116 19.6636 8.13309 19.53 8ZM14.25 4.81L17.19 7.75H14.25V4.81ZM15.25 19C15.25 19.3315 15.1183 19.6495 14.8839 19.8839C14.6495 20.1183 14.3315 20.25 14 20.25H7C6.66848 20.25 6.35054 20.1183 6.11612 19.8839C5.8817 19.6495 5.75 19.3315 5.75 19V9C5.75 8.66848 5.8817 8.35054 6.11612 8.11612C6.35054 7.8817 6.66848 7.75 7 7.75H8.25V15C8.25 15.7293 8.53973 16.4288 9.05546 16.9445C9.57118 17.4603 10.2707 17.75 11 17.75H15.25V19ZM17 16.25H11C10.6685 16.25 10.3505 16.1183 10.1161 15.8839C9.8817 15.6495 9.75 15.3315 9.75 15V5C9.75 4.66848 9.8817 4.35054 10.1161 4.11612C10.3505 3.8817 10.6685 3.75 11 3.75H12.75V8.5C12.7526 8.69811 12.8324 8.88737 12.9725 9.02747C13.1126 9.16756 13.3019 9.24741 13.5 9.25H18.25V15C18.25 15.3315 18.1183 15.6495 17.8839 15.8839C17.6495 16.1183 17.3315 16.25 17 16.25Z"- fill={color || '#000000'}- />+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>+ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>);@@ -543,6 +545,22 @@ export const AlexaIcon = (props) => (</svg>);+export const VoiceEmbodimentIcon = (props) => (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="16"+ height="20"+ viewBox="0 0 16 20"+ fill="none"+ {...props}+ >+ <path+ d="M15.0883 7.82626C15.5915 7.82626 16 8.25386 16 8.78287C16 13.0866 12.8946 16.6404 8.91219 17.1178V19.0434C8.91219 19.5714 8.50373 20 8.00046 20C7.49627 20 7.08872 19.5714 7.08872 19.0434V17.1178C3.10536 16.6404 0 13.0866 0 8.78287C0 8.25386 0.408456 7.82626 0.911733 7.82626C1.41501 7.82626 1.82347 8.25386 1.82347 8.78287C1.82347 12.3558 4.59422 15.2629 8.00046 15.2629C11.4058 15.2629 14.1765 12.3558 14.1765 8.78287C14.1765 8.25386 14.585 7.82626 15.0883 7.82626ZM8.16448 0C10.4265 0 12.2609 1.92373 12.2609 4.29706V8.92033C12.2609 11.2927 10.4265 13.2174 8.16448 13.2174H7.83534C5.57333 13.2174 3.73984 11.2927 3.73984 8.92033V4.29706C3.73984 1.92373 5.57333 0 7.83534 0H8.16448Z"+ fill="#515151"+ />+ </svg>+);+export const CircleGridIcon = (props) => (<svgwidth="24"diff --git a/packages/app/src/react/shared/types/api-results.types.ts b/packages/app/src/react/shared/types/api-results.types.tsindex 8bdf7f3b..fe761824 100644--- a/packages/app/src/react/shared/types/api-results.types.ts+++ b/packages/app/src/react/shared/types/api-results.types.ts@@ -85,6 +85,11 @@ export interface FormPreviewEmbodimentData {outputPreview: boolean;}+export interface VoiceEmbodimentData {+ name: string;+ allowedDomains: string[];+}+export interface ChatbotEmbodimentData {name: string;introMessage: string;diff --git a/packages/app/src/react/shared/types/embodiment.types.ts b/packages/app/src/react/shared/types/embodiment.types.tsindex b1b367bb..12fd405f 100644--- a/packages/app/src/react/shared/types/embodiment.types.ts+++ b/packages/app/src/react/shared/types/embodiment.types.ts@@ -41,6 +41,11 @@ export type TFormPreviewProperties = {outputPreview: boolean;};+export type TVoiceProperties = {+ name: string;+ allowedDomains: string[];+};+export type TGptEmbodimentProperties = {humanName: string;modelName: string;