@opengeni/react 1.4.0 → 1.4.2

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.
Files changed (212) hide show
  1. package/README.md +8 -0
  2. package/dist/accounts.js +2 -0
  3. package/dist/accounts.js.map +1 -1
  4. package/dist/artifacts-document.js +5 -4
  5. package/dist/artifacts-presentation.js +5 -4
  6. package/dist/artifacts-spreadsheet.js +4 -3
  7. package/dist/artifacts.js +14 -13
  8. package/dist/artifacts.js.map +1 -1
  9. package/dist/browser-viewer-WGJ43YGI.js +17 -0
  10. package/dist/chat-interactive-block-ZFHOKTMS.js +12 -0
  11. package/dist/{chunk-WEHMPOXK.js → chunk-2DDJ6YH6.js} +3 -1
  12. package/dist/{chunk-WEHMPOXK.js.map → chunk-2DDJ6YH6.js.map} +1 -1
  13. package/dist/{chunk-C5X5AJXK.js → chunk-2HVLQ26H.js} +5 -4
  14. package/dist/{chunk-C5X5AJXK.js.map → chunk-2HVLQ26H.js.map} +1 -1
  15. package/dist/{chunk-A4UJB2MM.js → chunk-32CGLXW2.js} +4 -3
  16. package/dist/{chunk-A4UJB2MM.js.map → chunk-32CGLXW2.js.map} +1 -1
  17. package/dist/{chunk-5CVXZA3Y.js → chunk-45NUOSXQ.js} +3 -2
  18. package/dist/{chunk-5CVXZA3Y.js.map → chunk-45NUOSXQ.js.map} +1 -1
  19. package/dist/{chunk-WUISZ3WU.js → chunk-53KJBGPZ.js} +5 -4
  20. package/dist/{chunk-WUISZ3WU.js.map → chunk-53KJBGPZ.js.map} +1 -1
  21. package/dist/{chunk-MBMPHOMA.js → chunk-55DXD22O.js} +3 -2
  22. package/dist/{chunk-MBMPHOMA.js.map → chunk-55DXD22O.js.map} +1 -1
  23. package/dist/{chunk-JT4JW7BC.js → chunk-5I4VRWBB.js} +3 -1
  24. package/dist/{chunk-JT4JW7BC.js.map → chunk-5I4VRWBB.js.map} +1 -1
  25. package/dist/{chunk-UK4TINKT.js → chunk-B27E3V37.js} +3 -1
  26. package/dist/{chunk-UK4TINKT.js.map → chunk-B27E3V37.js.map} +1 -1
  27. package/dist/{chunk-J6DBS4T3.js → chunk-BNKV5ZLF.js} +5 -4
  28. package/dist/{chunk-J6DBS4T3.js.map → chunk-BNKV5ZLF.js.map} +1 -1
  29. package/dist/{chunk-YM2DE7BQ.js → chunk-C5BF4L26.js} +13 -12
  30. package/dist/{chunk-YM2DE7BQ.js.map → chunk-C5BF4L26.js.map} +1 -1
  31. package/dist/{chunk-YBXQDQFX.js → chunk-C7CMD56T.js} +6 -5
  32. package/dist/{chunk-YBXQDQFX.js.map → chunk-C7CMD56T.js.map} +1 -1
  33. package/dist/{chunk-UGLEYEMP.js → chunk-CM7LVUKC.js} +3 -1
  34. package/dist/{chunk-UGLEYEMP.js.map → chunk-CM7LVUKC.js.map} +1 -1
  35. package/dist/{chunk-LJ2UTJJE.js → chunk-CREMJMVN.js} +181 -96
  36. package/dist/chunk-CREMJMVN.js.map +1 -0
  37. package/dist/{chunk-JVYQRRC4.js → chunk-CVYCLFMH.js} +3 -1
  38. package/dist/{chunk-JVYQRRC4.js.map → chunk-CVYCLFMH.js.map} +1 -1
  39. package/dist/{chunk-Y2PRMYLC.js → chunk-G3U2A6GS.js} +3 -2
  40. package/dist/{chunk-Y2PRMYLC.js.map → chunk-G3U2A6GS.js.map} +1 -1
  41. package/dist/{chunk-WZMYFJD3.js → chunk-G6YRCIYJ.js} +16 -7
  42. package/dist/{chunk-WZMYFJD3.js.map → chunk-G6YRCIYJ.js.map} +1 -1
  43. package/dist/{chunk-B3V6TG77.js → chunk-GC3PH6N7.js} +3 -1
  44. package/dist/{chunk-B3V6TG77.js.map → chunk-GC3PH6N7.js.map} +1 -1
  45. package/dist/{chunk-CJUO7J5Z.js → chunk-HXYOSSQO.js} +3 -2
  46. package/dist/{chunk-CJUO7J5Z.js.map → chunk-HXYOSSQO.js.map} +1 -1
  47. package/dist/{chunk-BRM6FVZA.js → chunk-IEE7WCLN.js} +4 -3
  48. package/dist/{chunk-BRM6FVZA.js.map → chunk-IEE7WCLN.js.map} +1 -1
  49. package/dist/{chunk-DYWBUX5Q.js → chunk-IMSUVYQB.js} +6 -5
  50. package/dist/{chunk-DYWBUX5Q.js.map → chunk-IMSUVYQB.js.map} +1 -1
  51. package/dist/{chunk-LN6TCXD3.js → chunk-IUHHPMAX.js} +184 -48
  52. package/dist/chunk-IUHHPMAX.js.map +1 -0
  53. package/dist/{chunk-SGKD2OCN.js → chunk-IYQCWGU5.js} +6 -5
  54. package/dist/{chunk-SGKD2OCN.js.map → chunk-IYQCWGU5.js.map} +1 -1
  55. package/dist/{chunk-J2QWVSQY.js → chunk-JH7V627O.js} +8 -7
  56. package/dist/{chunk-J2QWVSQY.js.map → chunk-JH7V627O.js.map} +1 -1
  57. package/dist/{chunk-EESD3PY3.js → chunk-JHTIMBOL.js} +6 -5
  58. package/dist/{chunk-EESD3PY3.js.map → chunk-JHTIMBOL.js.map} +1 -1
  59. package/dist/{chunk-LNIRAOA3.js → chunk-L2J3PU7A.js} +7 -6
  60. package/dist/{chunk-LNIRAOA3.js.map → chunk-L2J3PU7A.js.map} +1 -1
  61. package/dist/{chunk-ZYRGEKWS.js → chunk-LJUMYUBO.js} +3 -1
  62. package/dist/{chunk-ZYRGEKWS.js.map → chunk-LJUMYUBO.js.map} +1 -1
  63. package/dist/{chunk-4RVYOY4O.js → chunk-LSW2OJVV.js} +4 -3
  64. package/dist/{chunk-4RVYOY4O.js.map → chunk-LSW2OJVV.js.map} +1 -1
  65. package/dist/{chunk-UTRTG6LH.js → chunk-LVS3MH5T.js} +3 -1
  66. package/dist/{chunk-UTRTG6LH.js.map → chunk-LVS3MH5T.js.map} +1 -1
  67. package/dist/chunk-M357MHH3.js +2 -0
  68. package/dist/{chunk-GYVRFZDY.js → chunk-MDIXFKA3.js} +9 -8
  69. package/dist/{chunk-GYVRFZDY.js.map → chunk-MDIXFKA3.js.map} +1 -1
  70. package/dist/{chunk-WRHIZYZF.js → chunk-MEQM4LI3.js} +6 -5
  71. package/dist/{chunk-WRHIZYZF.js.map → chunk-MEQM4LI3.js.map} +1 -1
  72. package/dist/chunk-NX4ADH73.js +14 -0
  73. package/dist/chunk-NX4ADH73.js.map +1 -0
  74. package/dist/{chunk-XCHWDJ22.js → chunk-OGTTUYNT.js} +3 -1
  75. package/dist/{chunk-XCHWDJ22.js.map → chunk-OGTTUYNT.js.map} +1 -1
  76. package/dist/{chunk-GIMRELBW.js → chunk-OYQQJL3J.js} +3 -1
  77. package/dist/{chunk-GIMRELBW.js.map → chunk-OYQQJL3J.js.map} +1 -1
  78. package/dist/{chunk-RSI7XYXL.js → chunk-PBCZL4JP.js} +6 -5
  79. package/dist/{chunk-RSI7XYXL.js.map → chunk-PBCZL4JP.js.map} +1 -1
  80. package/dist/{chunk-I7IWRQLN.js → chunk-PHBFJCEU.js} +17 -11
  81. package/dist/chunk-PHBFJCEU.js.map +1 -0
  82. package/dist/{chunk-3CTRFMAK.js → chunk-PKCAYHDC.js} +5 -4
  83. package/dist/{chunk-3CTRFMAK.js.map → chunk-PKCAYHDC.js.map} +1 -1
  84. package/dist/{chunk-K3HQAKQX.js → chunk-PMV53IMM.js} +3 -1
  85. package/dist/{chunk-K3HQAKQX.js.map → chunk-PMV53IMM.js.map} +1 -1
  86. package/dist/{chunk-YQEAA6LT.js → chunk-QHUE7E4N.js} +3 -2
  87. package/dist/{chunk-YQEAA6LT.js.map → chunk-QHUE7E4N.js.map} +1 -1
  88. package/dist/{chunk-OA6HFRQP.js → chunk-QMMCJGFI.js} +4 -3
  89. package/dist/{chunk-OA6HFRQP.js.map → chunk-QMMCJGFI.js.map} +1 -1
  90. package/dist/{chunk-YV4L3ILF.js → chunk-QV3DJVRZ.js} +3 -1
  91. package/dist/{chunk-YV4L3ILF.js.map → chunk-QV3DJVRZ.js.map} +1 -1
  92. package/dist/{chunk-447JLCBU.js → chunk-S2QH6EZ5.js} +3 -1
  93. package/dist/{chunk-447JLCBU.js.map → chunk-S2QH6EZ5.js.map} +1 -1
  94. package/dist/{chunk-PNY3JKBJ.js → chunk-SFH43JT2.js} +5 -4
  95. package/dist/{chunk-PNY3JKBJ.js.map → chunk-SFH43JT2.js.map} +1 -1
  96. package/dist/{chunk-AWZLIMKX.js → chunk-T46QZH3E.js} +3 -1
  97. package/dist/{chunk-AWZLIMKX.js.map → chunk-T46QZH3E.js.map} +1 -1
  98. package/dist/{chunk-5J4FOW6Q.js → chunk-TNEZNMSN.js} +3 -1
  99. package/dist/{chunk-5J4FOW6Q.js.map → chunk-TNEZNMSN.js.map} +1 -1
  100. package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
  101. package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
  102. package/dist/{chunk-H5X55XH7.js → chunk-UDPH5SLV.js} +4 -3
  103. package/dist/{chunk-H5X55XH7.js.map → chunk-UDPH5SLV.js.map} +1 -1
  104. package/dist/{chunk-HDJWDK7W.js → chunk-VCSERYXH.js} +10 -9
  105. package/dist/{chunk-HDJWDK7W.js.map → chunk-VCSERYXH.js.map} +1 -1
  106. package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
  107. package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
  108. package/dist/{chunk-5F4WR7X7.js → chunk-XS67YG5R.js} +3 -1
  109. package/dist/{chunk-5F4WR7X7.js.map → chunk-XS67YG5R.js.map} +1 -1
  110. package/dist/{chunk-TKOTKRWY.js → chunk-XTD7TZHW.js} +3 -1
  111. package/dist/{chunk-TKOTKRWY.js.map → chunk-XTD7TZHW.js.map} +1 -1
  112. package/dist/{chunk-A2PI6UMY.js → chunk-YSRBFJMQ.js} +3 -1
  113. package/dist/{chunk-A2PI6UMY.js.map → chunk-YSRBFJMQ.js.map} +1 -1
  114. package/dist/chunk-YVFRBXST.js +1420 -0
  115. package/dist/chunk-YVFRBXST.js.map +1 -0
  116. package/dist/{chunk-SCOTPE2I.js → chunk-YYLBXXTE.js} +3 -1
  117. package/dist/{chunk-SCOTPE2I.js.map → chunk-YYLBXXTE.js.map} +1 -1
  118. package/dist/{chunk-RHREZ7BO.js → chunk-ZUWF4NF7.js} +3 -1
  119. package/dist/{chunk-RHREZ7BO.js.map → chunk-ZUWF4NF7.js.map} +1 -1
  120. package/dist/clipboard.js +3 -2
  121. package/dist/components/composer-transcription-control.d.ts +4 -0
  122. package/dist/components/session-conversation.d.ts +6 -0
  123. package/dist/composer-voice-events.d.ts +8 -0
  124. package/dist/composer.js +15 -13
  125. package/dist/computer-viewer-46UIN7F3.js +20 -0
  126. package/dist/connect.js +15 -12
  127. package/dist/connect.js.map +1 -1
  128. package/dist/desktop.js +6 -5
  129. package/dist/desktop.js.map +1 -1
  130. package/dist/diffs.js +2 -1
  131. package/dist/diffs.js.map +1 -1
  132. package/dist/editor.js +4 -3
  133. package/dist/editor.js.map +1 -1
  134. package/dist/embedded-voice-NIL4RDX3.js +69 -0
  135. package/dist/embedded-voice-NIL4RDX3.js.map +1 -0
  136. package/dist/{fleet-decision-row-YZ3ZKWMM.js → fleet-decision-row-SI63O5V4.js} +3 -1
  137. package/dist/{fleet-decision-row-YZ3ZKWMM.js.map → fleet-decision-row-SI63O5V4.js.map} +1 -1
  138. package/dist/hooks/use-client-config-flags.d.ts +6 -0
  139. package/dist/hooks/use-realtime-voice-models.d.ts +9 -0
  140. package/dist/hooks/use-voice-input.d.ts +8 -1
  141. package/dist/index.js +47 -45
  142. package/dist/index.js.map +1 -1
  143. package/dist/interaction.js +14 -13
  144. package/dist/interaction.js.map +1 -1
  145. package/dist/{latest-question-GPYM2JNU.js → latest-question-2POFPYNB.js} +5 -4
  146. package/dist/{latest-question-GPYM2JNU.js.map → latest-question-2POFPYNB.js.map} +1 -1
  147. package/dist/machines.js +8 -7
  148. package/dist/{markdown-table-layout-QXSLK4BY.js → markdown-table-layout-DQ4DRNVT.js} +3 -1
  149. package/dist/{markdown-table-layout-QXSLK4BY.js.map → markdown-table-layout-DQ4DRNVT.js.map} +1 -1
  150. package/dist/model-policy-picker-menu-WRNSRFQC.js +15 -0
  151. package/dist/model-policy.js +2 -1
  152. package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
  153. package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
  154. package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
  155. package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
  156. package/dist/{platform-activity-row-627BFZ46.js → platform-activity-row-PJJVATTZ.js} +3 -1
  157. package/dist/{platform-activity-row-627BFZ46.js.map → platform-activity-row-PJJVATTZ.js.map} +1 -1
  158. package/dist/{queue-surface-implementation-ZHFI5JBP.js → queue-surface-implementation-67FS7FUI.js} +10 -9
  159. package/dist/{queue-surface-implementation-ZHFI5JBP.js.map → queue-surface-implementation-67FS7FUI.js.map} +1 -1
  160. package/dist/realtime/embedded-voice.d.ts +20 -0
  161. package/dist/realtime.js +22 -1353
  162. package/dist/realtime.js.map +1 -1
  163. package/dist/sandbox-files-34CJJNOY.js +21 -0
  164. package/dist/session-ui.js +32 -30
  165. package/dist/session-ui.js.map +1 -1
  166. package/dist/session.js +10 -9
  167. package/dist/sites.js +2 -1
  168. package/dist/terminal.js +6 -5
  169. package/dist/terminal.js.map +1 -1
  170. package/dist/{timeline-annotation-markers-GNDHTGBD.js → timeline-annotation-markers-U3G66KUD.js} +5 -4
  171. package/dist/{timeline-annotation-markers-GNDHTGBD.js.map → timeline-annotation-markers-U3G66KUD.js.map} +1 -1
  172. package/dist/{timeline-annotation-selection-DMLMM2TX.js → timeline-annotation-selection-BI7QTPTZ.js} +4 -3
  173. package/dist/{timeline-annotation-selection-DMLMM2TX.js.map → timeline-annotation-selection-BI7QTPTZ.js.map} +1 -1
  174. package/dist/{timeline-annotations-dialog-ELRDBHTS.js → timeline-annotations-dialog-FOMHSDTE.js} +7 -6
  175. package/dist/{timeline-annotations-dialog-ELRDBHTS.js.map → timeline-annotations-dialog-FOMHSDTE.js.map} +1 -1
  176. package/dist/usage.js +6 -5
  177. package/dist/usage.js.map +1 -1
  178. package/dist/voice-recording-owner.d.ts +7 -0
  179. package/package.json +3 -3
  180. package/src/components/composer-transcription-control.tsx +109 -27
  181. package/src/components/markdown.tsx +7 -2
  182. package/src/components/message-timeline.tsx +10 -1
  183. package/src/components/session-conversation.tsx +44 -0
  184. package/src/components/session-proxy-scope.tsx +26 -5
  185. package/src/composer-voice-events.ts +12 -0
  186. package/src/connection-discovery.tsx +4 -1
  187. package/src/hooks/use-client-config-flags.ts +8 -0
  188. package/src/hooks/use-goal.ts +12 -1
  189. package/src/hooks/use-realtime-voice-models.ts +67 -0
  190. package/src/hooks/use-voice-input.ts +109 -18
  191. package/src/realtime/embedded-voice.tsx +81 -0
  192. package/src/realtime/realtime-control.tsx +82 -17
  193. package/src/voice-recording-owner.ts +22 -0
  194. package/styles/compiled.css +72 -18
  195. package/styles/index.css +49 -0
  196. package/styles/responsive.css +61 -4
  197. package/styles/session-capability.css +1 -1
  198. package/dist/browser-viewer-SHYKQRNX.js +0 -16
  199. package/dist/chat-interactive-block-UGBTNB3L.js +0 -11
  200. package/dist/chunk-I7IWRQLN.js.map +0 -1
  201. package/dist/chunk-IWIDV7SB.js +0 -1
  202. package/dist/chunk-LJ2UTJJE.js.map +0 -1
  203. package/dist/chunk-LN6TCXD3.js.map +0 -1
  204. package/dist/computer-viewer-6SRGWRUX.js +0 -19
  205. package/dist/model-policy-picker-menu-DXHUL73H.js +0 -14
  206. package/dist/sandbox-files-GORZOUUJ.js +0 -20
  207. /package/dist/{browser-viewer-SHYKQRNX.js.map → browser-viewer-WGJ43YGI.js.map} +0 -0
  208. /package/dist/{chat-interactive-block-UGBTNB3L.js.map → chat-interactive-block-ZFHOKTMS.js.map} +0 -0
  209. /package/dist/{chunk-IWIDV7SB.js.map → chunk-M357MHH3.js.map} +0 -0
  210. /package/dist/{computer-viewer-6SRGWRUX.js.map → computer-viewer-46UIN7F3.js.map} +0 -0
  211. /package/dist/{model-policy-picker-menu-DXHUL73H.js.map → model-policy-picker-menu-WRNSRFQC.js.map} +0 -0
  212. /package/dist/{sandbox-files-GORZOUUJ.js.map → sandbox-files-34CJJNOY.js.map} +0 -0
