@datalayer/agent-runtimes 1.5.20 → 1.5.21

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 (277) hide show
  1. package/dist-embed/chunks/{AgentDetails-DZyyuD5F.js → AgentDetails-C7tCazwB.js} +1 -1
  2. package/dist-embed/chunks/{AgentDetailsDialog-DaQyQxlm.js → AgentDetailsDialog-Cwps4GeH.js} +1 -1
  3. package/dist-embed/chunks/{AgentInspector-CBNiiRtv.js → AgentInspector-Gk7jbg8t.js} +1 -1
  4. package/dist-embed/chunks/{AgentInspectorDialog-BxMOAc7K.js → AgentInspectorDialog-BSSDOFrT.js} +1 -1
  5. package/dist-embed/chunks/{CellSidebarExtension-Dwe7PfXi.js → CellSidebarExtension-p2BAkwis.js} +9 -9
  6. package/dist-embed/chunks/ChatView-fHb_i4kH.js +32 -0
  7. package/dist-embed/chunks/{ContextPie-n1y886z-.js → ContextPie-bd_YOjzP.js} +1 -1
  8. package/dist-embed/chunks/{DeckComponent-BSeEBNHt.js → DeckComponent-4gxuEH4A.js} +2 -2
  9. package/dist-embed/chunks/{DocumentView-OIdQEk_n.js → DocumentView-BZSYqTh_.js} +1 -1
  10. package/dist-embed/chunks/{EphemeralDocument-C-uLD1W7.js → EphemeralDocument-Cevnk5OF.js} +1 -1
  11. package/dist-embed/chunks/{EphemeralNotebook-C_peDfqf.js → EphemeralNotebook-JvALIbK2.js} +1 -1
  12. package/dist-embed/chunks/{ExcalidrawComponent-DHSxnPc9.js → ExcalidrawComponent-CbghNk-F.js} +1 -1
  13. package/dist-embed/chunks/{ExcalidrawModal-BpsfNG-u.js → ExcalidrawModal-BOVvWzYQ.js} +1 -1
  14. package/dist-embed/chunks/{JupyterLexicalExtension-BUSLnJVL.js → JupyterLexicalExtension-CRccZ2h7.js} +29 -29
  15. package/dist-embed/chunks/{KernelVariables-Cu7UeFhT.js → KernelVariables-ompObBEM.js} +1 -1
  16. package/dist-embed/chunks/{LexicalToolRegistry-CNg1T5sQ.js → LexicalToolRegistry-BlBEZPP4.js} +4 -4
  17. package/dist-embed/chunks/{NotebookToolSurfaces-Cm6-oE_W.js → NotebookToolSurfaces-DP8sWqVy.js} +1 -1
  18. package/dist-embed/chunks/{NotebookView-Be2lNZjS.js → NotebookView-DC6BDVEp.js} +1 -1
  19. package/dist-embed/chunks/{Output-OIgTyxpD.js → Output-C4hBhZ5k.js} +1 -1
  20. package/dist-embed/chunks/{SandboxDetailsDialog-BMq0tlcE.js → SandboxDetailsDialog-CX8wvCLJ.js} +1 -1
  21. package/dist-embed/chunks/{SchemaForm-D3mmq2C1.js → SchemaForm-BuhXDyz6.js} +1 -1
  22. package/dist-embed/chunks/{WidgetVariableView-DnuwkCHl.js → WidgetVariableView-C2X5Ehcg.js} +1 -1
  23. package/dist-embed/chunks/{YouTubePlugin-Bum16ua6.js → YouTubePlugin-CjgOnMCz.js} +1 -1
  24. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-BMkFygW4.js → abnfDiagram-VCTEODGH-kzVu7pzT.js} +1 -1
  25. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-Dac38D-P.js → abnfDiagram-VCTEODGH-wvUaPpVC.js} +1 -1
  26. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-JDFjD_Dk.js → ar-SA-G6X2FPQ2-ArgZTGSp.js} +1 -1
  27. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-DXJTBh9S.js → architectureDiagram-5GKGNRK7-CwbfxDHw.js} +1 -1
  28. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-D7VBU0uf.js → architectureDiagram-5GKGNRK7-DVZUrWEx.js} +1 -1
  29. package/dist-embed/chunks/{az-AZ-76LH7QW2-AbN1w5Zy.js → az-AZ-76LH7QW2-DQgz6n32.js} +1 -1
  30. package/dist-embed/chunks/{bg-BG-XCXSNQG7-BULkJsTf.js → bg-BG-XCXSNQG7-Cx0dPt6-.js} +1 -1
  31. package/dist-embed/chunks/{blockDiagram-868be97b-Bk9MNjmt.js → blockDiagram-868be97b-DEQh5CUO.js} +1 -1
  32. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-CKjKQ6Dq.js → blockDiagram-I7D4REHJ-C6gbEBfg.js} +1 -1
  33. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-BwenaP7n.js → blockDiagram-I7D4REHJ-DUIcpkIN.js} +1 -1
  34. package/dist-embed/chunks/{bn-BD-2XOGV67Q-B6EtUyIk.js → bn-BD-2XOGV67Q-BkekmuYO.js} +1 -1
  35. package/dist-embed/chunks/{c4Diagram-3f4bdde3-BGoSdP5p.js → c4Diagram-3f4bdde3-CUcRctJE.js} +1 -1
  36. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-DlkcVfDa.js → c4Diagram-7LVT6UL2-DSQiEaxC.js} +1 -1
  37. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BZRokUDB.js → c4Diagram-7LVT6UL2-f7UaZWVg.js} +1 -1
  38. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-BZ0wzUck.js → ca-ES-6MX7JW3Y-Yr14RtMP.js} +1 -1
  39. package/dist-embed/chunks/{celltoolbartracker-CCRqu43G.js → celltoolbartracker-Bx9x9aeh.js} +1 -1
  40. package/dist-embed/chunks/{chunk-2Q5K7J3B-CfYiHpfd.js → chunk-2Q5K7J3B-BBPiCQqO.js} +1 -1
  41. package/dist-embed/chunks/{chunk-2Q5K7J3B-DLu9zZx0.js → chunk-2Q5K7J3B-DbzMjK_L.js} +1 -1
  42. package/dist-embed/chunks/{chunk-5VM5RSS4-yHAygNq4.js → chunk-5VM5RSS4-CcNPo9qP.js} +1 -1
  43. package/dist-embed/chunks/{chunk-5VM5RSS4-dV5IUPYK.js → chunk-5VM5RSS4-rEZEdbpi.js} +1 -1
  44. package/dist-embed/chunks/{chunk-F27PBJKO-BeY8iI19.js → chunk-F27PBJKO-BH7lDumP.js} +1 -1
  45. package/dist-embed/chunks/{chunk-F27PBJKO-BArvzx7H.js → chunk-F27PBJKO-DTgjd0wN.js} +1 -1
  46. package/dist-embed/chunks/{chunk-IMKFNOWR-iUeFNxCU.js → chunk-IMKFNOWR-BA-vmq_V.js} +1 -1
  47. package/dist-embed/chunks/{chunk-IMKFNOWR-BJRUyuXy.js → chunk-IMKFNOWR-DuzpuE1w.js} +1 -1
  48. package/dist-embed/chunks/{chunk-JWPE2WC7-BDUBU4vN.js → chunk-JWPE2WC7-BfRI4eJ2.js} +1 -1
  49. package/dist-embed/chunks/{chunk-JWPE2WC7-Djk-1JPJ.js → chunk-JWPE2WC7-CAdvd3EQ.js} +1 -1
  50. package/dist-embed/chunks/{chunk-POPQ4Y6H-E4731IOt.js → chunk-POPQ4Y6H-B7pT6rUf.js} +1 -1
  51. package/dist-embed/chunks/{chunk-POPQ4Y6H-CibXbz_c.js → chunk-POPQ4Y6H-Dw1h_9lT.js} +1 -1
  52. package/dist-embed/chunks/{chunk-SVP7TREG-DeRyA6Ek.js → chunk-SVP7TREG-BxpYXJab.js} +1 -1
  53. package/dist-embed/chunks/{chunk-SVP7TREG-o7JviCXQ.js → chunk-SVP7TREG-VsO48dck.js} +1 -1
  54. package/dist-embed/chunks/{chunk-TICWLB2K-BIhZcpwn.js → chunk-TICWLB2K-CU2oQRJ9.js} +1 -1
  55. package/dist-embed/chunks/{chunk-TICWLB2K-Zk_gUXIu.js → chunk-TICWLB2K-LCiyX33a.js} +1 -1
  56. package/dist-embed/chunks/{chunk-XXDRQBXY-DATpHkZD.js → chunk-XXDRQBXY-CL1cUI4w.js} +1 -1
  57. package/dist-embed/chunks/{chunk-XXDRQBXY-Cp6f69YK.js → chunk-XXDRQBXY-islJGiCO.js} +1 -1
  58. package/dist-embed/chunks/{classDiagram-ZZMXUADV-DcutslOq.js → classDiagram-ZZMXUADV-C7-Ca_nP.js} +1 -1
  59. package/dist-embed/chunks/{classDiagram-ZZMXUADV-BfpWJKcC.js → classDiagram-ZZMXUADV-Ctw7VU-m.js} +1 -1
  60. package/dist-embed/chunks/{classDiagram-f62afe4f-BVLyWZwA.js → classDiagram-f62afe4f-BaJUb6H9.js} +1 -1
  61. package/dist-embed/chunks/{classDiagram-v2-604399ef-CgcAzr_L.js → classDiagram-v2-604399ef-s6LKeK41.js} +1 -1
  62. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-DcutslOq.js → classDiagram-v2-VYDZK3BY-C7-Ca_nP.js} +1 -1
  63. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-BfpWJKcC.js → classDiagram-v2-VYDZK3BY-Ctw7VU-m.js} +1 -1
  64. package/dist-embed/chunks/{code-block-IT6T5CEO-D5_yhrdD.js → code-block-IT6T5CEO-BieLU8ls.js} +1 -1
  65. package/dist-embed/chunks/{component-DoyMsR16.js → component-p2xkjXeh.js} +3 -3
  66. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-B-LvsoyE.js → cose-bilkent-JH36ORCC-BkezndW_.js} +1 -1
  67. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DhPsWJev.js → cose-bilkent-JH36ORCC-DrOmRWVI.js} +1 -1
  68. package/dist-embed/chunks/{createText-aed3d8b3-CnP7VdTn.js → createText-aed3d8b3-Dw8k7JC8.js} +1 -1
  69. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-CHIiQJ-9.js → cs-CZ-2BRQDIVT-DYR-S6bD.js} +1 -1
  70. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-D4zzGd7W.js → cynefinDiagram-5FMLGOSQ-DqoI6t3s.js} +1 -1
  71. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-B4k-OykO.js → cynefinDiagram-5FMLGOSQ-qZ6StjuY.js} +1 -1
  72. package/dist-embed/chunks/{da-DK-5WZEPLOC-dfN2SAKQ.js → da-DK-5WZEPLOC-DhaHIgKI.js} +1 -1
  73. package/dist-embed/chunks/{dagre-GXQ25YYZ-DUrWhbsC.js → dagre-GXQ25YYZ-Bb0_WA3x.js} +1 -1
  74. package/dist-embed/chunks/{dagre-GXQ25YYZ-BlWkzzlo.js → dagre-GXQ25YYZ-pcAHu_bK.js} +1 -1
  75. package/dist-embed/chunks/{de-DE-XR44H4JA-BKsKfmfo.js → de-DE-XR44H4JA-CJpRH2Fy.js} +1 -1
  76. package/dist-embed/chunks/{diagram-S7CK7UJ4-FxHXDIYr.js → diagram-S7CK7UJ4-CwINt91M.js} +1 -1
  77. package/dist-embed/chunks/{diagram-S7CK7UJ4-BuRBzTwI.js → diagram-S7CK7UJ4-W17wgXHY.js} +1 -1
  78. package/dist-embed/chunks/{diagram-UQ7AKVKN-FxYHrvzF.js → diagram-UQ7AKVKN-CXRpfLBt.js} +1 -1
  79. package/dist-embed/chunks/{diagram-UQ7AKVKN-CeDT8Vz4.js → diagram-UQ7AKVKN-mH7QBO8y.js} +1 -1
  80. package/dist-embed/chunks/{diagram-VSXAHHWV-Cv0WAiv8.js → diagram-VSXAHHWV-Bg68Bv82.js} +1 -1
  81. package/dist-embed/chunks/{diagram-VSXAHHWV-C2icUdkA.js → diagram-VSXAHHWV-CFHqpDaB.js} +1 -1
  82. package/dist-embed/chunks/{diagram-VX7I27RA-D6VPVMhu.js → diagram-VX7I27RA-BEO0D7jE.js} +1 -1
  83. package/dist-embed/chunks/{diagram-VX7I27RA-AoxkG7BW.js → diagram-VX7I27RA-DQ6XlKLw.js} +1 -1
  84. package/dist-embed/chunks/{diagram-Z3DM3KII-DxunLDOr.js → diagram-Z3DM3KII-BLJQK61P.js} +1 -1
  85. package/dist-embed/chunks/{diagram-Z3DM3KII-CHxtPQ6F.js → diagram-Z3DM3KII-Cenqf76m.js} +1 -1
  86. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-CfsTBJc5.js → ebnfDiagram-PWID7BFC-6H6OSebp.js} +1 -1
  87. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-CmJlfM6d.js → ebnfDiagram-PWID7BFC-Cqmnghct.js} +1 -1
  88. package/dist-embed/chunks/{edges-b2856ca0-Cl5rq6T8.js → edges-b2856ca0-ChO7JKaP.js} +1 -1
  89. package/dist-embed/chunks/{el-GR-BZB4AONW-Cs0zPSU1.js → el-GR-BZB4AONW-DPGB1p8K.js} +1 -1
  90. package/dist-embed/chunks/{erDiagram-5d81789a-C0jmz-br.js → erDiagram-5d81789a-jzhAXdZi.js} +1 -1
  91. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-Dyljy6tN.js → erDiagram-RLTQ6QDP-DEAWMrMT.js} +1 -1
  92. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-FFD_URlX.js → erDiagram-RLTQ6QDP-hAbP0vV0.js} +1 -1
  93. package/dist-embed/chunks/{es-ES-U4NZUMDT-fGOqRf0o.js → es-ES-U4NZUMDT-CLztgM3g.js} +1 -1
  94. package/dist-embed/chunks/{eu-ES-A7QVB2H4-CLZ09rVe.js → eu-ES-A7QVB2H4--ffZf65_.js} +1 -1
  95. package/dist-embed/chunks/{fa-IR-HGAKTJCU-Cjimbc8n.js → fa-IR-HGAKTJCU-Cwwej6FC.js} +1 -1
  96. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-ZXNEW916.js → fi-FI-Z5N7JZ37-Tw-dUSxy.js} +1 -1
  97. package/dist-embed/chunks/{flowDb-185abca5-Cden9aoH.js → flowDb-185abca5-DDUaXZ_Q.js} +1 -1
  98. package/dist-embed/chunks/{flowDiagram-1629c991-Bar9YxSW.js → flowDiagram-1629c991-DpvDtFPK.js} +1 -1
  99. package/dist-embed/chunks/{flowDiagram-HODETNUW-bg09n0_F.js → flowDiagram-HODETNUW-DENY4Bvt.js} +1 -1
  100. package/dist-embed/chunks/{flowDiagram-HODETNUW-02Xo2-6n.js → flowDiagram-HODETNUW-Hr-elwWq.js} +1 -1
  101. package/dist-embed/chunks/{flowDiagram-v2-1d953310-C6FnOAb2.js → flowDiagram-v2-1d953310-TxFSXMN7.js} +1 -1
  102. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-DcmMV2Wi.js → flowchart-elk-definition-6df44142-BGFxwidp.js} +1 -1
  103. package/dist-embed/chunks/{fr-FR-RHASNOE6-DQaq_g67.js → fr-FR-RHASNOE6-CT1NyjSV.js} +1 -1
  104. package/dist-embed/chunks/{ganttDiagram-3b0b3873-BN61xNrz.js → ganttDiagram-3b0b3873-DJqKtGUz.js} +1 -1
  105. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-BCLyiaOJ.js → ganttDiagram-EL5Y4UJY-3bErrKpg.js} +1 -1
  106. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-JviVPOnF.js → ganttDiagram-EL5Y4UJY-Ddh9hVkO.js} +1 -1
  107. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CzBMuAvA.js → gitGraphDiagram-WWUBYQGX-B3BVHs36.js} +1 -1
  108. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CNc3l-2t.js → gitGraphDiagram-WWUBYQGX-BiEolUQH.js} +1 -1
  109. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-7ecaKDp7.js → gitGraphDiagram-f01e8bc2-vOvP_sU8.js} +1 -1
  110. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-BlrLF7Sk.js → gl-ES-HMX3MZ6V-BKTaXj_2.js} +1 -1
  111. package/dist-embed/chunks/{he-IL-6SHJWFNN-DLfo2nov.js → he-IL-6SHJWFNN-BJ5SwTG5.js} +1 -1
  112. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-BcbS0I1h.js → hi-IN-IWLTKZ5I-D5ZQxogx.js} +1 -1
  113. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-B_-3TehM.js → hu-HU-A5ZG7DT2-CoAAAzpy.js} +1 -1
  114. package/dist-embed/chunks/{id-ID-SAP4L64H-C920eBs5.js → id-ID-SAP4L64H-DFWbGjYj.js} +1 -1
  115. package/dist-embed/chunks/{index-D_-7qr4x.js → index-1MXuxaax.js} +1 -1
  116. package/dist-embed/chunks/{index-CGhVy6OJ.js → index-6feFd5AZ.js} +1 -1
  117. package/dist-embed/chunks/{index-MNZ1LVAM.js → index-8Jy3Vws8.js} +6 -6
  118. package/dist-embed/chunks/{index-9bae90f3-_mZDJyzh.js → index-9bae90f3-YA-Pbv-C.js} +1 -1
  119. package/dist-embed/chunks/{index-C2UmIEOV.js → index-B0MhQWhs.js} +1 -1
  120. package/dist-embed/chunks/{index-DcbXB4Ou.js → index-B0omKuYl.js} +1 -1
  121. package/dist-embed/chunks/{index-CLojGXLe.js → index-B8y71UkT.js} +1 -1
  122. package/dist-embed/chunks/{index-DmKOrT_f.js → index-B9vBhR-p.js} +1 -1
  123. package/dist-embed/chunks/{index-B3qU5V3s.js → index-BL4KuFQP.js} +1 -1
  124. package/dist-embed/chunks/{index-BMqDh5WU.js → index-BNFZYAJT.js} +1 -1
  125. package/dist-embed/chunks/{index-BVkaRzYN.js → index-BTeNnRc_.js} +1 -1
  126. package/dist-embed/chunks/{index-W-qUA31l.js → index-BVzIb3Wy.js} +1 -1
  127. package/dist-embed/chunks/{index-D1CRwrf9.js → index-BfMo5nXi.js} +2 -2
  128. package/dist-embed/chunks/{index-C3p2Hbbg.js → index-BgWf1G8H.js} +1 -1
  129. package/dist-embed/chunks/{index-C3zGthUI.js → index-BuyZwxeT.js} +1 -1
  130. package/dist-embed/chunks/{index-7V4MgoX0.js → index-BzQxauhZ.js} +1 -1
  131. package/dist-embed/chunks/{index-Dyv67BU9.js → index-C7os26P7.js} +2 -2
  132. package/dist-embed/chunks/{index-BbtA7ppb.js → index-CCA_V9Td.js} +1 -1
  133. package/dist-embed/chunks/{index-oJ3M8HYJ.js → index-CIDdX0nc.js} +1 -1
  134. package/dist-embed/chunks/{index-C8N5z7FZ.js → index-CkOZcvYl.js} +1 -1
  135. package/dist-embed/chunks/{index-DV2fNvY7.js → index-CxIZHPCc.js} +1 -1
  136. package/dist-embed/chunks/{index-BST3vALX.js → index-D62kZnWZ.js} +3 -3
  137. package/dist-embed/chunks/{index-CuqMWXgT.js → index-DMf0f7ny.js} +3 -3
  138. package/dist-embed/chunks/{index-OZDJ7kli.js → index-DPzPvDBn.js} +1 -1
  139. package/dist-embed/chunks/{index-B0VC_nl2.js → index-DSgHh0-i.js} +1 -1
  140. package/dist-embed/chunks/{index-DmYrjwOw.js → index-DTCcg1ap.js} +1 -1
  141. package/dist-embed/chunks/{index-D95mZTII.js → index-DTbF6Y7O.js} +1 -1
  142. package/dist-embed/chunks/{index-DbHMJ-IM.js → index-Db1qHC1a.js} +1 -1
  143. package/dist-embed/chunks/{index--rbc1jdS.js → index-DiBcWu6d.js} +1 -1
  144. package/dist-embed/chunks/{index-DSts8s_N.js → index-DpJpQnPn.js} +1 -1
  145. package/dist-embed/chunks/{index-DqwL86GY.js → index-Dw1P-H6s.js} +12 -12
  146. package/dist-embed/chunks/{index-k3ISgWrJ.js → index-FbZJIbu_.js} +1 -1
  147. package/dist-embed/chunks/{index-DMTXHmrU.js → index-JhvHCMRQ.js} +1 -1
  148. package/dist-embed/chunks/{index-BVdp0AG7.js → index-TDpnbl90.js} +4 -4
  149. package/dist-embed/chunks/{index-CW0DxnfF.js → index-fQxrRXLD.js} +1 -1
  150. package/dist-embed/chunks/{index.esm-Dy7cyZyH.js → index.esm-B6P80s3J.js} +1 -1
  151. package/dist-embed/chunks/{index.esm-jFa95d0B.js → index.esm-z-R1Ypx2.js} +1 -1
  152. package/dist-embed/chunks/{infoDiagram-27XIBGKW-CuQ0a02I.js → infoDiagram-27XIBGKW-8DlnjSdf.js} +1 -1
  153. package/dist-embed/chunks/{infoDiagram-27XIBGKW-CDc0DV-6.js → infoDiagram-27XIBGKW-CZPNcDbH.js} +1 -1
  154. package/dist-embed/chunks/{infoDiagram-a29d40f1-BKWmVk4B.js → infoDiagram-a29d40f1-Di_kmyTC.js} +1 -1
  155. package/dist-embed/chunks/{isEqual-SWNqZJZT.js → isEqual-D0eOPSLC.js} +1 -1
  156. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-BY7eKNmA.js → ishikawaDiagram-5VMMS53U-DD5TaPvH.js} +1 -1
  157. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CPu6wHAG.js → ishikawaDiagram-5VMMS53U-ri4cvaWs.js} +1 -1
  158. package/dist-embed/chunks/{it-IT-JPQ66NNP-CsJELR-H.js → it-IT-JPQ66NNP-C7p9bCWQ.js} +1 -1
  159. package/dist-embed/chunks/{ja-JP-DBVTYXUO-Bh4bW0cv.js → ja-JP-DBVTYXUO-DupAM7Cv.js} +1 -1
  160. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-6CRYfcQL.js → journeyDiagram-3NMN7TZE-1NqbTyL4.js} +1 -1
  161. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-Cv_KZqY3.js → journeyDiagram-3NMN7TZE-BpYgEBLO.js} +1 -1
  162. package/dist-embed/chunks/{journeyDiagram-95396277-yJruA0Fm.js → journeyDiagram-95396277-xr9Xk_mL.js} +1 -1
  163. package/dist-embed/chunks/{kaa-6HZHGXH3-BmDtc0g0.js → kaa-6HZHGXH3-DrthOcPY.js} +1 -1
  164. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-Bluox3dD.js → kab-KAB-ZGHBKWFO-C4hr0kbU.js} +1 -1
  165. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-Dps45ZlJ.js → kanban-definition-UXKFOSKX-B5nUu45Q.js} +1 -1
  166. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-Biauy1A4.js → kanban-definition-UXKFOSKX-DlSwjr3b.js} +1 -1
  167. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-EZjFhsK8.js → kk-KZ-P5N5QNE5-CrjDkh9r.js} +1 -1
  168. package/dist-embed/chunks/{km-KH-HSX4SM5Z-BpZu76AC.js → km-KH-HSX4SM5Z-JHWf7VZ6.js} +1 -1
  169. package/dist-embed/chunks/{ko-KR-MTYHY66A-C5JZPTHd.js → ko-KR-MTYHY66A-CJ4JxKMG.js} +1 -1
  170. package/dist-embed/chunks/{ku-TR-6OUDTVRD-BUaf6TOB.js → ku-TR-6OUDTVRD-YSlLPag_.js} +1 -1
  171. package/dist-embed/chunks/{layout-C8INuwYa.js → layout-5FOjTADt.js} +1 -1
  172. package/dist-embed/chunks/{layout-CEbgEIwd.js → layout-Bdtul_rg.js} +1 -1
  173. package/dist-embed/chunks/{lexicalHooks-DFMSPigW.js → lexicalHooks-eqXJbnX9.js} +1 -1
  174. package/dist-embed/chunks/{lt-LT-XHIRWOB4-CuGmKRQr.js → lt-LT-XHIRWOB4-2v6r2YYq.js} +1 -1
  175. package/dist-embed/chunks/{lv-LV-5QDEKY6T-EYERw_NP.js → lv-LV-5QDEKY6T-DVGd68q4.js} +1 -1
  176. package/dist-embed/chunks/{mermaid.core-hzdTpjmh.js → mermaid.core-BU1Nkb56.js} +5 -5
  177. package/dist-embed/chunks/{mermaid.core-BeAq5EQp.js → mermaid.core-DY5DKOtx.js} +3 -3
  178. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX--O06aygF.js → mindmap-definition-YA3MSWOX-CEuIjXO2.js} +1 -1
  179. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-iB7eW5x9.js → mindmap-definition-YA3MSWOX-sSfUfKt8.js} +1 -1
  180. package/dist-embed/chunks/{mindmap-definition-e4c1d938-DCwgMhNw.js → mindmap-definition-e4c1d938-btrk6STt.js} +1 -1
  181. package/dist-embed/chunks/{mr-IN-CRQNXWMA-SKx4bMeU.js → mr-IN-CRQNXWMA-D1q8zjMr.js} +1 -1
  182. package/dist-embed/chunks/{my-MM-5M5IBNSE-BG-vgEXz.js → my-MM-5M5IBNSE-CCWuEpIN.js} +1 -1
  183. package/dist-embed/chunks/{nb-NO-T6EIAALU-BbW-11AI.js → nb-NO-T6EIAALU-eJ92wx2h.js} +1 -1
  184. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CSKGpuSJ.js → nl-NL-IS3SIHDZ-DmkMgsvp.js} +1 -1
  185. package/dist-embed/chunks/{nn-NO-6E72VCQL-P1tnp9TQ.js → nn-NO-6E72VCQL-CWYEaXBn.js} +1 -1
  186. package/dist-embed/chunks/{oc-FR-POXYY2M6-vpu8tuQT.js → oc-FR-POXYY2M6-CayriaEZ.js} +1 -1
  187. package/dist-embed/chunks/{pa-IN-N4M65BXN-CIpdGll2.js → pa-IN-N4M65BXN-CydiKcR8.js} +1 -1
  188. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-ZPizxhEX.js → pegDiagram-XKGWAZYB--dcG-x2B.js} +1 -1
  189. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-Bon6jQ3L.js → pegDiagram-XKGWAZYB-CqRRvKft.js} +1 -1
  190. package/dist-embed/chunks/{percentages-BXMCSKIN-hVEpOtFm.js → percentages-BXMCSKIN-fzYCDL7m.js} +5 -5
  191. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-C0Pc9GUi.js → pieDiagram-E7YTZNPT-CkHpKSua.js} +1 -1
  192. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-Di8dEHt9.js → pieDiagram-E7YTZNPT-D-uncTun.js} +1 -1
  193. package/dist-embed/chunks/{pieDiagram-c941bede-C--hwbRv.js → pieDiagram-c941bede-BoVaJIdw.js} +1 -1
  194. package/dist-embed/chunks/{pl-PL-T2D74RX3-Ckyj0Mzv.js → pl-PL-T2D74RX3-DhiK4YSC.js} +1 -1
  195. package/dist-embed/chunks/{pt-BR-5N22H2LF-3jDc9_Aa.js → pt-BR-5N22H2LF-CwSVxIqs.js} +1 -1
  196. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-lhLbXf7Q.js → pt-PT-UZXXM6DQ-BnxquNJT.js} +1 -1
  197. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-Ffo3hgR0.js → quadrantDiagram-AXDQQJYC-ClE_bWPS.js} +1 -1
  198. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-D0QYtpIp.js → quadrantDiagram-AXDQQJYC-nOA8Q9nG.js} +1 -1
  199. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-Bqmed-0s.js → quadrantDiagram-cf8b8fe0-V_e2KgDu.js} +1 -1
  200. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BMC9Ldnh.js → railroadDiagram-O6MQD6OU-CkhmY0tS.js} +1 -1
  201. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-aTc7bF4I.js → railroadDiagram-O6MQD6OU-D-SNyKIn.js} +1 -1
  202. package/dist-embed/chunks/{renderer-CR6Lxa3d.js → renderer-BwlsmtXF.js} +1 -1
  203. package/dist-embed/chunks/{requirementDiagram-53bda41b-DExdw0ey.js → requirementDiagram-53bda41b-BZw7Ipej.js} +1 -1
  204. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-mBFLHcqA.js → requirementDiagram-BXWQKSXE-1A97ivzl.js} +1 -1
  205. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-DBj1iVv5.js → requirementDiagram-BXWQKSXE-BXwXUXrr.js} +1 -1
  206. package/dist-embed/chunks/{ro-RO-JPDTUUEW-Dy9oeW3b.js → ro-RO-JPDTUUEW-D3G2f_fQ.js} +1 -1
  207. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CK16-wfD.js → ru-RU-B4JR7IUQ-SnVfNwaW.js} +1 -1
  208. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-DzaadHXz.js → sankeyDiagram-P5KCCOFB-0B_Kvjm2.js} +1 -1
  209. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-9W9X5V7a.js → sankeyDiagram-P5KCCOFB-ktT6v9aY.js} +1 -1
  210. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-B6u8wnkU.js → sankeyDiagram-c3ef121a-e1QLivkZ.js} +1 -1
  211. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-Bq8bvLh8.js → sequenceDiagram-82a5b84f-N-16oABv.js} +1 -1
  212. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-BNfJw8_y.js → sequenceDiagram-WJ2MYXX4-CtbkJYCv.js} +1 -1
  213. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-B76NTf4c.js → sequenceDiagram-WJ2MYXX4-DYY-dZgX.js} +1 -1
  214. package/dist-embed/chunks/{sessions-XxjScqnJ.js → sessions-C9DBCyZI.js} +1 -1
  215. package/dist-embed/chunks/{si-LK-N5RQ5JYF-AJdaUbzl.js → si-LK-N5RQ5JYF-Da7Bfexz.js} +1 -1
  216. package/dist-embed/chunks/{sizeCapture-INFHLROL-KZBUxNmb.js → sizeCapture-INFHLROL-B3xt8UaI.js} +1 -1
  217. package/dist-embed/chunks/{sizeCapture-INFHLROL-DQ5s0TIW.js → sizeCapture-INFHLROL-DJOph387.js} +1 -1
  218. package/dist-embed/chunks/{sk-SK-C5VTKIMK-Bk82hIVU.js → sk-SK-C5VTKIMK-BB-Ks1b-.js} +1 -1
  219. package/dist-embed/chunks/{sl-SI-NN7IZMDC-DSFcvf6W.js → sl-SI-NN7IZMDC-DF3fUKHX.js} +1 -1
  220. package/dist-embed/chunks/{stateDiagram-43e79a5f-BiTTNI1Z.js → stateDiagram-43e79a5f-BJcJNr41.js} +1 -1
  221. package/dist-embed/chunks/{stateDiagram-D77RDMKH-D4hQpdZ2.js → stateDiagram-D77RDMKH-DVd0MOrg.js} +1 -1
  222. package/dist-embed/chunks/{stateDiagram-D77RDMKH-lndPMO3D.js → stateDiagram-D77RDMKH-LjWP-fRB.js} +1 -1
  223. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-BbFiQEfG.js → stateDiagram-v2-2041ed4f-DTEruWg2.js} +1 -1
  224. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-pqcRT12A.js → stateDiagram-v2-MP3YSRHH-CJD5_Eji.js} +1 -1
  225. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-C-kIBdBJ.js → stateDiagram-v2-MP3YSRHH-_xCQcvgo.js} +1 -1
  226. package/dist-embed/chunks/{styles-455b33cd-U9lx7mAf.js → styles-455b33cd-OIhmfs6N.js} +1 -1
  227. package/dist-embed/chunks/{styles-f932cba9-S-lYZYdK.js → styles-f932cba9-CwLjreIv.js} +1 -1
  228. package/dist-embed/chunks/{styles-fcc2142b-DfudfB3j.js → styles-fcc2142b-DP74dQpR.js} +1 -1
  229. package/dist-embed/chunks/{subset-shared.chunk-f2gmZjeG.js → subset-shared.chunk-Cf9zgTA9.js} +1 -1
  230. package/dist-embed/chunks/{subset-worker.chunk-De1CPIQ6.js → subset-worker.chunk-WYW3AHku.js} +1 -1
  231. package/dist-embed/chunks/{sv-SE-XGPEYMSR-BbGfLHIi.js → sv-SE-XGPEYMSR-CeR-pJHy.js} +1 -1
  232. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-ClgHG0vb.js → svgDrawCommon-148a3cd9-CgE5QJIv.js} +1 -1
  233. package/dist-embed/chunks/{swimlanes-42K2YHIH-OqZ4t-07.js → swimlanes-42K2YHIH-CZyflHYJ.js} +1 -1
  234. package/dist-embed/chunks/{swimlanes-42K2YHIH-CjV1bdPk.js → swimlanes-42K2YHIH-Cj4fdAYa.js} +1 -1
  235. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-9twpvQtj.js → swimlanesDiagram-VR7AAH4N-B2gk37ys.js} +1 -1
  236. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BdS4NGOx.js → swimlanesDiagram-VR7AAH4N-Bmr6N4fj.js} +1 -1
  237. package/dist-embed/chunks/{ta-IN-2NMHFXQM-BWMJgnI2.js → ta-IN-2NMHFXQM-lmsodGuU.js} +1 -1
  238. package/dist-embed/chunks/{th-TH-HPSO5L25-DiP_CZXl.js → th-TH-HPSO5L25-DQCWr96I.js} +1 -1
  239. package/dist-embed/chunks/{timeline-definition-24CTP7MA-Cs4Bwobu.js → timeline-definition-24CTP7MA-D5dMAy5U.js} +1 -1
  240. package/dist-embed/chunks/{timeline-definition-24CTP7MA-B7uSaXDu.js → timeline-definition-24CTP7MA-DqY5EM6p.js} +1 -1
  241. package/dist-embed/chunks/{timeline-definition-7545f45a-CHrBluu1.js → timeline-definition-7545f45a-B8wMEyZY.js} +1 -1
  242. package/dist-embed/chunks/{tr-TR-DEFEU3FU-CKMBvOkr.js → tr-TR-DEFEU3FU-CqnvlGZW.js} +1 -1
  243. package/dist-embed/chunks/{uk-UA-QMV73CPH-CQL0E0jU.js → uk-UA-QMV73CPH-DdWFjbHe.js} +1 -1
  244. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-uwWpr4uC.js → vennDiagram-4TSXK5OY-63-O_xI8.js} +1 -1
  245. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-CHSyRZN_.js → vennDiagram-4TSXK5OY-BMg6wc5A.js} +1 -1
  246. package/dist-embed/chunks/{vi-VN-M7AON7JQ-BpvEBNJo.js → vi-VN-M7AON7JQ-CydTT0Fi.js} +1 -1
  247. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-0UuvD-IO.js → wardleyDiagram-VM6X3IG4-C5wMQ_qe.js} +1 -1
  248. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-zIfOyYBf.js → wardleyDiagram-VM6X3IG4-C9vLUvHf.js} +1 -1
  249. package/dist-embed/chunks/{xychartDiagram-3f383b91-ChbRPzo8.js → xychartDiagram-3f383b91-BfoQg8n9.js} +1 -1
  250. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-hCGgyjir.js → xychartDiagram-S5SC5T6Z-BZr3T3n_.js} +1 -1
  251. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-q9gcUSF1.js → xychartDiagram-S5SC5T6Z-DthHDnAV.js} +1 -1
  252. package/dist-embed/chunks/{zh-CN-LNUGB5OW-DWmzAIjK.js → zh-CN-LNUGB5OW-DEn1TFfK.js} +1 -1
  253. package/dist-embed/chunks/{zh-HK-E62DVLB3-CQ-xPzHX.js → zh-HK-E62DVLB3-DJQRmOHH.js} +1 -1
  254. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-DvlSTykD.js → zh-TW-RAJ6MFWO-B7s9vmSf.js} +1 -1
  255. package/dist-embed/datalayer-app-main.js +52 -52
  256. package/lib/apps/embed/visitorApp.d.ts +1 -1
  257. package/lib/apps/embed/visitorApp.js +1 -1
  258. package/lib/apps/plugins/chat/ChatView.js +13 -2
  259. package/lib/chat/ChatFloating.js +4 -1
  260. package/lib/chat/base/ChatBase.js +11 -3
  261. package/lib/chat/prompt/InputPrompt.d.ts +6 -1
  262. package/lib/chat/prompt/InputPrompt.js +12 -2
  263. package/lib/voice/ComposerVoice.d.ts +15 -2
  264. package/lib/voice/ComposerVoice.js +23 -17
  265. package/lib/voice/VoiceMenu.d.ts +27 -0
  266. package/lib/voice/VoiceMenu.js +32 -0
  267. package/lib/voice/chatVoice.js +2 -2
  268. package/lib/voice/choices.d.ts +33 -0
  269. package/lib/voice/choices.js +70 -0
  270. package/lib/voice/index.d.ts +4 -0
  271. package/lib/voice/index.js +3 -0
  272. package/lib/voice/settings.d.ts +17 -1
  273. package/lib/voice/settings.js +64 -1
  274. package/lib/voice/useVoiceSettings.d.ts +6 -0
  275. package/lib/voice/useVoiceSettings.js +25 -0
  276. package/package.json +1 -1
  277. package/dist-embed/chunks/ChatView-C2La9033.js +0 -32
