@datalayer/agent-runtimes 1.5.52 → 1.5.53

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 (463) hide show
  1. package/dist-embed/chunks/{ChatView-Dy-IgGFL.js → ChatView-CRp8Mt57.js} +4 -4
  2. package/dist-embed/datalayer-app-main.js +86 -86
  3. package/lib/api/runtimes/environments.d.ts +2 -2
  4. package/lib/api/runtimes/environments.js +5 -5
  5. package/lib/api/runtimes/runtimes.d.ts +7 -7
  6. package/lib/api/runtimes/runtimes.js +5 -5
  7. package/lib/apps/__tests__/fixtures/sceneCheckCases.json +1 -1
  8. package/lib/apps/apps/AppBrowserSandbox.js +1 -1
  9. package/lib/apps/apps/AppComposer.d.ts +3 -3
  10. package/lib/apps/apps/AppComposer.js +3 -3
  11. package/lib/apps/apps/AppFeedback.d.ts +1 -1
  12. package/lib/apps/apps/AppKept.d.ts +1 -1
  13. package/lib/apps/apps/AppKept.js +1 -1
  14. package/lib/apps/apps/AppRenderer.d.ts +14 -14
  15. package/lib/apps/apps/AppRenderer.js +18 -20
  16. package/lib/apps/apps/AppRuntimePlugins.js +2 -3
  17. package/lib/apps/apps/agent.js +1 -1
  18. package/lib/apps/apps/appspec.d.ts +10 -10
  19. package/lib/apps/apps/appspec.js +35 -35
  20. package/lib/apps/apps/browserSandbox.d.ts +1 -1
  21. package/lib/apps/apps/checks.d.ts +16 -7
  22. package/lib/apps/apps/checks.js +65 -21
  23. package/lib/apps/apps/composer.d.ts +2 -2
  24. package/lib/apps/apps/composer.js +1 -1
  25. package/lib/apps/apps/computer.d.ts +3 -3
  26. package/lib/apps/apps/computer.js +1 -1
  27. package/lib/apps/apps/customComponents.d.ts +2 -2
  28. package/lib/apps/apps/customComponents.js +3 -3
  29. package/lib/apps/apps/feedback.d.ts +2 -2
  30. package/lib/apps/apps/hostTools.d.ts +3 -3
  31. package/lib/apps/apps/hostTools.js +2 -2
  32. package/lib/apps/apps/kept.d.ts +1 -1
  33. package/lib/apps/apps/language.d.ts +1 -1
  34. package/lib/apps/apps/pluginPair.d.ts +1 -1
  35. package/lib/apps/apps/records.js +1 -1
  36. package/lib/apps/apps/rules.d.ts +2 -2
  37. package/lib/apps/apps/rules.js +2 -2
  38. package/lib/apps/apps/saved.d.ts +1 -1
  39. package/lib/apps/apps/saved.js +1 -1
  40. package/lib/apps/apps/sceneChecks.js +3 -3
  41. package/lib/apps/apps/sceneYaml.js +1 -1
  42. package/lib/apps/apps/sessionRules.d.ts +7 -8
  43. package/lib/apps/apps/sessionRules.js +6 -7
  44. package/lib/apps/apps/settingsInputs.d.ts +1 -1
  45. package/lib/apps/apps/settingsInputs.js +1 -1
  46. package/lib/apps/apps/threads.d.ts +2 -2
  47. package/lib/apps/apps/threads.js +1 -1
  48. package/lib/apps/apps/uploads.d.ts +1 -1
  49. package/lib/apps/apps/visitorToken.d.ts +1 -1
  50. package/lib/apps/apps/visitorToken.js +2 -2
  51. package/lib/apps/core/a2uiComponents.js +1 -2
  52. package/lib/apps/core/appFiles.js +1 -1
  53. package/lib/apps/core/canvasBlocks.d.ts +1 -1
  54. package/lib/apps/core/canvasBlocks.js +1 -1
  55. package/lib/apps/core/canvasParts.d.ts +3 -3
  56. package/lib/apps/core/canvasParts.js +1 -1
  57. package/lib/apps/core/index.d.ts +12 -13
  58. package/lib/apps/core/index.js +5 -6
  59. package/lib/apps/embed/AppEmbed.d.ts +9 -9
  60. package/lib/apps/embed/AppEmbed.js +9 -10
  61. package/lib/apps/embed/LoopEmbed.d.ts +2 -3
  62. package/lib/apps/embed/datalayer-app.js +1 -1
  63. package/lib/apps/embed/element.js +11 -11
  64. package/lib/apps/embed/embedConfig.d.ts +8 -10
  65. package/lib/apps/embed/embedConfig.js +6 -7
  66. package/lib/apps/embed/embedSession.d.ts +3 -3
  67. package/lib/apps/embed/embedSession.js +2 -2
  68. package/lib/apps/embed/embeddedSecrets.d.ts +1 -1
  69. package/lib/apps/embed/embeddedSecrets.js +1 -1
  70. package/lib/apps/embed/hostBridge.d.ts +14 -14
  71. package/lib/apps/embed/hostBridge.js +9 -9
  72. package/lib/apps/embed/loader.js +2 -2
  73. package/lib/apps/embed/visitorApp.d.ts +1 -1
  74. package/lib/apps/index.d.ts +1 -1
  75. package/lib/apps/index.js +3 -3
  76. package/lib/apps/plugins/a2ui/A2uiView.js +1 -1
  77. package/lib/apps/plugins/a2ui-surface/AnswerShows.d.ts +2 -2
  78. package/lib/apps/plugins/a2ui-surface/AnswerShows.js +1 -1
  79. package/lib/apps/plugins/a2ui-surface/InlineSurface.d.ts +1 -1
  80. package/lib/apps/plugins/a2ui-surface/SurfaceToolResult.js +2 -2
  81. package/lib/apps/plugins/a2ui-surface/index.js +1 -1
  82. package/lib/apps/plugins/a2ui-surface/ownComponents.js +1 -1
  83. package/lib/apps/plugins/a2ui-surface/toolResult.d.ts +2 -2
  84. package/lib/apps/plugins/a2ui-surface/toolResult.js +2 -2
  85. package/lib/apps/plugins/agent-capacity/index.d.ts +2 -2
  86. package/lib/apps/plugins/agents/DatalayerAgentBridge.js +4 -4
  87. package/lib/apps/plugins/agents/appLaunch.d.ts +1 -1
  88. package/lib/apps/plugins/agents/plugin.d.ts +4 -4
  89. package/lib/apps/plugins/agents/switchable.js +1 -1
  90. package/lib/apps/plugins/app-activity/AppActivity.d.ts +1 -1
  91. package/lib/apps/plugins/app-components/index.d.ts +1 -2
  92. package/lib/apps/plugins/app-components/index.js +1 -2
  93. package/lib/apps/plugins/app-computer/AppComputer.d.ts +1 -1
  94. package/lib/apps/plugins/app-computer/AppComputer.js +2 -2
  95. package/lib/apps/plugins/app-elements/AppElements.d.ts +1 -2
  96. package/lib/apps/plugins/app-elements/AppElements.js +1 -1
  97. package/lib/apps/plugins/app-elements/QuestionView.d.ts +1 -2
  98. package/lib/apps/plugins/app-elements/QuestionView.js +1 -1
  99. package/lib/apps/plugins/app-elements/index.d.ts +2 -2
  100. package/lib/apps/plugins/app-elements/index.js +2 -2
  101. package/lib/apps/plugins/app-page/AppPage.d.ts +3 -3
  102. package/lib/apps/plugins/app-page/appPageModel.d.ts +5 -5
  103. package/lib/apps/plugins/app-page/appPageModel.js +1 -1
  104. package/lib/apps/plugins/app-page/index.d.ts +3 -3
  105. package/lib/apps/plugins/app-page/index.js +1 -1
  106. package/lib/apps/plugins/app-page/pageRun.d.ts +2 -2
  107. package/lib/apps/plugins/app-page/pageRun.js +2 -2
  108. package/lib/apps/plugins/app-rules/AppRulesCard.d.ts +5 -5
  109. package/lib/apps/plugins/app-rules/AppRulesCard.js +4 -4
  110. package/lib/apps/plugins/assistant/index.d.ts +2 -2
  111. package/lib/apps/plugins/assistant-characters/index.d.ts +2 -2
  112. package/lib/apps/plugins/assistant-characters/index.js +2 -2
  113. package/lib/apps/plugins/canvas-blocks/index.d.ts +1 -1
  114. package/lib/apps/plugins/canvas-blocks/index.js +1 -1
  115. package/lib/apps/plugins/canvas-parts/index.d.ts +5 -5
  116. package/lib/apps/plugins/canvas-parts/index.js +5 -5
  117. package/lib/apps/plugins/chat/ChatView.js +36 -34
  118. package/lib/apps/plugins/chat/index.d.ts +8 -8
  119. package/lib/apps/plugins/document/DocumentView.js +2 -2
  120. package/lib/apps/plugins/notebook/NotebookView.js +1 -1
  121. package/lib/apps/plugins/page-layout/SplitLayout.d.ts +1 -1
  122. package/lib/apps/plugins/pap-sign-in/PapSignInCard.d.ts +1 -1
  123. package/lib/apps/plugins/pap-sign-in/PapSignInCard.js +1 -1
  124. package/lib/apps/plugins/pap-sign-in/index.js +1 -1
  125. package/lib/apps/plugins/pap-sign-in/signIn.d.ts +1 -1
  126. package/lib/apps/plugins/pap-sign-in/signIn.js +1 -1
  127. package/lib/apps/plugins/plugins-panel/index.d.ts +1 -1
  128. package/lib/apps/plugins/plugins-panel/index.js +1 -1
  129. package/lib/apps/plugins/shield-displays/DiffCard.d.ts +2 -2
  130. package/lib/apps/plugins/shield-displays/TerminalCard.d.ts +1 -1
  131. package/lib/apps/plugins/shield-displays/index.js +3 -3
  132. package/lib/apps/presets.d.ts +9 -9
  133. package/lib/apps/presets.js +3 -3
  134. package/lib/apps/shell/LoopWorkspace.d.ts +1 -1
  135. package/lib/apps/shell/LoopWorkspace.js +1 -1
  136. package/lib/apps/shell/PluginToggles.d.ts +1 -1
  137. package/lib/apps/shell/SidebarRail.d.ts +1 -1
  138. package/lib/apps/shell/paneMotion.d.ts +1 -1
  139. package/lib/apps/shell/paneMotion.js +1 -1
  140. package/lib/chat/ChatFloating.d.ts +8 -9
  141. package/lib/chat/ChatFloating.js +4 -4
  142. package/lib/chat/ChatInline.js +1 -1
  143. package/lib/chat/ChatLanguage.d.ts +1 -1
  144. package/lib/chat/ChatLanguage.js +1 -1
  145. package/lib/chat/assistant/AssistantContextMenu.d.ts +1 -1
  146. package/lib/chat/assistant/AssistantStage.d.ts +4 -4
  147. package/lib/chat/assistant/AssistantStage.js +1 -1
  148. package/lib/chat/assistant/BalloonParts.d.ts +1 -1
  149. package/lib/chat/assistant/BalloonVisual.d.ts +1 -1
  150. package/lib/chat/assistant/SpeechBalloon.d.ts +2 -2
  151. package/lib/chat/assistant/SpriteCharacter.d.ts +1 -1
  152. package/lib/chat/assistant/characters.d.ts +2 -2
  153. package/lib/chat/assistant/formats/acf.js +1 -1
  154. package/lib/chat/assistant/formats/files.js +1 -1
  155. package/lib/chat/assistant/formats/index.d.ts +1 -1
  156. package/lib/chat/assistant/formats/index.js +1 -1
  157. package/lib/chat/assistant/formats/types.d.ts +1 -1
  158. package/lib/chat/assistant/state.d.ts +2 -2
  159. package/lib/chat/assistant/toolLine.js +1 -1
  160. package/lib/chat/base/ChatBase.js +28 -20
  161. package/lib/chat/base/conversationItems.d.ts +3 -3
  162. package/lib/chat/base/loopElement.d.ts +2 -2
  163. package/lib/chat/base/loopStep.d.ts +3 -3
  164. package/lib/chat/base/loopStep.js +1 -1
  165. package/lib/chat/base/loopWindow.d.ts +3 -3
  166. package/lib/chat/base/loopWindow.js +3 -3
  167. package/lib/chat/base/uiFiles.d.ts +1 -1
  168. package/lib/chat/base/uiFiles.js +1 -1
  169. package/lib/chat/base/uiOps.d.ts +1 -1
  170. package/lib/chat/base/uiOps.js +1 -1
  171. package/lib/chat/index.js +1 -1
  172. package/lib/chat/indicators/McpStatusIndicator.js +1 -1
  173. package/lib/chat/indicators/SkillsStatusIndicator.js +1 -1
  174. package/lib/chat/messages/ChatMessageList.d.ts +3 -4
  175. package/lib/chat/messages/ChatMessageList.js +2 -2
  176. package/lib/chat/messages/markdownWithoutHtml.d.ts +1 -1
  177. package/lib/chat/messages/markdownWithoutHtml.js +1 -1
  178. package/lib/chat/presence/Presence.d.ts +2 -2
  179. package/lib/chat/presence/Presence.js +1 -1
  180. package/lib/chat/presence/presenceStatus.d.ts +2 -2
  181. package/lib/chat/presence/presenceStatus.js +2 -2
  182. package/lib/chat/prompt/InputPrompt.d.ts +3 -3
  183. package/lib/chat/prompt/InputPromptBase.d.ts +1 -1
  184. package/lib/chat/prompt/InputPromptBase.js +1 -1
  185. package/lib/chat/prompt/InputPromptLexical.d.ts +1 -1
  186. package/lib/chat/styles/streamdownStyles.js +1 -1
  187. package/lib/chat/useViewportDrag.d.ts +1 -1
  188. package/lib/chat/viewModes.d.ts +1 -1
  189. package/lib/chat/viewModes.js +2 -2
  190. package/lib/chat/words.js +1 -1
  191. package/lib/client/mixins/RuntimesMixin.d.ts +3 -3
  192. package/lib/client/mixins/RuntimesMixin.js +3 -3
  193. package/lib/components/a2ui/custom/index.d.ts +3 -3
  194. package/lib/components/a2ui/custom/index.js +1 -1
  195. package/lib/components/a2ui/custom/sandbox.d.ts +2 -2
  196. package/lib/components/a2ui/custom/sandbox.js +2 -2
  197. package/lib/components/a2ui/datalayer/Chart.js +2 -2
  198. package/lib/components/a2ui/datalayer/Chat.js +1 -1
  199. package/lib/components/a2ui/datalayer/Download.js +1 -1
  200. package/lib/components/a2ui/datalayer/Evidence.js +1 -1
  201. package/lib/components/a2ui/datalayer/FileUpload.d.ts +1 -1
  202. package/lib/components/a2ui/datalayer/FileUpload.js +2 -2
  203. package/lib/components/a2ui/datalayer/Form.js +2 -2
  204. package/lib/components/a2ui/datalayer/SchemaForm.d.ts +1 -1
  205. package/lib/components/a2ui/datalayer/Table.js +1 -1
  206. package/lib/components/a2ui/datalayer/drawn.d.ts +1 -1
  207. package/lib/components/a2ui/datalayer/drawn.js +1 -1
  208. package/lib/components/a2ui/datalayer/formWidgets.js +1 -1
  209. package/lib/components/a2ui/datalayer/index.d.ts +1 -1
  210. package/lib/components/a2ui/datalayer/schema.d.ts +2 -2
  211. package/lib/components/a2ui/datalayer/schema.js +2 -2
  212. package/lib/components/a2ui/styles.js +1 -1
  213. package/lib/components/a2ui/visibleWhen.d.ts +3 -3
  214. package/lib/components/a2ui/visibleWhen.js +3 -3
  215. package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.d.ts +1 -1
  216. package/lib/components/code-sandboxes/CodeSandboxLauncher.js +1 -1
  217. package/lib/components/code-sandboxes/CodeSandboxUtils.d.ts +1 -1
  218. package/lib/components/code-sandboxes/codeSandboxEnvironments.d.ts +2 -2
  219. package/lib/components/inspector/a2aSpans.d.ts +1 -1
  220. package/lib/components/inspector/a2aSpans.js +1 -1
  221. package/lib/components/teams/A2ATeamGraph.d.ts +3 -3
  222. package/lib/components/teams/A2ATeamGraph.js +1 -3
  223. package/lib/components/teams/AnswerSurfaces.d.ts +1 -1
  224. package/lib/components/teams/NotebookPreview.d.ts +1 -1
  225. package/lib/components/teams/SceneTranscript.d.ts +1 -1
  226. package/lib/components/teams/SceneView.d.ts +1 -1
  227. package/lib/components/teams/a2aTeamFlow.d.ts +1 -1
  228. package/lib/components/teams/a2aTeamFlow.js +1 -1
  229. package/lib/components/teams/sceneStage.d.ts +1 -1
  230. package/lib/components/teams/sceneTranscript.d.ts +1 -1
  231. package/lib/components/teams/useA2ATeam.d.ts +5 -5
  232. package/lib/components/teams/useA2ATeam.js +3 -3
  233. package/lib/config/AgentConfiguration.d.ts +1 -1
  234. package/lib/examples/AssistantExample.d.ts +1 -1
  235. package/lib/examples/AssistantExample.js +1 -1
  236. package/lib/examples/AssistantGalleryExample.d.ts +1 -1
  237. package/lib/examples/AssistantGalleryExample.js +1 -1
  238. package/lib/examples/LoopAppComputerExample.d.ts +1 -1
  239. package/lib/examples/LoopAppComputerExample.js +1 -1
  240. package/lib/examples/ProtocolSignedRequestsExample.d.ts +1 -1
  241. package/lib/examples/ProtocolSignedRequestsExample.js +1 -1
  242. package/lib/examples/ProtocolUcpCheckoutExample.d.ts +1 -1
  243. package/lib/examples/ProtocolUcpCheckoutExample.js +1 -1
  244. package/lib/examples/ScenesExample.d.ts +1 -1
  245. package/lib/examples/ScenesExample.js +1 -1
  246. package/lib/examples/ShieldHarnessExample.d.ts +1 -1
  247. package/lib/examples/ShieldHarnessExample.js +1 -1
  248. package/lib/examples/ShieldPolicyExample.d.ts +1 -1
  249. package/lib/examples/ShieldPolicyExample.js +1 -1
  250. package/lib/examples/VoiceChatExample.d.ts +1 -1
  251. package/lib/examples/VoiceChatExample.js +1 -1
  252. package/lib/examples/example-selector.js +3 -3
  253. package/lib/examples/exampleGroups.js +3 -3
  254. package/lib/examples/pap/PapSignInDisplayView.d.ts +1 -1
  255. package/lib/examples/pap/PapSignInDisplayView.js +1 -1
  256. package/lib/examples/pap/papSignInCases.js +1 -1
  257. package/lib/examples/protocols/signedRequestsDemo.d.ts +1 -1
  258. package/lib/examples/protocols/signedRequestsDemo.js +1 -1
  259. package/lib/examples/protocols/ucpCheckoutDemo.d.ts +1 -1
  260. package/lib/examples/protocols/ucpCheckoutDemo.js +1 -1
  261. package/lib/examples/shield/shieldHarness.d.ts +1 -1
  262. package/lib/examples/shield/shieldPolicyDemo.d.ts +2 -2
  263. package/lib/examples/shield/shieldPolicyDemo.js +1 -1
  264. package/lib/examples/utils/assistantGallery.d.ts +1 -1
  265. package/lib/examples/utils/clippyJsCharacters.js +2 -2
  266. package/lib/examples/utils/testSpriteCharacter.js +2 -2
  267. package/lib/hooks/ownRoutes.d.ts +1 -1
  268. package/lib/hooks/useAgentRuntimes.d.ts +1 -1
  269. package/lib/hooks/useChat.js +1 -1
  270. package/lib/index.js +1 -1
  271. package/lib/loop-example-main.js +1 -1
  272. package/lib/models/Environment.d.ts +11 -11
  273. package/lib/models/Environment.js +1 -1
  274. package/lib/models/RuntimeDTO.d.ts +1 -1
  275. package/lib/portable/activity.d.ts +2 -2
  276. package/lib/portable/activity.js +3 -3
  277. package/lib/portable/adapterEvents.d.ts +1 -1
  278. package/lib/portable/agUiRefusal.d.ts +1 -1
  279. package/lib/portable/agUiRefusal.js +1 -1
  280. package/lib/portable/agui.d.ts +2 -2
  281. package/lib/portable/agui.js +2 -2
  282. package/lib/portable/approvalCard.d.ts +1 -1
  283. package/lib/portable/approvalCard.js +1 -1
  284. package/lib/portable/approvals.d.ts +2 -2
  285. package/lib/portable/approvals.js +1 -1
  286. package/lib/portable/conversation.d.ts +2 -2
  287. package/lib/portable/conversation.js +1 -1
  288. package/lib/portable/direct.d.ts +2 -2
  289. package/lib/portable/displays.d.ts +2 -2
  290. package/lib/portable/displays.js +3 -3
  291. package/lib/portable/fixtures.d.ts +4 -5
  292. package/lib/portable/fixtures.js +4 -5
  293. package/lib/portable/hosts/agentClient.d.ts +5 -6
  294. package/lib/portable/hosts/agentClient.js +7 -7
  295. package/lib/portable/hosts/approvalRenderers.d.ts +6 -7
  296. package/lib/portable/hosts/approvalRenderers.js +2 -3
  297. package/lib/portable/hosts/client.d.ts +9 -6
  298. package/lib/portable/hosts/client.js +9 -8
  299. package/lib/portable/hosts/contracts.d.ts +2 -4
  300. package/lib/portable/hosts/contracts.js +2 -4
  301. package/lib/portable/hosts/contracts.json +2 -2
  302. package/lib/portable/hosts/deadLetters.js +2 -2
  303. package/lib/portable/hosts/deliveries.d.ts +2 -3
  304. package/lib/portable/hosts/forbiddenGraph.d.ts +4 -4
  305. package/lib/portable/hosts/forbiddenGraph.js +4 -4
  306. package/lib/portable/hosts/health.d.ts +3 -4
  307. package/lib/portable/hosts/health.js +3 -4
  308. package/lib/portable/hosts/index.d.ts +1 -1
  309. package/lib/portable/hosts/index.js +1 -1
  310. package/lib/portable/hosts/observability.d.ts +1 -1
  311. package/lib/portable/hosts/observability.js +3 -4
  312. package/lib/portable/hosts/postgresQueue.d.ts +2 -2
  313. package/lib/portable/hosts/postgresQueue.js +3 -3
  314. package/lib/portable/hosts/queue.d.ts +1 -1
  315. package/lib/portable/hosts/quotas.d.ts +2 -2
  316. package/lib/portable/hosts/quotas.js +2 -2
  317. package/lib/portable/hosts/rateLimit.d.ts +1 -1
  318. package/lib/portable/hosts/resolution.d.ts +2 -2
  319. package/lib/portable/hosts/schema.d.ts +1 -1
  320. package/lib/portable/hosts/schema.js +1 -1
  321. package/lib/portable/hosts/secretCipher.d.ts +2 -2
  322. package/lib/portable/hosts/sessionUid.js +1 -2
  323. package/lib/portable/hosts/turnState.d.ts +1 -1
  324. package/lib/portable/index.js +12 -12
  325. package/lib/portable/lifecycle.d.ts +3 -3
  326. package/lib/portable/presence.d.ts +3 -3
  327. package/lib/portable/protectedInput.d.ts +1 -1
  328. package/lib/portable/records.d.ts +2 -2
  329. package/lib/portable/records.js +2 -2
  330. package/lib/portable/runMeasures.d.ts +1 -1
  331. package/lib/portable/runMeasures.js +1 -1
  332. package/lib/portable/runtimes.d.ts +1 -1
  333. package/lib/portable/semantic-events.json +1 -1
  334. package/lib/portable/semantic.d.ts +1 -1
  335. package/lib/portable/semantic.js +1 -1
  336. package/lib/portable/semanticOfAgUi.d.ts +2 -2
  337. package/lib/portable/semanticOfAgUi.js +1 -1
  338. package/lib/portable/signIn.d.ts +5 -5
  339. package/lib/portable/signIn.js +1 -1
  340. package/lib/portable/signInStatus.d.ts +1 -2
  341. package/lib/portable/signInStatus.js +1 -2
  342. package/lib/portable/thread.d.ts +2 -2
  343. package/lib/portable/thread.js +2 -2
  344. package/lib/portable/views.d.ts +5 -5
  345. package/lib/protocols/A2AAdapter.d.ts +1 -1
  346. package/lib/protocols/A2AAdapter.js +3 -3
  347. package/lib/protocols/AGUIAdapter.d.ts +1 -1
  348. package/lib/protocols/AGUIAdapter.js +2 -2
  349. package/lib/protocols/BrowserAgentAdapter.d.ts +2 -2
  350. package/lib/protocols/BrowserAgentAdapter.js +1 -1
  351. package/lib/protocols/VercelAIAdapter.js +2 -2
  352. package/lib/protocols/a2a/index.d.ts +1 -1
  353. package/lib/protocols/a2a/index.js +1 -1
  354. package/lib/protocols/agentProtocols.d.ts +1 -1
  355. package/lib/protocols/agentProtocols.js +1 -1
  356. package/lib/protocols/agentic-commerce/index.d.ts +2 -2
  357. package/lib/protocols/agentic-commerce/index.js +2 -2
  358. package/lib/protocols/commerce.d.ts +1 -1
  359. package/lib/protocols/commerce.js +3 -3
  360. package/lib/protocols/core.d.ts +3 -3
  361. package/lib/protocols/core.js +2 -2
  362. package/lib/protocols/mcp/client.js +1 -1
  363. package/lib/protocols/mcp/index.js +1 -1
  364. package/lib/protocols/pact/index.d.ts +6 -6
  365. package/lib/protocols/pact/index.js +6 -6
  366. package/lib/protocols/ucp/index.d.ts +2 -2
  367. package/lib/protocols/ucp/index.js +2 -2
  368. package/lib/protocols/ucp/merchant.js +1 -2
  369. package/lib/protocols/web-bot-auth/index.d.ts +1 -1
  370. package/lib/protocols/web-bot-auth/index.js +1 -1
  371. package/lib/protocols/web-bot-auth/tap.js +1 -1
  372. package/lib/runtimes/actions.js +2 -2
  373. package/lib/runtimes/apis.d.ts +3 -4
  374. package/lib/runtimes/browser/a2aPeer.d.ts +1 -1
  375. package/lib/runtimes/browser/a2aPeer.js +1 -1
  376. package/lib/runtimes/browser/protocol.d.ts +1 -1
  377. package/lib/runtimes/variants.d.ts +3 -3
  378. package/lib/runtimes/variants.js +4 -4
  379. package/lib/specs/agents/agents.js +2 -2
  380. package/lib/specs/apps.js +28 -28
  381. package/lib/specs/appspecSchema.js +62 -62
  382. package/lib/specs/harnesses.d.ts +1 -1
  383. package/lib/specs/harnesses.js +1 -1
  384. package/lib/specs/policies.d.ts +1 -1
  385. package/lib/specs/policies.js +2 -2
  386. package/lib/specs/protocols.d.ts +1 -1
  387. package/lib/specs/sceneSchema.js +4 -4
  388. package/lib/specs/scenes.js +4 -4
  389. package/lib/specs/standards.d.ts +1 -1
  390. package/lib/specs/ui.d.ts +2 -2
  391. package/lib/specs/ui.js +1 -1
  392. package/lib/specs/uiRenderers.d.ts +1 -1
  393. package/lib/specs/voices.d.ts +2 -2
  394. package/lib/specs/voices.js +2 -2
  395. package/lib/stories/loop/ReferenceScreens.js +1 -1
  396. package/lib/stories/loop/pictures-main.js +2 -2
  397. package/lib/test-setup.js +1 -1
  398. package/lib/types/agentspecs.d.ts +81 -85
  399. package/lib/types/chat.d.ts +26 -13
  400. package/lib/types/messages.d.ts +1 -1
  401. package/lib/types/protocol.d.ts +3 -3
  402. package/lib/types/scenes.d.ts +6 -6
  403. package/lib/types/teams.d.ts +3 -3
  404. package/lib/ui-plugins/MCPUIPlugin.d.ts +2 -2
  405. package/lib/ui-plugins/MCPUIPlugin.js +1 -1
  406. package/lib/voice/ComposerVoice.d.ts +5 -3
  407. package/lib/voice/ComposerVoice.js +4 -4
  408. package/lib/voice/HandsFree.d.ts +9 -3
  409. package/lib/voice/HandsFree.js +8 -3
  410. package/lib/voice/ReadAloud.d.ts +1 -1
  411. package/lib/voice/VoiceInput.d.ts +1 -2
  412. package/lib/voice/VoiceMenu.d.ts +1 -1
  413. package/lib/voice/captions.d.ts +1 -1
  414. package/lib/voice/captions.js +1 -1
  415. package/lib/voice/capture.d.ts +1 -1
  416. package/lib/voice/capture.js +1 -1
  417. package/lib/voice/chatVoice.d.ts +1 -1
  418. package/lib/voice/chatVoice.js +3 -3
  419. package/lib/voice/choices.d.ts +2 -2
  420. package/lib/voice/choices.js +2 -2
  421. package/lib/voice/consent.js +1 -1
  422. package/lib/voice/handsFree.d.ts +29 -4
  423. package/lib/voice/handsFree.js +32 -4
  424. package/lib/voice/hearing.d.ts +1 -1
  425. package/lib/voice/hearing.js +1 -1
  426. package/lib/voice/index.d.ts +2 -2
  427. package/lib/voice/pinned.d.ts +2 -2
  428. package/lib/voice/pinned.js +2 -2
  429. package/lib/voice/sayAloud.d.ts +2 -2
  430. package/lib/voice/sayAloud.js +2 -2
  431. package/lib/voice/sentences.d.ts +1 -1
  432. package/lib/voice/sentences.js +1 -1
  433. package/lib/voice/serverHearing.d.ts +8 -2
  434. package/lib/voice/serverHearing.js +37 -6
  435. package/lib/voice/settings.d.ts +2 -2
  436. package/lib/voice/settings.js +2 -2
  437. package/lib/voice/speaker.d.ts +10 -4
  438. package/lib/voice/speaker.js +5 -2
  439. package/lib/voice/types.d.ts +1 -1
  440. package/lib/voice/useSpokenAnswers.js +2 -2
  441. package/lib/voice/useVoiceSettings.js +1 -1
  442. package/lib/voice/useVoiceSpeaker.js +1 -1
  443. package/package.json +2 -2
  444. package/scripts/codegen/generate_agentic_commerce.sh +1 -1
  445. package/scripts/codegen/generate_agents.py +5 -5
  446. package/scripts/codegen/generate_apps.py +3 -3
  447. package/scripts/codegen/generate_harnesses.py +4 -4
  448. package/scripts/codegen/generate_mcp_servers.py +2 -2
  449. package/scripts/codegen/generate_policies.py +3 -3
  450. package/scripts/codegen/generate_protocols.py +3 -4
  451. package/scripts/codegen/generate_scenes.py +4 -4
  452. package/scripts/codegen/generate_standards.py +3 -3
  453. package/scripts/codegen/generate_teams.py +1 -1
  454. package/scripts/codegen/generate_ui.py +8 -8
  455. package/scripts/codegen/generate_ui_renderers.py +3 -3
  456. package/scripts/codegen/generate_voices.py +4 -4
  457. package/scripts/dist-embed.mjs +1 -1
  458. package/scripts/generate-environments-types.py +1 -1
  459. package/scripts/record-scene-checks.py +2 -2
  460. package/scripts/voice/measure.py +3 -3
  461. package/scripts/voice/pin_store.py +1 -1
  462. package/scripts/voice/serve_store.py +1 -1
  463. package/scripts/voice/transcribe.mjs +1 -1
