@moveo-ai/web-client 0.101.0 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/147.min.js.LICENSE.txt +1 -1
- package/dist/329.min.js.LICENSE.txt +1 -1
- package/dist/audio-client.min.js +1 -1
- package/dist/audio-client.min.js.LICENSE.txt +1 -1
- package/dist/audio-client.min.js.map +1 -1
- package/dist/iframe.min.js +1 -1
- package/dist/iframe.min.js.LICENSE.txt +1 -1
- package/dist/iframe.min.js.map +1 -1
- package/dist/iframe.v2.min.js +1 -1
- package/dist/iframe.v2.min.js.LICENSE.txt +1 -1
- package/dist/iframe.v2.min.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/preview-webrtc/index.html +91 -0
- package/dist/preview.css.min.js.LICENSE.txt +1 -1
- package/dist/web-client.min.js.LICENSE.txt +1 -1
- package/dist/webrtc-client.min.js +2 -0
- package/dist/webrtc-client.min.js.LICENSE.txt +46 -0
- package/dist/webrtc-client.min.js.map +1 -0
- package/package.json +8 -1
package/dist/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const widgetId = urlParams.get('widgetId');
|
|
16
16
|
const version = urlParams.get('version');
|
|
17
17
|
|
|
18
|
-
const defaultScript = 'iframe.min.js?
|
|
18
|
+
const defaultScript = 'iframe.min.js?3fd23e627a9b604b419b';
|
|
19
19
|
const versionPattern = /^v\d+$/;
|
|
20
20
|
const script = document.createElement('script');
|
|
21
21
|
script.src =
|
package/dist/preview/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="keywords" content="Moveo.ai, Preview, WebChat, WebWidget, webclient, chatbot"/><meta name="description" content="Preview and Improve your AI Agent"/><meta name="twitter:card" value="summary"><meta property="og:title" content="Moveo.ai Webchat Preview"/><meta property="og:type" content="website"/><meta property="og:url" content="https://moveo.ai"/><meta property="og:image" content="https://web-client.moveo.ai/public/og-image.jpg"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:description" content="Preview and Improve your AI Agent"/><title>Moveo.ai Client Preview</title><script src="../preview.css.min.js?
|
|
1
|
+
<!doctype html><html><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="keywords" content="Moveo.ai, Preview, WebChat, WebWidget, webclient, chatbot"/><meta name="description" content="Preview and Improve your AI Agent"/><meta name="twitter:card" value="summary"><meta property="og:title" content="Moveo.ai Webchat Preview"/><meta property="og:type" content="website"/><meta property="og:url" content="https://moveo.ai"/><meta property="og:image" content="https://web-client.moveo.ai/public/og-image.jpg"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:description" content="Preview and Improve your AI Agent"/><title>Moveo.ai Client Preview</title><script src="../preview.css.min.js?3fd23e627a9b604b419b"></script><style>body::before {
|
|
2
2
|
background-image: url('/public/background.svg');
|
|
3
3
|
}</style></head><body><div class="moveo_preview"><div class="preview_actions"><p class="header_text"><span class="colored">Preview</span> and <span class="colored">Test</span><br>your Webchat</p><p class="body_text">Moveo.ai can help you build engaging conversational applications powered by Artificial Intelligence.</p><div class="button_container"><button class="action_button" id="open-chat-button">Open Webchat</button> <button class="action_button" id="close-chat-button">Close Webchat</button> <button class="action_button" id="render-chat-button">Render Webchat</button></div></div><div id="embed-chat-container"><p id="embed-text">The webchat will render in the html element of your choice. Render the webchat here, in order to preview other settings.</p><div id="embed-chat"></div></div></div><script>// Get version from URL or default to v1
|
|
4
4
|
const queryString = window.location.search;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const version = urlParams.get('version') || 'v1';
|
|
7
7
|
|
|
8
8
|
// Find web-client.min.js directly
|
|
9
|
-
const webpackFiles = `../iframe.min.js?
|
|
9
|
+
const webpackFiles = `../iframe.min.js?3fd23e627a9b604b419b,../iframe.v2.min.js?3fd23e627a9b604b419b,../web-client.min.js?3fd23e627a9b604b419b,../preview.css.min.js?3fd23e627a9b604b419b,../audio-client.min.js?3fd23e627a9b604b419b,../webrtc-client.min.js?3fd23e627a9b604b419b`.split(',');
|
|
10
10
|
const webClientFile = webpackFiles.find(file => file.includes('web-client.min.js'));
|
|
11
11
|
const previewCssFile = webpackFiles.find(file => file.includes('preview.css.min.js'));
|
|
12
12
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="keywords" content="Moveo.ai, Voice, WebRTC, Preview"/><meta name="description" content="Test your WebRTC Voice Integration"/><meta name="twitter:card" content="summary"/><meta property="og:title" content="Moveo.ai WebRTC Preview"/><meta property="og:type" content="website"/><meta property="og:url" content="https://moveo.ai"/><meta property="og:image" content="https://web-client.moveo.ai/public/og-image.jpg"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:description" content="Test your WebRTC Voice Integration"/><title>Moveo.ai WebRTC Preview</title><script src="https://cdn.tailwindcss.com"></script><script>tailwind.config = {
|
|
2
|
+
important: '#preview-content',
|
|
3
|
+
corePlugins: { preflight: false },
|
|
4
|
+
theme: {
|
|
5
|
+
extend: {
|
|
6
|
+
fontFamily: {
|
|
7
|
+
sans: ['Inter', 'system-ui', '-apple-system', 'sans-serif'],
|
|
8
|
+
},
|
|
9
|
+
colors: {
|
|
10
|
+
'moveo-primary': '#1B66D6',
|
|
11
|
+
'moveo-secondary': '#EEF2FF',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};</script><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet"/><script defer="defer" src="/webrtc-client.min.js"></script></head><body><div id="preview-content" class="relative min-h-screen font-sans text-slate-900 antialiased"><main class="relative z-10 flex min-h-screen items-center"><section class="mx-auto flex w-full max-w-6xl flex-col gap-12 px-6 py-16 md:flex-row md:items-start md:px-12 lg:gap-16"><header class="max-w-2xl space-y-6 text-center md:text-left"><h1 class="text-4xl font-semibold leading-tight sm:text-5xl">Preview and test<br class="hidden sm:block"/>your WebRTC voice integration</h1><p class="text-lg text-slate-600 sm:text-xl">Click the widget button at the bottom right to start a test call and try your AI Agent with native WebRTC voice.</p><div id="status" class="text-sm font-medium"></div></header><div class="flex-1"><div id="transcript-log" class="hidden max-h-96 w-full overflow-y-auto rounded-xl border border-slate-200 bg-white/80 p-4 font-mono text-sm shadow-sm backdrop-blur"><h3 class="mb-3 text-xs font-semibold uppercase tracking-wider text-slate-400">Live Transcript</h3><div id="transcript-entries" class="space-y-2"></div></div></div></section></main></div><script>localStorage.debug = 'moveo:webrtc:*';
|
|
16
|
+
|
|
17
|
+
const statusNode = document.getElementById('status');
|
|
18
|
+
const transcriptLog = document.getElementById('transcript-log');
|
|
19
|
+
const transcriptEntries = document.getElementById('transcript-entries');
|
|
20
|
+
const toneColor = {
|
|
21
|
+
warning: 'text-amber-600',
|
|
22
|
+
error: 'text-rose-600',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const setStatus = (message, tone = 'error') => {
|
|
26
|
+
if (!statusNode) return;
|
|
27
|
+
statusNode.className = `text-sm font-medium ${toneColor[tone] ?? toneColor.error}`;
|
|
28
|
+
statusNode.textContent = message;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const addTranscript = (speaker, text) => {
|
|
32
|
+
if (!transcriptEntries || !transcriptLog) return;
|
|
33
|
+
transcriptLog.classList.remove('hidden');
|
|
34
|
+
|
|
35
|
+
const entry = document.createElement('div');
|
|
36
|
+
const label = speaker === 'user' ? '🎤 You' : '🤖 Agent';
|
|
37
|
+
const color = speaker === 'user' ? 'text-sky-600' : 'text-emerald-600';
|
|
38
|
+
entry.innerHTML = `<span class="font-semibold ${color}">${label}:</span> ${text}`;
|
|
39
|
+
transcriptEntries.appendChild(entry);
|
|
40
|
+
transcriptEntries.scrollTop = transcriptEntries.scrollHeight;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
window.addEventListener('load', async () => {
|
|
44
|
+
const params = new URLSearchParams(window.location.search);
|
|
45
|
+
const integrationId =
|
|
46
|
+
(params.get('integration_id') ?? params.get('integrationId') ?? '').trim();
|
|
47
|
+
if (!integrationId) {
|
|
48
|
+
setStatus('Add "?integration_id=YOUR_ID" to the URL to begin.', 'warning');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const hostParam = (params.get('host') ?? '').trim();
|
|
53
|
+
const host = hostParam ? hostParam.replace(/\/+$/, '') : '';
|
|
54
|
+
|
|
55
|
+
if (!window.MoveoWebRTC?.init) {
|
|
56
|
+
console.error('MoveoWebRTC UMD build is not available on window.');
|
|
57
|
+
setStatus(
|
|
58
|
+
'Unable to load the WebRTC client. Check the bundle output.',
|
|
59
|
+
'error'
|
|
60
|
+
);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
const controller = await window.MoveoWebRTC.init({
|
|
66
|
+
integrationId,
|
|
67
|
+
...(host ? { host } : {}),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
controller.on?.('error', ({ message }) => {
|
|
71
|
+
setStatus(`Call error: ${message || 'unexpected error'}`, 'error');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
controller.on?.('transcript', ({ data }) => {
|
|
75
|
+
if (data && typeof data === 'object' && 'text' in data) {
|
|
76
|
+
addTranscript('user', data.text);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
controller.on?.('agent-response', ({ data }) => {
|
|
81
|
+
if (data && typeof data === 'object' && 'text' in data) {
|
|
82
|
+
addTranscript('agent', data.text);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
console.log('✅ MoveoWebRTC widget initialized', controller);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error('❌ Failed to initialize MoveoWebRTC widget:', error);
|
|
89
|
+
setStatus('Failed to initialize the WebRTC widget', 'error');
|
|
90
|
+
}
|
|
91
|
+
});</script></body></html>
|