@moveo-ai/web-client 0.106.0-true.3 → 0.106.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/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?63edebdfb4ea406e34a0';
18
+ const defaultScript = 'iframe.min.js?9e9b02ef90fd3404810d';
19
19
  const versionPattern = /^v\d+$/;
20
20
  const script = document.createElement('script');
21
21
  script.src =
@@ -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?63edebdfb4ea406e34a0"></script><style>body::before {
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?9e9b02ef90fd3404810d"></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?63edebdfb4ea406e34a0,../iframe.v2.min.js?63edebdfb4ea406e34a0,../web-client.min.js?63edebdfb4ea406e34a0,../preview.css.min.js?63edebdfb4ea406e34a0,../audio-client.min.js?63edebdfb4ea406e34a0,../webrtc-client.min.js?63edebdfb4ea406e34a0,../telnyx-client.min.js?63edebdfb4ea406e34a0`.split(',');
9
+ const webpackFiles = `../iframe.min.js?9e9b02ef90fd3404810d,../iframe.v2.min.js?9e9b02ef90fd3404810d,../web-client.min.js?9e9b02ef90fd3404810d,../preview.css.min.js?9e9b02ef90fd3404810d,../audio-client.min.js?9e9b02ef90fd3404810d,../webrtc-client.min.js?9e9b02ef90fd3404810d,../telnyx-client.min.js?9e9b02ef90fd3404810d`.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
 
@@ -12,7 +12,7 @@
12
12
  },
13
13
  },
14
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:*';
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-start md:items-center"><section class="mx-auto flex w-full max-w-6xl flex-col gap-12 px-6 py-16 pb-32 md:flex-row md:items-start md:px-12 md:pb-16 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-[60vh] w-full overflow-y-auto rounded-xl border border-slate-200 bg-white/80 p-4 font-mono text-sm shadow-sm backdrop-blur md:max-h-[70vh]"><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 pb-24"></div></div></div></section></main></div><script>localStorage.debug = 'moveo:webrtc:*';
16
16
 
17
17
  const statusNode = document.getElementById('status');
18
18
  const transcriptLog = document.getElementById('transcript-log');
@@ -37,7 +37,7 @@
37
37
  const color = speaker === 'user' ? 'text-sky-600' : 'text-emerald-600';
38
38
  entry.innerHTML = `<span class="font-semibold ${color}">${label}:</span> ${text}`;
39
39
  transcriptEntries.appendChild(entry);
40
- transcriptEntries.scrollTop = transcriptEntries.scrollHeight;
40
+ transcriptLog.scrollTop = transcriptLog.scrollHeight;
41
41
  };
42
42
 
43
43
  window.addEventListener('load', async () => {
@@ -71,16 +71,63 @@
71
71
  setStatus(`Call error: ${message || 'unexpected error'}`, 'error');
72
72
  });
73
73
 
74
+ // One entry element per request_id for the current call; reset when a
75
+ // new call starts so a prior call's lines don't carry over.
76
+ let brainEntries = {};
77
+ let lastState = 'idle';
78
+ const resetTranscript = () => {
79
+ if (transcriptEntries) transcriptEntries.innerHTML = '';
80
+ brainEntries = {};
81
+ if (transcriptLog) transcriptLog.classList.add('hidden');
82
+ };
83
+
84
+ // A fresh call is idle/error -> connecting. A mid-call reconnect goes
85
+ // through 'reconnecting' (or connected -> connecting on an ICE blip), so
86
+ // the live transcript survives it.
87
+ controller.on?.('state-change', ({ data }) => {
88
+ if (data === 'connecting' && (lastState === 'idle' || lastState === 'error')) {
89
+ resetTranscript();
90
+ }
91
+ lastState = data;
92
+ });
93
+
74
94
  controller.on?.('transcript', ({ data }) => {
75
95
  if (data && typeof data === 'object' && 'text' in data) {
76
96
  addTranscript('user', data.text);
77
97
  }
78
98
  });
79
99
 
80
- controller.on?.('agent-response', ({ data }) => {
81
- if (data && typeof data === 'object' && 'text' in data) {
82
- addTranscript('agent', data.text);
100
+ // brain-response streams in chunks; upsert one line per request_id so
101
+ // the assembled reply grows in place instead of appending each chunk.
102
+ controller.on?.('brain-response', ({ data }) => {
103
+ if (!data || typeof data !== 'object' || !('text' in data)) return;
104
+ if (!transcriptEntries || !transcriptLog) return;
105
+ transcriptLog.classList.remove('hidden');
106
+ const reqId = ('request_id' in data && data.request_id) || '_';
107
+ let entry = brainEntries[reqId];
108
+ if (!entry) {
109
+ entry = document.createElement('div');
110
+ transcriptEntries.appendChild(entry);
111
+ brainEntries[reqId] = entry;
83
112
  }
113
+ entry.innerHTML =
114
+ `<span class="font-semibold text-emerald-600">🤖 Agent:</span> ${data.text}`;
115
+ transcriptLog.scrollTop = transcriptLog.scrollHeight;
116
+ });
117
+
118
+ // interrupt marks a barge-in: keep the heard text, gray out the unheard
119
+ // tail (never delete).
120
+ controller.on?.('interrupt', ({ data }) => {
121
+ if (!data || typeof data !== 'object' || !('request_id' in data)) return;
122
+ const reqId = data.request_id || '_';
123
+ const entry = brainEntries[reqId];
124
+ if (!entry) return;
125
+ const heard = ('heardText' in data && data.heardText) || '';
126
+ const unheard = ('unheardText' in data && data.unheardText) || '';
127
+ entry.innerHTML =
128
+ `<span class="font-semibold text-emerald-600">🤖 Agent:</span> ${heard}` +
129
+ (unheard ? ` <span class="text-slate-400 line-through">${unheard}</span>` : '');
130
+ transcriptLog.scrollTop = transcriptLog.scrollHeight;
84
131
  });
85
132
 
86
133
  console.log('✅ MoveoWebRTC widget initialized', controller);
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.106.0-true.3
3
+ * @moveo-ai/web-client v0.106.0
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */