@datalayer/agent-runtimes 1.5.20 → 1.5.22

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 (305) hide show
  1. package/dist-embed/chunks/{AgentDetails-DZyyuD5F.js → AgentDetails-B6vekLFY.js} +1 -1
  2. package/dist-embed/chunks/{AgentDetailsDialog-DaQyQxlm.js → AgentDetailsDialog-C-o8qFsS.js} +1 -1
  3. package/dist-embed/chunks/{AgentInspector-CBNiiRtv.js → AgentInspector-EiBHJgc9.js} +1 -1
  4. package/dist-embed/chunks/{AgentInspectorDialog-BxMOAc7K.js → AgentInspectorDialog-3fbLXnLP.js} +1 -1
  5. package/dist-embed/chunks/{CellSidebarExtension-Dwe7PfXi.js → CellSidebarExtension-BBXRIRgA.js} +7 -7
  6. package/dist-embed/chunks/ChatView-BjZ993Ch.js +32 -0
  7. package/dist-embed/chunks/{ContextPie-n1y886z-.js → ContextPie-Daf19Ivt.js} +1 -1
  8. package/dist-embed/chunks/{DeckComponent-BSeEBNHt.js → DeckComponent-C76a8LYD.js} +2 -2
  9. package/dist-embed/chunks/{DocumentView-OIdQEk_n.js → DocumentView-BZhbQkbP.js} +1 -1
  10. package/dist-embed/chunks/{EphemeralDocument-C-uLD1W7.js → EphemeralDocument-Bzv1mPpG.js} +1 -1
  11. package/dist-embed/chunks/{EphemeralNotebook-C_peDfqf.js → EphemeralNotebook-C4_wmSgk.js} +1 -1
  12. package/dist-embed/chunks/{ExcalidrawComponent-DHSxnPc9.js → ExcalidrawComponent-DVOnRDkN.js} +1 -1
  13. package/dist-embed/chunks/{ExcalidrawModal-BpsfNG-u.js → ExcalidrawModal-B0h_-M3l.js} +1 -1
  14. package/dist-embed/chunks/{JupyterLexicalExtension-BUSLnJVL.js → JupyterLexicalExtension-B2PQrLXS.js} +9 -9
  15. package/dist-embed/chunks/{KernelVariables-Cu7UeFhT.js → KernelVariables-trZsXNAi.js} +1 -1
  16. package/dist-embed/chunks/{LexicalToolRegistry-CNg1T5sQ.js → LexicalToolRegistry-8wJyLumb.js} +4 -4
  17. package/dist-embed/chunks/{NotebookToolSurfaces-Cm6-oE_W.js → NotebookToolSurfaces-BuKcXArX.js} +1 -1
  18. package/dist-embed/chunks/{NotebookView-Be2lNZjS.js → NotebookView-Em4y6Een.js} +1 -1
  19. package/dist-embed/chunks/{Output-OIgTyxpD.js → Output-DA8Udq91.js} +1 -1
  20. package/dist-embed/chunks/{SandboxDetailsDialog-BMq0tlcE.js → SandboxDetailsDialog-o2z6YFyb.js} +1 -1
  21. package/dist-embed/chunks/{SchemaForm-D3mmq2C1.js → SchemaForm-DCt_mqR1.js} +1 -1
  22. package/dist-embed/chunks/{WidgetVariableView-DnuwkCHl.js → WidgetVariableView-CDEFi0p0.js} +1 -1
  23. package/dist-embed/chunks/{YouTubePlugin-Bum16ua6.js → YouTubePlugin-DxRPFzvS.js} +1 -1
  24. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-Dac38D-P.js → abnfDiagram-VCTEODGH-Cit223SC.js} +1 -1
  25. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-BMkFygW4.js → abnfDiagram-VCTEODGH-CsoEWluu.js} +1 -1
  26. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-JDFjD_Dk.js → ar-SA-G6X2FPQ2-CjJtC55z.js} +1 -1
  27. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-D7VBU0uf.js → architectureDiagram-5GKGNRK7-DfqpfKOB.js} +1 -1
  28. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-DXJTBh9S.js → architectureDiagram-5GKGNRK7-DyQuZM-c.js} +1 -1
  29. package/dist-embed/chunks/{az-AZ-76LH7QW2-AbN1w5Zy.js → az-AZ-76LH7QW2-B7KkL6wt.js} +1 -1
  30. package/dist-embed/chunks/{bg-BG-XCXSNQG7-BULkJsTf.js → bg-BG-XCXSNQG7-D7UwtEhO.js} +1 -1
  31. package/dist-embed/chunks/{blockDiagram-868be97b-Bk9MNjmt.js → blockDiagram-868be97b-jJKAH_Up.js} +1 -1
  32. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-CKjKQ6Dq.js → blockDiagram-I7D4REHJ-BcQwB7-r.js} +1 -1
  33. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-BwenaP7n.js → blockDiagram-I7D4REHJ-z3xnLtdG.js} +1 -1
  34. package/dist-embed/chunks/{bn-BD-2XOGV67Q-B6EtUyIk.js → bn-BD-2XOGV67Q-pDDWE9Mn.js} +1 -1
  35. package/dist-embed/chunks/{c4Diagram-3f4bdde3-BGoSdP5p.js → c4Diagram-3f4bdde3-DU_-LipO.js} +1 -1
  36. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-DlkcVfDa.js → c4Diagram-7LVT6UL2-BeMfCOG_.js} +1 -1
  37. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BZRokUDB.js → c4Diagram-7LVT6UL2-DjfnLrWZ.js} +1 -1
  38. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-BZ0wzUck.js → ca-ES-6MX7JW3Y-By1uEeFx.js} +1 -1
  39. package/dist-embed/chunks/{celltoolbartracker-CCRqu43G.js → celltoolbartracker-DcYHi8Du.js} +1 -1
  40. package/dist-embed/chunks/{chunk-2Q5K7J3B-DLu9zZx0.js → chunk-2Q5K7J3B-BGvvv_gg.js} +1 -1
  41. package/dist-embed/chunks/{chunk-2Q5K7J3B-CfYiHpfd.js → chunk-2Q5K7J3B-YWpfqKnX.js} +1 -1
  42. package/dist-embed/chunks/{chunk-5VM5RSS4-yHAygNq4.js → chunk-5VM5RSS4-4bCWL_eZ.js} +1 -1
  43. package/dist-embed/chunks/{chunk-5VM5RSS4-dV5IUPYK.js → chunk-5VM5RSS4-t-8mwHFb.js} +1 -1
  44. package/dist-embed/chunks/{chunk-F27PBJKO-BArvzx7H.js → chunk-F27PBJKO-3yGsHIDd.js} +1 -1
  45. package/dist-embed/chunks/{chunk-F27PBJKO-BeY8iI19.js → chunk-F27PBJKO-De9ONU-g.js} +1 -1
  46. package/dist-embed/chunks/{chunk-IMKFNOWR-BJRUyuXy.js → chunk-IMKFNOWR-Bvbi7lre.js} +1 -1
  47. package/dist-embed/chunks/{chunk-IMKFNOWR-iUeFNxCU.js → chunk-IMKFNOWR-DA2KJGep.js} +1 -1
  48. package/dist-embed/chunks/{chunk-JWPE2WC7-BDUBU4vN.js → chunk-JWPE2WC7-CVkDZh_H.js} +1 -1
  49. package/dist-embed/chunks/{chunk-JWPE2WC7-Djk-1JPJ.js → chunk-JWPE2WC7-w_AaYpEU.js} +1 -1
  50. package/dist-embed/chunks/{chunk-POPQ4Y6H-E4731IOt.js → chunk-POPQ4Y6H-C1mg0obI.js} +1 -1
  51. package/dist-embed/chunks/{chunk-POPQ4Y6H-CibXbz_c.js → chunk-POPQ4Y6H-DnstozKC.js} +1 -1
  52. package/dist-embed/chunks/{chunk-SVP7TREG-o7JviCXQ.js → chunk-SVP7TREG-CVLd6GtA.js} +1 -1
  53. package/dist-embed/chunks/{chunk-SVP7TREG-DeRyA6Ek.js → chunk-SVP7TREG-DmKkKduL.js} +1 -1
  54. package/dist-embed/chunks/{chunk-TICWLB2K-Zk_gUXIu.js → chunk-TICWLB2K-C-lEt3p0.js} +1 -1
  55. package/dist-embed/chunks/{chunk-TICWLB2K-BIhZcpwn.js → chunk-TICWLB2K-xv7MPgmq.js} +1 -1
  56. package/dist-embed/chunks/{chunk-XXDRQBXY-DATpHkZD.js → chunk-XXDRQBXY-Cq8wF2xQ.js} +1 -1
  57. package/dist-embed/chunks/{chunk-XXDRQBXY-Cp6f69YK.js → chunk-XXDRQBXY-j7xuWjIK.js} +1 -1
  58. package/dist-embed/chunks/{classDiagram-ZZMXUADV-BfpWJKcC.js → classDiagram-ZZMXUADV-DRPRMTvC.js} +1 -1
  59. package/dist-embed/chunks/{classDiagram-ZZMXUADV-DcutslOq.js → classDiagram-ZZMXUADV-Dvh08RMu.js} +1 -1
  60. package/dist-embed/chunks/{classDiagram-f62afe4f-BVLyWZwA.js → classDiagram-f62afe4f-B8-b8b-t.js} +1 -1
  61. package/dist-embed/chunks/{classDiagram-v2-604399ef-CgcAzr_L.js → classDiagram-v2-604399ef-CHogX84-.js} +1 -1
  62. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-BfpWJKcC.js → classDiagram-v2-VYDZK3BY-DRPRMTvC.js} +1 -1
  63. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-DcutslOq.js → classDiagram-v2-VYDZK3BY-Dvh08RMu.js} +1 -1
  64. package/dist-embed/chunks/{code-block-IT6T5CEO-D5_yhrdD.js → code-block-IT6T5CEO-Dbm1cj5T.js} +1 -1
  65. package/dist-embed/chunks/{component-DoyMsR16.js → component-CsXw-w1P.js} +3 -3
  66. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-B-LvsoyE.js → cose-bilkent-JH36ORCC-BrisaBwh.js} +1 -1
  67. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DhPsWJev.js → cose-bilkent-JH36ORCC-DGpwW9PH.js} +1 -1
  68. package/dist-embed/chunks/{createText-aed3d8b3-CnP7VdTn.js → createText-aed3d8b3-C8C5hNtS.js} +1 -1
  69. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-CHIiQJ-9.js → cs-CZ-2BRQDIVT-TB9QxoL2.js} +1 -1
  70. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-B4k-OykO.js → cynefinDiagram-5FMLGOSQ-B37BRKcq.js} +1 -1
  71. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-D4zzGd7W.js → cynefinDiagram-5FMLGOSQ-NXny6Mot.js} +1 -1
  72. package/dist-embed/chunks/{da-DK-5WZEPLOC-dfN2SAKQ.js → da-DK-5WZEPLOC-CLl8TZ2P.js} +1 -1
  73. package/dist-embed/chunks/{dagre-GXQ25YYZ-BlWkzzlo.js → dagre-GXQ25YYZ-b03jeXc5.js} +1 -1
  74. package/dist-embed/chunks/{dagre-GXQ25YYZ-DUrWhbsC.js → dagre-GXQ25YYZ-mM6SsGs8.js} +1 -1
  75. package/dist-embed/chunks/{de-DE-XR44H4JA-BKsKfmfo.js → de-DE-XR44H4JA-6gY_Hl4H.js} +1 -1
  76. package/dist-embed/chunks/{diagram-S7CK7UJ4-BuRBzTwI.js → diagram-S7CK7UJ4-C8TF_Y_V.js} +1 -1
  77. package/dist-embed/chunks/{diagram-S7CK7UJ4-FxHXDIYr.js → diagram-S7CK7UJ4-fpaH_1xM.js} +1 -1
  78. package/dist-embed/chunks/{diagram-UQ7AKVKN-CeDT8Vz4.js → diagram-UQ7AKVKN-CcqaQfbU.js} +1 -1
  79. package/dist-embed/chunks/{diagram-UQ7AKVKN-FxYHrvzF.js → diagram-UQ7AKVKN-G8fspx37.js} +1 -1
  80. package/dist-embed/chunks/{diagram-VSXAHHWV-C2icUdkA.js → diagram-VSXAHHWV-B3Q41FOl.js} +1 -1
  81. package/dist-embed/chunks/{diagram-VSXAHHWV-Cv0WAiv8.js → diagram-VSXAHHWV-DLhWEHn-.js} +1 -1
  82. package/dist-embed/chunks/{diagram-VX7I27RA-AoxkG7BW.js → diagram-VX7I27RA-Dnbm3teD.js} +1 -1
  83. package/dist-embed/chunks/{diagram-VX7I27RA-D6VPVMhu.js → diagram-VX7I27RA-Dy-IHeZr.js} +1 -1
  84. package/dist-embed/chunks/{diagram-Z3DM3KII-DxunLDOr.js → diagram-Z3DM3KII-BkiB9_Ay.js} +1 -1
  85. package/dist-embed/chunks/{diagram-Z3DM3KII-CHxtPQ6F.js → diagram-Z3DM3KII-hE5FTtNp.js} +1 -1
  86. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-CfsTBJc5.js → ebnfDiagram-PWID7BFC-DJhj6Mbd.js} +1 -1
  87. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-CmJlfM6d.js → ebnfDiagram-PWID7BFC-DZiCEGSK.js} +1 -1
  88. package/dist-embed/chunks/{edges-b2856ca0-Cl5rq6T8.js → edges-b2856ca0-DuBY_rn3.js} +1 -1
  89. package/dist-embed/chunks/{el-GR-BZB4AONW-Cs0zPSU1.js → el-GR-BZB4AONW-CFGi_gqP.js} +1 -1
  90. package/dist-embed/chunks/{erDiagram-5d81789a-C0jmz-br.js → erDiagram-5d81789a-BYOejxuX.js} +1 -1
  91. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-Dyljy6tN.js → erDiagram-RLTQ6QDP-Bg2UfSBM.js} +1 -1
  92. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-FFD_URlX.js → erDiagram-RLTQ6QDP-v1tF2vX5.js} +1 -1
  93. package/dist-embed/chunks/{es-ES-U4NZUMDT-fGOqRf0o.js → es-ES-U4NZUMDT-D_HQumEp.js} +1 -1
  94. package/dist-embed/chunks/{eu-ES-A7QVB2H4-CLZ09rVe.js → eu-ES-A7QVB2H4-CvUID20p.js} +1 -1
  95. package/dist-embed/chunks/{fa-IR-HGAKTJCU-Cjimbc8n.js → fa-IR-HGAKTJCU-C7_Vi5QP.js} +1 -1
  96. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-ZXNEW916.js → fi-FI-Z5N7JZ37-SBYxKS7Q.js} +1 -1
  97. package/dist-embed/chunks/{flowDb-185abca5-Cden9aoH.js → flowDb-185abca5-C_IywhMB.js} +1 -1
  98. package/dist-embed/chunks/{flowDiagram-1629c991-Bar9YxSW.js → flowDiagram-1629c991-C8JQo90r.js} +1 -1
  99. package/dist-embed/chunks/{flowDiagram-HODETNUW-bg09n0_F.js → flowDiagram-HODETNUW-BigtRRvu.js} +1 -1
  100. package/dist-embed/chunks/{flowDiagram-HODETNUW-02Xo2-6n.js → flowDiagram-HODETNUW-Cd1y1bVx.js} +1 -1
  101. package/dist-embed/chunks/{flowDiagram-v2-1d953310-C6FnOAb2.js → flowDiagram-v2-1d953310-DTH8N-sj.js} +1 -1
  102. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-DcmMV2Wi.js → flowchart-elk-definition-6df44142-W8s7oFgJ.js} +1 -1
  103. package/dist-embed/chunks/{fr-FR-RHASNOE6-DQaq_g67.js → fr-FR-RHASNOE6-fAErz4Nf.js} +1 -1
  104. package/dist-embed/chunks/{ganttDiagram-3b0b3873-BN61xNrz.js → ganttDiagram-3b0b3873-D_XwfPDh.js} +1 -1
  105. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-BCLyiaOJ.js → ganttDiagram-EL5Y4UJY-BIsU1Bcw.js} +1 -1
  106. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-JviVPOnF.js → ganttDiagram-EL5Y4UJY-VT_s02F9.js} +1 -1
  107. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CzBMuAvA.js → gitGraphDiagram-WWUBYQGX-BDdr_2gq.js} +1 -1
  108. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CNc3l-2t.js → gitGraphDiagram-WWUBYQGX-BvxzF9hn.js} +1 -1
  109. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-7ecaKDp7.js → gitGraphDiagram-f01e8bc2-UBa5a0HV.js} +1 -1
  110. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-BlrLF7Sk.js → gl-ES-HMX3MZ6V-DCciQOEM.js} +1 -1
  111. package/dist-embed/chunks/{he-IL-6SHJWFNN-DLfo2nov.js → he-IL-6SHJWFNN-CuQhQVb2.js} +1 -1
  112. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-BcbS0I1h.js → hi-IN-IWLTKZ5I-BlH8AK2z.js} +1 -1
  113. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-B_-3TehM.js → hu-HU-A5ZG7DT2-BaBGhZVQ.js} +1 -1
  114. package/dist-embed/chunks/{id-ID-SAP4L64H-C920eBs5.js → id-ID-SAP4L64H-Dkm1zS1g.js} +1 -1
  115. package/dist-embed/chunks/{index-9bae90f3-_mZDJyzh.js → index-9bae90f3-CvHGNDGk.js} +1 -1
  116. package/dist-embed/chunks/{index-W-qUA31l.js → index-B9aqZrHy.js} +1 -1
  117. package/dist-embed/chunks/{index-DbHMJ-IM.js → index-BDs-ntTo.js} +1 -1
  118. package/dist-embed/chunks/{index-D1CRwrf9.js → index-BQp4l7hT.js} +2 -2
  119. package/dist-embed/chunks/{index-D_-7qr4x.js → index-BcdbHyzT.js} +1 -1
  120. package/dist-embed/chunks/{index-DmKOrT_f.js → index-BqDJ3hYN.js} +1 -1
  121. package/dist-embed/chunks/{index-CuqMWXgT.js → index-CFP9psRB.js} +3 -3
  122. package/dist-embed/chunks/{index-C8N5z7FZ.js → index-CUAnjzKL.js} +1 -1
  123. package/dist-embed/chunks/{index-k3ISgWrJ.js → index-CWwj0zW9.js} +1 -1
  124. package/dist-embed/chunks/{index-DV2fNvY7.js → index-CecqH6mN.js} +1 -1
  125. package/dist-embed/chunks/{index-C3zGthUI.js → index-CoxYszKx.js} +1 -1
  126. package/dist-embed/chunks/{index-7V4MgoX0.js → index-CozDzMOf.js} +1 -1
  127. package/dist-embed/chunks/{index-C2UmIEOV.js → index-CrL-deXT.js} +1 -1
  128. package/dist-embed/chunks/{index-CW0DxnfF.js → index-CtEseCtc.js} +1 -1
  129. package/dist-embed/chunks/{index-OZDJ7kli.js → index-D2vkNPmG.js} +1 -1
  130. package/dist-embed/chunks/{index-MNZ1LVAM.js → index-D5xVRNk8.js} +1 -1
  131. package/dist-embed/chunks/{index-DmYrjwOw.js → index-D8wHLHbt.js} +1 -1
  132. package/dist-embed/chunks/{index-B0VC_nl2.js → index-DAZUOPnd.js} +1 -1
  133. package/dist-embed/chunks/{index-BbtA7ppb.js → index-DE_JTiwB.js} +1 -1
  134. package/dist-embed/chunks/{index-CLojGXLe.js → index-DMll0Yzi.js} +1 -1
  135. package/dist-embed/chunks/{index-DcbXB4Ou.js → index-DN-cizG6.js} +1 -1
  136. package/dist-embed/chunks/{index-DMTXHmrU.js → index-DPHM1WLM.js} +1 -1
  137. package/dist-embed/chunks/{index-Dyv67BU9.js → index-DSN70XMH.js} +2 -2
  138. package/dist-embed/chunks/{index-CGhVy6OJ.js → index-Dc5AqaeZ.js} +1 -1
  139. package/dist-embed/chunks/{index-B3qU5V3s.js → index-DdmqZZnv.js} +1 -1
  140. package/dist-embed/chunks/{index-BST3vALX.js → index-DlYw1KQn.js} +5 -5
  141. package/dist-embed/chunks/{index-C3p2Hbbg.js → index-Dobs-OKl.js} +1 -1
  142. package/dist-embed/chunks/{index-oJ3M8HYJ.js → index-Dp3JEvYy.js} +1 -1
  143. package/dist-embed/chunks/{index-D95mZTII.js → index-DsMBsL3g.js} +1 -1
  144. package/dist-embed/chunks/{index-BVdp0AG7.js → index-DvyxBamA.js} +4 -4
  145. package/dist-embed/chunks/{index-BMqDh5WU.js → index-SsFECYMb.js} +1 -1
  146. package/dist-embed/chunks/{index-DqwL86GY.js → index-YVrQYH-H.js} +12 -12
  147. package/dist-embed/chunks/{index-DSts8s_N.js → index-a9o1fYab.js} +1 -1
  148. package/dist-embed/chunks/{index-BVkaRzYN.js → index-bC_5dTbf.js} +4 -4
  149. package/dist-embed/chunks/{index--rbc1jdS.js → index-jJxXKHoT.js} +1 -1
  150. package/dist-embed/chunks/{index.esm-Dy7cyZyH.js → index.esm-p0OnSU9h.js} +1 -1
  151. package/dist-embed/chunks/{index.esm-jFa95d0B.js → index.esm-q_fIJH5v.js} +1 -1
  152. package/dist-embed/chunks/{infoDiagram-27XIBGKW-CuQ0a02I.js → infoDiagram-27XIBGKW-DIeaDzEK.js} +1 -1
  153. package/dist-embed/chunks/{infoDiagram-27XIBGKW-CDc0DV-6.js → infoDiagram-27XIBGKW-DZ6Xhv3K.js} +1 -1
  154. package/dist-embed/chunks/{infoDiagram-a29d40f1-BKWmVk4B.js → infoDiagram-a29d40f1-B9PMyz4X.js} +1 -1
  155. package/dist-embed/chunks/{isEqual-SWNqZJZT.js → isEqual-Cwjr2skl.js} +1 -1
  156. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CPu6wHAG.js → ishikawaDiagram-5VMMS53U-BP4Q8nEu.js} +1 -1
  157. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-BY7eKNmA.js → ishikawaDiagram-5VMMS53U-CwrdITPn.js} +1 -1
  158. package/dist-embed/chunks/{it-IT-JPQ66NNP-CsJELR-H.js → it-IT-JPQ66NNP-BrcctIsI.js} +1 -1
  159. package/dist-embed/chunks/{ja-JP-DBVTYXUO-Bh4bW0cv.js → ja-JP-DBVTYXUO-CKuJ3Sod.js} +1 -1
  160. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-6CRYfcQL.js → journeyDiagram-3NMN7TZE-iJrCUeL0.js} +1 -1
  161. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-Cv_KZqY3.js → journeyDiagram-3NMN7TZE-wI34jsXX.js} +1 -1
  162. package/dist-embed/chunks/{journeyDiagram-95396277-yJruA0Fm.js → journeyDiagram-95396277-B6WhL2Fl.js} +1 -1
  163. package/dist-embed/chunks/{kaa-6HZHGXH3-BmDtc0g0.js → kaa-6HZHGXH3-ChFYZBwI.js} +1 -1
  164. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-Bluox3dD.js → kab-KAB-ZGHBKWFO-C7C7EuVk.js} +1 -1
  165. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-Biauy1A4.js → kanban-definition-UXKFOSKX-B8AB0LN4.js} +1 -1
  166. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-Dps45ZlJ.js → kanban-definition-UXKFOSKX-gqU76cK9.js} +1 -1
  167. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-EZjFhsK8.js → kk-KZ-P5N5QNE5-Bff18CC1.js} +1 -1
  168. package/dist-embed/chunks/{km-KH-HSX4SM5Z-BpZu76AC.js → km-KH-HSX4SM5Z-DU2YQt8I.js} +1 -1
  169. package/dist-embed/chunks/{ko-KR-MTYHY66A-C5JZPTHd.js → ko-KR-MTYHY66A-CQruDlRn.js} +1 -1
  170. package/dist-embed/chunks/{ku-TR-6OUDTVRD-BUaf6TOB.js → ku-TR-6OUDTVRD-DoySMeIi.js} +1 -1
  171. package/dist-embed/chunks/{layout-C8INuwYa.js → layout-CJFemkl6.js} +1 -1
  172. package/dist-embed/chunks/{layout-CEbgEIwd.js → layout-DbdaqszO.js} +1 -1
  173. package/dist-embed/chunks/{lexicalHooks-DFMSPigW.js → lexicalHooks-Pqoe8h_O.js} +1 -1
  174. package/dist-embed/chunks/{lt-LT-XHIRWOB4-CuGmKRQr.js → lt-LT-XHIRWOB4-72Vmr8iW.js} +1 -1
  175. package/dist-embed/chunks/{lv-LV-5QDEKY6T-EYERw_NP.js → lv-LV-5QDEKY6T-CxtO97qO.js} +1 -1
  176. package/dist-embed/chunks/{mermaid.core-BeAq5EQp.js → mermaid.core-CAzPWd8O.js} +3 -3
  177. package/dist-embed/chunks/{mermaid.core-hzdTpjmh.js → mermaid.core-DaZxhAXO.js} +5 -5
  178. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-iB7eW5x9.js → mindmap-definition-YA3MSWOX-D8W0sJ7P.js} +1 -1
  179. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX--O06aygF.js → mindmap-definition-YA3MSWOX-DPl-uWpT.js} +1 -1
  180. package/dist-embed/chunks/{mindmap-definition-e4c1d938-DCwgMhNw.js → mindmap-definition-e4c1d938-CGXwlH4A.js} +1 -1
  181. package/dist-embed/chunks/{mr-IN-CRQNXWMA-SKx4bMeU.js → mr-IN-CRQNXWMA-BNGEl_QE.js} +1 -1
  182. package/dist-embed/chunks/{my-MM-5M5IBNSE-BG-vgEXz.js → my-MM-5M5IBNSE-4wIAMvGF.js} +1 -1
  183. package/dist-embed/chunks/{nb-NO-T6EIAALU-BbW-11AI.js → nb-NO-T6EIAALU-z-1s9yX9.js} +1 -1
  184. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CSKGpuSJ.js → nl-NL-IS3SIHDZ-CYKGEVB8.js} +1 -1
  185. package/dist-embed/chunks/{nn-NO-6E72VCQL-P1tnp9TQ.js → nn-NO-6E72VCQL-DwQFIFpO.js} +1 -1
  186. package/dist-embed/chunks/{oc-FR-POXYY2M6-vpu8tuQT.js → oc-FR-POXYY2M6-mH2n3eM_.js} +1 -1
  187. package/dist-embed/chunks/{pa-IN-N4M65BXN-CIpdGll2.js → pa-IN-N4M65BXN-DbixE6jQ.js} +1 -1
  188. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-Bon6jQ3L.js → pegDiagram-XKGWAZYB-D3qs3UBw.js} +1 -1
  189. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-ZPizxhEX.js → pegDiagram-XKGWAZYB-DJmZupPa.js} +1 -1
  190. package/dist-embed/chunks/{percentages-BXMCSKIN-hVEpOtFm.js → percentages-BXMCSKIN-5Q9KX_WU.js} +5 -5
  191. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-C0Pc9GUi.js → pieDiagram-E7YTZNPT-C58cd6s7.js} +1 -1
  192. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-Di8dEHt9.js → pieDiagram-E7YTZNPT-CrZQ-dOy.js} +1 -1
  193. package/dist-embed/chunks/{pieDiagram-c941bede-C--hwbRv.js → pieDiagram-c941bede-Dn3GMx6q.js} +1 -1
  194. package/dist-embed/chunks/{pl-PL-T2D74RX3-Ckyj0Mzv.js → pl-PL-T2D74RX3-jOVonFYe.js} +1 -1
  195. package/dist-embed/chunks/{pt-BR-5N22H2LF-3jDc9_Aa.js → pt-BR-5N22H2LF-Cx4MrqgK.js} +1 -1
  196. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-lhLbXf7Q.js → pt-PT-UZXXM6DQ-B2PzNwuF.js} +1 -1
  197. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-D0QYtpIp.js → quadrantDiagram-AXDQQJYC-CJn8hkR8.js} +1 -1
  198. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-Ffo3hgR0.js → quadrantDiagram-AXDQQJYC-haT-kxqE.js} +1 -1
  199. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-Bqmed-0s.js → quadrantDiagram-cf8b8fe0-B3wudq14.js} +1 -1
  200. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BMC9Ldnh.js → railroadDiagram-O6MQD6OU-T23yIHww.js} +1 -1
  201. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-aTc7bF4I.js → railroadDiagram-O6MQD6OU-Ty6XXjBy.js} +1 -1
  202. package/dist-embed/chunks/{renderer-CR6Lxa3d.js → renderer-Au1S-H5k.js} +1 -1
  203. package/dist-embed/chunks/{requirementDiagram-53bda41b-DExdw0ey.js → requirementDiagram-53bda41b-B-eAYQ6c.js} +1 -1
  204. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-DBj1iVv5.js → requirementDiagram-BXWQKSXE-CgkHdmYF.js} +1 -1
  205. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-mBFLHcqA.js → requirementDiagram-BXWQKSXE-fpBmgh7Q.js} +1 -1
  206. package/dist-embed/chunks/{ro-RO-JPDTUUEW-Dy9oeW3b.js → ro-RO-JPDTUUEW-BCQxuLcc.js} +1 -1
  207. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CK16-wfD.js → ru-RU-B4JR7IUQ-CqSiHvqj.js} +1 -1
  208. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-9W9X5V7a.js → sankeyDiagram-P5KCCOFB-DEGMK43Q.js} +1 -1
  209. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-DzaadHXz.js → sankeyDiagram-P5KCCOFB-hDbZE81L.js} +1 -1
  210. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-B6u8wnkU.js → sankeyDiagram-c3ef121a-O14jOeqO.js} +1 -1
  211. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-Bq8bvLh8.js → sequenceDiagram-82a5b84f-BFFzLElQ.js} +1 -1
  212. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-BNfJw8_y.js → sequenceDiagram-WJ2MYXX4-MrC4K4SC.js} +1 -1
  213. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-B76NTf4c.js → sequenceDiagram-WJ2MYXX4-wongMGVN.js} +1 -1
  214. package/dist-embed/chunks/{sessions-XxjScqnJ.js → sessions-BRALW9Yv.js} +1 -1
  215. package/dist-embed/chunks/{si-LK-N5RQ5JYF-AJdaUbzl.js → si-LK-N5RQ5JYF-Dbgk5YHt.js} +1 -1
  216. package/dist-embed/chunks/{sizeCapture-INFHLROL-KZBUxNmb.js → sizeCapture-INFHLROL-CiOiAAo5.js} +1 -1
  217. package/dist-embed/chunks/{sizeCapture-INFHLROL-DQ5s0TIW.js → sizeCapture-INFHLROL-j4-sCda0.js} +1 -1
  218. package/dist-embed/chunks/{sk-SK-C5VTKIMK-Bk82hIVU.js → sk-SK-C5VTKIMK-OBAaNvVw.js} +1 -1
  219. package/dist-embed/chunks/{sl-SI-NN7IZMDC-DSFcvf6W.js → sl-SI-NN7IZMDC-DqLxi4IM.js} +1 -1
  220. package/dist-embed/chunks/{stateDiagram-43e79a5f-BiTTNI1Z.js → stateDiagram-43e79a5f-BZm5gFdu.js} +1 -1
  221. package/dist-embed/chunks/{stateDiagram-D77RDMKH-lndPMO3D.js → stateDiagram-D77RDMKH-D7_xyy8n.js} +1 -1
  222. package/dist-embed/chunks/{stateDiagram-D77RDMKH-D4hQpdZ2.js → stateDiagram-D77RDMKH-DXrbH1aM.js} +1 -1
  223. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-BbFiQEfG.js → stateDiagram-v2-2041ed4f-DiXOgJsK.js} +1 -1
  224. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-pqcRT12A.js → stateDiagram-v2-MP3YSRHH-DLsY6ysL.js} +1 -1
  225. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-C-kIBdBJ.js → stateDiagram-v2-MP3YSRHH-ngWpJn6k.js} +1 -1
  226. package/dist-embed/chunks/{styles-455b33cd-U9lx7mAf.js → styles-455b33cd-CrHizSU7.js} +1 -1
  227. package/dist-embed/chunks/{styles-f932cba9-S-lYZYdK.js → styles-f932cba9-YuCN7fSa.js} +1 -1
  228. package/dist-embed/chunks/{styles-fcc2142b-DfudfB3j.js → styles-fcc2142b-tjrOPOh4.js} +1 -1
  229. package/dist-embed/chunks/{subset-shared.chunk-f2gmZjeG.js → subset-shared.chunk-Du2agLgk.js} +1 -1
  230. package/dist-embed/chunks/{subset-worker.chunk-De1CPIQ6.js → subset-worker.chunk-BXR8pgHc.js} +1 -1
  231. package/dist-embed/chunks/{sv-SE-XGPEYMSR-BbGfLHIi.js → sv-SE-XGPEYMSR-BbgHKxhC.js} +1 -1
  232. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-ClgHG0vb.js → svgDrawCommon-148a3cd9-DTqtvo5_.js} +1 -1
  233. package/dist-embed/chunks/{swimlanes-42K2YHIH-OqZ4t-07.js → swimlanes-42K2YHIH-B289Mbni.js} +1 -1
  234. package/dist-embed/chunks/{swimlanes-42K2YHIH-CjV1bdPk.js → swimlanes-42K2YHIH-B3H_wpMu.js} +1 -1
  235. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-9twpvQtj.js → swimlanesDiagram-VR7AAH4N-D0ZHzw-_.js} +1 -1
  236. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BdS4NGOx.js → swimlanesDiagram-VR7AAH4N-qWg-2xN_.js} +1 -1
  237. package/dist-embed/chunks/{ta-IN-2NMHFXQM-BWMJgnI2.js → ta-IN-2NMHFXQM-0pH7gQyu.js} +1 -1
  238. package/dist-embed/chunks/{th-TH-HPSO5L25-DiP_CZXl.js → th-TH-HPSO5L25-Dvbu09CU.js} +1 -1
  239. package/dist-embed/chunks/{timeline-definition-24CTP7MA-B7uSaXDu.js → timeline-definition-24CTP7MA-DUc18SdK.js} +1 -1
  240. package/dist-embed/chunks/{timeline-definition-24CTP7MA-Cs4Bwobu.js → timeline-definition-24CTP7MA-DpMq7g2g.js} +1 -1
  241. package/dist-embed/chunks/{timeline-definition-7545f45a-CHrBluu1.js → timeline-definition-7545f45a--4ypi4BE.js} +1 -1
  242. package/dist-embed/chunks/{tr-TR-DEFEU3FU-CKMBvOkr.js → tr-TR-DEFEU3FU-B6YS3iEB.js} +1 -1
  243. package/dist-embed/chunks/{uk-UA-QMV73CPH-CQL0E0jU.js → uk-UA-QMV73CPH-DMG9vIVp.js} +1 -1
  244. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-uwWpr4uC.js → vennDiagram-4TSXK5OY-CS12EGJw.js} +1 -1
  245. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-CHSyRZN_.js → vennDiagram-4TSXK5OY-CvEXE1xX.js} +1 -1
  246. package/dist-embed/chunks/{vi-VN-M7AON7JQ-BpvEBNJo.js → vi-VN-M7AON7JQ-DB3ZrpeP.js} +1 -1
  247. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-0UuvD-IO.js → wardleyDiagram-VM6X3IG4-8LfGni9_.js} +1 -1
  248. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-zIfOyYBf.js → wardleyDiagram-VM6X3IG4-Bj02LzjH.js} +1 -1
  249. package/dist-embed/chunks/{xychartDiagram-3f383b91-ChbRPzo8.js → xychartDiagram-3f383b91-CE_OY5QR.js} +1 -1
  250. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-hCGgyjir.js → xychartDiagram-S5SC5T6Z-BdZi5x4a.js} +1 -1
  251. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-q9gcUSF1.js → xychartDiagram-S5SC5T6Z-DXqC0l3r.js} +1 -1
  252. package/dist-embed/chunks/{zh-CN-LNUGB5OW-DWmzAIjK.js → zh-CN-LNUGB5OW-VV-lg83H.js} +1 -1
  253. package/dist-embed/chunks/{zh-HK-E62DVLB3-CQ-xPzHX.js → zh-HK-E62DVLB3-DLoyC6Q9.js} +1 -1
  254. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-DvlSTykD.js → zh-TW-RAJ6MFWO-DhFllgOW.js} +1 -1
  255. package/dist-embed/datalayer-app-main.js +54 -54
  256. package/lib/apps/apps/records.d.ts +0 -29
  257. package/lib/apps/apps/records.js +11 -34
  258. package/lib/apps/apps/threads.d.ts +2 -21
  259. package/lib/apps/apps/threads.js +0 -75
  260. package/lib/apps/embed/embedSession.d.ts +0 -8
  261. package/lib/apps/embed/embedSession.js +1 -38
  262. package/lib/apps/embed/visitorApp.d.ts +23 -4
  263. package/lib/apps/embed/visitorApp.js +43 -5
  264. package/lib/apps/plugins/chat/ChatView.js +15 -3
  265. package/lib/chat/ChatFloating.js +4 -1
  266. package/lib/chat/base/ChatBase.js +12 -4
  267. package/lib/chat/base/fullContextMessages.js +1 -1
  268. package/lib/chat/prompt/InputPrompt.d.ts +6 -1
  269. package/lib/chat/prompt/InputPrompt.js +12 -2
  270. package/lib/hooks/useAgUi.js +1 -1
  271. package/lib/hooks/useToolApprovals.d.ts +1 -1
  272. package/lib/hooks/useToolApprovals.js +1 -1
  273. package/lib/{protocols → portable}/agUiRefusal.d.ts +1 -1
  274. package/lib/{protocols → portable}/agUiRefusal.js +1 -1
  275. package/lib/portable/agui.d.ts +72 -0
  276. package/lib/portable/agui.js +174 -0
  277. package/lib/portable/conversation.d.ts +124 -0
  278. package/lib/portable/conversation.js +357 -0
  279. package/lib/portable/index.d.ts +11 -6
  280. package/lib/portable/index.js +14 -11
  281. package/lib/portable/records.d.ts +27 -0
  282. package/lib/portable/records.js +46 -0
  283. package/lib/portable/sessions.d.ts +92 -0
  284. package/lib/portable/sessions.js +134 -0
  285. package/lib/portable/thread.d.ts +41 -0
  286. package/lib/portable/thread.js +102 -0
  287. package/lib/protocols/AGUIAdapter.d.ts +0 -2
  288. package/lib/protocols/AGUIAdapter.js +39 -74
  289. package/lib/voice/ComposerVoice.d.ts +15 -2
  290. package/lib/voice/ComposerVoice.js +23 -17
  291. package/lib/voice/VoiceMenu.d.ts +27 -0
  292. package/lib/voice/VoiceMenu.js +32 -0
  293. package/lib/voice/chatVoice.js +2 -2
  294. package/lib/voice/choices.d.ts +33 -0
  295. package/lib/voice/choices.js +70 -0
  296. package/lib/voice/index.d.ts +4 -0
  297. package/lib/voice/index.js +3 -0
  298. package/lib/voice/settings.d.ts +17 -1
  299. package/lib/voice/settings.js +64 -1
  300. package/lib/voice/useVoiceSettings.d.ts +6 -0
  301. package/lib/voice/useVoiceSettings.js +25 -0
  302. package/package.json +1 -1
  303. package/dist-embed/chunks/ChatView-C2La9033.js +0 -32
  304. /package/lib/{utils → portable}/approvals.d.ts +0 -0
  305. /package/lib/{utils → portable}/approvals.js +0 -0