@@ -1,3 +1,7 @@
1
+ import {
2
+ COMPOSER_VOICE_INPUT_START_EVENT,
3
+ composerVoiceEventScope,
4
+ } from "../composer-voice-events";
1
5
  import type {
2
6
  ClientVoiceInputConfig,
3
7
  OpenGeniClient,
@@ -35,6 +39,10 @@ export type ComposerTranscriptionMessages = {
35
39
  stop: string;
36
40
  cancel: string;
37
41
  retry: string;
42
+ /** Transcribe a recording that was stopped without transcribing or recovered. */
43
+ transcribeSaved: string;
44
+ /** Shown near the automatic stop; `{seconds}` is replaced. */
45
+ timeRemaining: string;
38
46
  pauseRetrying: string;
39
47
  requestingPermission: string;
40
48
  recording: string;
@@ -64,32 +72,34 @@ export type ComposerTranscriptionMessages = {
64
72
  const defaultMessages: ComposerTranscriptionMessages = {
65
73
  start: "Start voice input",
66
74
  stop: "Stop and transcribe",
67
- cancel: "Cancel recording",
75
+ cancel: "Stop without transcribing",
68
76
  retry: "Retry voice input",
77
+ transcribeSaved: "Transcribe saved recording",
78
+ timeRemaining: "Stops and transcribes in {seconds}s",
69
79
  pauseRetrying: "Pause automatic retry",
70
80
  requestingPermission: "Requesting microphone…",
71
- recording: "Recording. Press Escape to cancel.",
81
+ recording: "Recording. Press Escape to stop without transcribing.",
72
82
  saving: "Saving audio locally…",
73
83
  transcribing: "Transcribing…",
74
- retrying: "Recording saved. Retrying automatically…",
75
- recovered: "Recording recovered and saved locally.",
76
- recoveredTranscript: "Transcript saved locally. Check your draft before inserting.",
84
+ retrying: "Saved. Retrying transcription…",
85
+ recovered: "Recording saved on this device.",
86
+ recoveredTranscript: "Transcript saved. Insert it into your draft?",
77
87
  insertRecoveredTranscript: "Insert saved transcript",
78
88
  discardRecovered: "Discard saved recording",
79
89
  unavailableDisabled: "Voice input is unavailable while the composer is disabled.",
80
90
  unavailable: "Voice input is unavailable for this workspace.",
81
- errorPermissionDenied: "Microphone permission was denied. Your draft was not changed.",
91
+ errorPermissionDenied: "Microphone access is blocked. Allow it in site settings, then try again.",
82
92
  errorNotSupported: "Voice input is not supported on this device.",
83
93
  errorUnavailable: "Voice input is not configured.",
84
94
  errorInsufficientCredits:
85
- "Voice input needs Opengeni credits. Add credits, then retry your saved recording.",
86
- errorAllowanceExhausted: "Your usage limit was reached. Your recording is saved for later.",
95
+ "Voice input needs credits. Recording saved; retry after adding credits.",
96
+ errorAllowanceExhausted: "Usage limit reached. Recording saved for later.",
87
97
  errorPolicyBlocked: "Voice input isn't allowed for this account or workspace.",
88
98
  errorTooLarge: "Recording is too large. Try a shorter message.",
89
99
  errorInvalidAudio: "The recording could not be read. Try again.",
90
100
  errorStorageUnavailable: "Voice input stopped because audio could not be saved safely.",
91
- errorRetryable: "Recording is saved locally. Retry transcription when ready.",
92
- errorHandoffUncertain: "Transcript is saved. Check your draft before inserting it again.",
101
+ errorRetryable: "Saved. Transcription failed, retry when ready.",
102
+ errorHandoffUncertain: "Transcript saved. Check your draft before inserting again.",
93
103
  errorUnknown: "Voice input could not start. Try again.",
94
104
  };
95
105
 
@@ -153,12 +163,18 @@ export function ComposerTranscriptionControl({
153
163
  const capturing = status === "requesting-permission" || status === "recording";
154
164
 
155
165
  const cancelTranscription = transcription.cancel;
166
+ const discardTranscription = transcription.discard;
167
+ const hasRecoverableRecording = transcription.hasRecoverableRecording;
156
168
  useEffect(() => {
157
169
  if (!suppressed) return;
158
170
  if (status === "recording" || status === "requesting-permission") {
159
171
  cancelTranscription();
172
+ } else if (status === "error" && !hasRecoverableRecording) {
173
+ // Live voice took over: a stale start error (nothing saved) would only
174
+ // duplicate whatever live voice reports next to it.
175
+ void discardTranscription();
160
176
  }
161
- }, [cancelTranscription, status, suppressed]);
177
+ }, [cancelTranscription, discardTranscription, hasRecoverableRecording, status, suppressed]);
162
178
  const active = capturing || status === "saving" || status === "transcribing";
163
179
  const recoverable =
164
180
  transcription.hasRecoverableRecording &&
@@ -194,11 +210,22 @@ export function ComposerTranscriptionControl({
194
210
  ? (errorMessage ?? messages.errorUnknown)
195
211
  : unavailableMessage;
196
212
 
213
+ const recoveredLabel = savedTranscript
214
+ ? (errorMessage ?? messages.recoveredTranscript)
215
+ : retrying
216
+ ? messages.retrying
217
+ : status === "error"
218
+ ? (errorMessage ?? messages.errorRetryable)
219
+ : messages.recovered;
220
+
197
221
  function start(event: MouseEvent<HTMLButtonElement>) {
198
222
  if (unavailableMessage) {
199
223
  event.preventDefault();
200
224
  return;
201
225
  }
226
+ composerVoiceEventScope(event.currentTarget)?.dispatchEvent(
227
+ new Event(COMPOSER_VOICE_INPUT_START_EVENT),
228
+ );
202
229
  void transcription.start();
203
230
  }
204
231
 
@@ -220,6 +247,9 @@ export function ComposerTranscriptionControl({
220
247
  )}
221
248
  data-transcription-status={status}
222
249
  data-transcription-capturing={capturing ? "" : undefined}
250
+ data-transcription-attention={
251
+ !capturing && (recoverable || (status === "error" && errorMessage)) ? "" : undefined
252
+ }
223
253
  >
224
254
  <span className="inline-flex min-w-0 items-center gap-1.5">
225
255
  <AnimatePresence mode="popLayout" initial={false}>
@@ -235,14 +265,11 @@ export function ComposerTranscriptionControl({
235
265
  "bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11",
236
266
  )}
237
267
  >
238
- <span className="og-transcription-recovered-label max-w-44 truncate text-og-xs text-og-fg-muted max-sm:max-w-28">
239
- {savedTranscript
240
- ? (errorMessage ?? messages.recoveredTranscript)
241
- : retrying
242
- ? messages.retrying
243
- : status === "error"
244
- ? (errorMessage ?? messages.errorRetryable)
245
- : messages.recovered}
268
+ <span
269
+ title={recoveredLabel}
270
+ className="og-transcription-recovered-label max-w-56 line-clamp-2 text-og-xs leading-tight text-og-fg-muted max-sm:max-w-32"
271
+ >
272
+ {recoveredLabel}
246
273
  </span>
247
274
  <Tip
248
275
  tip={
@@ -250,7 +277,9 @@ export function ComposerTranscriptionControl({
250
277
  ? messages.insertRecoveredTranscript
251
278
  : retrying
252
279
  ? messages.pauseRetrying
253
- : messages.retry
280
+ : status === "recovered"
281
+ ? messages.transcribeSaved
282
+ : messages.retry
254
283
  }
255
284
  >
256
285
  <button
@@ -268,7 +297,9 @@ export function ComposerTranscriptionControl({
268
297
  ? messages.insertRecoveredTranscript
269
298
  : retrying
270
299
  ? messages.pauseRetrying
271
- : messages.retry
300
+ : status === "recovered"
301
+ ? messages.transcribeSaved
302
+ : messages.retry
272
303
  }
273
304
  className={cn(
274
305
  "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
@@ -330,6 +361,13 @@ export function ComposerTranscriptionControl({
330
361
  stream={status === "recording" ? transcription.stream : null}
331
362
  mode={status === "recording" ? "recording" : "transcribing"}
332
363
  />
364
+ {status === "recording" && transcription.recordingStartedAt !== null ? (
365
+ <RecordingClock
366
+ startedAt={transcription.recordingStartedAt}
367
+ maxSeconds={transcription.maxRecordingSeconds}
368
+ remainingLabel={messages.timeRemaining}
369
+ />
370
+ ) : null}
333
371
  </span>
334
372
  )}
335
373
  {status === "recording" ? (
@@ -401,14 +439,22 @@ export function ComposerTranscriptionControl({
401
439
  )}
402
440
  </AnimatePresence>
403
441
  {status === "error" && errorMessage && !recoverable ? (
404
- <Tip tip={errorMessage}>
405
- <span
406
- aria-hidden="true"
407
- className="og-transcription-error-label max-w-40 truncate text-og-xs text-og-status-failed max-sm:max-w-24"
408
- >
442
+ // Nothing is saved in this state, so dismissing loses no speech.
443
+ <button
444
+ type="button"
445
+ title={errorMessage}
446
+ aria-label={`Dismiss: ${errorMessage}`}
447
+ onClick={() => void transcription.discard()}
448
+ className={cn(
449
+ "inline-flex min-w-0 items-center gap-1 rounded-og-sm text-left outline-hidden",
450
+ "text-og-status-failed focus-visible:ring-2 focus-visible:ring-og-accent/45",
451
+ )}
452
+ >
453
+ <span className="og-transcription-error-label max-w-56 line-clamp-2 text-og-xs leading-tight max-sm:max-w-32">
409
454
  {errorMessage}
410
455
  </span>
411
- </Tip>
456
+ <XIcon className="size-3 shrink-0 opacity-70" aria-hidden />
457
+ </button>
412
458
  ) : null}
413
459
  <span
414
460
  className="sr-only"
@@ -424,6 +470,42 @@ export function ComposerTranscriptionControl({
424
470
  );
425
471
  }
426
472
 
473
+ /** Elapsed dictation time; warns before the automatic stop-and-transcribe. */
474
+ function RecordingClock({
475
+ startedAt,
476
+ maxSeconds,
477
+ remainingLabel,
478
+ }: {
479
+ startedAt: number;
480
+ maxSeconds: number | null;
481
+ remainingLabel: string;
482
+ }) {
483
+ const [now, setNow] = useState(() => Date.now());
484
+ useEffect(() => {
485
+ const timer = setInterval(() => setNow(Date.now()), 500);
486
+ return () => clearInterval(timer);
487
+ }, []);
488
+ const elapsed = Math.max(0, Math.floor((now - startedAt) / 1_000));
489
+ const remaining = maxSeconds === null ? null : Math.max(0, maxSeconds - elapsed);
490
+ const warn = remaining !== null && remaining <= 15;
491
+ const label = `${Math.floor(elapsed / 60)}:${String(elapsed % 60).padStart(2, "0")}`;
492
+ return (
493
+ <span
494
+ data-recording-clock
495
+ title={warn ? remainingLabel.replace("{seconds}", String(remaining)) : undefined}
496
+ className={cn(
497
+ "min-w-[2.25rem] text-right text-og-xs tabular-nums",
498
+ warn ? "font-medium text-og-status-failed" : "text-og-fg-muted",
499
+ )}
500
+ >
501
+ {label}
502
+ {warn ? (
503
+ <span className="sr-only">{remainingLabel.replace("{seconds}", String(remaining))}</span>
504
+ ) : null}
505
+ </span>
506
+ );
507
+ }
508
+
427
509
  function VoiceWaveform({
428
510
  stream,
429
511
  mode,
@@ -230,7 +230,7 @@ const baseComponents: Components = {
230
230
  ),
231
231
  td: ({ children, ...props }) => (
232
232
  <td
233
- className="border-b border-og-border/70 px-0 py-1.5 pr-4 align-top text-og-fg-muted [tr:last-child>&]:border-b-0"
233
+ className="border-b border-og-border/70 px-0 py-1.5 pr-4 align-top text-og-fg-muted"
234
234
  {...props}
235
235
  >
236
236
  {children}
@@ -615,7 +615,12 @@ function MarkdownTable({ children, className, ...props }: ComponentPropsWithoutR
615
615
  <div className="overflow-x-auto" tabIndex={0}>
616
616
  <table
617
617
  ref={tableRef}
618
- className={cn("w-full min-w-0 border-collapse text-og-base", className)}
618
+ className={cn(
619
+ // Leading `&` only: a trailing one (`tr:last-child>&`) under the scoped
620
+ // selector list needs `:is()`, which bundlers warn about for older targets.
621
+ "w-full min-w-0 border-collapse text-og-base [&_tr:last-child>td]:border-b-0",
622
+ className,
623
+ )}
619
624
  {...props}
620
625
  >
621
626
  {children}
@@ -2496,6 +2496,16 @@ export function MessageTimeline({
2496
2496
  }
2497
2497
  releasePinAfterScrollSettled(node);
2498
2498
  };
2499
+ // React 18 has no `onScrollEnd` prop: it warns and never calls it, while
2500
+ // `supportsScrollEndEvent()` still makes the camera wait for scrollend. A
2501
+ // native listener (re-bound each commit, so it always sees this render's
2502
+ // handler and scroller) works on every supported React version.
2503
+ useEffect(() => {
2504
+ const node = scrollRef.current;
2505
+ if (!node) return;
2506
+ node.addEventListener("scrollend", onScrollEnd);
2507
+ return () => node.removeEventListener("scrollend", onScrollEnd);
2508
+ });
2499
2509
 
2500
2510
  const timeline = (
2501
2511
  <AllowancePresentationProvider
@@ -2538,7 +2548,6 @@ export function MessageTimeline({
2538
2548
  }
2539
2549
  tabIndex={-1}
2540
2550
  onScroll={onScroll}
2541
- onScrollEnd={onScrollEnd}
2542
2551
  onWheel={onWheel}
2543
2552
  onTouchStart={(event) => {
2544
2553
  stopSettlement();
@@ -34,6 +34,7 @@ import {
34
34
  createWorkspaceRetainedArtifactLoader,
35
35
  createWorkspaceRetainedVideoLoader,
36
36
  } from "../timeline/retained-loaders";
37
+ import { useRealtimeVoiceModels } from "../hooks/use-realtime-voice-models";
37
38
  import { projectPendingApprovals } from "../approvals";
38
39
  import { ApprovalSurface } from "./approval-surface";
39
40
  import { ChatComposer, type ChatComposerProps } from "./chat-composer";
@@ -126,6 +127,12 @@ export type SessionConversationProps = ClientOverride &
126
127
  * (`createSessionProxyHandler({ voiceInput: false })` turns it off).
127
128
  */
128
129
  voiceInput?: boolean | undefined;
130
+ /**
131
+ * Live speech-to-speech voice in the composer. Defaults to true; the voice
132
+ * button appears only when the workspace offers an available voice model
133
+ * and the proxy has not turned it off (`realtimeVoice: false`).
134
+ */
135
+ realtimeVoice?: boolean | undefined;
129
136
  /**
130
137
  * Show the model/reasoning picker. End users of an embedded product rarely
131
138
  * choose models, so it is hidden unless this is `true` or the client config
@@ -210,6 +217,7 @@ function Conversation({
210
217
  allowanceExhaustedLabels,
211
218
  attachments: attachmentsRequested = true,
212
219
  voiceInput: voiceInputRequested = true,
220
+ realtimeVoice: realtimeVoiceRequested = true,
213
221
  modelPicker,
214
222
  modelPickerProps,
215
223
  userMessageDisclosureLabels,
@@ -319,6 +327,30 @@ function Conversation({
319
327
  if (feed.error) void feed.jumpToLatest();
320
328
  };
321
329
  const running = status === "running" || status === "recovering" || status === "waiting_capacity";
330
+ const voiceModels = useRealtimeVoiceModels(
331
+ context.client,
332
+ context.workspaceId,
333
+ realtimeVoiceRequested && config.realtimeVoice && !importedArchive,
334
+ );
335
+ const [voiceActive, setVoiceActive] = useState(false);
336
+ const voiceControl =
337
+ composer.effectiveControl ?? queue.effectiveControl ?? detail.session?.effectiveControl;
338
+ const voice =
339
+ voiceModels.length > 0 && status && !terminal && voiceControl ? (
340
+ <Suspense fallback={null}>
341
+ <LazyEmbeddedRealtimeVoice
342
+ client={context.client}
343
+ workspaceId={context.workspaceId}
344
+ models={voiceModels}
345
+ sessionId={sessionId}
346
+ sessionStatus={status}
347
+ effectiveControl={voiceControl}
348
+ events={feed.events}
349
+ eventsReady={!feed.initialLoading}
350
+ onVoiceActiveChange={setVoiceActive}
351
+ />
352
+ </Suspense>
353
+ ) : null;
322
354
  return (
323
355
  <div
324
356
  className={cn(
@@ -467,6 +499,17 @@ function Conversation({
467
499
  {...(transcription && composerProps?.transcription === undefined
468
500
  ? { transcription }
469
501
  : {})}
502
+ actionsStart={
503
+ voice ? (
504
+ <>
505
+ {composerProps?.actionsStart}
506
+ {voice}
507
+ </>
508
+ ) : (
509
+ composerProps?.actionsStart
510
+ )
511
+ }
512
+ transcriptionSuppressed={composerProps?.transcriptionSuppressed ?? voiceActive}
470
513
  composer={composer}
471
514
  attachments={uploadsEnabled ? files : undefined}
472
515
  disabled={terminal || composerProps?.disabled}
@@ -534,6 +577,7 @@ function GoalChrome({ sessionId, client, workspaceId, events, chrome }: Conversa
534
577
  });
535
578
  return <SessionChrome {...chrome} goal={goal} />;
536
579
  }
580
+ const LazyEmbeddedRealtimeVoice = lazy(() => import("../realtime/embedded-voice"));
537
581
 
538
582
  const LazyChatInteractiveBlock = lazy(() =>
539
583
  import("./artifacts/chat-interactive-block").then((module) => ({
@@ -1,4 +1,9 @@
1
- import { OpenGeniBrowserClient, type FetchLike } from "@opengeni/sdk/browser";
1
+ import {
2
+ formatErrorMessage,
3
+ OpenGeniApiError,
4
+ OpenGeniBrowserClient,
5
+ type FetchLike,
6
+ } from "@opengeni/sdk/browser";
2
7
  import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
3
8
  import type { SessionClientLike } from "../client";
4
9
  import { OpenGeniProvider } from "../provider";
@@ -26,6 +31,25 @@ export type SessionProxyBaseUrl = {
26
31
  fetch?: FetchLike | undefined;
27
32
  };
28
33
 
34
+ /**
35
+ * End-user copy for a failed first load. The proxy calls Opengeni with the
36
+ * server's key, so Opengeni's own `unauthenticated` refusal means that key was
37
+ * rejected (the server logs what to fix), not that this person must sign in.
38
+ * A host's own 401 from `resolve` carries no Opengeni code and still reads as
39
+ * "Sign in to continue."
40
+ */
41
+ function proxyLoadErrorMessage(error: unknown): string {
42
+ if (
43
+ error instanceof OpenGeniApiError &&
44
+ error.status === 401 &&
45
+ error.code === "unauthenticated"
46
+ ) {
47
+ const message = "Chat is unavailable right now. Ask an administrator for help.";
48
+ return error.correlationId ? `${message} Reference: ${error.correlationId}.` : message;
49
+ }
50
+ return formatErrorMessage(error, "Could not load the conversation.");
51
+ }
52
+
29
53
  type ScopeState =
30
54
  | { status: "loading" }
31
55
  | { status: "ready"; workspaceId: string }
@@ -103,10 +127,7 @@ export function SessionProxyScope({
103
127
  },
104
128
  (error: unknown) => {
105
129
  if (!active) return;
106
- setState({
107
- status: "error",
108
- message: error instanceof Error ? error.message : "Could not load the conversation.",
109
- });
130
+ setState({ status: "error", message: proxyLoadErrorMessage(error) });
110
131
  },
111
132
  );
112
133
  return () => {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Internal DOM signal between the composer's two voice controls: dictation
3
+ * starting supersedes a stale live-voice start failure in the same composer.
4
+ * Not part of the public package surface.
5
+ */
6
+ export const COMPOSER_VOICE_INPUT_START_EVENT = "opengeni:composer-voice-input-start";
7
+
8
+ /** Closest composer root shared by both voice controls (falls back to the document). */
9
+ export function composerVoiceEventScope(element: Element | null): EventTarget | null {
10
+ if (!element) return null;
11
+ return element.closest(".og-composer") ?? element.ownerDocument;
12
+ }
@@ -92,7 +92,10 @@ function ScopedDiscovery({
92
92
  (item) =>
93
93
  item.kind === "mcp" &&
94
94
  item.authKind === "oauth2" &&
95
- Boolean(item.mcpUrl ?? item.endpointUrl),
95
+ Boolean(item.mcpUrl ?? item.endpointUrl) &&
96
+ // The provider refuses self-registration and this deployment
97
+ // has no operator client for it: Connect cannot succeed.
98
+ (item.enabled || item.runtime?.operatorOAuthClient?.configured !== false),
96
99
  ),
97
100
  );
98
101
  }
@@ -12,6 +12,7 @@ export type ClientConfigFlagsSource = {
12
12
  sessionCreation?: boolean | undefined;
13
13
  archive?: boolean | undefined;
14
14
  voiceInput?: ClientVoiceInputConfig | undefined;
15
+ realtimeVoice?: boolean | undefined;
15
16
  }>;
16
17
  };
17
18
 
@@ -33,6 +34,11 @@ export type ClientConfigFlags = {
33
34
  archive: boolean;
34
35
  /** Native voice input when the deployment can transcribe, else null. */
35
36
  voiceInput: ClientVoiceInputConfig | null;
37
+ /**
38
+ * Live voice. `false` until the config loads and when a session proxy turns
39
+ * it off; availability otherwise comes from the realtime model catalog.
40
+ */
41
+ realtimeVoice: boolean;
36
42
  };
37
43
 
38
44
  const INITIAL_FLAGS: ClientConfigFlags = {
@@ -45,6 +51,7 @@ const INITIAL_FLAGS: ClientConfigFlags = {
45
51
  sessionCreation: true,
46
52
  archive: true,
47
53
  voiceInput: null,
54
+ realtimeVoice: false,
48
55
  };
49
56
 
50
57
  type ClientConfigFlagsInput = Awaited<ReturnType<ClientConfigFlagsSource["getClientConfig"]>>;
@@ -89,6 +96,7 @@ export function useClientConfigFlags(
89
96
  sessionCreation: config.sessionCreation !== false,
90
97
  archive: config.archive !== false,
91
98
  voiceInput: config.voiceInput?.available === true ? config.voiceInput : null,
99
+ realtimeVoice: config.realtimeVoice !== false,
92
100
  });
93
101
  }
94
102
  },
@@ -84,6 +84,9 @@ export function useGoal(
84
84
  const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
85
85
  const generation = useRef(0);
86
86
  const targetKeyRef = useRef<string | null>(null);
87
+ // True after the server answered 404. Only a goal event can create a goal,
88
+ // so turn/session traffic must not refetch (and 404) while none exists.
89
+ const goalAbsentRef = useRef(false);
87
90
  const loadAbort = useRef<AbortController | null>(null);
88
91
 
89
92
  const retireLoads = useCallback(() => {
@@ -105,6 +108,7 @@ export function useGoal(
105
108
  signal: controller.signal,
106
109
  });
107
110
  if (ticket === generation.current) {
111
+ goalAbsentRef.current = false;
108
112
  setGoal(fetched);
109
113
  setError(null);
110
114
  setLoading(false);
@@ -115,6 +119,7 @@ export function useGoal(
115
119
  }
116
120
  if (cause instanceof OpenGeniApiError && cause.status === 404) {
117
121
  // No goal is a normal state, not an error.
122
+ goalAbsentRef.current = true;
118
123
  setGoal(null);
119
124
  setError(null);
120
125
  } else {
@@ -130,6 +135,7 @@ export function useGoal(
130
135
  const targetKey = `${workspaceId} ${sessionId ?? ""}`;
131
136
  if (targetKeyRef.current !== targetKey) {
132
137
  targetKeyRef.current = targetKey;
138
+ goalAbsentRef.current = false;
133
139
  setGoal(null);
134
140
  setError(null);
135
141
  }
@@ -181,7 +187,12 @@ export function useGoal(
181
187
  ]);
182
188
 
183
189
  const scheduleRefresh = useDebouncedCallback(() => void load());
184
- useSessionEventTrigger(client, workspaceId, sessionId, isGoalRefreshEvent, scheduleRefresh, {
190
+ const isRefreshEvent = useCallback(
191
+ (event: SessionEvent) =>
192
+ goalAbsentRef.current ? isGoalEvent(event) : isGoalRefreshEvent(event),
193
+ [],
194
+ );
195
+ useSessionEventTrigger(client, workspaceId, sessionId, isRefreshEvent, scheduleRefresh, {
185
196
  enabled,
186
197
  ...(sharedEvents !== undefined ? { events: sharedEvents } : {}),
187
198
  });
@@ -0,0 +1,67 @@
1
+ import type { WorkspaceRealtimeModelCatalogResponse } from "@opengeni/sdk";
2
+ import { useEffect, useState } from "react";
3
+
4
+ type CatalogClient = {
5
+ getWorkspaceRealtimeModelCatalog?: (
6
+ workspaceId: string,
7
+ options?: { signal?: AbortSignal | undefined },
8
+ ) => Promise<WorkspaceRealtimeModelCatalogResponse>;
9
+ };
10
+
11
+ type AvailableVoiceModels = WorkspaceRealtimeModelCatalogResponse["models"];
12
+
13
+ const CACHE_TTL_MS = 60_000;
14
+ const cache = new WeakMap<
15
+ object,
16
+ Map<string, { models: Promise<AvailableVoiceModels>; expiresAt: number }>
17
+ >();
18
+
19
+ function load(client: CatalogClient, workspaceId: string): Promise<AvailableVoiceModels> {
20
+ let byWorkspace = cache.get(client);
21
+ if (!byWorkspace) {
22
+ byWorkspace = new Map();
23
+ cache.set(client, byWorkspace);
24
+ }
25
+ const hit = byWorkspace.get(workspaceId);
26
+ if (hit && hit.expiresAt > Date.now()) return hit.models;
27
+ // A throwing structural client (one without voice) just means no voice.
28
+ const models = Promise.resolve()
29
+ .then(() => client.getWorkspaceRealtimeModelCatalog!(workspaceId))
30
+ .then((catalog) => catalog.models.filter((model) => model.available));
31
+ const entry = { models, expiresAt: Date.now() + CACHE_TTL_MS };
32
+ byWorkspace.set(workspaceId, entry);
33
+ models.catch(() => {
34
+ if (byWorkspace.get(workspaceId) === entry) byWorkspace.delete(workspaceId);
35
+ });
36
+ return models;
37
+ }
38
+
39
+ /**
40
+ * Voice models this user can start right now in the workspace, or an empty
41
+ * list while unknown, disabled, unsupported (older API or proxy), or failed.
42
+ * Availability is advisory; Opengeni still admits and meters every call.
43
+ */
44
+ export function useRealtimeVoiceModels(
45
+ client: unknown,
46
+ workspaceId: string,
47
+ enabled: boolean,
48
+ ): AvailableVoiceModels {
49
+ const [models, setModels] = useState<AvailableVoiceModels>([]);
50
+ useEffect(() => {
51
+ setModels([]);
52
+ const catalogClient = client as CatalogClient;
53
+ if (!enabled || !workspaceId) return;
54
+ if (typeof catalogClient.getWorkspaceRealtimeModelCatalog !== "function") return;
55
+ let live = true;
56
+ load(catalogClient, workspaceId).then(
57
+ (available) => {
58
+ if (live) setModels(available);
59
+ },
60
+ () => undefined,
61
+ );
62
+ return () => {
63
+ live = false;
64
+ };
65
+ }, [client, workspaceId, enabled]);
66
+ return models;
67
+ }