@@ -640,7 +640,7 @@ export type ThemeOverrides = {
640
640
  dark?: Record<string, string>;
641
641
  };
642
642
  /**
643
- * A conversation the chat goes on with (LOOP D-13): an embedded
643
+ * A conversation the chat goes on with (D-13): an embedded
644
644
  * application's session, reattached after its page reloaded.
645
645
  */
646
646
  export type ResumedThread = {
@@ -649,7 +649,7 @@ export type ResumedThread = {
649
649
  /** What it holds already; none for a new one. */
650
650
  messages: ChatMessage[];
651
651
  /**
652
- * Opened from a person's history (LOOP P-24): its conversation is read
652
+ * Opened from a person's history (P-24): its conversation is read
653
653
  * from the runtime the application's chat runs on as the chat mounts —
654
654
  * held there, else resumed from its record — in place of `messages`.
655
655
  */
@@ -684,20 +684,26 @@ export interface ChatBaseProps {
684
684
  */
685
685
  thread: () => string;
686
686
  /**
687
- * Stops the agent's voice (VOICE.md VO-10): the chat's own speaker,
687
+ * Stops the agent's voice (VO-10): the chat's own speaker,
688
688
  * for a host whose composer holds the microphone and *Stop speaking*.
689
689
  * Absent while its answers are not heard.
690
690
  */
691
691
  stopSpeaking?: () => void;
692
692
  /**
693
- * Marks the answer the person spoke over *interrupted* (VOICE.md
694
- * VO-13), for a host whose composer holds the microphone.
693
+ * How loud the chat's speaker plays now, 0 to 1 (VO-13): a
694
+ * host's hands-free gates barge-in on it. Absent while its answers
695
+ * are not heard by a speaker that gives a level.
696
+ */
697
+ voiceLevel?: () => number;
698
+ /**
699
+ * Marks the answer the person spoke over *interrupted* (VO-13),
700
+ * for a host whose composer holds the microphone.
695
701
  */
696
702
  markInterrupted: () => void;
697
703
  } | null) => void;
698
704
  /**
699
705
  * Reports whether the agent's voice is speaking, for a host that draws the
700
- * composer and so its *Stop speaking* (VOICE.md VO-10).
706
+ * composer and so its *Stop speaking* (VO-10).
701
707
  */
702
708
  onSpeakingChange?: (speaking: boolean) => void;
703
709
  /**
@@ -781,7 +787,7 @@ export interface ChatBaseProps {
781
787
  mentionableAgents?: MentionableAgent[];
782
788
  /**
783
789
  * Commands the prompt lists while `/` is typed, before its own: an
784
- * application's (LOOP P-19). Picking one writes `/<name> `. Lexical only.
790
+ * application's (P-19). Picking one writes `/<name> `. Lexical only.
785
791
  */
786
792
  promptCommands?: PromptCommand[];
787
793
  /**
@@ -886,7 +892,7 @@ export interface ChatBaseProps {
886
892
  themeVariant?: string;
887
893
  /**
888
894
  * Properties laid over the theme's own, by mode — an application's accent
889
- * over the theme it wears (LOOP T-05): without them the chat would wear the
895
+ * over the theme it wears (T-05): without them the chat would wear the
890
896
  * theme's default accent whatever the page around it set.
891
897
  */
892
898
  themeOverrides?: ThemeOverrides;
@@ -1001,7 +1007,7 @@ export interface ChatBaseProps {
1001
1007
  /**
1002
1008
  * The agent's welcome, said as the first message of the history: drawn as
1003
1009
  * the chat draws the agent's messages, and never sent nor kept. The floating
1004
- * assistant's balloon opens on it (LOOP T-23).
1010
+ * assistant's balloon opens on it (T-23).
1005
1011
  */
1006
1012
  welcome?: string;
1007
1013
  /**
@@ -1011,7 +1017,7 @@ export interface ChatBaseProps {
1011
1017
  */
1012
1018
  trailingContent?: ReactNode;
1013
1019
  /**
1014
- * Its voice (VOICE.md V1): a microphone in the composer, push-to-talk,
1020
+ * Its voice (V1): a microphone in the composer, push-to-talk,
1015
1021
  * what is said heard on the device and put in the composer — or sent, with
1016
1022
  * *Send what I say* — marked as spoken (VO-27).
1017
1023
  */
@@ -1020,13 +1026,20 @@ export interface ChatBaseProps {
1020
1026
  voiceSpeaking?: boolean;
1021
1027
  /**
1022
1028
  * The sentence the host's speaker is saying, marked in the conversation
1023
- * (VOICE.md VO-65); a chat that speaks for itself marks its own.
1029
+ * (VO-65); a chat that speaks for itself marks its own.
1024
1030
  */
1025
1031
  voiceSentence?: string;
1026
1032
  /** Stops the agent's voice: the composer's *Stop speaking*, and the microphone opening (VO-13). */
1027
1033
  onStopSpeaking?: () => void;
1028
1034
  /**
1029
- * Reads an answer aloud (VOICE.md VO-21): given, each answer the agent has
1035
+ * How loud the host's speaker plays now, between 0 and 1 (`useVoiceSpeaker`'s
1036
+ * `level`): hands-free's barge-in counts speech only above what the answer's
1037
+ * own sound can leave in the microphone (VO-13). A chat that speaks
1038
+ * for itself reads its own.
1039
+ */
1040
+ voiceLevel?: () => number;
1041
+ /**
1042
+ * Reads an answer aloud (VO-21): given, each answer the agent has
1030
1043
  * finished writing has a *Read aloud* under it, which calls it with the
1031
1044
  * answer's text.
1032
1045
  */
@@ -1229,7 +1242,7 @@ export interface ChatBaseProps {
1229
1242
  accessToken?: string;
1230
1243
  }>;
1231
1244
  /**
1232
- * The conversation to go on with (LOOP D-13): its AG-UI thread — an
1245
+ * The conversation to go on with (D-13): its AG-UI thread — an
1233
1246
  * application's session — and what it holds, drawn in place of the
1234
1247
  * runtime's history, which is its agent's and not one session's. Read
1235
1248
  * when the chat mounts; a new thread (the header's +) is the chat's own.
@@ -124,7 +124,7 @@ export interface ChatMessage {
124
124
  metadata?: Record<string, unknown>;
125
125
  /**
126
126
  * What the message shows besides its words: the displays sent under it
127
- * (`reactor.ui`, REACTOR_UI RU-2), in the order they came; each drawn by
127
+ * (`reactor.ui`, RU-2), in the order they came; each drawn by
128
128
  * the renderer a plugin contributed for its type.
129
129
  */
130
130
  displays?: Display[];
@@ -45,7 +45,7 @@ export interface ProtocolConfig {
45
45
  /** Config endpoint URL for non-Jupyter protocols (if not set, uses Jupyter requestAPI) */
46
46
  configEndpoint?: string;
47
47
  /**
48
- * The ui channel's WebSocket (`ws://` or `wss://`, REACTOR_UI RU-W): an
48
+ * The ui channel's WebSocket (`ws://` or `wss://`, RU-W): an
49
49
  * application's session says on it what its messages show, its steps, its
50
50
  * elements, its authors and its window messages, and takes the presses of
51
51
  * what they offered. Set for an application's agent; one connection per
@@ -54,7 +54,7 @@ export interface ProtocolConfig {
54
54
  uiSocket?: string;
55
55
  /**
56
56
  * Where a file of a conversation is uploaded before the run or the press
57
- * that names it (REACTOR_UI RU-6): Reactor's upload, the bytes as the body,
57
+ * that names it (RU-6): Reactor's upload, the bytes as the body,
58
58
  * the conversation's thread its scope. A run carries the ref it answers,
59
59
  * never the bytes. Set for an application's agent.
60
60
  */
@@ -69,7 +69,7 @@ export interface ProtocolConfig {
69
69
  appSessions?: string;
70
70
  /**
71
71
  * The runtime answers only the application's own routes (OwnRoutesOnly,
72
- * PAP_DATALAYER's release gates): it serves a deployment — kept always on,
72
+ * the release gates): it serves a deployment — kept always on,
73
73
  * launched by a hosted page for it — or is the visitors' runtime. Nothing
74
74
  * outside them is opened: not the monitoring stream (an application's
75
75
  * session asks its approvals in the conversation, over `uiSocket`), not
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Scenes (agentspecs `scenes`, `schema: loop.scene/v1`, LOOP A-11): a team,
2
+ * Scenes (agentspecs `scenes`, `schema: loop.scene/v1`, A-11): a team,
3
3
  * staged. The team says who is on stage; the scene says what happens there —
4
4
  * the setting, the script, the stage directions, the audience, the rehearsal
5
5
  * and where it plays.
@@ -72,7 +72,7 @@ export interface SceneCueSpec {
72
72
  }
73
73
  /** What kind of answer comes back, and what the page shows. */
74
74
  export type SceneAnswerKind = 'words' | 'table' | 'chart' | 'notebook' | 'map' | 'file' | 'image'
75
- /** The sources it read, as cards that open (STUDIO H-02). */
75
+ /** The sources it read, as cards that open (H-02). */
76
76
  | 'sources'
77
77
  /** A choice as buttons that answer the application. */
78
78
  | 'choice'
@@ -162,7 +162,7 @@ export interface SceneRehearsalBeatSpec {
162
162
  mustNotSay?: string[];
163
163
  within: string;
164
164
  }
165
- /** A transcript recorded once, played when the scene cannot play live (LOOP H-08). */
165
+ /** A transcript recorded once, played when the scene cannot play live (H-08). */
166
166
  export interface SceneRecordingSpec {
167
167
  path: string;
168
168
  taken: string;
@@ -185,7 +185,7 @@ export interface ScenePlayedBeatSpec {
185
185
  }
186
186
  /**
187
187
  * What came of the last rehearsal `loop scenes rehearse --cloud` played
188
- * (LOOP A-14): kept beside the specs in `<id>/rehearsal.json`, written by the
188
+ * (A-14): kept beside the specs in `<id>/rehearsal.json`, written by the
189
189
  * command and never by hand. A scene is *Live* when it `passed`; one that did
190
190
  * not says so with `says`.
191
191
  */
@@ -210,7 +210,7 @@ export interface SceneDeploymentSpec {
210
210
  addresses: Record<string, string>;
211
211
  }
212
212
  /** Specification for a scene: a team, staged. */
213
- /** Somebody on a scripted scene: a person, an application, a company (PAP_DATALAYER X-02). */
213
+ /** Somebody on a scripted scene: a person, an application, a company (X-02). */
214
214
  export interface SceneActorSpec {
215
215
  id: string;
216
216
  /** The name the audience sees. */
@@ -258,7 +258,7 @@ export interface SceneSpec {
258
258
  version: string;
259
259
  /**
260
260
  * `team`: a team staged, live; `scripted`: actors and lines written out,
261
- * played as written, with no team, cast or script (PAP_DATALAYER X-02).
261
+ * played as written, with no team, cast or script (X-02).
262
262
  */
263
263
  kind: 'team' | 'scripted';
264
264
  /** The tab's name. */
@@ -48,7 +48,7 @@ export interface TeamContextSpec {
48
48
  sharing: TeamContextSharing;
49
49
  /**
50
50
  * The Frames every member works under, in order, `id` or `id:version`
51
- * (LOOP A-04): the team's shared context, as a Cog names its own.
51
+ * (A-04): the team's shared context, as a Cog names its own.
52
52
  */
53
53
  frames?: string[];
54
54
  }
@@ -88,13 +88,13 @@ export interface TeamAgentspec {
88
88
  /**
89
89
  * MCP server catalogue reference, in place of `ref` and `app`: the member
90
90
  * is that server, a system of the scene the others reach over MCP
91
- * (LOOP A-04). It asks nobody.
91
+ * (A-04). It asks nobody.
92
92
  */
93
93
  server?: string;
94
94
  /**
95
95
  * Harness catalogue id, in place of `ref`, `app` and `server`: the member is
96
96
  * that agent program over ACP behind the Shield — Claude Code, Codex, an
97
- * organization's own — asked over A2A or ACP (SHIELD SH-45).
97
+ * organization's own — asked over A2A or ACP (SH-45).
98
98
  */
99
99
  harness?: string;
100
100
  /** Where its loop turns: in the person's `browser`, or on a `runtime`. */
@@ -2,7 +2,7 @@
2
2
  * MCP-UI plugin for chat component.
3
3
  * Renders MCP UI protocol messages and resources.
4
4
  *
5
- * What it never draws (STUDIO D-22): the markup of a resource (`text/html`)
5
+ * What it never draws (D-22): the markup of a resource (`text/html`)
6
6
  * and a UI element built from a tool's props. Either is markup a server or a
7
7
  * model supplies, and the chat may sit on the platform's origin, where people
8
8
  * are signed in: each is refused in a sentence, in place, with no fallback.
@@ -53,7 +53,7 @@ export interface MCPUIMessage {
53
53
  };
54
54
  }
55
55
  /**
56
- * What the chat says in place of the MCP UI's markup (STUDIO D-22).
56
+ * What the chat says in place of the MCP UI's markup (D-22).
57
57
  */
58
58
  export declare const MCP_UI_NOT_DRAWN: {
59
59
  readonly html: "This answer carries a page of HTML from its MCP server. It is not drawn here: no markup from a server or a model reaches this page.";
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
- * What the chat says in place of the MCP UI's markup (STUDIO D-22).
3
+ * What the chat says in place of the MCP UI's markup (D-22).
4
4
  */
5
5
  export const MCP_UI_NOT_DRAWN = {
6
6
  html: 'This answer carries a page of HTML from its MCP server. It is not drawn here: no markup from a server or a model reaches this page.',
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The microphone of a composer whose text its host holds (VOICE.md VO-10,
3
- * VO-11): `ChatBase`'s own, and the workspace's (an application's page,
2
+ * The microphone of a composer whose text its host holds (VO-10, VO-11):
3
+ * `ChatBase`'s own, and the workspace's (an application's page,
4
4
  * whose composer is a plugin of its own). What the box held when the
5
5
  * microphone opened stays; the words heard go after it as they come, and the
6
6
  * whole of what was heard replaces them once it stops. Put there for the
@@ -31,6 +31,8 @@ export interface ComposerVoiceProps {
31
31
  speaking?: boolean;
32
32
  /** Stops the agent's voice, also when the microphone opens (VO-13). */
33
33
  onStopSpeaking?: () => void;
34
+ /** How loud the agent's voice plays now, 0 to 1: hands-free's barge-in is gated on it (VO-13). */
35
+ playbackLevel?: () => number;
34
36
  /** The agent is answering: a run is in progress (hands-free, VO-12). */
35
37
  running?: boolean;
36
38
  /** Stops the run while the answer is still being written (barge-in, VO-13). */
@@ -50,5 +52,5 @@ export interface ComposerVoiceProps {
50
52
  }
51
53
  /** Whether something rides on a run as a spoken message's metadata (VO-27). */
52
54
  export declare function spokenOf(value: unknown): SpokenMetadata | undefined;
53
- export declare function ComposerVoice({ voice, input, setInput, onSpoken, send, disabled, speaking, onStopSpeaking, running, onStopRun, onInterrupted, onInterimChange, answers, }: ComposerVoiceProps): JSX.Element | null;
55
+ export declare function ComposerVoice({ voice, input, setInput, onSpoken, send, disabled, speaking, onStopSpeaking, playbackLevel, running, onStopRun, onInterrupted, onInterimChange, answers, }: ComposerVoiceProps): JSX.Element | null;
54
56
  export default ComposerVoice;
@@ -15,9 +15,9 @@ export function spokenOf(value) {
15
15
  ? said
16
16
  : undefined;
17
17
  }
18
- export function ComposerVoice({ voice, input, setInput, onSpoken, send, disabled = false, speaking = false, onStopSpeaking, running = false, onStopRun, onInterrupted, onInterimChange, answers = false, }) {
18
+ export function ComposerVoice({ voice, input, setInput, onSpoken, send, disabled = false, speaking = false, onStopSpeaking, playbackLevel, running = false, onStopRun, onInterrupted, onInterimChange, answers = false, }) {
19
19
  // In the browser, or on Datalayer's servers where the application, the
20
- // language or the person's detection asks for it (§5, VO-14, VO-34).
20
+ // language or the person's detection asks for it (VO-14, VO-34).
21
21
  const place = hearingPlace(voice);
22
22
  const hearing = useMemo(() => {
23
23
  if (voice.input === 'off') {
@@ -31,7 +31,7 @@ export function ComposerVoice({ voice, input, setInput, onSpoken, send, disabled
31
31
  detect: voice.detect,
32
32
  })
33
33
  : undefined;
34
- // `where: auto` (§5): the device when it hears the language and its model
34
+ // `where: auto`: the device when it hears the language and its model
35
35
  // loads, the server otherwise — and back to the device when the server
36
36
  // refuses (a visitor's day spent).
37
37
  if (server && !voice.detect && (voice.where ?? 'auto') === 'auto') {
@@ -55,7 +55,7 @@ export function ComposerVoice({ voice, input, setInput, onSpoken, send, disabled
55
55
  if (!hearing) {
56
56
  return null;
57
57
  }
58
- return (_jsxs("span", { "data-composer-voice": "", style: { display: 'inline-flex', alignItems: 'center', gap: 2 }, children: [_jsx(VoiceMenu, { voice: voice, answers: answers, disabled: disabled }), voice.input === 'hands_free' ? (_jsx(HandsFree, { hearing: hearing, language: voice.language, consentKey: voice.consentKey ?? 'chat', microphoneId: voice.microphoneId, turnSilenceMs: voice.turnSilenceMs, disabled: disabled, running: running, speaking: speaking, onStopSpeaking: onStopSpeaking, onStopRun: onStopRun, onInterrupted: onInterrupted, onInterim: (words) => {
58
+ return (_jsxs("span", { "data-composer-voice": "", style: { display: 'inline-flex', alignItems: 'center', gap: 2 }, children: [_jsx(VoiceMenu, { voice: voice, answers: answers, disabled: disabled }), voice.input === 'hands_free' ? (_jsx(HandsFree, { hearing: hearing, language: voice.language, consentKey: voice.consentKey ?? 'chat', microphoneId: voice.microphoneId, turnSilenceMs: voice.turnSilenceMs, disabled: disabled, running: running, speaking: speaking, playbackLevel: playbackLevel, onStopSpeaking: onStopSpeaking, onStopRun: onStopRun, onInterrupted: onInterrupted, onInterim: (words) => {
59
59
  setInput(words ? afterBase(words) : base.current);
60
60
  onInterimChange?.(words !== '');
61
61
  }, send: (text, metadata) => {
@@ -1,6 +1,6 @@
1
1
  /**
2
- * *Talk with it*: a conversation by voice, hands-free (VOICE.md VO-12,
3
- * VO-13), beside the composer's microphone where the application's voice
2
+ * *Talk with it*: a conversation by voice, hands-free (VO-12, VO-13),
3
+ * beside the composer's microphone where the application's voice
4
4
  * says `input: hands_free`.
5
5
  *
6
6
  * On, the microphone stays open. The words are written in the composer as
@@ -43,6 +43,12 @@ export interface HandsFreeProps {
43
43
  running?: boolean;
44
44
  /** The agent's answer is being said. */
45
45
  speaking?: boolean;
46
+ /**
47
+ * How loud the agent's voice plays now, between 0 and 1 (the speaker's
48
+ * `level`): while it speaks, speech counts as barge-in only above what the
49
+ * playback can leave in the microphone (VO-13, `heardOverPlayback`).
50
+ */
51
+ playbackLevel?: () => number;
46
52
  /** Stops the agent's voice at once (barge-in, VO-13). */
47
53
  onStopSpeaking?: () => void;
48
54
  /** Stops the run while the answer is still being written (barge-in, VO-13). */
@@ -51,5 +57,5 @@ export interface HandsFreeProps {
51
57
  onInterrupted?: () => void;
52
58
  disabled?: boolean;
53
59
  }
54
- export declare function HandsFree({ hearing, language, consentKey, microphoneId, turnSilenceMs, send, onInterim, running, speaking, onStopSpeaking, onStopRun, onInterrupted, disabled, }: HandsFreeProps): JSX.Element;
60
+ export declare function HandsFree({ hearing, language, consentKey, microphoneId, turnSilenceMs, send, onInterim, running, speaking, playbackLevel, onStopSpeaking, onStopRun, onInterrupted, disabled, }: HandsFreeProps): JSX.Element;
55
61
  export default HandsFree;
@@ -8,7 +8,7 @@ import { HANDS_FREE_WORDS, IDLE_PAUSE_MS, TURN_SILENCE_MS, bargedIn, handsFreeSt
8
8
  import { INTERIM_MS } from './VoiceInput';
9
9
  /** Waits. */
10
10
  const pause = (ms) => new Promise(resolve => setTimeout(resolve, ms));
11
- export function HandsFree({ hearing, language, consentKey, microphoneId, turnSilenceMs = TURN_SILENCE_MS, send, onInterim, running = false, speaking = false, onStopSpeaking, onStopRun, onInterrupted, disabled = false, }) {
11
+ export function HandsFree({ hearing, language, consentKey, microphoneId, turnSilenceMs = TURN_SILENCE_MS, send, onInterim, running = false, speaking = false, playbackLevel, onStopSpeaking, onStopRun, onInterrupted, disabled = false, }) {
12
12
  const [on, setOn] = useState(false);
13
13
  const [paused, setPaused] = useState(false);
14
14
  const [asking, setAsking] = useState(false);
@@ -22,6 +22,7 @@ export function HandsFree({ hearing, language, consentKey, microphoneId, turnSil
22
22
  const latest = useRef({
23
23
  send,
24
24
  onInterim,
25
+ playbackLevel,
25
26
  onStopSpeaking,
26
27
  onStopRun,
27
28
  onInterrupted,
@@ -29,6 +30,7 @@ export function HandsFree({ hearing, language, consentKey, microphoneId, turnSil
29
30
  latest.current = {
30
31
  send,
31
32
  onInterim,
33
+ playbackLevel,
32
34
  onStopSpeaking,
33
35
  onStopRun,
34
36
  onInterrupted,
@@ -118,7 +120,11 @@ export function HandsFree({ hearing, language, consentKey, microphoneId, turnSil
118
120
  if (so.spoke) {
119
121
  quietSince = Date.now();
120
122
  }
121
- if (bargedIn(now, so)) {
123
+ const playing = latest.current.playbackLevel;
124
+ const levels = playing
125
+ ? { microphone: open.level(), playback: playing() }
126
+ : undefined;
127
+ if (bargedIn(now, so, levels)) {
122
128
  // The person speaks over the agent (VO-13): its voice and its run
123
129
  // stop; what was heard goes on as the next turn.
124
130
  latest.current.onStopSpeaking?.();
@@ -173,7 +179,6 @@ export function HandsFree({ hearing, language, consentKey, microphoneId, turnSil
173
179
  capture.current = undefined;
174
180
  };
175
181
  // The loop reads the state through a ref: it is not restarted on it.
176
- // eslint-disable-next-line react-hooks/exhaustive-deps
177
182
  }, [on, paused, hearing, language, microphoneId, turnSilenceMs]);
178
183
  // Esc pauses it.
179
184
  useEffect(() => {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * *Read aloud*, under an answer (VOICE.md VO-21, `on_request`): the answer,
2
+ * *Read aloud*, under an answer (VO-21, `on_request`): the answer,
3
3
  * read as plain words and cut into sentences, given to the speaker — what it
4
4
  * was saying stops first. The press is the gesture a browser plays sound
5
5
  * after.
@@ -1,6 +1,5 @@
1
1
  /**
2
- * The microphone in the composer (VOICE.md VO-10, VO-11, VO-61, VO-62, VO-65
3
- * to VO-68).
2
+ * The microphone in the composer (VO-10, VO-11, VO-61, VO-62, VO-65 to VO-68).
4
3
  *
5
4
  * Clicked, it listens: the words are written in the composer as they are
6
5
  * heard (`onInterim`), and it stops at a second click, or once the person
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The composer's voice menu (VOICE.md VO-14, VO-21, VO-25, VO-30): beside
2
+ * The composer's voice menu (VO-14, VO-21, VO-25, VO-30): beside
3
3
  * the microphone, what a person chooses for themselves — the language they
4
4
  * speak and hear, when answers are heard, the voice, its speed and loudness,
5
5
  * how long they pause before they are done (VO-69), *Send what I say*, the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Captions always (VOICE.md VO-65): the sentence being said is marked in the
2
+ * Captions always (VO-65): the sentence being said is marked in the
3
3
  * open conversation, not by colour alone. The answer that holds it is marked
4
4
  * `aria-current` and `data-voice-saying` with a bar beside it; the sentence
5
5
  * itself is underlined in place through the CSS Custom Highlight API, which
@@ -3,7 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  /**
6
- * Captions always (VOICE.md VO-65): the sentence being said is marked in the
6
+ * Captions always (VO-65): the sentence being said is marked in the
7
7
  * open conversation, not by colour alone. The answer that holds it is marked
8
8
  * `aria-current` and `data-voice-saying` with a bar beside it; the sentence
9
9
  * itself is underlined in place through the CSS Custom Highlight API, which
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The microphone, for one press (VOICE.md VO-10, VO-62): opened by a
2
+ * The microphone, for one press (VO-10, VO-62): opened by a
3
3
  * gesture, shown while open, closed when the press ends or is cancelled.
4
4
  * What it heard is kept in memory only, until it is transcribed.
5
5
  *
@@ -3,7 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  /**
6
- * The microphone, for one press (VOICE.md VO-10, VO-62): opened by a
6
+ * The microphone, for one press (VO-10, VO-62): opened by a
7
7
  * gesture, shown while open, closed when the press ends or is cancelled.
8
8
  * What it heard is kept in memory only, until it is transcribed.
9
9
  *
@@ -46,7 +46,7 @@ export declare function chatVoiceOf(spec: AppVoiceSpec | undefined, place: ChatV
46
46
  * its runtime (VO-37, VO-19): the token its host gave, else the chat's own —
47
47
  * a visitor's token minted from ai-inference, an embed's token, or the
48
48
  * person's. One token for the conversation and its voice, never a second.
49
- * An embed's deployment is the one its token names (decision 16): the page
49
+ * An embed's deployment is the one its token names: the page
50
50
  * says none.
51
51
  */
52
52
  export declare function voiceAskedAs(voice: ChatVoice | undefined, token: string | undefined): ChatVoice | undefined;
@@ -3,8 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  /**
6
- * A chat's voice, from what an application or an agent says of it (VOICE.md
7
- * VO-41, VO-49): the `voice` a host gives `ChatBase`, `ChatFloating` or an
6
+ * A chat's voice, from what an application or an agent says of it (VO-41, VO-49):
7
+ * the `voice` a host gives `ChatBase`, `ChatFloating` or an
8
8
  * application's workspace, with Datalayer's places filled in — the browser's
9
9
  * models from Datalayer's CDN, the packages that hear loaded on first use.
10
10
  *
@@ -68,7 +68,7 @@ export function chatVoiceOf(spec, place) {
68
68
  * its runtime (VO-37, VO-19): the token its host gave, else the chat's own —
69
69
  * a visitor's token minted from ai-inference, an embed's token, or the
70
70
  * person's. One token for the conversation and its voice, never a second.
71
- * An embed's deployment is the one its token names (decision 16): the page
71
+ * An embed's deployment is the one its token names: the page
72
72
  * says none.
73
73
  */
74
74
  export function voiceAskedAs(voice, token) {
@@ -1,6 +1,6 @@
1
1
  /**
2
- * What a person may choose for their voice (VOICE.md VO-14, VO-21, VO-25,
3
- * VO-30), from the catalogue: the languages a voice speaks and the device
2
+ * What a person may choose for their voice (VO-14, VO-21, VO-25, VO-30),
3
+ * from the catalogue: the languages a voice speaks and the device
4
4
  * hears, the voices of each, the speeds and loudnesses offered, and when
5
5
  * answers are heard. Read by the composer's menu (`VoiceMenu`) and by a
6
6
  * settings page, so both offer the same.
@@ -3,8 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  /**
6
- * What a person may choose for their voice (VOICE.md VO-14, VO-21, VO-25,
7
- * VO-30), from the catalogue: the languages a voice speaks and the device
6
+ * What a person may choose for their voice (VO-14, VO-21, VO-25, VO-30),
7
+ * from the catalogue: the languages a voice speaks and the device
8
8
  * hears, the voices of each, the speeds and loudnesses offered, and when
9
9
  * answers are heard. Read by the composer's menu (`VoiceMenu`) and by a
10
10
  * settings page, so both offer the same.
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /**
6
6
  * The person's yes to the microphone, asked once per application before the
7
- * browser's own prompt (VOICE.md VO-61), and remembered where the page keeps
7
+ * browser's own prompt (VO-61), and remembered where the page keeps
8
8
  * its preferences. A page without storage asks again next time.
9
9
  *
10
10
  * @module voice/consent
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A conversation by voice, hands-free (VOICE.md VO-12, VO-13): what the
2
+ * A conversation by voice, hands-free (VO-12, VO-13): what the
3
3
  * composer is doing at every moment, and when a turn ends or the person
4
4
  * speaks over the agent. Pure: the component (`HandsFree`) keeps the
5
5
  * microphone and the clock, this decides.
@@ -49,13 +49,38 @@ export interface HeardSoFarLike {
49
49
  * turn's silence since (VO-12).
50
50
  */
51
51
  export declare function turnEnded(heard: HeardSoFarLike, turnSilenceMs?: number): boolean;
52
+ /**
53
+ * At most this share of what plays is taken to come back into the
54
+ * microphone once the browser's echo cancellation has done its part (VO-13),
55
+ * on the meters' own scales (the microphone's `Capture.level`, the speaker's
56
+ * `level`). A setting, not a measure yet: VO-52 measures it on a laptop's
57
+ * own speakers.
58
+ */
59
+ export declare const ECHO_SHARE = 0.6;
60
+ /** How far above that echo the person's voice must be, on the meter's scale. */
61
+ export declare const VOICE_OVER_ECHO = 0.08;
62
+ /** How loud the microphone and the agent's voice are now, each between 0 and 1. */
63
+ export interface Levels {
64
+ microphone: number;
65
+ playback: number;
66
+ }
67
+ /**
68
+ * Whether the microphone holds more than the agent's own voice coming back
69
+ * (VO-13): nothing plays, or the microphone is louder than the echo the
70
+ * playback can leave by `VOICE_OVER_ECHO`.
71
+ */
72
+ export declare function heardOverPlayback(levels: Levels, echoShare?: number): boolean;
52
73
  /**
53
74
  * Whether the person spoke over the agent (VO-13): speech found since the
54
75
  * agent began answering, while it thinks or speaks. The microphone is opened
55
- * anew when the agent begins, so what it holds is the person's, not the
56
- * answer's echo — the browser's echo cancellation keeps that out.
76
+ * anew when the agent begins, so what it holds came since; the browser's
77
+ * echo cancellation keeps most of the answer's sound out, and while the
78
+ * answer plays the VAD's speech counts only when the microphone is louder
79
+ * than what the playback can leave in it (`heardOverPlayback`) — when the
80
+ * levels are known. A host whose speaker gives no level (the browser's own
81
+ * voices) relies on echo cancellation alone.
57
82
  */
58
- export declare function bargedIn(state: HandsFreeState, heard: HeardSoFarLike): boolean;
83
+ export declare function bargedIn(state: HandsFreeState, heard: HeardSoFarLike, levels?: Levels): boolean;
59
84
  /** A message as the conversation holds it: enough to find the answer spoken over. */
60
85
  export interface ConversationItemLike {
61
86
  id: string;
@@ -37,14 +37,42 @@ export function handsFreeState(inputs) {
37
37
  export function turnEnded(heard, turnSilenceMs = TURN_SILENCE_MS) {
38
38
  return heard.spoke && heard.silentMs >= turnSilenceMs;
39
39
  }
40
+ /**
41
+ * At most this share of what plays is taken to come back into the
42
+ * microphone once the browser's echo cancellation has done its part (VO-13),
43
+ * on the meters' own scales (the microphone's `Capture.level`, the speaker's
44
+ * `level`). A setting, not a measure yet: VO-52 measures it on a laptop's
45
+ * own speakers.
46
+ */
47
+ export const ECHO_SHARE = 0.6;
48
+ /** How far above that echo the person's voice must be, on the meter's scale. */
49
+ export const VOICE_OVER_ECHO = 0.08;
50
+ /**
51
+ * Whether the microphone holds more than the agent's own voice coming back
52
+ * (VO-13): nothing plays, or the microphone is louder than the echo the
53
+ * playback can leave by `VOICE_OVER_ECHO`.
54
+ */
55
+ export function heardOverPlayback(levels, echoShare = ECHO_SHARE) {
56
+ if (levels.playback <= 0) {
57
+ return true;
58
+ }
59
+ return levels.microphone >= levels.playback * echoShare + VOICE_OVER_ECHO;
60
+ }
40
61
  /**
41
62
  * Whether the person spoke over the agent (VO-13): speech found since the
42
63
  * agent began answering, while it thinks or speaks. The microphone is opened
43
- * anew when the agent begins, so what it holds is the person's, not the
44
- * answer's echo — the browser's echo cancellation keeps that out.
64
+ * anew when the agent begins, so what it holds came since; the browser's
65
+ * echo cancellation keeps most of the answer's sound out, and while the
66
+ * answer plays the VAD's speech counts only when the microphone is louder
67
+ * than what the playback can leave in it (`heardOverPlayback`) — when the
68
+ * levels are known. A host whose speaker gives no level (the browser's own
69
+ * voices) relies on echo cancellation alone.
45
70
  */
46
- export function bargedIn(state, heard) {
47
- return (state === 'speaking' || state === 'thinking') && heard.spoke;
71
+ export function bargedIn(state, heard, levels) {
72
+ if (!(state === 'speaking' || state === 'thinking') || !heard.spoke) {
73
+ return false;
74
+ }
75
+ return state !== 'speaking' || !levels || heardOverPlayback(levels);
48
76
  }
49
77
  /**
50
78
  * The answer the person spoke over (VO-13): the agent's last message after
@@ -23,7 +23,7 @@ export interface HeardSoFar {
23
23
  silentMs: number;
24
24
  }
25
25
  /**
26
- * What hears a press, wherever it runs (§5): in the page (`DeviceHearing`)
26
+ * What hears a press, wherever it runs: in the page (`DeviceHearing`)
27
27
  * or on Datalayer's servers (`ServerHearing`).
28
28
  */
29
29
  export interface Hearing {
@@ -3,7 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  /**
6
- * Hearing on the device (VOICE.md VO-10, VO-14, decision 3): what was said
6
+ * Hearing on the device (VO-10, VO-14): what was said
7
7
  * in one press, kept to its speech by Silero VAD and transcribed by the
8
8
  * catalogue's model for the language — Moonshine for English, Whisper for
9
9
  * French — in the page, with transformers.js. The audio never leaves the