@@ -0,0 +1,33 @@
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
4
+ * hears, the voices of each, the speeds and loudnesses offered, and when
5
+ * answers are heard. Read by the composer's menu (`VoiceMenu`) and by a
6
+ * settings page, so both offer the same.
7
+ *
8
+ * @module voice/choices
9
+ */
10
+ import { type VoiceSpec } from '../specs/voices';
11
+ import type { ChatVoice } from './index';
12
+ /** A choice as a menu or a page lists it. */
13
+ export interface VoiceChoice<T> {
14
+ value: T;
15
+ label: string;
16
+ }
17
+ /** A language's name, in English, as the menu says it: `en-GB` is *British English*. */
18
+ export declare function languageName(language: string): string;
19
+ /**
20
+ * The languages a person may speak and hear: each a voice of the catalogue
21
+ * speaks and a model on the device hears, in the catalogue's order.
22
+ */
23
+ export declare function voiceLanguages(): VoiceChoice<string>[];
24
+ /** The voices that speak a language, in the catalogue's order. */
25
+ export declare function voicesSpeaking(language: string): VoiceSpec[];
26
+ /** Whether a voice of the catalogue speaks a language: what a new language keeps of a chosen voice. */
27
+ export declare function catalogueVoiceSpeaks(voice: string, language: string): boolean;
28
+ /** The speeds offered, as multipliers of the voice's own. */
29
+ export declare const RATE_CHOICES: VoiceChoice<number>[];
30
+ /** The loudnesses offered, 0 to 1. */
31
+ export declare const VOLUME_CHOICES: VoiceChoice<number>[];
32
+ /** When answers are heard (VO-21): what a person may choose where the application speaks. */
33
+ export declare const OUTPUT_CHOICES: VoiceChoice<NonNullable<ChatVoice['output']>>[];
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
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
8
+ * hears, the voices of each, the speeds and loudnesses offered, and when
9
+ * answers are heard. Read by the composer's menu (`VoiceMenu`) and by a
10
+ * settings page, so both offer the same.
11
+ *
12
+ * @module voice/choices
13
+ */
14
+ import { VOICE_CATALOGUE, transcriberFor, voiceSpeaks, } from '../specs/voices';
15
+ /** A language's name, in English, as the menu says it: `en-GB` is *British English*. */
16
+ export function languageName(language) {
17
+ try {
18
+ const names = new Intl.DisplayNames(['en'], { type: 'language' });
19
+ return names.of(language) ?? language;
20
+ }
21
+ catch {
22
+ return language;
23
+ }
24
+ }
25
+ /**
26
+ * The languages a person may speak and hear: each a voice of the catalogue
27
+ * speaks and a model on the device hears, in the catalogue's order.
28
+ */
29
+ export function voiceLanguages() {
30
+ const seen = new Set();
31
+ const languages = [];
32
+ for (const voice of Object.values(VOICE_CATALOGUE)) {
33
+ for (const language of voice.languages) {
34
+ if (!seen.has(language) && transcriberFor(language)) {
35
+ seen.add(language);
36
+ languages.push({ value: language, label: languageName(language) });
37
+ }
38
+ }
39
+ }
40
+ return languages;
41
+ }
42
+ /** The voices that speak a language, in the catalogue's order. */
43
+ export function voicesSpeaking(language) {
44
+ return Object.values(VOICE_CATALOGUE).filter(voice => voiceSpeaks(voice, language) ||
45
+ voiceSpeaks(voice, language.split('-')[0]));
46
+ }
47
+ /** Whether a voice of the catalogue speaks a language: what a new language keeps of a chosen voice. */
48
+ export function catalogueVoiceSpeaks(voice, language) {
49
+ return voicesSpeaking(language).some(spoken => spoken.id === voice);
50
+ }
51
+ /** The speeds offered, as multipliers of the voice's own. */
52
+ export const RATE_CHOICES = [
53
+ { value: 0.75, label: 'Slower' },
54
+ { value: 1, label: 'Normal' },
55
+ { value: 1.25, label: 'Faster' },
56
+ { value: 1.5, label: 'Fastest' },
57
+ ];
58
+ /** The loudnesses offered, 0 to 1. */
59
+ export const VOLUME_CHOICES = [
60
+ { value: 0.25, label: 'Quiet' },
61
+ { value: 0.5, label: 'Half' },
62
+ { value: 0.75, label: 'Loud' },
63
+ { value: 1, label: 'Full' },
64
+ ];
65
+ /** When answers are heard (VO-21): what a person may choose where the application speaks. */
66
+ export const OUTPUT_CHOICES = [
67
+ { value: 'off', label: 'Never' },
68
+ { value: 'on_request', label: 'When I ask (Read aloud)' },
69
+ { value: 'always', label: 'Always, as they are written' },
70
+ ];
@@ -16,6 +16,10 @@ export * from './hearing';
16
16
  export * from './speaker';