@@ -0,0 +1,32 @@
1
+ import{E as N,eN as So,r as o,j as t,eO as yo,eP as wo,b_ as Rn,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 Co,eR as ko,eS as jo,e3 as Io,eT as Eo,aH as To,dX as Bn,dV as Ro,dY as Gt,eU as Ao,eV as Mo,eW as Po,eX as Uo,eY as An,eZ as $o,e_ as Oo,e$ as Fo,d3 as Lo,a_ as _o,f0 as zo,f1 as No,f2 as Bo,f3 as Vo,f4 as Ho,f5 as Wo,x as Nt,f6 as Do,f7 as Go,f8 as Ko,f9 as Yo,fa as qo,fb as Jo,fc as Qo,fd as Xo,fe as Zo,ff as es,fg as ts,fh as ns,fi as os,fj as ss,fk as as,fl as is,fm as rs,fn as ls,fo as cs,fp as ds,fq as tt,fr as us,fs,ft as ps,fu as ms,fv as Mn,fw as gs,fx as Fe,fy as hs,fz as bs,a$ as vt,fA as xs,fB as vs,fC as Pn,fD as Ss,fE as ys,fF as ws,fG as Cs,eC as ks,fH as Bt,fI as Ce,fJ as js,fK as Is,fL as Es,fM as Un,fN as Ts,fO as Rs,fP as As,fQ as Ms,fR as Ps,fS as Us,fT as $s,fU as Os,fV as Fs,fW as Ls,fX as St,fY as _s,fZ as zs,f_ as Ns,I as Bs,f$ as Vs,g0 as Hs,g1 as $n,g2 as Ws,g3 as Ds,g4 as Gs,g5 as Kt,g6 as Ks,g7 as Ys,ek as Vt,g8 as qs,g9 as Js}from"../datalayer-app-main.js";import{S as Qs,E as Xs,a as Zs}from"./SignInIcon-4HkE48mS.js";import{F as ea,a as ta,b as na}from"./LinkedInGreyIcon-BoWXE-HS.js";function Vn(){const n=N(So);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""}},oa=(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},sa=Eo`
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
+ `,aa=({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(Io,{size:24}),github:u=!1,google:J=!1,linkedin:B=!1,apiKey:nt=!1,signUp:O=!0,socialSignInNavigationTarget:te,asDoc:S=!1,fillHeight:E=!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(Qs,{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,Ie]=o.useState(null),[L,It]=o.useState(null),[ge,Ee]=o.useState(""),[Te,rt]=o.useState(null),[Re,$]=o.useState(null),{enqueueToast:he}=yo(),[Ae,ae]=o.useState(!1),[ie,be]=o.useState(""),I=o.useRef(null),Me=o.useCallback(d=>wo()?Rn.URLExt.join(Rn.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){$(null),Ie(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=oa(j);$(P),he(P,{variant:"error"}),Ie(null),it(!1)}}},[Me,G,he,se,te]);o.useEffect(()=>{Ae&&I.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),$(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){It(P),rt(j.token),$(null);return}n&&n(j.token,D)}else $(j.message||"Invalid username or password.")}catch(d){$(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),$(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);$(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||!E?"flex-start":"center",justifyContent:"center",minHeight:ne||oe||!E?"auto":"100vh",bg:ne?"transparent":"canvas.default",color:"fg.default",py:ne?0:oe?2:4,children:[t.jsx(sa,{}),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"}):ea,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"}):ta,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"}):na,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?Xs:Zs,"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(Co,{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=>Ee(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}),O&&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:ko,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(jo,{block:!0,required:!0,autoFocus:!0,placeholder:"Paste your API key here",value:ie,onInput:d=>be(d.currentTarget.value),ref:I})]}),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 ia(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 Fn=To((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 ra({agentName:n,sandboxStillRuns:s=!1,temporary:l=!0,onSignedIn:i,onSignUp:c}){const{configuration:g}=Bn(),v=o.useCallback(w=>{Ro.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(aa,{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 la="https://r1.datalayer.run";function ca(n=!0){const{configuration:s}=Bn(),l=Gt(w=>w.token),i=s?.aiInferenceUrl||la,c=Ao(i,n&&!l),g=l||c.token,v=o.useMemo(()=>({inferenceUrl:i,token:g||void 0}),[i,g]);return{inference:v,needsSignIn:Mo(v),anonymous:c,inferenceUrl:i}}const da={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 Ln(n){const s=n?.subagents;if(!s)return[];const l=(s.subagents??[]).map(i=>{const c=i.ref?Po(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,da]:l}function ua(n){return n.replace(/^datalayer_/,"").replace(/_lexical$/,"")}function fa(n){const s=ua(n);return/^executeCodeIn(Notebook|Document)$/.test(s)||/^(read|list)[A-Z]/.test(s)}function pa(n,s){return n.filter(l=>s?.has(l.name)||fa(l.name))}function ma(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 ga(n,s,l){if(!l||!n.endsWith("-tools"))return!1;const i=n.slice(0,-6);return s.has(i)&&i!==l}const ha={type:"object",properties:{}};function ba(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??ha,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 Hn(n,s){return n.flatMap(l=>ba(l,s))}function xa(){const n=Uo(),s=Vn();return o.useMemo(()=>Hn(s,n),[s,n])}const _n={opening:"Opening your conversation…",notOpened:n=>`Your conversation could not be opened, so this is a new one: ${n}`};function va(n){const s=n?.app_instance;if(!s||typeof s!="object")return"";const l=s.deployment_uid;return typeof l=="string"?l.trim():""}function Sa(n,s,l){return n||!s?n:{id:l,messages:[]}}function ya(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 zn(n){try{const s=await n.json();if(typeof s.detail=="string"&&s.detail)return s.detail}catch{}return`${n.status}`}async function wa({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 An(B.messages)}if(w.status!==404)throw new Error(await zn(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 zn(u));const J=ya(await u.text());if(!J)throw new Error(`The runtime said nothing of session ${l}.`);return An(J)}const Ca="var(--theme-accent)";function Wn({face:n,size:s}){return typeof n=="string"?t.jsx($o,{emoji:n,size:s,label:""}):t.jsx(t.Fragment,{children:n})}function ka({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 ${Ca}`,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(Wn,{face:n,size:s})})]})}function ja({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:Oo[n]})}const Ia=Kt(void 0),Ea=Kt(""),Ta=Kt({}),ee="",Ra=1400,Nn=parseInt(qs["--loop-face-large"],10);function $a({workspace:n}){const s=Fo(),l=Lo(),i=o.useRef(null),{setViewControls:c}=n,[g,v]=o.useState(null),w=_o(),u=w.getConfig(zo),J=u?.placeholder||s.placeholder,B=u?.defaultSurface??"notebook",nt=w.getConfig(No),[O,te]=o.useState(ee),S=o.useRef(!1),E=N(Bo),ne=N(Vo),Le=N(Ho),ue=N(Wo)[0]?.value,Q=Nt(ue?.promptStance??Ia)??ue?.prompt,yt=N(Do),_e=Go(yt[0]?.value),V=o.useRef(_e);V.current=_e;const X=o.useRef(""),ze=N(Ko),wt=o.useMemo(()=>Yo(()=>ze.reduce((e,r)=>({...e,...r.value.extras.value}),{})),[ze]),b=Nt(ze.length>0?wt:Ta),Z=o.useRef(new Set),oe=qo(Ks,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=Jo(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}=Qo(e);je(we=>we.open===r&&we.pendingApproval===a?we:{open:r,pendingApproval:a});const m={saying:Zo(e),answering:Xo(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,""),vo=Y[ye]??`using ${x.toolName}`;z.activity(`${X.current||"The agent"} is ${vo}…`)},[]),Ie=o.useRef(b);Ie.current=b;const L=o.useCallback(e=>{no(e),V.current?.usage(e),Ie.current.onUsage?.(e)},[]),It=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(es).filter(f=>f.trim().length>0).join(`
29
+
30
+ `);r.assistant(m)},[]),Ee=o.useRef([]),Te=o.useRef(!1),rt=o.useRef(void 0),Re=o.useRef(void 0),$=o.useRef(void 0),he=N(ts),Ae=o.useRef(he);Ae.current=he;const ae=o.useCallback((e,r)=>{if(Re.current)return Re.current;const a=$.current;$.current=void 0;const m=ns(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:ss(String(x.name??"")),base64:os(String(x.data_url??""))}))}catch(x){return x instanceof Error?x.message:String(x)}M.execute(as(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
+ ${is(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){Ee.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||Ee.current.length===0)return;const e=Ee.current.splice(0,Ee.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 rs(Ie.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]),I=o.useMemo(()=>E.find(e=>e.value.surfaceId===O)?.value,[E,O]),Me=o.useCallback(e=>{S.current=!0,te(e)},[]);o.useEffect(()=>ls(Me),[Me]),o.useEffect(()=>{cs(E.map(e=>e.value.surfaceId))},[E]),o.useEffect(()=>{ds(O&&O!==ee?O:Js)},[O]);const G=o.useMemo(()=>B===ee||B==="none"?void 0:E.find(e=>e.value.surfaceId===B),[E,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}=us(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(()=>{I&&!tt(I,n)&&(re(I.surfaceId),te(ee))},[I,n]);const P=o.useMemo(()=>{if(H)return E.find(e=>e.value.surfaceId===H)?.value;if(!S.current&&O===ee)return G?.value},[E,H,O,G]);o.useEffect(()=>{if(!H||O!==ee)return;const e=E.find(r=>r.value.surfaceId===H);e&&tt(e.value,n)&&(re(null),te(H))},[E,O,H,n]);const h=n.agentId?.trim()||"default",R=fs(n.sandbox.target??"local");Te.current=R;const C=ps(),le=Nt(C?.selected??Ea),y=C?.members.find(e=>e.id===le),De=N(ms)[0]?.value,Pe=De?.specId,A=Mn(y?.specId??h)??(Pe?Mn(Pe):void 0),Ge=y?void 0:De,qt=R&&!y?Gs(Pe,A):void 0;X.current=y?.name??A?.name??h;const Jt=N(gs),Qt=b.hiddenOpeners,Xt=b.hideOpeners,Et=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(Et)return r(Et);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,Et]),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,Dn=Fe(C?.team.icon),Zt=N(hs),ut=o.useMemo(()=>{const e=[],r=new Map,a=new Set,m=new Set(E.map(f=>f.value.surfaceId));for(const f of ma(Zt,I?.surfaceId)){if(ga(f.value.id,m,I?.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 I?e:pa(e,a)},[Zt,n.surfaceId,n.agentId,b.frontendTools,I?.surfaceId,E]),At=xa(),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=Vn(),Mt=b.agentToolBundles,Gn=o.useMemo(()=>{const e=b.frontendTools??[];if(!Mt?.length)return b.frontendTools;const r=Hn(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===bs)?w.getOutput(vt)?.sandbox:void 0;const T=xs(n.sandbox,n.serverUrl),tn=N(vs),Kn=o.useMemo(()=>tn.filter(e=>e.value.composer).map(e=>({name:e.value.name,description:e.value.description})),[tn]),Yn=o.useMemo(()=>{if(!C||!y)return Ln(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=Pn(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:qn}=ca(R),Jn=Gt(e=>e.user),Pt=R&&qn.status==="expired",on=!Jn,Ye=Ss();Re.current=Ye.disabled?Ye.disableReason||"This conversation is closed here.":void 0;const Ut=T===void 0?ys(n.sandbox,s):void 0,qe=st||Pt||!!qt||!!Ut||Ye.disabled,sn=Pt?on?s.demoKeyExpired:s.keyExpired:qt??Ut??Ct??(Ye.disabled?Ye.disableReason:void 0),[$t,Je]=o.useState(""),[an]=ws(),Qe=o.useMemo(()=>u?.voice?Cs(u.voice,an):void 0,[u?.voice,an]),[Qn,Xn]=o.useState(!1),[Zn,rn]=o.useState(),ft=Zn??Ge?.model??A?.model??n.model??"",Ue=ks(),ln=o.useRef(Ue),cn=o.useRef(le),dn=o.useRef(Ue);dn.current=Ue,o.useEffect(()=>{cn.current!==le&&(cn.current=le,ln.current=dn.current,rn(void 0))},[le]);const eo=Ue&&Ue!==ln.current?Ue:null,[to,no]=o.useState(),oo=eo??to??null,so=Bt(Ce.inpromptMenu),un=Bt(Ce.promptAction),fn=Bt(Ce.chatHeader),ao=o.useMemo(()=>C?.members.map(e=>({id:e.id,name:e.name,description:e.description,icon:Fe(e.icon)}))??[],[C]),xe=Fn(e=>e.pending),[pn,io]=o.useState(0);o.useEffect(()=>js(()=>io(e=>e+1)),[]),o.useEffect(()=>{xe&&(Je(xe.text),Fn.getState().consume(),xe.submit&&be(xe.text))},[xe]);const mn=w.getConfig(vt)?.datalayerCreatePayload,ve=!!(Ge?.createPayload?.app_spec||mn?.app_spec),Xe=va(mn),ro=Gt(e=>e.token),Ot=w.getConfig(vt)?.datalayerVisitors,lo=Is(Ot),co=w.getConfig(vt)?.embedToken,Se=Ot?lo.token:co||ro,uo=o.useMemo(()=>Es(u?.voice,Se||void 0,Xe),[u?.voice,Se,Xe]),ce=!!(Xe||Ot);if(ce&&!ve)throw new Error("A deployment’s page runs its application: its host gave no app_spec.");const[gn]=o.useState(Un),U=o.useMemo(()=>Sa(u?.thread,Xe,gn),[u?.thread,Xe,gn]),[$e,hn]=o.useState(null),fo=!!(U?.fromRuntime&&$e?.given!==U.id);o.useEffect(()=>{if(!U?.fromRuntime||!ve||!T)return;let e=!0;return(async()=>{let r="";for(let a=0;a<4&&e;a+=1)try{const m=await wa({agentBaseUrl:T,agentId:h,uid:U.id,token:Se});e&&hn({given:U.id,thread:{...U,fromRuntime:!1,messages:m}});return}catch(m){r=m instanceof Error?m.message:String(m),await new Promise(f=>setTimeout(f,1500))}e&&hn({given:U.id,thread:{id:Un(),messages:[],onStarted:U.onStarted},said:_n.notOpened(r)})})(),()=>{e=!1}},[U?.id,U?.fromRuntime,ve,T,h,Se]);const bn=U?.fromRuntime?$e?.given===U.id?$e.thread:void 0:U,Ft=o.useMemo(()=>R?ia({agentId:y?.specId??h,instructions:Ts(A,Ge?.instructions),model:ft||void 0,inference:nn,frontendTools:Ke,subagents:C&&y?Pn(C.team,y.id):Ln(A),sharing:C?.sharing,onSubagentEvent:e=>Ys.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=Rs(!R,Ft?.type==="ag-ui"?Ft.configEndpoint:void 0,void 0,h),Ze=As(),mt=Ms(h),[xn,Lt]=o.useState(void 0),[po,mo]=o.useState(void 0);o.useEffect(()=>{if(R||T===void 0)return;const e=Ps(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?Us(a):[]),mo(a?$s(a):void 0))}).catch(()=>{r||Lt([])}),()=>{r=!0}},[T,h,R,ce]);const go=o.useMemo(()=>Os(xn,()=>Object.values(Fs).filter(e=>e.available&&Ls(e)).map(e=>({id:e.id,name:e.name,provider:e.provider}))),[xn]),vn=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]),Sn=o.useMemo(()=>new Set((Ze.data?.skills??[]).filter(e=>e.status==="enabled"||e.status==="loaded").map(e=>e.id)),[Ze.data]),ho=o.useCallback(async e=>{if(ce)throw new Error("A deployment’s chat does not switch its runtime’s model.");rn(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]),yn=u?.promptPlacement==="bottom-chat",bo=u?.promptPlacement==="floating",Oe=u?.promptPlacement==="top",et=u?.hidePrompt===!0||b.hidePrompt===!0,xo={onSend:()=>{be($t)},input:$t,setInput:Je,focusTrigger:xe||pn?(xe?.nonce??0)+pn:void 0,placement:bo||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,interim:Qn,padding:Oe||Q==="floating-top"||Q==="floating-bottom"||Q==="docked-top"?2:3,promptVariant:"lexical",autoFocus:u?.autoFocusPrompt??!0,mentionableAgents:Yn,promptCommands:Kn,headerContent:so.length>0?t.jsx(St,{slot:Ce.inpromptMenu,props:{workspace:n}}):void 0,footerExtras:un.length>0||Qe&&Qe.input!=="off"?t.jsxs(t.Fragment,{children:[un.length>0?t.jsx(St,{slot:Ce.promptAction,props:{workspace:n}}):null,Qe&&Qe.input!=="off"?t.jsx(_s,{voice:Qe,input:$t,setInput:Je,disabled:qe,speaking:kt,onStopSpeaking:()=>i.current?.stopSpeaking?.(),onInterimChange:Xn,answers:!!(u?.voice?.output&&u.voice.output!=="off"&&u.voice.speechUrl),onSpoken:e=>{$.current=e},send:(e,r)=>{$.current=r,be(e)}}):null]}):void 0,showAgentsMenu:!_,showInlineAgentsMenu:!1,agents:ao,selectedAgentId:le,onSelectAgent:e=>C?.select(e),showTokenUsage:b.showTokenUsage??u?.showTokenUsage??!0,showContextRing:!0,agentUsage:oo??void 0,showModelSelector:!_&&!ce,models:go,decisions:po,selectedModel:ft,onModelSelect:e=>{ho(e)},showToolsMenu:!_,availableTools:vn.runtime,availableFrontendTools:vn.frontend,mcpServers:pt.data?.mcpServers??[],mcpStatusData:b.mcpStatusData??void 0,showSkillsMenu:!_,skills:Ze.data?.skills??[],skillsLoading:Ze.isLoading,enabledSkills:Sn,onToggleSkill:e=>Sn.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},wn=ne[0]?.value.Component,_t=Le[0]?.value.Component,Cn=!u?.hideHeader&&!!_t,gt=wn?t.jsx(wn,{workspace:n,composer:xo}):null,kn=E.length>0&&u?.showSurfaceSelector!==!1?t.jsx(Aa,{surfaces:E.map(e=>e.value),active:I?.surfaceId??P?.surfaceId??ee,onChange:Me,workspace:n}):null,jn=t.jsxs(t.Fragment,{children:[E.map(e=>{const r=e.value,a=I?.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(zs,{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}),!I&&P?t.jsx(p,{flex:"1 1 0",minWidth:0,minHeight:0,children:t.jsxs(Wt,{children:["Starting ",P.title,"…"]})}):null]}),In=t.jsx(t.Fragment,{children:t.jsxs(p,{flex:Oe&&I?"0 0 34%":"1 1 0",maxWidth:Oe&&I?460:void 0,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",borderLeft:I?"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,$e?.said&&$e.given===U?.id?t.jsx(W,{as:"p",role:"status",sx:{m:0,px:3,py:2,fontSize:1,color:"fg.muted"},children:$e.said}):null,t.jsx(p,{flex:"1 1 auto",minHeight:0,display:"flex",children:fo?t.jsx(W,{as:"p",role:"status",sx:{m:0,p:3,fontSize:1,color:"fg.muted"},children:_n.opening}):t.jsx(Ns,{themeVariant:u?.themeVariant,themeOverrides:u?.themeOverrides,colorMode:u?.colorMode,thread:bn,voice:uo,disabled:qe,disableReason:sn,protocol:Ft,frontendTools:R?void 0:Gn,initialModel:ft||void 0,title:_?.name??y?.name??A?.name??h,description:_?.welcome??A?.description,brandIcon:_?.face?t.jsx(ka,{face:_.face,size:20,state:pe}):t.jsx(Rt,{size:20}),headerContent:_&&!Ut?t.jsx(ja,{state:pe}):void 0,emptyState:{icon:_?.face?t.jsx("span",{"aria-hidden":!0,style:{fontSize:Nn,lineHeight:1},children:t.jsx(Wn,{face:_.face,size:Nn})}):t.jsx(Rt,{size:48}),title:_?.name??y?.name??A?.name??h,...C&&y?{sections:[{group:C.team.name,icon:t.jsx(Dn,{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:Oe||ue||u?.suggestionLabels===!1?[]:dt,showHeader:Cn,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,fn.length>0?t.jsx(St,{slot:Ce.chatHeader,props:{workspace:n}}):null,t.jsx(Bs,{icon:K?Vs:Hs,"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 ${Ra}ms ease-in-out infinite`},"@media (prefers-reduced-motion: reduce)":{"&&":{animation:"none"}}}:void 0})]}),showInput:!1,onSendReady:it,notebookToolSurfacesId:I?void 0:n.surfaceId,showTurnFooter:b.showTokenUsage??u?.showTokenUsage??!0,onContextSnapshot:L,onLoadingChange:It,onSpeakingChange:at,onItemsChange:ge,onDisplayItemsChange:Ne,enableStreaming:!0},bn?.id)}),!Cn&&fn.length>0?t.jsx(p,{hidden:!0,children:t.jsx(St,{slot:Ce.chatHeader,props:{workspace:n}})}):null,yn&&!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(Ws,{title:e.title,maxWidth:"100%",sx:{minWidth:0},children:e.title})},e.title))}):null,Tn=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:jn,hasEditor:!!I,transcript:In,prompt:et?null:gt,chips:et?null:En,picker:kn,transient:Tn}):t.jsxs(t.Fragment,{children:[Oe&&!et?t.jsxs(p,{flex:"0 0 auto",borderBottom:"1px solid",borderColor:"border.default",children:[gt,En]}):null,kn,t.jsxs(p,{flex:"1 1 auto",minHeight:0,display:"flex",position:"relative",children:[jn,In]}),Tn,yn||et||Oe?null:gt]}),Pt?t.jsx(p,{position:"absolute",inset:0,zIndex:5,bg:"canvas.default",display:"flex",flexDirection:"column",minHeight:0,children:t.jsx(ra,{agentName:y?.name??A?.name,sandboxStillRuns:R,temporary:on,onSignedIn:()=>Ds.getState().clear()})}):null]})}function Aa({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{$a as default};
@@ -1 +1 @@
1
- import{r as x,j as e,B as n,T as s,q as i}from"../datalayer-app-main.js";import j from"./index-D_-7qr4x.js";function A({agentUsage:o,padding:y,showContextRing:T=!1}){const[k,h]=x.useState(!1),v=x.useRef(null),c=x.useRef(null),g=!!o.turnUsage,C=!!o.sessionUsage,w=!!o.costUsage&&(o.costUsage.cumulativeCostUsd>0||o.costUsage.lastTurnCostUsd>0),m=o.sessionUsage,p=o.turnUsage,b=o.costUsage,d=t=>t<.01?`$${t.toFixed(4)}`:t<1?`$${t.toFixed(3)}`:`$${t.toFixed(2)}`,f=o.totalTokens,u=o.contextWindow,S=Math.max(0,u-f),a=u>0?f/u*100:0,r=[];if(o.distribution?.children?.length){const t={"System Prompts":"#8250df","Tool Definitions":"#bf8700","User Messages":"#16A085","Assistant Messages":"#1a7f37","Tool Usage":"#cf222e"};for(const l of o.distribution.children)r.push({name:l.name,value:l.value,color:t[l.name]||"#6e7781"})}else{o.systemPromptTokens>0&&r.push({name:"System Prompts",value:o.systemPromptTokens,color:"#8250df"}),o.toolTokens>0&&r.push({name:"Tool Definitions",value:o.toolTokens,color:"#bf8700"});const t=(o.userMessageTokens||0)+(o.assistantMessageTokens||0);t>0&&r.push({name:"Messages",value:t,color:"#16A085"});const l=(o.toolCallTokens||0)+(o.toolReturnTokens||0);l>0&&r.push({name:"Tool Results",value:l,color:"#cf222e"})}const z=a>90?"#cf222e":a>70?"#bf8700":"#16A085",W="var(--bgColor-muted, #f6f8fa)",R="var(--borderColor-default, #d1d9e0)",M={animation:!1,series:[{type:"pie",radius:[0,"90%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},data:[{value:f,itemStyle:{color:z}},{value:S,itemStyle:{color:W}}]}]},P={animation:!1,series:[{type:"pie",radius:["45%","80%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},itemStyle:{borderColor:"var(--bgColor-default, #ffffff)",borderWidth:1},data:[...r.map(t=>({value:t.value,itemStyle:{color:t.color}})),{value:S,itemStyle:{color:R}}]}]};return e.jsxs(n,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,py:1,px:y,bg:"canvas.subtle",flexWrap:"nowrap",overflow:"visible",whiteSpace:"nowrap",minWidth:0,children:[T&&e.jsxs(n,{position:"relative",flexShrink:0,onMouseEnter:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!0),150)},onMouseLeave:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!1),250)},children:[e.jsx(n,{ref:v,cursor:"pointer",width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid",borderColor:"border.default",borderRadius:"50%",children:e.jsx(j,{option:M,style:{width:18,height:18},opts:{renderer:"svg"}})}),k&&e.jsxs(n,{position:"absolute",bottom:"100%",left:0,mb:1,p:3,width:260,bg:"canvas.overlay",borderRadius:2,boxShadow:"shadow.large",border:"1px solid",borderColor:"border.default",zIndex:100,children:[e.jsx(s,{sx:{fontWeight:"bold",fontSize:1,color:"fg.default",display:"block",mb:2},children:"Context"}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:1},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:i(f)})," / ",i(u)," tokens"]}),o.costUsage&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:2},children:["cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.lastTurnCostUsd)})," turn · ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.cumulativeCostUsd)})," total"]}),e.jsxs(s,{sx:{fontSize:0,color:a>90?"danger.fg":a>70?"attention.fg":"fg.muted",fontWeight:"semibold",display:"block",mb:2},children:["• ",a.toFixed(0),"%"]}),e.jsx(n,{display:"flex",justifyContent:"center",mb:2,children:e.jsx(j,{option:P,style:{width:80,height:80},opts:{renderer:"svg"}})}),e.jsx(n,{display:"flex",flexDirection:"column",gap:1,children:r.map(t=>{const l=f>0?t.value/f*100:0;return e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(n,{width:8,height:8,borderRadius:"50%",bg:t.color,flexShrink:0}),e.jsx(s,{sx:{fontSize:0,color:"fg.muted",flex:1},children:t.name}),e.jsxs(s,{sx:{fontSize:0,color:"fg.default",fontWeight:"semibold"},children:[l.toFixed(1),"%"]})]},t.name)})}),a>70&&e.jsx(s,{sx:{fontSize:0,color:"attention.fg",display:"block",mt:2,fontStyle:"italic"},children:"Quality may decline as limit nears."})]})]}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:i(o.totalTokens)})," / ",i(o.contextWindow)," ctx"]}),w&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.lastTurnCostUsd??0)})," turn / ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.cumulativeCostUsd??0)})]}),C&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· session ",i(m?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(m?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]}),g&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· turn ",i(p?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(p?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]})]})}export{A as ContextPie};
1
+ import{r as x,j as e,B as n,T as s,q as i}from"../datalayer-app-main.js";import j from"./index-1MXuxaax.js";function A({agentUsage:o,padding:y,showContextRing:T=!1}){const[k,h]=x.useState(!1),v=x.useRef(null),c=x.useRef(null),g=!!o.turnUsage,C=!!o.sessionUsage,w=!!o.costUsage&&(o.costUsage.cumulativeCostUsd>0||o.costUsage.lastTurnCostUsd>0),m=o.sessionUsage,p=o.turnUsage,b=o.costUsage,d=t=>t<.01?`$${t.toFixed(4)}`:t<1?`$${t.toFixed(3)}`:`$${t.toFixed(2)}`,f=o.totalTokens,u=o.contextWindow,S=Math.max(0,u-f),a=u>0?f/u*100:0,r=[];if(o.distribution?.children?.length){const t={"System Prompts":"#8250df","Tool Definitions":"#bf8700","User Messages":"#16A085","Assistant Messages":"#1a7f37","Tool Usage":"#cf222e"};for(const l of o.distribution.children)r.push({name:l.name,value:l.value,color:t[l.name]||"#6e7781"})}else{o.systemPromptTokens>0&&r.push({name:"System Prompts",value:o.systemPromptTokens,color:"#8250df"}),o.toolTokens>0&&r.push({name:"Tool Definitions",value:o.toolTokens,color:"#bf8700"});const t=(o.userMessageTokens||0)+(o.assistantMessageTokens||0);t>0&&r.push({name:"Messages",value:t,color:"#16A085"});const l=(o.toolCallTokens||0)+(o.toolReturnTokens||0);l>0&&r.push({name:"Tool Results",value:l,color:"#cf222e"})}const z=a>90?"#cf222e":a>70?"#bf8700":"#16A085",W="var(--bgColor-muted, #f6f8fa)",R="var(--borderColor-default, #d1d9e0)",M={animation:!1,series:[{type:"pie",radius:[0,"90%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},data:[{value:f,itemStyle:{color:z}},{value:S,itemStyle:{color:W}}]}]},P={animation:!1,series:[{type:"pie",radius:["45%","80%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},itemStyle:{borderColor:"var(--bgColor-default, #ffffff)",borderWidth:1},data:[...r.map(t=>({value:t.value,itemStyle:{color:t.color}})),{value:S,itemStyle:{color:R}}]}]};return e.jsxs(n,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,py:1,px:y,bg:"canvas.subtle",flexWrap:"nowrap",overflow:"visible",whiteSpace:"nowrap",minWidth:0,children:[T&&e.jsxs(n,{position:"relative",flexShrink:0,onMouseEnter:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!0),150)},onMouseLeave:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!1),250)},children:[e.jsx(n,{ref:v,cursor:"pointer",width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid",borderColor:"border.default",borderRadius:"50%",children:e.jsx(j,{option:M,style:{width:18,height:18},opts:{renderer:"svg"}})}),k&&e.jsxs(n,{position:"absolute",bottom:"100%",left:0,mb:1,p:3,width:260,bg:"canvas.overlay",borderRadius:2,boxShadow:"shadow.large",border:"1px solid",borderColor:"border.default",zIndex:100,children:[e.jsx(s,{sx:{fontWeight:"bold",fontSize:1,color:"fg.default",display:"block",mb:2},children:"Context"}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:1},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:i(f)})," / ",i(u)," tokens"]}),o.costUsage&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:2},children:["cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.lastTurnCostUsd)})," turn · ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.cumulativeCostUsd)})," total"]}),e.jsxs(s,{sx:{fontSize:0,color:a>90?"danger.fg":a>70?"attention.fg":"fg.muted",fontWeight:"semibold",display:"block",mb:2},children:["• ",a.toFixed(0),"%"]}),e.jsx(n,{display:"flex",justifyContent:"center",mb:2,children:e.jsx(j,{option:P,style:{width:80,height:80},opts:{renderer:"svg"}})}),e.jsx(n,{display:"flex",flexDirection:"column",gap:1,children:r.map(t=>{const l=f>0?t.value/f*100:0;return e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(n,{width:8,height:8,borderRadius:"50%",bg:t.color,flexShrink:0}),e.jsx(s,{sx:{fontSize:0,color:"fg.muted",flex:1},children:t.name}),e.jsxs(s,{sx:{fontSize:0,color:"fg.default",fontWeight:"semibold"},children:[l.toFixed(1),"%"]})]},t.name)})}),a>70&&e.jsx(s,{sx:{fontSize:0,color:"attention.fg",display:"block",mt:2,fontStyle:"italic"},children:"Quality may decline as limit nears."})]})]}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:i(o.totalTokens)})," / ",i(o.contextWindow)," ctx"]}),w&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.lastTurnCostUsd??0)})," turn / ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.cumulativeCostUsd??0)})]}),C&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· session ",i(m?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(m?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]}),g&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· turn ",i(p?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(p?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]})]})}export{A as ContextPie};