17
17
  export * from './consent';
18
18
  export * from './settings';
19
+ export * from './choices';
20
+ export { useVoiceSettings } from './useVoiceSettings';
21
+ export { VoiceMenu } from './VoiceMenu';
22
+ export type { VoiceMenuProps } from './VoiceMenu';
19
23
  export * from './useSpokenAnswers';
20
24
  export { VoiceInput } from './VoiceInput';
21
25
  export type { VoiceInputProps, ListeningState } from './VoiceInput';
@@ -10,6 +10,9 @@ export * from './hearing';
10
10
  export * from './speaker';
11
11
  export * from './consent';
12
12
  export * from './settings';
13
+ export * from './choices';
14
+ export { useVoiceSettings } from './useVoiceSettings';
15
+ export { VoiceMenu } from './VoiceMenu';
13
16
  export * from './useSpokenAnswers';
14
17
  export { VoiceInput } from './VoiceInput';
15
18
  export { ReadAloud, readAloud, readsAloud } from './ReadAloud';
@@ -62,8 +62,24 @@ export interface VoiceSettings {
62
62
  export declare function saneVoiceSettings(settings: VoiceSettings | null | undefined): VoiceSettings;
63
63
  /** What was kept, or nothing. Storage may be refused, or hold nonsense. */
64
64
  export declare function keptVoiceSettings(): VoiceSettings;
65
- /** Keep what the person chose; an empty choice forgets it. */
65
+ /** The person's settings as the page holds them (VO-30). */
66
+ export declare function heldVoiceSettings(): VoiceSettings;
67
+ /**
68
+ * Be told when the person's settings change — from a menu on this page, or
69
+ * from another tab, whose storage event is read here. Returns the unsubscribe.
70
+ */
71
+ export declare function onVoiceSettingsChange(listener: (settings: VoiceSettings) => void): () => void;
72
+ /**
73
+ * Keep what the person chose; an empty choice forgets it. Every chat on the
74
+ * page is told, so the menu's choice is heard at once (VO-30).
75
+ */
66
76
  export declare function keepVoiceSettings(settings: VoiceSettings): VoiceSettings;
77
+ /**
78
+ * The settings with one choice changed (VO-30): `undefined` forgets that
79
+ * choice, giving it back to the application. A new language drops a voice
80
+ * the person chose that does not speak it, for the language's own.
81
+ */
82
+ export declare function withVoiceSetting<K extends keyof VoiceSettings>(settings: VoiceSettings, key: K, value: VoiceSettings[K] | undefined, speaks?: (voice: string, language: string) => boolean): VoiceSettings;
67
83
  /** The language the browser says the person reads, or nothing. */
68
84
  export declare function browserLanguage(): string | undefined;
69
85
  /**
@@ -54,7 +54,47 @@ export function keptVoiceSettings() {
54
54
  return {};
55
55
  }
56
56
  }
57
- /** Keep what the person chose; an empty choice forgets it. */
57
+ /**
58
+ * What the page holds: the kept settings, or the choice made on this page
59
+ * when storage refused it. Read once, then told of each change.
60
+ */
61
+ let held;
62
+ /** Who is told when the person's settings change: every chat on the page (VO-30). */
63
+ const listeners = new Set();
64
+ /** The person's settings as the page holds them (VO-30). */
65
+ export function heldVoiceSettings() {
66
+ if (held === undefined) {
67
+ held = keptVoiceSettings();
68
+ }
69
+ return held;
70
+ }
71
+ /**
72
+ * Be told when the person's settings change — from a menu on this page, or
73
+ * from another tab, whose storage event is read here. Returns the unsubscribe.
74
+ */
75
+ export function onVoiceSettingsChange(listener) {
76
+ listeners.add(listener);
77
+ return () => {
78
+ listeners.delete(listener);
79
+ };
80
+ }
81
+ function told(settings) {
82
+ held = settings;
83
+ for (const listener of [...listeners]) {
84
+ listener(settings);
85
+ }
86
+ }
87
+ if (typeof window !== 'undefined') {
88
+ window.addEventListener('storage', event => {
89
+ if (event.key === VOICE_SETTINGS_KEY || event.key === null) {
90
+ told(keptVoiceSettings());
91
+ }
92
+ });
93
+ }
94
+ /**
95
+ * Keep what the person chose; an empty choice forgets it. Every chat on the
96
+ * page is told, so the menu's choice is heard at once (VO-30).
97
+ */
58
98
  export function keepVoiceSettings(settings) {
59
99
  const sane = saneVoiceSettings(settings);
60
100
  try {
@@ -68,8 +108,31 @@ export function keepVoiceSettings(settings) {
68
108
  catch {
69
109
  // Without storage the choice holds for the page.
70
110
  }
111
+ told(sane);
71
112
  return sane;
72
113
  }
114
+ /**
115
+ * The settings with one choice changed (VO-30): `undefined` forgets that
116
+ * choice, giving it back to the application. A new language drops a voice
117
+ * the person chose that does not speak it, for the language's own.
118
+ */
119
+ export function withVoiceSetting(settings, key, value, speaks) {
120
+ const next = { ...saneVoiceSettings(settings) };
121
+ if (value === undefined) {
122
+ delete next[key];
123
+ }
124
+ else {
125
+ next[key] = value;
126
+ }
127
+ if (key === 'language' &&
128
+ typeof value === 'string' &&
129
+ next.voice &&
130
+ speaks &&
131
+ !speaks(next.voice, value)) {
132
+ delete next.voice;
133
+ }
134
+ return saneVoiceSettings(next);
135
+ }
73
136
  /** The language the browser says the person reads, or nothing. */
74
137
  export function browserLanguage() {
75
138
  try {
@@ -0,0 +1,6 @@
1
+ import { type VoiceSettings } from './settings';
2
+ /** The person's settings, and a setter that keeps them and tells every chat. */
3
+ export declare function useVoiceSettings(): [
4
+ VoiceSettings,
5
+ (settings: VoiceSettings) => void
6
+ ];
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * A person's voice settings, as a React state that follows every change —
7
+ * the composer's menu, a settings page, another tab (VOICE.md VO-30).
8
+ *
9
+ * @module voice/useVoiceSettings
10
+ */
11
+ import { useCallback, useEffect, useState } from 'react';
12
+ import { heldVoiceSettings, keepVoiceSettings, onVoiceSettingsChange, } from './settings';
13
+ /** The person's settings, and a setter that keeps them and tells every chat. */
14
+ export function useVoiceSettings() {
15
+ const [settings, setSettings] = useState(heldVoiceSettings);
16
+ useEffect(() => {
17
+ // A change between the first draw and this subscription is read here.
18
+ setSettings(heldVoiceSettings());
19
+ return onVoiceSettingsChange(setSettings);
20
+ }, []);
21
+ const keep = useCallback((next) => {
22
+ keepVoiceSettings(next);
23
+ }, []);
24
+ return [settings, keep];
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.5.20",
3
+ "version": "1.5.22",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -1,32 +0,0 @@
1
- import{E as N,eN as bo,r as o,j as t,eO as xo,eP as vo,b_ as Tn,B as p,H as bt,T as W,c as q,cu as zt,eu as Dt,eQ as de,co as xt,e as So,eR as yo,eS as wo,e3 as Co,eT as ko,aH as jo,dX as Nn,dV as Eo,dY as Gt,eU as Io,eV as To,eW as Ro,eX as Ao,eY as Rn,eZ as Mo,e_ as Po,e$ as $o,d3 as Oo,a_ as Uo,f0 as Fo,f1 as Lo,f2 as _o,f3 as zo,f4 as No,f5 as Bo,x as Nt,f6 as Vo,f7 as Ho,f8 as Wo,f9 as Do,fa as Go,fb as Ko,fc as Yo,fd as qo,fe as Jo,ff as Qo,fg as Xo,fh as Zo,fi as es,fj as ts,fk as ns,fl as os,fm as ss,fn as as,fo as is,fp as rs,fq as tt,fr as ls,fs as cs,ft as ds,fu as us,fv as An,fw as fs,fx as Fe,fy as ps,fz as ms,a$ as vt,fA as gs,fB as hs,fC as Mn,fD as bs,fE as xs,fF as vs,eC as Ss,fG as Bt,fH as Ce,fI as ys,fJ as ws,fK as Cs,fL as Pn,fM as ks,fN as js,fO as Es,fP as Is,fQ as Ts,fR as Rs,fS as As,fT as Ms,fU as Ps,fV as $s,fW as St,fX as Os,fY as Us,fZ as Fs,I as Ls,f_ as _s,f$ as zs,g0 as $n,g1 as Ns,g2 as Bs,g3 as Vs,g4 as Kt,g5 as Hs,g6 as Ws,ek as Vt,g7 as Ds,g8 as Gs}from"../datalayer-app-main.js";import{S as Ks,E as Ys,a as qs}from"./SignInIcon-4HkE48mS.js";import{F as Js,a as Qs,b as Xs}from"./LinkedInGreyIcon-BoWXE-HS.js";function Bn(){const n=N(bo);return o.useMemo(()=>n.map(s=>s.value),[n])}const Ht={github:{name:"github",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/github/callback"},google:{name:"google",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/google/callback"},linkedin:{name:"linkedin",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/linkedin/callback"}},On=()=>{if(typeof document>"u")return"";const n=document.getElementById("datalayer-config-data");if(!n?.textContent)return"";try{const s=JSON.parse(n.textContent);return String(s?.iamUrl||"").replace(/\/$/,"")}catch{return""}},Zs=(n,s="Unable to start social sign-in.")=>{if(n instanceof Error&&n.message)return n.message;if(typeof n=="string"&&n.trim())return n;if(n&&typeof n=="object"&&"message"in n){const l=n.message;if(typeof l=="string"&&l.trim())return l}return s},ea=ko`
2
- .signin-input-theme-scope input:-webkit-autofill,
3
- .signin-input-theme-scope input:-webkit-autofill:hover,
4
- .signin-input-theme-scope input:-webkit-autofill:focus,
5
- .signin-input-theme-scope input:-webkit-autofill:active,
6
- .signin-input-theme-scope input:-webkit-autofill:disabled,
7
- .signin-input-theme-scope textarea:-webkit-autofill,
8
- .signin-input-theme-scope textarea:-webkit-autofill:hover,
9
- .signin-input-theme-scope textarea:-webkit-autofill:focus,
10
- .signin-input-theme-scope textarea:-webkit-autofill:active,
11
- .signin-input-theme-scope textarea:-webkit-autofill:disabled {
12
- -webkit-text-fill-color: var(--fgColor-default) !important;
13
- caret-color: var(--fgColor-default) !important;
14
- -webkit-box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
15
- box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
16
- background-color: var(--bgColor-default) !important;
17
- transition: background-color 9999s ease-in-out 0s !important;
18
- }
19
-
20
- .signin-input-theme-scope input:disabled,
21
- .signin-input-theme-scope textarea:disabled {
22
- -webkit-text-fill-color: var(--fgColor-muted) !important;
23
- -webkit-box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
24
- box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
25
- background-color: var(--bgColor-default) !important;
26
- opacity: 1 !important;
27
- }
28
- `,ta=({onSignIn:n,onApiKeySignIn:s,loginUrl:l,name:i,title:c="Datalayer OTEL",description:g="Sign in to access the observability dashboard.",icon:v,leadingIcon:w=t.jsx(Co,{size:24}),github:u=!1,google:J=!1,linkedin:B=!1,apiKey:nt=!1,signUp:U=!0,socialSignInNavigationTarget:te,asDoc:S=!1,fillHeight:I=!0,hideHero:ne=!1,calloutTitle:Le,calloutDescription:ot,passwordToggleLabel:ue="Sign in with a password",signUpTitle:Yt="Don't have an account?",signUpDescription:Q="Create a free Datalayer account with your email address.",signUpLabel:yt="Sign up with email",signUpHref:_e="https://datalayer.ai/signup",onSignUp:V,forgotPasswordHref:X="/password",forgotPasswordLabel:ze="Forgot password?",showForgotPassword:wt=!0,socialButtonMarginTop:b=3,actionButtonMaxWidth:Z=320})=>{const oe=S&&!ne,st=i??(S&&c==="Datalayer OTEL"?"Datalayer Sign In":c),Ct=v??(S?t.jsx(Ks,{size:24}):w),F=o.useMemo(()=>{if(l)return l;const d=On();return d?`${d}/api/iam/v1/login`:"/api/iam/v1/login"},[l]),[D,ke]=o.useState(""),[fe,kt]=o.useState(""),[at,jt]=o.useState(!1),[je,pe]=o.useState(!1),[k,me]=o.useState(!1),[se,it]=o.useState(!1),[Ne,Ee]=o.useState(null),[L,Et]=o.useState(null),[ge,Ie]=o.useState(""),[Te,rt]=o.useState(null),[Re,O]=o.useState(null),{enqueueToast:he}=xo(),[Ae,ae]=o.useState(!1),[ie,be]=o.useState(""),E=o.useRef(null),Me=o.useCallback(d=>vo()?Tn.URLExt.join(Tn.PageConfig.getBaseUrl(),d.oauth2CallbackServerRoute):`${window.location.protocol}//${window.location.hostname}${window.location.port?`:${window.location.port}`:""}${d.oauth2CallbackUIRoute}`,[]),G=o.useMemo(()=>{if(typeof window>"u")return"/";const d=`${window.location.pathname}${window.location.search}${window.location.hash}`;return d.startsWith("/")?d:"/"},[]),H=o.useCallback(async d=>{if(!se){O(null),Ee(d.name),it(!0);try{const j=On(),P=new URLSearchParams({provider:d.name,callback_uri:Me(d)}),h=te===void 0?void 0:String(te||"").trim(),R=h===void 0?G&&G!=="/"?G:void 0:h&&h.startsWith("/")&&!h.startsWith("//")?h:void 0;R&&P.set("post_auth_redirect",R);const le=`${j||""}/api/iam/v1/oauth2/authz/url?${P.toString()}`,y=await fetch(le),De=await y.json(),Pe=De?.autorization_url;if(!y.ok||!Pe)throw new Error(De?.message||"Unable to start social sign-in.");window.location.assign(Pe)}catch(j){const P=Zs(j);O(P),he(P,{variant:"error"}),Ee(null),it(!1)}}},[Me,G,he,se,te]);o.useEffect(()=>{Ae&&E.current?.focus()},[Ae]);const re=o.useCallback(()=>{ae(!1),be("")},[]),lt=o.useCallback(()=>{!ie.trim()||!s||(s(ie.trim()),re())},[ie,s,re]),ct=o.useCallback(()=>{if(V){V();return}window.location.assign(_e)},[V,_e]),K=o.useCallback(()=>{if(X){if(X.startsWith("http://")||X.startsWith("https://")){window.open(X,"_blank","noopener,noreferrer");return}window.location.assign(X)}},[X]),Be=o.useCallback(async()=>{if(!(S||!D||!fe||k)){me(!0),O(null);try{const d=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({handle:D,password:fe})});if(!d.ok)throw new Error(`HTTP ${d.status}`);const j=await d.json();if(j.success&&j.token){const P=String(j?.user?.id||j?.user?.uid||"").trim();if(!!j?.user?.mfaUrl&&P){Et(P),rt(j.token),O(null);return}n&&n(j.token,D)}else O(j.message||"Invalid username or password.")}catch(d){O(d instanceof Error?d.message:String(d))}finally{me(!1)}}},[S,D,fe,k,F,n]),Ve=o.useCallback(async()=>{if(!(S||k||!L||!ge.trim()||!Te)){me(!0),O(null);try{const d=new URL(F,window.location.origin),j=d.pathname.endsWith("/api/iam/v1/login")?d.href.replace(/\/api\/iam\/v1\/login$/,""):`${d.origin}`,P=await fetch(`${j}/api/iam/v1/users/${L}/mfa/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userUid:L,code:ge.trim()})}),h=await P.json();if(!P.ok||!h?.success)throw new Error(h?.message||"Failed to validate your MFA code.");n&&n(Te,D)}catch(d){const j=d instanceof Error?d.message:String(d);O(j),he(j,{variant:"error"})}finally{me(!1)}}},[S,he,D,k,F,ge,Te,L,n]),He=o.useCallback(d=>{d.key==="Enter"&&(L?Ve():Be())},[L,Be,Ve]),We=se||k||S;return t.jsxs(p,{className:"signin-input-theme-scope",display:"flex",alignItems:ne||oe||!I?"flex-start":"center",justifyContent:"center",minHeight:ne||oe||!I?"auto":"100vh",bg:ne?"transparent":"canvas.default",color:"fg.default",py:ne?0:oe?2:4,children:[t.jsx(ea,{}),t.jsxs(p,{width:"100%",maxWidth:440,p:0,children:[!ne&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{display:"flex",alignItems:"center",gap:2,mb:oe?2:3,justifyContent:"center",children:[Ct,t.jsx(bt,{sx:{fontSize:3},children:st})]}),t.jsx(W,{as:"p",sx:{fontSize:1,color:"fg.muted",mb:oe?2:3,textAlign:"center"},children:g})]}),(Le||ot)&&t.jsxs(p,{mb:3,textAlign:"center",children:[Le&&t.jsx(bt,{as:"h3",sx:{fontSize:2,mb:1},children:Le}),ot&&t.jsx(W,{sx:{color:"fg.muted",fontSize:1},children:ot})]}),!L&&(u||J||B)&&t.jsxs(t.Fragment,{children:[u&&t.jsx(q,{block:!0,size:"large",leadingVisual:Ne==="github"?()=>t.jsx(zt,{size:"small"}):Js,disabled:We,onClick:()=>H(Ht.github),sx:{mt:b,maxWidth:Z,mx:"auto"},children:"Sign in with GitHub"}),J&&t.jsx(q,{block:!0,size:"large",leadingVisual:Ne==="google"?()=>t.jsx(zt,{size:"small"}):Qs,disabled:We,onClick:()=>H(Ht.google),sx:{mt:b,maxWidth:Z,mx:"auto"},children:"Sign in with Google"}),B&&t.jsx(q,{block:!0,size:"large",leadingVisual:Ne==="linkedin"?()=>t.jsx(zt,{size:"small"}):Xs,disabled:We,onClick:()=>H(Ht.linkedin),sx:{mt:b,maxWidth:Z,mx:"auto"},children:"Sign in with LinkedIn"})]}),!L&&!at&&t.jsx(p,{mt:3,display:"flex",justifyContent:"center",children:t.jsx(q,{leadingVisual:Dt,size:"large",block:!0,disabled:S||k||se,onClick:()=>jt(!0),sx:{maxWidth:Z,mx:"auto"},children:ue})}),!L&&at&&t.jsxs(p,{mt:4,children:[t.jsxs(de,{required:!0,sx:{mb:3},children:[t.jsx(de.Label,{children:"Username"}),t.jsx(xt,{autoFocus:!0,block:!0,placeholder:"Your username",value:D,disabled:k||S,onChange:d=>ke(d.target.value),onKeyDown:He})]}),t.jsxs(de,{required:!0,sx:{mb:3},children:[t.jsx(de.Label,{children:"Password"}),t.jsx(xt,{block:!0,placeholder:"Your password",type:je?"text":"password",value:fe,disabled:k||S,onChange:d=>kt(d.target.value),onKeyDown:He,trailingAction:t.jsx(xt.Action,{onClick:()=>pe(!je),disabled:k||S,icon:je?Ys:qs,"aria-label":je?"Hide password":"Show password",sx:{color:"var(--fgColor-muted)"}})})]}),t.jsxs(p,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:3,children:[t.jsx(q,{variant:"primary",disabled:k||S||!D||!fe,onClick:Be,children:k?"Signing in…":"Sign In"}),wt&&t.jsx(So,{as:"button",sx:{fontSize:1,cursor:S?"not-allowed":"pointer",background:"none",border:"none",opacity:S?.6:1},onClick:()=>{S||k||K()},children:ze})]})]}),L&&t.jsxs(t.Fragment,{children:[t.jsxs(de,{required:!0,sx:{mb:3,mt:2},children:[t.jsx(de.Label,{children:"MFA Code"}),t.jsx(xt,{autoFocus:!0,block:!0,placeholder:"Your MFA code",value:ge,disabled:k||S,onChange:d=>Ie(d.target.value),onKeyDown:He})]}),t.jsx(q,{variant:"primary",block:!0,disabled:k||S||!ge.trim(),onClick:Ve,sx:{maxWidth:Z,mx:"auto"},children:k?"Validating…":"Validate MFA Code"})]}),Re&&t.jsx(W,{sx:{color:"danger.fg",fontSize:1,mt:3,display:"block"},children:Re}),U&&t.jsxs(p,{mt:4,pt:4,textAlign:"center",borderTop:"1px solid",borderColor:"border.muted",children:[t.jsx(bt,{as:"h3",sx:{fontSize:2,mb:2},children:Yt}),t.jsx(W,{as:"p",sx:{color:"fg.muted",fontSize:1,mb:3},children:Q}),t.jsx(p,{display:"flex",justifyContent:"center",children:t.jsx(q,{variant:"primary",size:"large",leadingVisual:yo,disabled:S||k,onClick:ct,children:yt})})]}),nt&&s&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{display:"flex",alignItems:"center",gap:2,my:3,children:[t.jsx(p,{flex:1,height:"1px",bg:"border.default"}),t.jsx(W,{sx:{fontSize:0,color:"fg.muted"},children:"or"}),t.jsx(p,{flex:1,height:"1px",bg:"border.default"})]}),t.jsx(q,{block:!0,leadingVisual:Dt,disabled:S||k||se,onClick:()=>ae(!0),sx:{maxWidth:Z,mx:"auto"},children:"Sign in with an API Key"}),Ae&&t.jsx(p,{role:"dialog","aria-modal":"true","aria-labelledby":"signin-api-key-title",onKeyDown:d=>{d.key==="Escape"&&re()},onClick:re,position:"fixed",inset:0,zIndex:200,p:3,bg:"canvas.backdrop",display:"flex",alignItems:"center",justifyContent:"center",children:t.jsxs(p,{as:"form",onClick:d=>d.stopPropagation(),onSubmit:d=>{d.preventDefault(),lt()},width:"min(560px, 100%)",p:3,borderRadius:2,border:"1px solid",borderColor:"border.default",bg:"canvas.overlay",color:"fg.default",boxShadow:"shadow.large",children:[t.jsx(bt,{id:"signin-api-key-title",sx:{fontSize:2,mb:2},children:"Enter your API Key"}),t.jsxs(de,{required:!0,children:[t.jsx(de.Label,{children:"API Key"}),t.jsx(wo,{block:!0,required:!0,autoFocus:!0,placeholder:"Paste your API key here",value:ie,onInput:d=>be(d.currentTarget.value),ref:E})]}),t.jsxs(p,{mt:3,display:"flex",justifyContent:"flex-end",gap:2,children:[t.jsx(q,{type:"button",onClick:re,children:"Cancel"}),t.jsx(q,{type:"submit",variant:"primary",disabled:!ie.trim(),children:"Authenticate"})]})]})})]})]})]})};function na(n){const{agentId:s,instructions:l,model:i,frontendTools:c,inference:g,subagents:v,sharing:w,onSubagentEvent:u,modeEffect:J}=n;return{type:"browser-vercel-ai",endpoint:"",agentId:s,enableConfigQuery:!1,options:{instructions:l,model:i,frontendTools:c,inference:g,subagents:v,sharing:w,onSubagentEvent:u,modeEffect:J}}}const Un=jo((n,s)=>({pending:void 0,suggest:(l,i)=>{const c=l.trim();c&&n({pending:{text:c,submit:i?.submit??!1,nonce:(s().pending?.nonce??0)+1}})},consume:()=>n({pending:void 0})}));function oa({agentName:n,sandboxStillRuns:s=!1,temporary:l=!0,onSignedIn:i,onSignUp:c}){const{configuration:g}=Nn(),v=o.useCallback(w=>{Eo.getState().checkIAMToken(w),i?.()},[i]);return t.jsx(p,{height:"100%",minHeight:0,overflowY:"auto",bg:"canvas.default",px:4,py:4,children:t.jsxs(p,{maxWidth:440,mx:"auto",children:[t.jsxs(p,{display:"flex",alignItems:"center",justifyContent:"center",gap:2,color:"attention.fg",mb:2,children:[t.jsx(Dt,{size:20}),t.jsx(W,{sx:{fontSize:2,fontWeight:"semibold",color:"fg.default"},children:l?"This demo runs on a shared key":"Your key has expired"})]}),t.jsxs(W,{as:"p",sx:{fontSize:1,color:"fg.muted",textAlign:"center",mb:3},children:[l?`${n??"The agent"} has used the time this key allows. Sign in to point your own agent at it, use your own data, and drop the time limit.`:`${n??"The agent"} stopped because your session ran out.`,s?" Your notebook is still running in this page.":""]}),t.jsx(ta,{hideHero:!0,fillHeight:!1,calloutTitle:"Sign in to keep going",github:!0,google:!0,linkedin:!0,socialSignInNavigationTarget:typeof window>"u"?void 0:`${window.location.pathname}${window.location.search}`,loginUrl:g?.iamUrl?`${g.iamUrl}/api/iam/v1/login`:void 0,onSignIn:v,onSignUp:c})]})})}const sa="https://r1.datalayer.run";function aa(n=!0){const{configuration:s}=Nn(),l=Gt(w=>w.token),i=s?.aiInferenceUrl||sa,c=Io(i,n&&!l),g=l||c.token,v=o.useMemo(()=>({inferenceUrl:i,token:g||void 0}),[i,g]);return{inference:v,needsSignIn:To(v),anonymous:c,inferenceUrl:i}}const ia={name:"general-purpose",description:"A capable generalist for a task none of the specialists covers: research, reasoning, drafting, checking.",instructions:"You are a capable general-purpose assistant. Carry out the task you are given completely and report the result plainly, saying what you could not do."};function Fn(n){const s=n?.subagents;if(!s)return[];const l=(s.subagents??[]).map(i=>{const c=i.ref?Ro(i.ref):void 0;return{name:i.name,description:i.description||c?.description||i.name,instructions:i.instructions??c?.systemPrompt,model:i.model??c?.model??s.defaultModel,icon:c?.icon}});return s.includeGeneralPurpose?[...l,ia]:l}function ra(n){return n.replace(/^datalayer_/,"").replace(/_lexical$/,"")}function la(n){const s=ra(n);return/^executeCodeIn(Notebook|Document)$/.test(s)||/^(read|list)[A-Z]/.test(s)}function ca(n,s){return n.filter(l=>s?.has(l.name)||la(l.name))}function da(n,s){const l=i=>s&&i.value.id===`${s}-tools`?0:i.value.id==="notebook-tools"?1:2;return n.map((i,c)=>({entry:i,index:c,rank:l(i)})).sort((i,c)=>i.rank-c.rank||i.index-c.index).map(i=>i.entry)}function ua(n,s,l){if(!l||!n.endsWith("-tools"))return!1;const i=n.slice(0,-6);return s.has(i)&&i!==l}const fa={type:"object",properties:{}};function pa(n,s){const l=new Set(n.toolset);return n.commands.filter(i=>l.has(i.name)).map(i=>({name:i.name,description:i.description,parameters:i.parameters??fa,location:"frontend",handler:async c=>{if(!s)throw new Error(`${i.name}: the ${n.plugin??n.id} plugin is not mounted on this page.`);const g=Object.keys(c??{}).length>0?c:void 0,v=await s.executeCommand(i.command,g);return v===void 0?{ok:!0,command:i.command,argument:g}:v}}))}function Vn(n,s){return n.flatMap(l=>pa(l,s))}function ma(){const n=Ao(),s=Bn();return o.useMemo(()=>Vn(s,n),[s,n])}const Ln={opening:"Opening your conversation…",notOpened:n=>`Your conversation could not be opened, so this is a new one: ${n}`};function ga(n){const s=n?.app_instance;if(!s||typeof s!="object")return"";const l=s.deployment_uid;return typeof l=="string"?l.trim():""}function ha(n,s,l){return n||!s?n:{id:l,messages:[]}}function ba(n){let s;for(const l of n.split(/\r?\n\r?\n/)){const i=l.split(/\r?\n/).filter(c=>c.startsWith("data:")).map(c=>c.slice(5).trim()).join("");if(i)try{const c=JSON.parse(i);c.type==="MESSAGES_SNAPSHOT"&&Array.isArray(c.messages)&&(s=c.messages)}catch{}}return s}async function _n(n){try{const s=await n.json();if(typeof s.detail=="string"&&s.detail)return s.detail}catch{}return`${n.status}`}async function xa({agentBaseUrl:n,agentId:s,uid:l,token:i,fetcher:c=fetch}){const g=`${n.replace(/\/+$/,"")}/api/v1/apps/sessions/${encodeURIComponent(l)}`,v=i?{Authorization:`Bearer ${i}`}:{},w=await c(`${g}/messages`,{headers:v});if(w.ok){const B=await w.json();return Rn(B.messages)}if(w.status!==404)throw new Error(await _n(w));const u=await c(`${g}/resume`,{method:"POST",headers:{"Content-Type":"application/json",...v},body:JSON.stringify({agent:s})});if(!u.ok)throw new Error(await _n(u));const J=ba(await u.text());if(!J)throw new Error(`The runtime said nothing of session ${l}.`);return Rn(J)}const va="var(--theme-accent)";function Hn({face:n,size:s}){return typeof n=="string"?t.jsx(Mo,{emoji:n,size:s,label:""}):t.jsx(t.Fragment,{children:n})}function Sa({face:n,size:s,state:l}){const i=l==="thinking"||l==="working",c=l==="paused";return t.jsxs(p,{as:"span","aria-hidden":!0,"data-presence":l,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:s+8,height:s+8,flexShrink:0,fontSize:s,lineHeight:1,children:[t.jsx(p,{as:"span",position:"absolute",inset:0,borderRadius:"50%",boxShadow:c?"none":`0 0 0 2px ${va}`,border:c?"2px dashed":"none",borderColor:"border.default",opacity:i||l==="waiting"||c?.9:0,transition:"opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)",animation:i?"loopPresenceBreath 1.8s ease-in-out infinite":"none",reducedMotion:{animation:"none"},sx:{"@keyframes loopPresenceBreath":{"0%, 100%":{transform:"scale(0.92)",opacity:.35},"50%":{transform:"scale(1.06)",opacity:.9}}}}),t.jsx(p,{as:"span",display:"inline-flex",opacity:c?.55:1,filter:c?"grayscale(0.6)":"none",transition:"opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)",children:t.jsx(Hn,{face:n,size:s})})]})}function ya({state:n}){return t.jsx(W,{role:"status","aria-live":"polite","data-presence-line":n,sx:{fontSize:0,color:n==="waiting"?"fg.default":"fg.muted",fontWeight:n==="waiting"?"semibold":"normal",whiteSpace:"nowrap",flexShrink:0},children:Po[n]})}const wa=Kt(void 0),Ca=Kt(""),ka=Kt({}),ee="",ja=1400,zn=parseInt(Ds["--loop-face-large"],10);function Aa({workspace:n}){const s=$o(),l=Oo(),i=o.useRef(null),{setViewControls:c}=n,[g,v]=o.useState(null),w=Uo(),u=w.getConfig(Fo),J=u?.placeholder||s.placeholder,B=u?.defaultSurface??"notebook",nt=w.getConfig(Lo),[U,te]=o.useState(ee),S=o.useRef(!1),I=N(_o),ne=N(zo),Le=N(No),ue=N(Bo)[0]?.value,Q=Nt(ue?.promptStance??wa)??ue?.prompt,yt=N(Vo),_e=Ho(yt[0]?.value),V=o.useRef(_e);V.current=_e;const X=o.useRef(""),ze=N(Wo),wt=o.useMemo(()=>Do(()=>ze.reduce((e,r)=>({...e,...r.value.extras.value}),{})),[ze]),b=Nt(ze.length>0?wt:ka),Z=o.useRef(new Set),oe=Go(Hs,n),st=!oe.allowed,Ct=st?oe.reason??"Chat is unavailable for this sandbox":void 0,[F,D]=o.useState(!1),[ke,fe]=o.useState(!1),[kt,at]=o.useState(!1),[jt,je]=o.useState({open:!1,pendingApproval:!1}),pe=Ko(F,jt,u?.presence?.paused===!0),k=u?.presence?.onPresence;o.useEffect(()=>{k?.(pe),V.current?.setPresence(pe)},[k,pe]);const me=o.useRef(u?.presence?.onSaying);me.current=u?.presence?.onSaying;const se=o.useRef({answering:!1}),it=o.useCallback(e=>{i.current=e,fe(!!e)},[]),Ne=o.useCallback(e=>{const{open:r,pendingApproval:a}=Yo(e);je(we=>we.open===r&&we.pendingApproval===a?we:{open:r,pendingApproval:a});const m={saying:Jo(e),answering:qo(e)},f=se.current;(f.saying?.id!==m.saying?.id||f.saying?.text!==m.saying?.text||f.answering!==m.answering)&&(se.current=m,me.current?.(m));const z=V.current;if(!z)return;z.items(e);const M=new Set(["complete","completed","done","error","failed","cancelled","canceled","rejected","denied","stopped"]),Y={insertcell:"adding a cell",updatecell:"editing a cell",runcell:"running a cell",deletecells:"removing cells",readallcells:"reading the notebook",readcell:"reading a cell",executecode:"running code",insertblock:"adding a block",updateblock:"editing a block",runblock:"running a block",readdocument:"reading the document"};let x;for(let we=e.length-1;we>=0;we-=1){const ht=e[we];if(typeof ht.toolName=="string"&&ht.toolCallId){M.has(String(ht.status).toLowerCase())||(x=ht);break}}if(!x){z.activity(void 0);return}const ye=x.toolName.toLowerCase().replace(/^datalayer_/,"").replace(/_lexical$/,"").replace(/[^a-z]/g,""),ho=Y[ye]??`using ${x.toolName}`;z.activity(`${X.current||"The agent"} is ${ho}…`)},[]),Ee=o.useRef(b);Ee.current=b;const L=o.useCallback(e=>{Zn(e),V.current?.usage(e),Ee.current.onUsage?.(e)},[]),Et=o.useCallback(e=>{D(e),e||V.current?.end("done")},[]),ge=o.useCallback(e=>{const r=V.current;if(!r)return;let a=-1;for(let f=e.length-1;f>=0;f-=1)if(e[f].role==="user"){a=f;break}const m=e.slice(a+1).filter(f=>f.role==="assistant").map(Qo).filter(f=>f.trim().length>0).join(`
29
-
30
- `);r.assistant(m)},[]),Ie=o.useRef([]),Te=o.useRef(!1),rt=o.useRef(void 0),Re=o.useRef(void 0),O=o.useRef(void 0),he=N(Xo),Ae=o.useRef(he);Ae.current=he;const ae=o.useCallback((e,r)=>{if(Re.current)return Re.current;const a=O.current;O.current=void 0;const m=Zo(Ae.current.map(M=>M.value),a?{...r??{},voice:a}:r),f=m?.loop;if(Te.current&&f?.files&&f.files.length>0){const M=rt.current;if(!M)return"A file is given to an application running on a runtime: run it on Datalayer or on your machine to give it one.";let Y;try{Y=f.files.map(x=>({file:ts(String(x.name??"")),base64:es(String(x.data_url??""))}))}catch(x){return x instanceof Error?x.message:String(x)}M.execute(ns(Y)).then(x=>{if(!x.success){v(`The files could not be put in the sandbox: ${x.error??"it failed"}.`);return}ae(`${e}
31
-
32
- ${os(Y.map(ye=>ye.file))}`,{...m,loop:Object.fromEntries(Object.entries(f).filter(([ye])=>ye!=="files"))})});return}V.current?.begin(e,i.current?.thread());const z=i.current?.send;if(!z){Ie.current.push([e,m]);return}z(e,m)},[]);o.useEffect(()=>{c(ke?{busy:F,stop:i.current?.stop,newChat:i.current?.newChat,send:ae}:null)},[F,ke,c,ae]),o.useEffect(()=>()=>c(null),[c]),o.useEffect(()=>n.prompts.subscribe(ae),[n.prompts,ae]),o.useEffect(()=>{if(!ke||Ie.current.length===0)return;const e=Ie.current.splice(0,Ie.current.length);for(const[r,a]of e)i.current?.send(r,a)},[ke]);const ie=o.useRef(!1),be=o.useCallback(async e=>{v(null);const r=await ss(Ee.current,e);if(r){r.sent?Je(""):v(r.refused);return}ie.current||(ie.current=!0,nt?.firstPromptHook?.());const a=await n.submit(e);if(!a.handled){v(a.reason??null);return}Je(""),a.result?.content&&v(a.result.content)},[n,nt?.firstPromptHook]),E=o.useMemo(()=>I.find(e=>e.value.surfaceId===U)?.value,[I,U]),Me=o.useCallback(e=>{S.current=!0,te(e)},[]);o.useEffect(()=>as(Me),[Me]),o.useEffect(()=>{is(I.map(e=>e.value.surfaceId))},[I]),o.useEffect(()=>{rs(U&&U!==ee?U:Gs)},[U]);const G=o.useMemo(()=>B===ee||B==="none"?void 0:I.find(e=>e.value.surfaceId===B),[I,B]);o.useEffect(()=>{S.current||!G||tt(G.value,n)&&te(B)},[G,n,B]);const[H,re]=o.useState(null),lt=o.useRef(null),ct=u?.fullScreenTopOffset??0,{fullScreen:K,usingApi:Be,toggle:Ve,topOffsetPx:He}=ls(lt,{forceOverlay:!!ct,topOffset:ct}),[We,d]=o.useState(!1),j=o.useRef(!1);o.useEffect(()=>{!F||j.current||K||(j.current=!0,d(!0))},[F,K]),o.useEffect(()=>{K&&d(!1)},[K]),o.useEffect(()=>{E&&!tt(E,n)&&(re(E.surfaceId),te(ee))},[E,n]);const P=o.useMemo(()=>{if(H)return I.find(e=>e.value.surfaceId===H)?.value;if(!S.current&&U===ee)return G?.value},[I,H,U,G]);o.useEffect(()=>{if(!H||U!==ee)return;const e=I.find(r=>r.value.surfaceId===H);e&&tt(e.value,n)&&(re(null),te(H))},[I,U,H,n]);const h=n.agentId?.trim()||"default",R=cs(n.sandbox.target??"local");Te.current=R;const C=ds(),le=Nt(C?.selected??Ca),y=C?.members.find(e=>e.id===le),De=N(us)[0]?.value,Pe=De?.specId,A=An(y?.specId??h)??(Pe?An(Pe):void 0),Ge=y?void 0:De,qt=R&&!y?Vs(Pe,A):void 0;X.current=y?.name??A?.name??h;const Jt=N(fs),Qt=b.hiddenOpeners,Xt=b.hideOpeners,It=b.openers,Tt=o.useMemo(()=>{if(Xt)return[];const e=new Set(Qt??[]),r=x=>e.size===0?x:x.filter(ye=>!e.has(ye.text));if(It)return r(It);const a=Jt.flatMap(x=>x.value.suggestions);if(a.length>0)return r(a);const m=r(A?.suggestions??[]),f=r(C?.team.suggestions??[]);if(f.length===0)return m;const z=new Set(f.map(x=>x.text)),M=C?.team.name??"Team",Y=y?.name??A?.name??h;return[...f.map(x=>({...x,group:M})),...m.filter(x=>!z.has(x.text)).map(x=>({...x,group:Y}))]},[Jt,C,A,y,h,Qt,Xt,It]),dt=o.useMemo(()=>Tt.map(e=>({title:e.summary??e.text,message:e.message??e.text,group:e.group})),[Tt]),Rt=Fe(A?.icon),_=u?.presence,Wn=Fe(C?.team.icon),Zt=N(ps),ut=o.useMemo(()=>{const e=[],r=new Map,a=new Set,m=new Set(I.map(f=>f.value.surfaceId));for(const f of da(Zt,E?.surfaceId)){if(ua(f.value.id,m,E?.surfaceId))continue;let z;try{z=f.value.tools(n)}catch(M){console.warn(`[loop] frontend tools from '${f.plugin}' failed:`,M);continue}for(const M of z){const Y=r.get(M.name);if(Y){console.warn(`[loop] frontend tool '${M.name}' from '${f.plugin}' is shadowed by the one from '${Y}'.`);continue}r.set(M.name,f.plugin),e.push(M),f.value.chatView&&a.add(M.name)}}for(const f of b.frontendTools??[])r.has(f.name)||(r.set(f.name,"chat-extras"),e.push(f),a.add(f.name));return E?e:ca(e,a)},[Zt,n.surfaceId,n.agentId,b.frontendTools,E?.surfaceId,I]),At=ma(),Ke=o.useMemo(()=>{if(At.length===0)return ut;const e=new Set(ut.map(r=>r.name));return[...ut,...At.filter(r=>!e.has(r.name))]},[ut,At]),en=Bn(),Mt=b.agentToolBundles,Dn=o.useMemo(()=>{const e=b.frontendTools??[];if(!Mt?.length)return b.frontendTools;const r=Vn(en.filter(m=>Mt.includes(m.id)),w),a=new Set(e.map(m=>m.name));return[...e,...r.filter(m=>!a.has(m.name))]},[b.frontendTools,Mt,en,w]);rt.current=R&&Ke.some(e=>e.name===ms)?w.getOutput(vt)?.sandbox:void 0;const T=gs(n.sandbox,n.serverUrl),tn=N(hs),Gn=o.useMemo(()=>tn.filter(e=>e.value.composer).map(e=>({name:e.value.name,description:e.value.description})),[tn]),Kn=o.useMemo(()=>{if(!C||!y)return Fn(A).map(a=>({name:a.name,description:a.description,icon:Fe(a.icon)}));const e=C.members.map(a=>({name:a.name,description:a.description,emoji:a.emoji,icon:Fe(a.icon),disabled:a.id===y.id,disabledReason:a.id===y.id?`You are already talking to ${a.name}`:void 0})),r=Mn(C.team,y.id).filter(a=>!C.members.some(m=>m.name===a.name)).map(a=>({name:a.name,description:a.description,icon:Fe(a.icon)}));return[...e,...r]},[C,y,A]),{inference:nn,anonymous:Yn}=aa(R),qn=Gt(e=>e.user),Pt=R&&Yn.status==="expired",on=!qn,Ye=bs();Re.current=Ye.disabled?Ye.disableReason||"This conversation is closed here.":void 0;const $t=T===void 0?xs(n.sandbox,s):void 0,qe=st||Pt||!!qt||!!$t||Ye.disabled,sn=Pt?on?s.demoKeyExpired:s.keyExpired:qt??$t??Ct??(Ye.disabled?Ye.disableReason:void 0),[Ot,Je]=o.useState(""),Qe=o.useMemo(()=>u?.voice?vs(u.voice):void 0,[u?.voice]),[Jn,an]=o.useState(),ft=Jn??Ge?.model??A?.model??n.model??"",$e=Ss(),rn=o.useRef($e),ln=o.useRef(le),cn=o.useRef($e);cn.current=$e,o.useEffect(()=>{ln.current!==le&&(ln.current=le,rn.current=cn.current,an(void 0))},[le]);const Qn=$e&&$e!==rn.current?$e:null,[Xn,Zn]=o.useState(),eo=Qn??Xn??null,to=Bt(Ce.inpromptMenu),dn=Bt(Ce.promptAction),un=Bt(Ce.chatHeader),no=o.useMemo(()=>C?.members.map(e=>({id:e.id,name:e.name,description:e.description,icon:Fe(e.icon)}))??[],[C]),xe=Un(e=>e.pending),[fn,oo]=o.useState(0);o.useEffect(()=>ys(()=>oo(e=>e+1)),[]),o.useEffect(()=>{xe&&(Je(xe.text),Un.getState().consume(),xe.submit&&be(xe.text))},[xe]);const pn=w.getConfig(vt)?.datalayerCreatePayload,ve=!!(Ge?.createPayload?.app_spec||pn?.app_spec),Xe=ga(pn),so=Gt(e=>e.token),Ut=w.getConfig(vt)?.datalayerVisitors,ao=ws(Ut),io=w.getConfig(vt)?.embedToken,Se=Ut?ao.token:io||so,ro=o.useMemo(()=>Cs(u?.voice,Se||void 0,Xe),[u?.voice,Se,Xe]),ce=!!(Xe||Ut);if(ce&&!ve)throw new Error("A deployment’s page runs its application: its host gave no app_spec.");const[mn]=o.useState(Pn),$=o.useMemo(()=>ha(u?.thread,Xe,mn),[u?.thread,Xe,mn]),[Oe,gn]=o.useState(null),lo=!!($?.fromRuntime&&Oe?.given!==$.id);o.useEffect(()=>{if(!$?.fromRuntime||!ve||!T)return;let e=!0;return(async()=>{let r="";for(let a=0;a<4&&e;a+=1)try{const m=await xa({agentBaseUrl:T,agentId:h,uid:$.id,token:Se});e&&gn({given:$.id,thread:{...$,fromRuntime:!1,messages:m}});return}catch(m){r=m instanceof Error?m.message:String(m),await new Promise(f=>setTimeout(f,1500))}e&&gn({given:$.id,thread:{id:Pn(),messages:[],onStarted:$.onStarted},said:Ln.notOpened(r)})})(),()=>{e=!1}},[$?.id,$?.fromRuntime,ve,T,h,Se]);const hn=$?.fromRuntime?Oe?.given===$.id?Oe.thread:void 0:$,Ft=o.useMemo(()=>R?na({agentId:y?.specId??h,instructions:ks(A,Ge?.instructions),model:ft||void 0,inference:nn,frontendTools:Ke,subagents:C&&y?Mn(C.team,y.id):Fn(A),sharing:C?.sharing,onSubagentEvent:e=>Ws.getState().appendSubagentEvent(e),modeEffect:Ge?.modeEffect}):T!==void 0?{type:"ag-ui",endpoint:ve?`${T}/api/v1/apps/agents/${encodeURIComponent(h)}/ag-ui/`:`${T}/api/v1/ag-ui/${h}/`,...ve&&Se?{authToken:Se}:{},...ve?{uiSocket:`${T.replace(/^http/,"ws")}/api/v1/apps/ui`,uiFiles:`${T}/api/v1/apps/agents/${encodeURIComponent(h)}/files`,appSessions:`${T}/api/v1/apps/sessions`,...ce?{ownRoutesOnly:!0}:{}}:{},agentId:h,configEndpoint:`${T}/api/v1/configure`,enableConfigQuery:!0}:void 0,[h,R,nn,y,Ke,C,A,Ge,ft,T,ve,Se,ce]),pt=js(!R,Ft?.type==="ag-ui"?Ft.configEndpoint:void 0,void 0,h),Ze=Es(),mt=Is(h),[bn,Lt]=o.useState(void 0),[co,uo]=o.useState(void 0);o.useEffect(()=>{if(R||T===void 0)return;const e=Ts(T,h,ce);if(!e){Lt([]);return}let r=!1;return fetch(e).then(a=>a.ok?a.json():null).then(a=>{r||(Lt(a?Rs(a):[]),uo(a?As(a):void 0))}).catch(()=>{r||Lt([])}),()=>{r=!0}},[T,h,R,ce]);const fo=o.useMemo(()=>Ms(bn,()=>Object.values(Ps).filter(e=>e.available&&$s(e)).map(e=>({id:e.id,name:e.name,provider:e.provider}))),[bn]),xn=o.useMemo(()=>{const e=pt.data?.builtinTools??[],r=new Set(e.map(a=>a.name));return{runtime:e,frontend:Ke.filter(a=>!r.has(a.name)).map(a=>({id:a.name,name:a.name}))}},[pt.data?.builtinTools,Ke]),vn=o.useMemo(()=>new Set((Ze.data?.skills??[]).filter(e=>e.status==="enabled"||e.status==="loaded").map(e=>e.id)),[Ze.data]),po=o.useCallback(async e=>{if(ce)throw new Error("A deployment’s chat does not switch its runtime’s model.");an(e),!(R||T===void 0)&&await fetch(`${T}/api/v1/configure/inference/provider`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({model:e})}).catch(()=>{})},[T,R,ce]),Sn=u?.promptPlacement==="bottom-chat",mo=u?.promptPlacement==="floating",Ue=u?.promptPlacement==="top",et=u?.hidePrompt===!0||b.hidePrompt===!0,go={onSend:()=>{be(Ot)},input:Ot,setInput:Je,focusTrigger:xe||fn?(xe?.nonce??0)+fn:void 0,placement:mo||Q==="floating"||Q==="floating-top"||Q==="floating-bottom"?"floating":"docked",floatingAnchor:Q==="floating-top"?"top":"bottom",isLoading:F,onStop:()=>n.viewControls.stop?.(),placeholder:sn??b.sendInstead?.says??J,typingSuggestions:Tt.map(e=>e.text),suggestions:dt,disableInputPrompt:qe,connectionConfirmed:!qe,padding:Ue||Q==="floating-top"||Q==="floating-bottom"||Q==="docked-top"?2:3,promptVariant:"lexical",autoFocus:u?.autoFocusPrompt??!0,mentionableAgents:Kn,promptCommands:Gn,headerContent:to.length>0?t.jsx(St,{slot:Ce.inpromptMenu,props:{workspace:n}}):void 0,footerExtras:dn.length>0||Qe&&Qe.input!=="off"?t.jsxs(t.Fragment,{children:[dn.length>0?t.jsx(St,{slot:Ce.promptAction,props:{workspace:n}}):null,Qe&&Qe.input!=="off"?t.jsx(Os,{voice:Qe,input:Ot,setInput:Je,disabled:qe,speaking:kt,onStopSpeaking:()=>i.current?.stopSpeaking?.(),onSpoken:e=>{O.current=e},send:(e,r)=>{O.current=r,be(e)}}):null]}):void 0,showAgentsMenu:!_,showInlineAgentsMenu:!1,agents:no,selectedAgentId:le,onSelectAgent:e=>C?.select(e),showTokenUsage:b.showTokenUsage??u?.showTokenUsage??!0,showContextRing:!0,agentUsage:eo??void 0,showModelSelector:!_&&!ce,models:fo,decisions:co,selectedModel:ft,onModelSelect:e=>{po(e)},showToolsMenu:!_,availableTools:xn.runtime,availableFrontendTools:xn.frontend,mcpServers:pt.data?.mcpServers??[],mcpStatusData:b.mcpStatusData??void 0,showSkillsMenu:!_,skills:Ze.data?.skills??[],skillsLoading:Ze.isLoading,enabledSkills:vn,onToggleSkill:e=>vn.has(e)?mt.disableSkill(e):mt.enableSkill(e),onToggleAllSkills:(e,r)=>e.forEach(a=>r?mt.enableSkill(a):mt.disableSkill(a)),codemodeEnabled:b.codemodeEnabled??!1,onToggleCodemode:b.onToggleCodemode,isA2AProtocol:!1,hasConfigData:!!pt.data,hasSkillsData:!!Ze.data},yn=ne[0]?.value.Component,_t=Le[0]?.value.Component,wn=!u?.hideHeader&&!!_t,gt=yn?t.jsx(yn,{workspace:n,composer:go}):null,Cn=I.length>0&&u?.showSurfaceSelector!==!1?t.jsx(Ea,{surfaces:I.map(e=>e.value),active:E?.surfaceId??P?.surfaceId??ee,onChange:Me,workspace:n}):null,kn=t.jsxs(t.Fragment,{children:[I.map(e=>{const r=e.value,a=E?.surfaceId===r.surfaceId;return a||Z.current.has(r.surfaceId)||tt(r,n)?(Z.current.add(r.surfaceId),t.jsx(p,{sx:a?{flex:"1 1 0",minWidth:0,minHeight:0}:{position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",zIndex:-1},children:t.jsx(Us,{load:r.load,props:{surfaceId:r.surfaceId,workspace:n},fallback:t.jsxs(Wt,{children:["Loading ",r.title,"…"]}),errorFallback:f=>t.jsxs(Wt,{children:[r.title," failed to load: ",f.message]})})},r.surfaceId)):null}),!E&&P?t.jsx(p,{flex:"1 1 0",minWidth:0,minHeight:0,children:t.jsxs(Wt,{children:["Starting ",P.title,"…"]})}):null]}),jn=t.jsx(t.Fragment,{children:t.jsxs(p,{flex:Ue&&E?"0 0 34%":"1 1 0",maxWidth:Ue&&E?460:void 0,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",borderLeft:E?"1px solid":void 0,borderColor:"border.default",position:"relative",children:[b.errorBanner?t.jsx(p,{flexShrink:0,px:3,py:2,fontSize:1,borderBottom:"1px solid",bg:b.errorBanner.variant==="warning"?"attention.subtle":"danger.subtle",color:b.errorBanner.variant==="warning"?"attention.fg":"danger.fg",borderColor:b.errorBanner.variant==="warning"?"attention.muted":"danger.muted",children:b.errorBanner.message}):null,Oe?.said&&Oe.given===$?.id?t.jsx(W,{as:"p",role:"status",sx:{m:0,px:3,py:2,fontSize:1,color:"fg.muted"},children:Oe.said}):null,t.jsx(p,{flex:"1 1 auto",minHeight:0,display:"flex",children:lo?t.jsx(W,{as:"p",role:"status",sx:{m:0,p:3,fontSize:1,color:"fg.muted"},children:Ln.opening}):t.jsx(Fs,{themeVariant:u?.themeVariant,themeOverrides:u?.themeOverrides,colorMode:u?.colorMode,thread:hn,voice:ro,disabled:qe,disableReason:sn,protocol:Ft,frontendTools:R?void 0:Dn,initialModel:ft||void 0,title:_?.name??y?.name??A?.name??h,description:_?.welcome??A?.description,brandIcon:_?.face?t.jsx(Sa,{face:_.face,size:20,state:pe}):t.jsx(Rt,{size:20}),headerContent:_&&!$t?t.jsx(ya,{state:pe}):void 0,emptyState:{icon:_?.face?t.jsx("span",{"aria-hidden":!0,style:{fontSize:zn,lineHeight:1},children:t.jsx(Hn,{face:_.face,size:zn})}):t.jsx(Rt,{size:48}),title:_?.name??y?.name??A?.name??h,...C&&y?{sections:[{group:C.team.name,icon:t.jsx(Wn,{size:48}),title:C.team.name,subtitle:C.team.description},{group:y.name,icon:t.jsx(Rt,{size:32}),title:y.name,subtitle:A?.description}]}:null},suggestions:Ue||ue||u?.suggestionLabels===!1?[]:dt,showHeader:wn,headerButtons:{showNewChat:u?.headerButtons?.newChat??!1,showClear:u?.headerButtons?.clear??!1},renderHeader:_t?e=>t.jsx(_t,{workspace:n,header:n.chatViewModes?{...e,chatViewMode:n.chatViewModes.value,onChatViewModeChange:n.chatViewModes.onChange,offeredViewModes:n.chatViewModes.offered}:e}):void 0,showInformation:!0,headerActions:t.jsxs(p,{display:"inline-flex",alignItems:"center",gap:2,children:[n.chatHeaderActions,un.length>0?t.jsx(St,{slot:Ce.chatHeader,props:{workspace:n}}):null,t.jsx(Ls,{icon:K?_s:zs,"aria-label":K?"Exit full screen":"Enter full screen",variant:"invisible",size:"small",onClick:()=>{d(!1),Ve()},sx:We?{"@keyframes dla-fullscreen-hint":{"0%, 100%":{opacity:1},"50%":{opacity:.4}},"&&":{bg:`color-mix(in srgb, ${l.primary} 16%, transparent)`,boxShadow:`inset 0 0 0 1.5px ${l.primary}`,animation:`dla-fullscreen-hint ${ja}ms ease-in-out infinite`},"@media (prefers-reduced-motion: reduce)":{"&&":{animation:"none"}}}:void 0})]}),showInput:!1,onSendReady:it,notebookToolSurfacesId:E?void 0:n.surfaceId,showTurnFooter:b.showTokenUsage??u?.showTokenUsage??!0,onContextSnapshot:L,onLoadingChange:Et,onSpeakingChange:at,onItemsChange:ge,onDisplayItemsChange:Ne,enableStreaming:!0},hn?.id)}),!wn&&un.length>0?t.jsx(p,{hidden:!0,children:t.jsx(St,{slot:Ce.chatHeader,props:{workspace:n}})}):null,Sn&&!et?gt:null]})}),En=u?.suggestionLabels!==!1&&dt.length>0?t.jsx(p,{"aria-label":s.suggestedPrompts,display:"flex",flexWrap:"wrap",gap:2,px:2,pb:"6px",children:dt.map(e=>t.jsx(p,{as:"button",type:"button",title:e.message,disabled:F||qe,onClick:()=>{be(e.message)},appearance:"none",font:"inherit",fontSize:0,fontWeight:"semibold",lineHeight:1.25,px:"10px",py:"5px",width:$n,flex:`0 0 ${$n}px`,borderRadius:"999px",border:"1px solid",bg:"canvas.subtle",whiteSpace:"nowrap",sx:{borderColor:"border.default",color:"fg.default",cursor:"pointer","&:hover:not(:disabled)":{borderColor:"accent.fg",color:"accent.fg"},"&:disabled":{opacity:.5,cursor:"default"}},children:t.jsx(Ns,{title:e.title,maxWidth:"100%",sx:{minWidth:0},children:e.title})},e.title))}):null,In=g?t.jsx(p,{flex:"0 0 auto",px:3,py:2,borderTop:"1px solid",borderColor:"border.default",bg:"canvas.subtle",fontSize:1,maxHeight:"40%",overflowY:"auto",children:g}):null;return t.jsxs(p,{ref:lt,sx:{height:"100%",minHeight:0,display:"flex",flexDirection:"column",position:"relative",...K?{bg:"canvas.default"}:null,...K&&!Be.current?{position:"fixed",top:He,right:0,bottom:0,left:0,height:"auto",zIndex:1e3}:null},children:[ue?t.jsx(ue.Component,{workspace:n,editors:kn,hasEditor:!!E,transcript:jn,prompt:et?null:gt,chips:et?null:En,picker:Cn,transient:In}):t.jsxs(t.Fragment,{children:[Ue&&!et?t.jsxs(p,{flex:"0 0 auto",borderBottom:"1px solid",borderColor:"border.default",children:[gt,En]}):null,Cn,t.jsxs(p,{flex:"1 1 auto",minHeight:0,display:"flex",position:"relative",children:[kn,jn]}),In,Sn||et||Ue?null:gt]}),Pt?t.jsx(p,{position:"absolute",inset:0,zIndex:5,bg:"canvas.default",display:"flex",flexDirection:"column",minHeight:0,children:t.jsx(oa,{agentName:y?.name??A?.name,sandboxStillRuns:R,temporary:on,onSignedIn:()=>Bs.getState().clear()})}):null]})}function Ea({surfaces:n,active:s,onChange:l,workspace:i}){const c=[...n].sort((g,v)=>(g.order??100)-(v.order??100));return t.jsxs(p,{flex:"0 0 auto",display:"flex",alignItems:"center",gap:2,px:3,py:2,borderBottom:"1px solid",borderColor:"border.default",children:[t.jsx(W,{sx:{fontSize:0,color:"fg.muted"},children:"Beside the chat"}),t.jsxs(Vt,{"aria-label":"Editor beside the chat",size:"small",children:[t.jsx(Vt.Button,{selected:s===ee,onClick:()=>l(ee),children:"Chat"}),c.map(g=>{const v=tt(g,i),w=v?void 0:g.unavailableReason?.(i)??"Not available right now";return t.jsx(Vt.Button,{selected:s===g.surfaceId,"aria-disabled":!v,title:w??g.title,leadingIcon:g.icon,onClick:()=>{v&&l(g.surfaceId)},children:g.title},g.surfaceId)})]})]})}function Wt({children:n}){return t.jsx(p,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:3,textAlign:"center",children:n})}export{Aa as default};
File without changes
File without changes