@datalayer/agent-runtimes 1.5.65 → 1.5.70

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 (296) hide show
  1. package/dist-embed/chunks/{AgentDetails-RIFH8RAg.js → AgentDetails-BriiIXid.js} +1 -1
  2. package/dist-embed/chunks/{AgentDetailsDialog-CK7jVPSc.js → AgentDetailsDialog-Bh3yhb7O.js} +1 -1
  3. package/dist-embed/chunks/{AgentInspector-DwZk4yjT.js → AgentInspector-Dd-G3TvL.js} +1 -1
  4. package/dist-embed/chunks/{AgentInspectorDialog-Ct12Hqc-.js → AgentInspectorDialog-CQEiBqOl.js} +1 -1
  5. package/dist-embed/chunks/{CellSidebarExtension-CbVVhhaO.js → CellSidebarExtension-DbbW8AJP.js} +1 -1
  6. package/dist-embed/chunks/ChatView-LzqHHAEe.js +32 -0
  7. package/dist-embed/chunks/{ContextPie-DLR5REbp.js → ContextPie-I90j658q.js} +1 -1
  8. package/dist-embed/chunks/{DeckComponent-C_ZaO_iF.js → DeckComponent-DAnUabRV.js} +2 -2
  9. package/dist-embed/chunks/{DocumentView-DP-dxfpu.js → DocumentView-BKFitqiB.js} +1 -1
  10. package/dist-embed/chunks/{EphemeralDocument-D3rfKBME.js → EphemeralDocument-BRzYMd8Z.js} +1 -1
  11. package/dist-embed/chunks/{EphemeralNotebook-Dn3ku5jr.js → EphemeralNotebook-COnqhW7Q.js} +1 -1
  12. package/dist-embed/chunks/{ExcalidrawComponent-B7I0SoHM.js → ExcalidrawComponent-VnKcai35.js} +1 -1
  13. package/dist-embed/chunks/{ExcalidrawModal-B2VIt9DT.js → ExcalidrawModal-DrntFjbe.js} +1 -1
  14. package/dist-embed/chunks/{JupyterLexicalExtension-LpJ6Rj9h.js → JupyterLexicalExtension-BBivQZvX.js} +9 -9
  15. package/dist-embed/chunks/{KernelVariables-ZFnygJ4R.js → KernelVariables-CNEfUsyt.js} +1 -1
  16. package/dist-embed/chunks/{LexicalToolRegistry-BRMKFkxC.js → LexicalToolRegistry-B8ccPURu.js} +4 -4
  17. package/dist-embed/chunks/{NotebookToolSurfaces-Dz_cxy8L.js → NotebookToolSurfaces-B8Rmjy_m.js} +1 -1
  18. package/dist-embed/chunks/{NotebookView-DG-pAyOq.js → NotebookView-BDChKuA9.js} +1 -1
  19. package/dist-embed/chunks/{Output-Cnq5i-bK.js → Output-CEoYDjwn.js} +1 -1
  20. package/dist-embed/chunks/{SandboxDetailsDialog-BzGdQmTQ.js → SandboxDetailsDialog-DuavSJSL.js} +1 -1
  21. package/dist-embed/chunks/SchemaForm-C6wDxDrg.js +1 -0
  22. package/dist-embed/chunks/{WidgetVariableView-kRHeKnmD.js → WidgetVariableView-Tm5SSEKf.js} +1 -1
  23. package/dist-embed/chunks/{YouTubePlugin-ChwsOfjj.js → YouTubePlugin-C209681s.js} +1 -1
  24. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-sr3TJAkV.js → abnfDiagram-VCTEODGH-CsKFU4Ej.js} +1 -1
  25. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-Byz1QYm8.js → abnfDiagram-VCTEODGH-m7LJLYga.js} +1 -1
  26. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-D1OmbW2u.js → ar-SA-G6X2FPQ2-Dypu3IcK.js} +1 -1
  27. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-B7rDWQh9.js → architectureDiagram-5GKGNRK7-C22xzf-o.js} +1 -1
  28. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-DOxpBf54.js → architectureDiagram-5GKGNRK7-iDgRBR0a.js} +1 -1
  29. package/dist-embed/chunks/{az-AZ-76LH7QW2-CmSoFd5x.js → az-AZ-76LH7QW2-D8CzfKb1.js} +1 -1
  30. package/dist-embed/chunks/{bg-BG-XCXSNQG7-D7b2U9I0.js → bg-BG-XCXSNQG7-_NVFEM1_.js} +1 -1
  31. package/dist-embed/chunks/{blockDiagram-868be97b-CKmWpImQ.js → blockDiagram-868be97b-D3BurtSN.js} +1 -1
  32. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-_fDDlpCe.js → blockDiagram-I7D4REHJ-CHicgYkf.js} +1 -1
  33. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-bzZkd0c3.js → blockDiagram-I7D4REHJ-oDRNhSU2.js} +1 -1
  34. package/dist-embed/chunks/{bn-BD-2XOGV67Q-CG3iRJ8B.js → bn-BD-2XOGV67Q-DMgdNi-k.js} +1 -1
  35. package/dist-embed/chunks/{c4Diagram-3f4bdde3-zvlk6Xm2.js → c4Diagram-3f4bdde3-Dmbl9p6m.js} +1 -1
  36. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-NpmtOeoK.js → c4Diagram-7LVT6UL2-CR3iQQ6O.js} +1 -1
  37. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-vHp7kFMG.js → c4Diagram-7LVT6UL2-auJZQjpw.js} +1 -1
  38. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-BW4zf4cd.js → ca-ES-6MX7JW3Y-DpOQhzr4.js} +1 -1
  39. package/dist-embed/chunks/{celltoolbartracker-DDVXLR_l.js → celltoolbartracker-DCR86wxV.js} +1 -1
  40. package/dist-embed/chunks/{chunk-2Q5K7J3B-Blqxrfai.js → chunk-2Q5K7J3B-DpFWUcsT.js} +1 -1
  41. package/dist-embed/chunks/{chunk-2Q5K7J3B-D26LTlFj.js → chunk-2Q5K7J3B-H_DA_jTG.js} +1 -1
  42. package/dist-embed/chunks/{chunk-5VM5RSS4-CdbSD_M8.js → chunk-5VM5RSS4-BhWUyelG.js} +1 -1
  43. package/dist-embed/chunks/{chunk-5VM5RSS4-BcO1XpWr.js → chunk-5VM5RSS4-CaowF8Al.js} +1 -1
  44. package/dist-embed/chunks/{chunk-F27PBJKO-BQ-ZIw-1.js → chunk-F27PBJKO-B9wgW70d.js} +1 -1
  45. package/dist-embed/chunks/{chunk-F27PBJKO-BRe2RwsD.js → chunk-F27PBJKO-D7PuEggc.js} +1 -1
  46. package/dist-embed/chunks/{chunk-IMKFNOWR-D-RO-dCd.js → chunk-IMKFNOWR-DhXkXQPV.js} +1 -1
  47. package/dist-embed/chunks/{chunk-IMKFNOWR-CLFrksv5.js → chunk-IMKFNOWR-jZNuNkCa.js} +1 -1
  48. package/dist-embed/chunks/{chunk-JWPE2WC7-wyMu098x.js → chunk-JWPE2WC7-BIShIUcJ.js} +1 -1
  49. package/dist-embed/chunks/{chunk-JWPE2WC7-DbtWvNSt.js → chunk-JWPE2WC7-DaBG37yC.js} +1 -1
  50. package/dist-embed/chunks/{chunk-POPQ4Y6H-OgpU0qcq.js → chunk-POPQ4Y6H-DG5Q2OKT.js} +1 -1
  51. package/dist-embed/chunks/{chunk-POPQ4Y6H-lwXXWwpD.js → chunk-POPQ4Y6H-WjTzJISs.js} +1 -1
  52. package/dist-embed/chunks/{chunk-SVP7TREG-CtOO_gz8.js → chunk-SVP7TREG-ERRaAh-x.js} +1 -1
  53. package/dist-embed/chunks/{chunk-SVP7TREG-C1pZJEUL.js → chunk-SVP7TREG-bq0J6tH_.js} +1 -1
  54. package/dist-embed/chunks/{chunk-TICWLB2K-BUeW_P5i.js → chunk-TICWLB2K-B91fA6Jd.js} +1 -1
  55. package/dist-embed/chunks/{chunk-TICWLB2K-B2id4fS-.js → chunk-TICWLB2K-BV_9f6ak.js} +1 -1
  56. package/dist-embed/chunks/{chunk-XXDRQBXY-6emV99Se.js → chunk-XXDRQBXY-BAy0lBJk.js} +1 -1
  57. package/dist-embed/chunks/{chunk-XXDRQBXY-DASCZDLb.js → chunk-XXDRQBXY-fV8doVJJ.js} +1 -1
  58. package/dist-embed/chunks/{classDiagram-ZZMXUADV-BUcYJSYu.js → classDiagram-ZZMXUADV-B0pbDswj.js} +1 -1
  59. package/dist-embed/chunks/{classDiagram-ZZMXUADV-DXK_VS6x.js → classDiagram-ZZMXUADV-CGdcKCOI.js} +1 -1
  60. package/dist-embed/chunks/{classDiagram-f62afe4f-D_XtspOB.js → classDiagram-f62afe4f-tD890DEl.js} +1 -1
  61. package/dist-embed/chunks/{classDiagram-v2-604399ef-DmVGURP4.js → classDiagram-v2-604399ef-DReIuoeI.js} +1 -1
  62. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-BUcYJSYu.js → classDiagram-v2-VYDZK3BY-B0pbDswj.js} +1 -1
  63. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-DXK_VS6x.js → classDiagram-v2-VYDZK3BY-CGdcKCOI.js} +1 -1
  64. package/dist-embed/chunks/{code-block-IT6T5CEO-CLFy43wi.js → code-block-IT6T5CEO-DD7hwbHA.js} +1 -1
  65. package/dist-embed/chunks/{component-BABP_IeE.js → component-BWDcVpKW.js} +1 -1
  66. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DkllT3uc.js → cose-bilkent-JH36ORCC-BS_pJML-.js} +1 -1
  67. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-zloY56Dd.js → cose-bilkent-JH36ORCC-BsK2pWDL.js} +1 -1
  68. package/dist-embed/chunks/{createText-aed3d8b3-B_AmUgWn.js → createText-aed3d8b3-1eVJ8jxH.js} +2 -2
  69. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-DzWWfN4P.js → cs-CZ-2BRQDIVT-Fr-SpqHD.js} +1 -1
  70. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-CT11o-tV.js → cynefinDiagram-5FMLGOSQ-AxJwZ7KT.js} +1 -1
  71. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-Benlx8nr.js → cynefinDiagram-5FMLGOSQ-vmheD_S2.js} +1 -1
  72. package/dist-embed/chunks/{da-DK-5WZEPLOC-CaeirLFF.js → da-DK-5WZEPLOC-DO_sAXvt.js} +1 -1
  73. package/dist-embed/chunks/{dagre-GXQ25YYZ-B2PPWFKB.js → dagre-GXQ25YYZ-B8Ip03td.js} +1 -1
  74. package/dist-embed/chunks/{dagre-GXQ25YYZ-qys4evHY.js → dagre-GXQ25YYZ-BgrGEY09.js} +1 -1
  75. package/dist-embed/chunks/{de-DE-XR44H4JA-DBkebtzo.js → de-DE-XR44H4JA-4JnXB_iM.js} +1 -1
  76. package/dist-embed/chunks/{diagram-S7CK7UJ4-C1EHbNes.js → diagram-S7CK7UJ4-BxRBCYVP.js} +1 -1
  77. package/dist-embed/chunks/{diagram-S7CK7UJ4-CBkf-BrM.js → diagram-S7CK7UJ4-hQvZziAN.js} +1 -1
  78. package/dist-embed/chunks/{diagram-UQ7AKVKN-CKsxaZCe.js → diagram-UQ7AKVKN-BFkOO3Wu.js} +1 -1
  79. package/dist-embed/chunks/{diagram-UQ7AKVKN-C9zuKZ5Y.js → diagram-UQ7AKVKN-BvgP6_rf.js} +1 -1
  80. package/dist-embed/chunks/{diagram-VSXAHHWV-Cd8pBAf-.js → diagram-VSXAHHWV-Cy8iWh4H.js} +1 -1
  81. package/dist-embed/chunks/{diagram-VSXAHHWV-Dd_PlC0S.js → diagram-VSXAHHWV-WVuzjdxU.js} +1 -1
  82. package/dist-embed/chunks/{diagram-VX7I27RA-DZTLEsKe.js → diagram-VX7I27RA-CCx8R8FK.js} +1 -1
  83. package/dist-embed/chunks/{diagram-VX7I27RA-D5qf5Kw-.js → diagram-VX7I27RA-_LUOsaBb.js} +1 -1
  84. package/dist-embed/chunks/{diagram-Z3DM3KII-DlsBShb0.js → diagram-Z3DM3KII-CY856Sry.js} +1 -1
  85. package/dist-embed/chunks/{diagram-Z3DM3KII-B2zosfsY.js → diagram-Z3DM3KII-Dqcrl8-1.js} +1 -1
  86. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-VhBXkHc8.js → ebnfDiagram-PWID7BFC-DC-Zam6d.js} +1 -1
  87. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-sUXnKXhD.js → ebnfDiagram-PWID7BFC-kqD9RLAA.js} +1 -1
  88. package/dist-embed/chunks/{edges-b2856ca0-cYsFYCgh.js → edges-b2856ca0-B3ybuHDU.js} +1 -1
  89. package/dist-embed/chunks/{el-GR-BZB4AONW-DkmsSwGL.js → el-GR-BZB4AONW-MydAlwHl.js} +1 -1
  90. package/dist-embed/chunks/{erDiagram-5d81789a-DHzqp69u.js → erDiagram-5d81789a-HZ-VLc2f.js} +1 -1
  91. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-DPzcAUZq.js → erDiagram-RLTQ6QDP-CNO4pVhU.js} +1 -1
  92. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-BRf7HEXF.js → erDiagram-RLTQ6QDP-zwXEFcAp.js} +1 -1
  93. package/dist-embed/chunks/{es-ES-U4NZUMDT-Dvnvh6dW.js → es-ES-U4NZUMDT-rQmnr_uu.js} +1 -1
  94. package/dist-embed/chunks/{eu-ES-A7QVB2H4-DYX6hpyz.js → eu-ES-A7QVB2H4-j5Hf8ngk.js} +1 -1
  95. package/dist-embed/chunks/{fa-IR-HGAKTJCU-Dmlm1ZjK.js → fa-IR-HGAKTJCU-DMJRRSBp.js} +1 -1
  96. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-2ov9-9H3.js → fi-FI-Z5N7JZ37-BFLC0BFd.js} +1 -1
  97. package/dist-embed/chunks/{flowDb-185abca5-vnPYmNxZ.js → flowDb-185abca5-7Nn2obHG.js} +1 -1
  98. package/dist-embed/chunks/{flowDiagram-1629c991-D_P7IhnT.js → flowDiagram-1629c991-CnvM_psw.js} +1 -1
  99. package/dist-embed/chunks/{flowDiagram-HODETNUW-BUuZtbKx.js → flowDiagram-HODETNUW-BrbR1EkW.js} +1 -1
  100. package/dist-embed/chunks/{flowDiagram-HODETNUW-Dqms2kHK.js → flowDiagram-HODETNUW-Bsl5oOFb.js} +1 -1
  101. package/dist-embed/chunks/{flowDiagram-v2-1d953310-jyYNkbVD.js → flowDiagram-v2-1d953310-TkF25UVC.js} +1 -1
  102. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-CkUTQpED.js → flowchart-elk-definition-6df44142-CwiGfEuJ.js} +1 -1
  103. package/dist-embed/chunks/{fr-FR-RHASNOE6-BUlHGdL2.js → fr-FR-RHASNOE6-CxjhSJC1.js} +1 -1
  104. package/dist-embed/chunks/{ganttDiagram-3b0b3873-CDk8PUcC.js → ganttDiagram-3b0b3873-DeouFDZE.js} +1 -1
  105. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-D4fzILsk.js → ganttDiagram-EL5Y4UJY-BeK3rGHM.js} +1 -1
  106. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-Tsk8dNyJ.js → ganttDiagram-EL5Y4UJY-DfJDZVnm.js} +1 -1
  107. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-DSJR8KGU.js → gitGraphDiagram-WWUBYQGX-BujqTwbf.js} +1 -1
  108. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-XOpfU7hY.js → gitGraphDiagram-WWUBYQGX-DkYi8eWr.js} +1 -1
  109. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-C7QWh6IZ.js → gitGraphDiagram-f01e8bc2-mCCRVzIs.js} +1 -1
  110. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-T3hKsmlm.js → gl-ES-HMX3MZ6V-BuuMpTaX.js} +1 -1
  111. package/dist-embed/chunks/{he-IL-6SHJWFNN-DoePgaFj.js → he-IL-6SHJWFNN-Cv3Nrcgu.js} +1 -1
  112. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-B_E7TPlk.js → hi-IN-IWLTKZ5I-Sddst60F.js} +1 -1
  113. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-Bu8X3BrR.js → hu-HU-A5ZG7DT2-ehrXVpD0.js} +1 -1
  114. package/dist-embed/chunks/{id-ID-SAP4L64H-jOs7pgj2.js → id-ID-SAP4L64H-Gfb1UYxZ.js} +1 -1
  115. package/dist-embed/chunks/{index-JF61_zqs.js → index-5NOGMVjz.js} +1 -1
  116. package/dist-embed/chunks/{index-BzgczmKp.js → index-6zxVHKca.js} +10 -10
  117. package/dist-embed/chunks/{index-9bae90f3-BywpAnlj.js → index-9bae90f3-CzUk5Hhq.js} +1 -1
  118. package/dist-embed/chunks/{index-DvHqo_Qj.js → index-AHAhJxOc.js} +1 -1
  119. package/dist-embed/chunks/{index-7hNcqUR-.js → index-B9Ya6z2n.js} +1 -1
  120. package/dist-embed/chunks/{index-BwyZ8O-M.js → index-BOEhatkt.js} +1 -1
  121. package/dist-embed/chunks/{index-BYo3uv0g.js → index-BOGJMsUN.js} +2 -2
  122. package/dist-embed/chunks/{index-Bmo-OFNb.js → index-BaBNw6X5.js} +4 -4
  123. package/dist-embed/chunks/{index-BR58wzgU.js → index-BfvZMC2B.js} +1 -1
  124. package/dist-embed/chunks/{index-DnqWNX5L.js → index-BiuABva5.js} +1 -1
  125. package/dist-embed/chunks/{index-0m4vhMAR.js → index-BjfpYq_l.js} +1 -1
  126. package/dist-embed/chunks/{index-BI_0cBab.js → index-BuXVVl_h.js} +7 -7
  127. package/dist-embed/chunks/{index-fBSCurWE.js → index-By5Ku2wm.js} +4 -4
  128. package/dist-embed/chunks/{index-Bw1BRX9C.js → index-CNpJ8Y2y.js} +1 -1
  129. package/dist-embed/chunks/{index-zrM_sbHt.js → index-Cw1r0WFc.js} +1 -1
  130. package/dist-embed/chunks/{index-CS3mm6qN.js → index-D8x0MQWQ.js} +1 -1
  131. package/dist-embed/chunks/{index-BqpOM6Mx.js → index-DDnf06e_.js} +1 -1
  132. package/dist-embed/chunks/{index-B3fpdUTu.js → index-DGefzKhT.js} +1 -1
  133. package/dist-embed/chunks/{index-CgCcVxV_.js → index-DN6Cori6.js} +1 -1
  134. package/dist-embed/chunks/{index-_z7rhr9l.js → index-DQ-v6JVz.js} +4 -4
  135. package/dist-embed/chunks/{index-C2JsK59r.js → index-DTYZzbES.js} +1 -1
  136. package/dist-embed/chunks/{index-MfJ2dN-o.js → index-DWkIO3YS.js} +1 -1
  137. package/dist-embed/chunks/{index-CL2J1VY_.js → index-DZwyICkp.js} +1 -1
  138. package/dist-embed/chunks/{index-CoVJiT-h.js → index-D_vehxcD.js} +1 -1
  139. package/dist-embed/chunks/{index-wqOJuJys.js → index-DiTcTB7Y.js} +1 -1
  140. package/dist-embed/chunks/{index-COPak822.js → index-DmpLE1d4.js} +1 -1
  141. package/dist-embed/chunks/{index-Ca5wn1F-.js → index-Do4nOAaR.js} +1 -1
  142. package/dist-embed/chunks/{index-DBRbrQr1.js → index-DobaF_Ee.js} +1 -1
  143. package/dist-embed/chunks/{index-BfuxhQsr.js → index-DvwQdrde.js} +1 -1
  144. package/dist-embed/chunks/{index-KC9furSU.js → index-DzMYyq8T.js} +1 -1
  145. package/dist-embed/chunks/{index-Cz0vwY93.js → index-QHmZQlKN.js} +6 -6
  146. package/dist-embed/chunks/{index-C00mEIpi.js → index-hxIHgkzg.js} +1 -1
  147. package/dist-embed/chunks/{index-B27olYsx.js → index-nMwnYxTd.js} +1 -1
  148. package/dist-embed/chunks/{index-NvC9D0Mh.js → index-umwkqggg.js} +1 -1
  149. package/dist-embed/chunks/{index-3JfFVSno.js → index-yMppJWrQ.js} +1 -1
  150. package/dist-embed/chunks/{index.esm-BbIi4n-Y.js → index.esm-CC457Cyg.js} +1 -1
  151. package/dist-embed/chunks/{index.esm-ePira_es.js → index.esm-DFDbLGof.js} +1 -1
  152. package/dist-embed/chunks/{infoDiagram-27XIBGKW-CvSw0Uqm.js → infoDiagram-27XIBGKW-C18Zz25F.js} +1 -1
  153. package/dist-embed/chunks/{infoDiagram-27XIBGKW-BagqSEKB.js → infoDiagram-27XIBGKW-DiC5_yjB.js} +1 -1
  154. package/dist-embed/chunks/{infoDiagram-a29d40f1-CY6P-RB2.js → infoDiagram-a29d40f1-DRVyx4Bf.js} +1 -1
  155. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CJjl4-N0.js → ishikawaDiagram-5VMMS53U-3WGbru46.js} +1 -1
  156. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-DQfqd5pn.js → ishikawaDiagram-5VMMS53U-DrEzfSK9.js} +1 -1
  157. package/dist-embed/chunks/{it-IT-JPQ66NNP-CrGtxCjf.js → it-IT-JPQ66NNP-BehLHkar.js} +1 -1
  158. package/dist-embed/chunks/{ja-JP-DBVTYXUO-MhHoMhnM.js → ja-JP-DBVTYXUO-BZvqIigI.js} +1 -1
  159. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-B186toLf.js → journeyDiagram-3NMN7TZE-BZWmkUfk.js} +1 -1
  160. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-fMuL5yIV.js → journeyDiagram-3NMN7TZE-DpWKIFIN.js} +1 -1
  161. package/dist-embed/chunks/{journeyDiagram-95396277-Bt2VFr_f.js → journeyDiagram-95396277-D_QLiVq4.js} +1 -1
  162. package/dist-embed/chunks/{kaa-6HZHGXH3-otexWzw0.js → kaa-6HZHGXH3-DgAIF6rN.js} +1 -1
  163. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-Bk_pPM_n.js → kab-KAB-ZGHBKWFO-DW4thPSJ.js} +1 -1
  164. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-tkyZOsyz.js → kanban-definition-UXKFOSKX-B84ZaZEy.js} +1 -1
  165. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-DyX3lLGq.js → kanban-definition-UXKFOSKX-DxbTprYr.js} +1 -1
  166. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DuPx0Ivn.js → kk-KZ-P5N5QNE5-CCy_nSJ7.js} +1 -1
  167. package/dist-embed/chunks/{km-KH-HSX4SM5Z-DfW3Tv6Q.js → km-KH-HSX4SM5Z-kpXyoxjS.js} +1 -1
  168. package/dist-embed/chunks/{ko-KR-MTYHY66A-CWeM03UD.js → ko-KR-MTYHY66A-CFm6WtQG.js} +1 -1
  169. package/dist-embed/chunks/{ku-TR-6OUDTVRD-BpZVGVBG.js → ku-TR-6OUDTVRD-CKF85mOv.js} +1 -1
  170. package/dist-embed/chunks/{layout-i1FLEqsi.js → layout-DYytgC9r.js} +1 -1
  171. package/dist-embed/chunks/{layout-P_H-0ax9.js → layout-Dx5Hzkor.js} +1 -1
  172. package/dist-embed/chunks/{lexicalHooks-BjTCfdUi.js → lexicalHooks-DbTGOMyq.js} +1 -1
  173. package/dist-embed/chunks/{lt-LT-XHIRWOB4-LavcVuZR.js → lt-LT-XHIRWOB4-CO9Bo5qJ.js} +1 -1
  174. package/dist-embed/chunks/{lv-LV-5QDEKY6T-DWoheFP4.js → lv-LV-5QDEKY6T-CvZszc5p.js} +1 -1
  175. package/dist-embed/chunks/{mermaid.core-Cltl6__q.js → mermaid.core-D0955PCw.js} +5 -5
  176. package/dist-embed/chunks/{mermaid.core-Bd5egiDP.js → mermaid.core-D98kc0OO.js} +3 -3
  177. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-BmuUH3a3.js → mindmap-definition-YA3MSWOX-D86IPkt3.js} +1 -1
  178. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-Di0Xac42.js → mindmap-definition-YA3MSWOX-_1SBIPav.js} +1 -1
  179. package/dist-embed/chunks/{mindmap-definition-e4c1d938-D0Ep5LxZ.js → mindmap-definition-e4c1d938-UbbfpF-a.js} +1 -1
  180. package/dist-embed/chunks/{mr-IN-CRQNXWMA-G-1tBL4-.js → mr-IN-CRQNXWMA-Cio_dB9M.js} +1 -1
  181. package/dist-embed/chunks/{my-MM-5M5IBNSE-DpmzmQ2W.js → my-MM-5M5IBNSE-Z0RQ5Vbz.js} +1 -1
  182. package/dist-embed/chunks/{nb-NO-T6EIAALU-DFU_SPCx.js → nb-NO-T6EIAALU-BEQ0YP9J.js} +1 -1
  183. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-Dlz_okxD.js → nl-NL-IS3SIHDZ-YtkJnS_J.js} +1 -1
  184. package/dist-embed/chunks/{nn-NO-6E72VCQL-D9E-BpHw.js → nn-NO-6E72VCQL-C1j2s3qO.js} +1 -1
  185. package/dist-embed/chunks/{oc-FR-POXYY2M6-CVonm6mx.js → oc-FR-POXYY2M6-CinnjccW.js} +1 -1
  186. package/dist-embed/chunks/{pa-IN-N4M65BXN-a5ExTB9v.js → pa-IN-N4M65BXN-c_6OtC6L.js} +1 -1
  187. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-BYznG-ZK.js → pegDiagram-XKGWAZYB-BBVcHZ8T.js} +1 -1
  188. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-Cptotyez.js → pegDiagram-XKGWAZYB-BJAdJVqh.js} +1 -1
  189. package/dist-embed/chunks/{percentages-BXMCSKIN-C2-svgs_.js → percentages-BXMCSKIN-VqMxh8LK.js} +5 -5
  190. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-BYEkkWvq.js → pieDiagram-E7YTZNPT-C55wHgO0.js} +1 -1
  191. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-D51avc4V.js → pieDiagram-E7YTZNPT-EvMxJb2S.js} +1 -1
  192. package/dist-embed/chunks/{pieDiagram-c941bede-Bcau8_Gm.js → pieDiagram-c941bede-DTmViAsB.js} +1 -1
  193. package/dist-embed/chunks/{pl-PL-T2D74RX3-BaHKKcOg.js → pl-PL-T2D74RX3-Cn_9xZgM.js} +1 -1
  194. package/dist-embed/chunks/{pt-BR-5N22H2LF-DZEHszX8.js → pt-BR-5N22H2LF-Da6r-Pp1.js} +1 -1
  195. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-BbJKz8vE.js → pt-PT-UZXXM6DQ-D6lhcuX9.js} +1 -1
  196. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-BfWK8wgJ.js → quadrantDiagram-AXDQQJYC-BCeMrGXB.js} +1 -1
  197. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-CcMIo23m.js → quadrantDiagram-AXDQQJYC-rFaTvNlk.js} +1 -1
  198. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-Db1y7cGB.js → quadrantDiagram-cf8b8fe0-BZAbhmbg.js} +1 -1
  199. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BzqhRF47.js → railroadDiagram-O6MQD6OU-BAXhb26s.js} +1 -1
  200. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-DCRFdpxj.js → railroadDiagram-O6MQD6OU-bR7xXZGS.js} +1 -1
  201. package/dist-embed/chunks/{renderer-CM-Z_1Uj.js → renderer-DfML3j-s.js} +1 -1
  202. package/dist-embed/chunks/{requirementDiagram-53bda41b-Dj564NwS.js → requirementDiagram-53bda41b-DNqx3JRF.js} +1 -1
  203. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-dma0a-bN.js → requirementDiagram-BXWQKSXE-B0SL6Gqb.js} +1 -1
  204. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-CIFZt_cP.js → requirementDiagram-BXWQKSXE-DHLQ_9Lw.js} +1 -1
  205. package/dist-embed/chunks/{ro-RO-JPDTUUEW-szdAFgjr.js → ro-RO-JPDTUUEW-BFss9e8X.js} +1 -1
  206. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CbdtKkxy.js → ru-RU-B4JR7IUQ-DIruW2gS.js} +1 -1
  207. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-8ur8k-HP.js → sankeyDiagram-P5KCCOFB-CktuQIU1.js} +1 -1
  208. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-DRxZFl9I.js → sankeyDiagram-P5KCCOFB-Nk71fRsK.js} +1 -1
  209. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-Da81kIDr.js → sankeyDiagram-c3ef121a-4-5C_fXA.js} +1 -1
  210. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-DM8BTW5K.js → sequenceDiagram-82a5b84f-DedJ5qnD.js} +1 -1
  211. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-BH0Y4uG3.js → sequenceDiagram-WJ2MYXX4-BBGHED3s.js} +1 -1
  212. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-CNwXBdZi.js → sequenceDiagram-WJ2MYXX4-Dm3QM01Z.js} +1 -1
  213. package/dist-embed/chunks/{sessions-DlvFLGbP.js → sessions-lT1zQJEG.js} +2 -2
  214. package/dist-embed/chunks/{si-LK-N5RQ5JYF-DfCWfEQf.js → si-LK-N5RQ5JYF-Dom-aTTE.js} +1 -1
  215. package/dist-embed/chunks/{sizeCapture-INFHLROL-D-nX-7Hv.js → sizeCapture-INFHLROL-BNuVN7vX.js} +1 -1
  216. package/dist-embed/chunks/{sizeCapture-INFHLROL-Tw2tvJ1W.js → sizeCapture-INFHLROL-BW7unDBA.js} +1 -1
  217. package/dist-embed/chunks/{sk-SK-C5VTKIMK-CTeAwA1b.js → sk-SK-C5VTKIMK-CLRU9TNq.js} +1 -1
  218. package/dist-embed/chunks/{sl-SI-NN7IZMDC-eFw2lQcd.js → sl-SI-NN7IZMDC-BKLCNVXA.js} +1 -1
  219. package/dist-embed/chunks/{stateDiagram-43e79a5f-H8oVn7EH.js → stateDiagram-43e79a5f-C-TVhCrM.js} +1 -1
  220. package/dist-embed/chunks/{stateDiagram-D77RDMKH-DS-byRyy.js → stateDiagram-D77RDMKH-mLSMGpPQ.js} +1 -1
  221. package/dist-embed/chunks/{stateDiagram-D77RDMKH-CGEuq_3Z.js → stateDiagram-D77RDMKH-tqnmMQUf.js} +1 -1
  222. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-D7zd-PeH.js → stateDiagram-v2-2041ed4f-TVcKzajK.js} +1 -1
  223. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-Bbn7CxXx.js → stateDiagram-v2-MP3YSRHH-C3MNIg5B.js} +1 -1
  224. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-CllCmLuo.js → stateDiagram-v2-MP3YSRHH-C6TftAzE.js} +1 -1
  225. package/dist-embed/chunks/{styles-455b33cd-CYP0pxwM.js → styles-455b33cd-CIILXOoF.js} +1 -1
  226. package/dist-embed/chunks/{styles-f932cba9-dXHjU5Mc.js → styles-f932cba9-CVBMDsh6.js} +1 -1
  227. package/dist-embed/chunks/{styles-fcc2142b-CrgFTq7b.js → styles-fcc2142b-CTOmFTKK.js} +1 -1
  228. package/dist-embed/chunks/{subset-shared.chunk-BCNcfBdp.js → subset-shared.chunk-zIH7OLsP.js} +1 -1
  229. package/dist-embed/chunks/{subset-worker.chunk-nY71AE9b.js → subset-worker.chunk-b9j7PKPe.js} +1 -1
  230. package/dist-embed/chunks/{sv-SE-XGPEYMSR-B3BAd7ic.js → sv-SE-XGPEYMSR-D0UV0HV7.js} +1 -1
  231. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-DY-6e2w2.js → svgDrawCommon-148a3cd9-BCgvh5nL.js} +1 -1
  232. package/dist-embed/chunks/{swimlanes-42K2YHIH-CpFqKR23.js → swimlanes-42K2YHIH-BQTDK2Ta.js} +1 -1
  233. package/dist-embed/chunks/{swimlanes-42K2YHIH-BoshoQYI.js → swimlanes-42K2YHIH-DHcV40DB.js} +1 -1
  234. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BNalU-se.js → swimlanesDiagram-VR7AAH4N-BV8Vb5g2.js} +1 -1
  235. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-CUEoZUeR.js → swimlanesDiagram-VR7AAH4N-CQ7d-sbG.js} +1 -1
  236. package/dist-embed/chunks/{ta-IN-2NMHFXQM-Ch7Coorh.js → ta-IN-2NMHFXQM-C-EJ3jDE.js} +1 -1
  237. package/dist-embed/chunks/{th-TH-HPSO5L25-gmc7tguq.js → th-TH-HPSO5L25-CfQh62Qa.js} +1 -1
  238. package/dist-embed/chunks/{timeline-definition-24CTP7MA-BD_Hd7OM.js → timeline-definition-24CTP7MA-CKtubk73.js} +1 -1
  239. package/dist-embed/chunks/{timeline-definition-24CTP7MA-CLQC5Soj.js → timeline-definition-24CTP7MA-DJcFE1jT.js} +1 -1
  240. package/dist-embed/chunks/{timeline-definition-7545f45a-CBNPBc2S.js → timeline-definition-7545f45a-CLycxRtq.js} +1 -1
  241. package/dist-embed/chunks/{tr-TR-DEFEU3FU-DoKmjhCn.js → tr-TR-DEFEU3FU-Lz7Ka2Zr.js} +1 -1
  242. package/dist-embed/chunks/{uk-UA-QMV73CPH-uzMCDuv6.js → uk-UA-QMV73CPH-DU0hsGUJ.js} +1 -1
  243. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-Clhmiu8L.js → vennDiagram-4TSXK5OY-BMmQ-DIV.js} +1 -1
  244. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-BxbIHKUM.js → vennDiagram-4TSXK5OY-Bq0xMhnH.js} +1 -1
  245. package/dist-embed/chunks/{vi-VN-M7AON7JQ-UC9RyOt8.js → vi-VN-M7AON7JQ-CDvS0SiL.js} +1 -1
  246. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-HuiHAtr-.js → wardleyDiagram-VM6X3IG4-C1VKw6YX.js} +1 -1
  247. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-un-PuqHe.js → wardleyDiagram-VM6X3IG4-DL5LgQWr.js} +1 -1
  248. package/dist-embed/chunks/{xychartDiagram-3f383b91-3k3NdPbU.js → xychartDiagram-3f383b91-B-BTwetN.js} +1 -1
  249. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-CIDOTVoZ.js → xychartDiagram-S5SC5T6Z-BQHFHk-x.js} +1 -1
  250. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-CvZAV0KM.js → xychartDiagram-S5SC5T6Z-BXkM4beH.js} +1 -1
  251. package/dist-embed/chunks/{zh-CN-LNUGB5OW-DFA0PCzk.js → zh-CN-LNUGB5OW-CWE-bF0d.js} +1 -1
  252. package/dist-embed/chunks/{zh-HK-E62DVLB3-WzEwoBkd.js → zh-HK-E62DVLB3-pEfL2bds.js} +1 -1
  253. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-B7w1h39x.js → zh-TW-RAJ6MFWO-Cp6UFUuD.js} +1 -1
  254. package/dist-embed/datalayer-app-main.js +107 -106
  255. package/lib/apps/apps/records.d.ts +21 -4
  256. package/lib/apps/apps/records.js +8 -6
  257. package/lib/apps/apps/threads.d.ts +11 -1
  258. package/lib/apps/apps/threads.js +17 -0
  259. package/lib/apps/core/index.d.ts +71 -0
  260. package/lib/apps/core/index.js +22 -0
  261. package/lib/apps/plugins/app-activity/AppActivity.js +10 -4
  262. package/lib/apps/plugins/chat/ChatView.js +123 -6
  263. package/lib/apps/plugins/chat/SessionActionsMenu.d.ts +40 -0
  264. package/lib/apps/plugins/chat/SessionActionsMenu.js +73 -0
  265. package/lib/apps/plugins/chat/SessionChooseDialog.d.ts +22 -0
  266. package/lib/apps/plugins/chat/SessionChooseDialog.js +39 -0
  267. package/lib/apps/plugins/chat/index.js +8 -1
  268. package/lib/apps/plugins/chat/sessionActions.d.ts +65 -0
  269. package/lib/apps/plugins/chat/sessionActions.js +184 -0
  270. package/lib/chat/Chat.d.ts +42 -2
  271. package/lib/chat/Chat.js +148 -2
  272. package/lib/chat/base/ChatBase.js +33 -6
  273. package/lib/chat/index.d.ts +1 -1
  274. package/lib/chat/messages/ChatMessageList.d.ts +3 -1
  275. package/lib/chat/messages/ChatMessageList.js +21 -2
  276. package/lib/portable/activity.d.ts +91 -2
  277. package/lib/portable/activity.js +143 -4
  278. package/lib/portable/fixtures.d.ts +1 -1
  279. package/lib/portable/fixtures.js +17 -7
  280. package/lib/portable/index.d.ts +1 -1
  281. package/lib/portable/index.js +3 -2
  282. package/lib/portable/sessions.d.ts +25 -1
  283. package/lib/portable/sessions.js +62 -4
  284. package/lib/specs/harnesses.js +96 -0
  285. package/lib/specs/index.d.ts +1 -0
  286. package/lib/specs/index.js +1 -0
  287. package/lib/specs/sessionFiles.d.ts +123 -0
  288. package/lib/specs/sessionFiles.js +578 -0
  289. package/lib/types/agentspecs.d.ts +26 -0
  290. package/lib/types/chat.d.ts +38 -0
  291. package/package.json +1 -1
  292. package/scripts/codegen/generate_agents.py +1 -0
  293. package/scripts/codegen/generate_harnesses.py +70 -0
  294. package/scripts/codegen/generate_session_files.py +296 -0
  295. package/dist-embed/chunks/ChatView-B_EEvtKi.js +0 -32
  296. package/dist-embed/chunks/SchemaForm-Dg9uk6m3.js +0 -1
@@ -1782,6 +1782,7 @@ export * from './protocols';
1782
1782
  export * from './frames';
1783
1783
  export * from './cogs';
1784
1784
  export * from './harnesses';
1785
+ export * from './sessionFiles';
1785
1786
  export * from './policies';
1786
1787
  export * from './guards';
1787
1788
  export * from './gates';
@@ -20,6 +20,7 @@ Usage:
20
20
 
21
21
  import argparse
22
22
  import json
23
+ import re
23
24
  from pathlib import Path
24
25
  from typing import Any
25
26
 
@@ -29,6 +30,10 @@ from versioning import ensure_spec_version, version_suffix
29
30
  MCP = ("lend", "own", "none")
30
31
  THIRD_PARTIES = ("api_key_only", "permitted", "refused", "organizations_own")
31
32
  SKILLS_FORMATS = ("skill-md", "none")
33
+ RESUMES = ("none", "load", "native")
34
+ FORK_HISTORIES = ("none", "replay", "rebuild")
35
+ COMPACTIONS = ("own", "none")
36
+ NATIVE_SESSIONS = ("meta", "none")
32
37
  REGISTER = "register.yaml"
33
38
 
34
39
 
@@ -76,6 +81,46 @@ def load_harness_specs(specs_dir: Path) -> list[dict[str, Any]]:
76
81
  skills = spec.get("skills") or {}
77
82
  if skills.get("format") not in SKILLS_FORMATS:
78
83
  raise ValueError(f"{yaml_file.name}: skills.format one of {SKILLS_FORMATS}")
84
+ # The capabilities table (MH-20): required, its words known, agreeing with acp.
85
+ caps = spec.get("capabilities")
86
+ if not isinstance(caps, dict):
87
+ raise ValueError(
88
+ f"{yaml_file.name}: a harness declares its capabilities table"
89
+ )
90
+ if caps.get("resume") not in RESUMES:
91
+ raise ValueError(f"{yaml_file.name}: capabilities.resume one of {RESUMES}")
92
+ if caps.get("fork_history") not in FORK_HISTORIES:
93
+ raise ValueError(
94
+ f"{yaml_file.name}: capabilities.fork_history one of {FORK_HISTORIES}"
95
+ )
96
+ if caps.get("compaction") not in COMPACTIONS:
97
+ raise ValueError(
98
+ f"{yaml_file.name}: capabilities.compaction one of {COMPACTIONS}"
99
+ )
100
+ for flag in ("interrupt", "steering", "images"):
101
+ if not isinstance(caps.get(flag), bool):
102
+ raise ValueError(
103
+ f"{yaml_file.name}: capabilities.{flag} is true or false"
104
+ )
105
+ if acp is not None:
106
+ if acp.get("native_session", "none") not in NATIVE_SESSIONS:
107
+ raise ValueError(
108
+ f"{yaml_file.name}: acp.native_session one of {NATIVE_SESSIONS}"
109
+ )
110
+ if bool(acp.get("load_session")) != (caps["resume"] != "none"):
111
+ raise ValueError(
112
+ f"{yaml_file.name}: capabilities.resume and acp.load_session disagree"
113
+ )
114
+ for pattern in caps.get("auto_run") or []:
115
+ if not isinstance(pattern, str) or not pattern.startswith("^"):
116
+ raise ValueError(
117
+ f"{yaml_file.name}: capabilities.auto_run patterns are anchored with ^"
118
+ )
119
+ re.compile(pattern)
120
+ if list(caps.get("modes") or []) != list(acp.get("modes") or []):
121
+ raise ValueError(
122
+ f"{yaml_file.name}: capabilities.modes and acp.modes disagree"
123
+ )
79
124
  spec["_register"] = entry
80
125
  specs.append(spec)
81
126
  return specs
@@ -114,6 +159,7 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
114
159
  "",
115
160
  "from agent_runtimes.types import (",
116
161
  " HarnessAcpSpec,",
162
+ " HarnessCapabilitiesSpec,",
117
163
  " HarnessHonoursSpec,",
118
164
  " HarnessRegisterEntry,",
119
165
  " HarnessRequiresSpec,",
@@ -128,6 +174,7 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
128
174
  terms = spec.get("terms") or {}
129
175
  skills = spec.get("skills") or {}
130
176
  honours = spec.get("honours") or {}
177
+ caps = spec["capabilities"]
131
178
  entry = spec["_register"]
132
179
  lines += [
133
180
  "",
@@ -152,6 +199,7 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
152
199
  f" mcp={_s(acp['mcp'])},",
153
200
  f" modes={json.dumps(list(acp.get('modes') or []))},",
154
201
  f" env={json.dumps(dict(acp.get('env') or {}))},",
202
+ f" native_session={_s(acp.get('native_session', 'none'))},",
155
203
  " ),",
156
204
  ]
157
205
  lines += [
@@ -172,6 +220,16 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
172
220
  f" model={bool(honours.get('model', False))},",
173
221
  f" subagents={bool(honours.get('subagents', False))},",
174
222
  " ),",
223
+ " capabilities=HarnessCapabilitiesSpec(",
224
+ f" resume={_s(caps['resume'])},",
225
+ f" fork_history={_s(caps['fork_history'])},",
226
+ f" interrupt={bool(caps['interrupt'])},",
227
+ f" steering={bool(caps['steering'])},",
228
+ f" images={bool(caps['images'])},",
229
+ f" compaction={_s(caps['compaction'])},",
230
+ f" modes={json.dumps(list(caps.get('modes') or []))},",
231
+ f" auto_run={json.dumps(list(caps.get('auto_run') or []))},",
232
+ " ),",
175
233
  f" instructions_file={_s(spec.get('instructions_file'))},",
176
234
  " registered=HarnessRegisterEntry(",
177
235
  f" adapter={_s(entry.get('adapter'))},",
@@ -248,6 +306,7 @@ def generate_typescript_code(
248
306
  terms = spec.get("terms") or {}
249
307
  skills = spec.get("skills") or {}
250
308
  honours = spec.get("honours") or {}
309
+ caps = spec["capabilities"]
251
310
  entry = spec["_register"]
252
311
  lines += [
253
312
  "",
@@ -270,6 +329,7 @@ def generate_typescript_code(
270
329
  f" mcp: {_t(acp['mcp'])},",
271
330
  f" modes: {json.dumps(list(acp.get('modes') or []))},",
272
331
  f" env: {json.dumps(dict(acp.get('env') or {}))},",
332
+ f" nativeSession: {_t(acp.get('native_session', 'none'))},",
273
333
  " },",
274
334
  ]
275
335
  lines += [
@@ -294,6 +354,16 @@ def generate_typescript_code(
294
354
  f" model: {json.dumps(bool(honours.get('model', False)))},",
295
355
  f" subagents: {json.dumps(bool(honours.get('subagents', False)))},",
296
356
  " },",
357
+ " capabilities: {",
358
+ f" resume: {_t(caps['resume'])},",
359
+ f" forkHistory: {_t(caps['fork_history'])},",
360
+ f" interrupt: {json.dumps(bool(caps['interrupt']))},",
361
+ f" steering: {json.dumps(bool(caps['steering']))},",
362
+ f" images: {json.dumps(bool(caps['images']))},",
363
+ f" compaction: {_t(caps['compaction'])},",
364
+ f" modes: {json.dumps(list(caps.get('modes') or []))},",
365
+ f" autoRun: {json.dumps(list(caps.get('auto_run') or []))},",
366
+ " },",
297
367
  f" instructionsFile: {_t(spec.get('instructions_file'))},",
298
368
  " registered: {",
299
369
  f" adapter: {_t(entry.get('adapter'))},",
@@ -0,0 +1,296 @@
1
+ #!/usr/bin/env python3
2
+ # Copyright (c) 2025-2026 Datalayer, Inc.
3
+ # Distributed under the terms of the Modified BSD License.
4
+
5
+ """
6
+ Generate Python and TypeScript code from the session file specification.
7
+
8
+ One spec under ``agentspecs/sessions`` (MH-12): ``datalayer-session-1.yaml``
9
+ says the ``datalayer-session/1`` JSONL format — its caps, the states, the
10
+ entry kinds a file may carry, the redaction rules by name and the sentences
11
+ a reader refuses a file in — and ``session-file.schema.json`` beside it is
12
+ the JSON Schema of a line. Both are generated here so the runtime, ``loop``,
13
+ the chat and agent-teams refuse the same things in the same words.
14
+
15
+ Usage:
16
+ python generate_session_files.py \\
17
+ --specs-dir agentspecs/agentspecs/sessions \\
18
+ --python-output agent_runtimes/specs/session_files.py \\
19
+ --typescript-output src/specs/sessionFiles.ts
20
+ """
21
+
22
+ import argparse
23
+ import json
24
+ from pathlib import Path
25
+ from typing import Any
26
+
27
+ import yaml
28
+
29
+ SPEC = "datalayer-session-1.yaml"
30
+ SCHEMA = "session-file.schema.json"
31
+ STATES = ("open", "paused", "ended")
32
+
33
+
34
+ def load_spec(specs_dir: Path) -> tuple[dict[str, Any], dict[str, Any]]:
35
+ """The format spec and the schema of a line, each checked for what the generator needs."""
36
+ spec = yaml.safe_load((specs_dir / SPEC).read_text()) or {}
37
+ schema = json.loads((specs_dir / SCHEMA).read_text())
38
+ if spec.get("format") != "datalayer-session/1":
39
+ raise ValueError(
40
+ f"{SPEC}: the format is datalayer-session/1, not {spec.get('format')!r}"
41
+ )
42
+ if tuple(spec.get("states") or ()) != STATES:
43
+ raise ValueError(f"{SPEC}: the states are {STATES}")
44
+ for key in ("entry_kinds", "redaction_rules", "refusals", "caps"):
45
+ if not spec.get(key):
46
+ raise ValueError(f"{SPEC}: says its {key}")
47
+ caps = spec["caps"]
48
+ if int(caps.get("max_bytes") or 0) <= 0 or int(caps.get("max_entries") or 0) <= 0:
49
+ raise ValueError(f"{SPEC}: caps.max_bytes and caps.max_entries are positive")
50
+ if "oneOf" not in schema:
51
+ raise ValueError(f"{SCHEMA}: one of the three lines")
52
+ return spec, schema
53
+
54
+
55
+ def _s(value: Any) -> str:
56
+ return json.dumps(str(value or ""), ensure_ascii=False)
57
+
58
+
59
+ def generate_python_code(spec: dict[str, Any], schema: dict[str, Any]) -> str:
60
+ rules = spec["redaction_rules"]
61
+ lines = [
62
+ "# Copyright (c) 2025-2026 Datalayer, Inc.",
63
+ "# Distributed under the terms of the Modified BSD License.",
64
+ '"""',
65
+ "Session file format (MH-12).",
66
+ "",
67
+ "The datalayer-session/1 JSONL file: its caps, the states, the entry kinds,",
68
+ "the redaction rules and the refusal sentences, as agentspecs says them.",
69
+ "",
70
+ "This file is AUTO-GENERATED from YAML specifications.",
71
+ "DO NOT EDIT MANUALLY - run 'make specs' to regenerate.",
72
+ '"""',
73
+ "",
74
+ "import json",
75
+ "from typing import Any, Dict, Tuple",
76
+ "",
77
+ "#: The format: what a file's first line says.",
78
+ f"SESSION_FILE_FORMAT = {_s(spec['format'])}",
79
+ "",
80
+ f"SESSION_FILE_MEDIA_TYPE = {_s(spec['media_type'])}",
81
+ f"SESSION_FILE_EXTENSION = {_s(spec['extension'])}",
82
+ "",
83
+ "#: A file over either is refused with its counts.",
84
+ f"SESSION_FILE_MAX_BYTES = {int(spec['caps']['max_bytes'])}",
85
+ f"SESSION_FILE_MAX_ENTRIES = {int(spec['caps']['max_entries'])}",
86
+ "",
87
+ "#: A session's state, as the record says it.",
88
+ "SESSION_STATES: Tuple[str, ...] = ("
89
+ + "".join(f"{_s(state)}, " for state in spec["states"])
90
+ + ")",
91
+ "",
92
+ "#: The kinds an entry line may carry: the record's, and the session's audit rows.",
93
+ "SESSION_ENTRY_KINDS: Tuple[str, ...] = (",
94
+ *[f" {_s(kind)}," for kind in spec["entry_kinds"]],
95
+ ")",
96
+ "",
97
+ "#: The redaction rules applied at export, by id, each with what it does.",
98
+ "SESSION_REDACTION_RULES: Dict[str, str] = {",
99
+ *[f" {_s(rule['id'])}: {_s(rule['description'])}," for rule in rules],
100
+ "}",
101
+ "",
102
+ "#: Said, word for word, by whoever refuses a file; `{…}` are filled in.",
103
+ "SESSION_FILE_REFUSALS: Dict[str, str] = {",
104
+ *[
105
+ f" {_s(name)}: {_s(sentence)},"
106
+ for name, sentence in spec["refusals"].items()
107
+ ],
108
+ "}",
109
+ "",
110
+ "",
111
+ "def session_file_refusal(name: str, **facts: Any) -> str:",
112
+ ' """The spec\'s sentence for a refusal, its facts filled in."""',
113
+ " return SESSION_FILE_REFUSALS[name].format(**facts)",
114
+ "",
115
+ "",
116
+ "#: The JSON Schema of one line of the file: the session, the team session or an entry.",
117
+ "SESSION_FILE_SCHEMA: Dict[str, Any] = json.loads(",
118
+ " "
119
+ + json.dumps(
120
+ json.dumps(schema, sort_keys=True, ensure_ascii=False), ensure_ascii=False
121
+ ),
122
+ ")",
123
+ "",
124
+ ]
125
+ return "\n".join(lines)
126
+
127
+
128
+ def generate_typescript_code(spec: dict[str, Any], schema: dict[str, Any]) -> str:
129
+ rules = spec["redaction_rules"]
130
+ kinds = spec["entry_kinds"]
131
+ lines = [
132
+ "/*",
133
+ " * Copyright (c) 2025-2026 Datalayer, Inc.",
134
+ " * Distributed under the terms of the Modified BSD License.",
135
+ " */",
136
+ "",
137
+ "/**",
138
+ " * Session file format (MH-12).",
139
+ " *",
140
+ " * The datalayer-session/1 JSONL file: its caps, the states, the entry kinds,",
141
+ " * the redaction rules and the refusal sentences, as agentspecs says them.",
142
+ " *",
143
+ " * This file is AUTO-GENERATED from YAML specifications.",
144
+ " * DO NOT EDIT MANUALLY - run 'make specs' to regenerate.",
145
+ " */",
146
+ "",
147
+ "/** The format: what a file's first line says. */",
148
+ f"export const SESSION_FILE_FORMAT = {_s(spec['format'])};",
149
+ f"export const SESSION_FILE_MEDIA_TYPE = {_s(spec['media_type'])};",
150
+ f"export const SESSION_FILE_EXTENSION = {_s(spec['extension'])};",
151
+ "",
152
+ "/** A file over either is refused with its counts. */",
153
+ f"export const SESSION_FILE_MAX_BYTES = {int(spec['caps']['max_bytes'])};",
154
+ f"export const SESSION_FILE_MAX_ENTRIES = {int(spec['caps']['max_entries'])};",
155
+ "",
156
+ "/** A session's state, as the record says it. */",
157
+ f"export const SESSION_STATES = {json.dumps(list(spec['states']))} as const;",
158
+ "export type SessionState = (typeof SESSION_STATES)[number];",
159
+ "",
160
+ "/** The kinds an entry line may carry: the record's, and the session's audit rows. */",
161
+ "export const SESSION_ENTRY_KINDS = [",
162
+ *[f" {_s(kind)}," for kind in kinds],
163
+ "] as const;",
164
+ "export type SessionEntryKind = (typeof SESSION_ENTRY_KINDS)[number];",
165
+ "",
166
+ "/** The redaction rules applied at export, by id, each with what it does. */",
167
+ "export const SESSION_REDACTION_RULES: Record<string, string> = {",
168
+ *[f" {_s(rule['id'])}: {_s(rule['description'])}," for rule in rules],
169
+ "};",
170
+ "",
171
+ "/** Said, word for word, by whoever refuses a file; `{…}` are filled in. */",
172
+ "export const SESSION_FILE_REFUSALS: Record<string, string> = {",
173
+ *[
174
+ f" {_s(name)}: {_s(sentence)},"
175
+ for name, sentence in spec["refusals"].items()
176
+ ],
177
+ "};",
178
+ "",
179
+ "/** The spec's sentence for a refusal, its facts filled in. */",
180
+ "export function sessionFileRefusal(",
181
+ " name: string,",
182
+ " facts: Record<string, string | number> = {},",
183
+ "): string {",
184
+ " return SESSION_FILE_REFUSALS[name].replace(",
185
+ " /\\{(\\w+)(?:!r)?\\}/g,",
186
+ " (whole, key) =>",
187
+ " key in facts",
188
+ " ? whole.endsWith('!r}')",
189
+ ' ? JSON.stringify(String(facts[key])).replace(/^"|"$/g, "\'")',
190
+ " : String(facts[key])",
191
+ " : whole,",
192
+ " );",
193
+ "}",
194
+ "",
195
+ "/** Where a session came from. */",
196
+ "export interface SessionLineage {",
197
+ " forkedFrom: { uid: string; atTurn: number } | null;",
198
+ " importedFrom: {",
199
+ " digest: string;",
200
+ " exportedAt: string;",
201
+ " exportedBy: string;",
202
+ " } | null;",
203
+ "}",
204
+ "",
205
+ "/** The first line of a session file: the session. */",
206
+ "export interface SessionLine {",
207
+ " record_type: 'session';",
208
+ " format: typeof SESSION_FILE_FORMAT;",
209
+ " uid: string;",
210
+ " app: { id: string; version: number };",
211
+ " agent: string;",
212
+ " harness: string | null;",
213
+ " owner: { uid: string };",
214
+ " state: SessionState;",
215
+ " turns: number;",
216
+ " title: string;",
217
+ " archived: boolean;",
218
+ " lineage: {",
219
+ " forked_from: { uid: string; at_turn: number } | null;",
220
+ " imported_from: {",
221
+ " digest: string;",
222
+ " exported_at: string;",
223
+ " exported_by: string;",
224
+ " } | null;",
225
+ " };",
226
+ " kinds: string[];",
227
+ " entries: number;",
228
+ " exported_at: string;",
229
+ " exported_by: { uid: string };",
230
+ " redactions: number;",
231
+ "}",
232
+ "",
233
+ "/** One entry of the record, as the record holds it, redacted. */",
234
+ "export interface SessionEntryLine {",
235
+ " record_type: 'entry';",
236
+ " kind: SessionEntryKind;",
237
+ " at: string;",
238
+ " summary?: string;",
239
+ " payload?: Record<string, unknown>;",
240
+ "}",
241
+ "",
242
+ "/** The first line of a team session's file: the run; each seat's session follows. */",
243
+ "export interface TeamSessionLine {",
244
+ " record_type: 'team_session';",
245
+ " format: typeof SESSION_FILE_FORMAT;",
246
+ " execution_id: string;",
247
+ " team: { id: string; version: string };",
248
+ " owner: { uid: string };",
249
+ " state: SessionState;",
250
+ " seats: {",
251
+ " id: string;",
252
+ " session_uid: string;",
253
+ " agent: string;",
254
+ " harness: string | null;",
255
+ " }[];",
256
+ " lineage: {",
257
+ " forked_from: { execution_id: string } | null;",
258
+ " imported_from: {",
259
+ " digest: string;",
260
+ " exported_at: string;",
261
+ " exported_by: string;",
262
+ " } | null;",
263
+ " };",
264
+ " exported_at: string;",
265
+ " exported_by: { uid: string };",
266
+ " redactions: number;",
267
+ "}",
268
+ "",
269
+ "export type SessionFileLine = SessionLine | SessionEntryLine | TeamSessionLine;",
270
+ "",
271
+ "/** The JSON Schema of one line of the file. */",
272
+ "export const SESSION_FILE_SCHEMA: Record<string, unknown> = "
273
+ + json.dumps(schema, indent=2, sort_keys=True, ensure_ascii=False)
274
+ + ";",
275
+ "",
276
+ ]
277
+ return "\n".join(lines)
278
+
279
+
280
+ def main() -> None:
281
+ parser = argparse.ArgumentParser(description=__doc__)
282
+ parser.add_argument("--specs-dir", type=Path, required=True)
283
+ parser.add_argument("--python-output", type=Path, required=True)
284
+ parser.add_argument("--typescript-output", type=Path, required=True)
285
+ args = parser.parse_args()
286
+ spec, schema = load_spec(args.specs_dir)
287
+ args.python_output.write_text(generate_python_code(spec, schema))
288
+ args.typescript_output.write_text(generate_typescript_code(spec, schema))
289
+ print(
290
+ f"Generated the session file format {spec['format']}: "
291
+ f"{args.python_output}, {args.typescript_output}"
292
+ )
293
+
294
+
295
+ if __name__ == "__main__":
296
+ main()
@@ -1,32 +0,0 @@
1
- import{a5 as N,fi as So,r as o,j as t,fj as yo,fk as Co,ch as Mn,B as p,H as ht,T as H,v as Q,cN as _t,eN as Dt,fl as ue,cH as bt,y as wo,fm as ko,fn as jo,em as Io,fo as Eo,a_ as To,fp as Ro,ee as Bn,ec as Ao,ef as Gt,fq as Mo,fr as Po,fs as Uo,ft as Lo,fu as Fo,fv as Oo,dm as $o,bh as zo,fw as _o,fx as No,fy as Bo,fz as Vo,fA as Ho,fB as Wo,a0 as Nt,fC as Do,fD as Go,fE as Ko,fF as Yo,fG as qo,fH as Jo,fI as Qo,fJ as Xo,fK as Zo,fL as es,fM as ts,fN as ns,fO as os,fP as ss,fQ as as,fR as is,fS as rs,fT as ls,fU as cs,fV as ds,fW as tt,fX as us,fY as fs,fZ as ps,f_ as ms,f$ as Pn,g0 as gs,g1 as Oe,g2 as hs,g3 as bs,bi as xt,g4 as xs,g5 as vs,g6 as Un,g7 as Ss,g8 as ys,g9 as Cs,ga as ws,eV as ks,gb as Bt,gc as je,gd as js,ge as Is,gf as Es,gg as Ln,gh as Ts,gi as Fn,gj as Rs,gk as As,gl as Ms,gm as Ps,gn as Us,go as Ls,gp as Fs,gq as Os,gr as $s,gs as zs,gt as vt,gu as _s,gv as Ns,gw as Bs,I as Vs,gx as Hs,gy as Ws,gz as On,gA as Ds,gB as Gs,gC as Ks,gD as Kt,gE as Ys,gF as qs,eD as Vt,gG as Js,gH as Qs}from"../datalayer-app-main.js";import{S as Xs,E as Zs,a as ea}from"./SignInIcon-B9ZNyM4_.js";import{F as ta,a as na,b as oa}from"./LinkedInGreyIcon-BoWXE-HS.js";function Vn(){const n=N(So);return o.useMemo(()=>n.map(a=>a.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"}},$n=()=>{if(typeof document>"u")return"";const n=document.getElementById("datalayer-config-data");if(!n?.textContent)return"";try{const a=JSON.parse(n.textContent);return String(a?.iamUrl||"").replace(/\/$/,"")}catch{return""}},sa=(n,a="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 a},aa=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
- `,ia=({onSignIn:n,onApiKeySignIn:a,loginUrl:l,name:i,title:u="Datalayer OTEL",description:x="Sign in to access the observability dashboard.",icon:y,leadingIcon:L=t.jsx(Io,{size:24}),github:W=!1,google:U=!1,linkedin:f=!1,apiKey:St=!1,signUp:oe=!0,socialSignInNavigationTarget:Ie,asDoc:g=!1,fillHeight:fe=!0,hideHero:D=!1,calloutTitle:w,calloutDescription:$e,passwordToggleLabel:yt="Sign in with a password",signUpTitle:Yt="Don't have an account?",signUpDescription:pe="Create a free Datalayer account with your email address.",signUpLabel:qt="Sign up with email",signUpHref:G="https://datalayer.ai/signup",onSignUp:ze,forgotPasswordHref:X="/password",forgotPasswordLabel:Z="Forgot password?",showForgotPassword:nt=!0,socialButtonMarginTop:me=3,actionButtonMaxWidth:se=320})=>{const h=g&&!D,ot=i??(g&&u==="Datalayer OTEL"?"Datalayer Sign In":u),st=y??(g?t.jsx(Xs,{size:24}):L),ge=o.useMemo(()=>{if(l)return l;const c=$n();return c?`${c}/api/iam/v1/login`:"/api/iam/v1/login"},[l]),[K,Y]=o.useState(""),[he,Ee]=o.useState(""),[at,Ct]=o.useState(!1),[Te,wt]=o.useState(!1),[k,q]=o.useState(!1),[ae,_e]=o.useState(!1),[Re,it]=o.useState(null),[F,Ne]=o.useState(null),[be,kt]=o.useState(""),[Be,Ae]=o.useState(null),[Ve,B]=o.useState(null),{enqueueToast:ie}=yo(),[re,He]=o.useState(!1),[le,ce]=o.useState(""),We=o.useRef(null),xe=o.useCallback(c=>Co()?Mn.URLExt.join(Mn.PageConfig.getBaseUrl(),c.oauth2CallbackServerRoute):`${window.location.protocol}//${window.location.hostname}${window.location.port?`:${window.location.port}`:""}${c.oauth2CallbackUIRoute}`,[]),C=o.useMemo(()=>{if(typeof window>"u")return"/";const c=`${window.location.pathname}${window.location.search}${window.location.hash}`;return c.startsWith("/")?c:"/"},[]),ve=o.useCallback(async c=>{if(!ae){B(null),it(c.name),_e(!0);try{const j=$n(),M=new URLSearchParams({provider:c.name,callback_uri:xe(c)}),$=Ie===void 0?void 0:String(Ie||"").trim(),Pe=$===void 0?C&&C!=="/"?C:void 0:$&&$.startsWith("/")&&!$.startsWith("//")?$:void 0;Pe&&M.set("post_auth_redirect",Pe);const R=`${j||""}/api/iam/v1/oauth2/authz/url?${M.toString()}`,v=await fetch(R),te=await v.json(),S=te?.autorization_url;if(!v.ok||!S)throw new Error(te?.message||"Unable to start social sign-in.");window.location.assign(S)}catch(j){const M=sa(j);B(M),ie(M,{variant:"error"}),it(null),_e(!1)}}},[xe,C,ie,ae,Ie]);o.useEffect(()=>{re&&We.current?.focus()},[re]);const V=o.useCallback(()=>{He(!1),ce("")},[]),ee=o.useCallback(()=>{!le.trim()||!a||(a(le.trim()),V())},[le,a,V]),rt=o.useCallback(()=>{if(ze){ze();return}window.location.assign(G)},[ze,G]),lt=o.useCallback(()=>{if(X){if(X.startsWith("http://")||X.startsWith("https://")){window.open(X,"_blank","noopener,noreferrer");return}window.location.assign(X)}},[X]),Me=o.useCallback(async()=>{if(!(g||!K||!he||k)){q(!0),B(null);try{const c=await fetch(ge,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({handle:K,password:he})});if(!c.ok)throw new Error(`HTTP ${c.status}`);const j=await c.json();if(j.success&&j.token){const M=String(j?.user?.id||j?.user?.uid||"").trim();if(!!j?.user?.mfaUrl&&M){Ne(M),Ae(j.token),B(null);return}n&&n(j.token,K)}else B(j.message||"Invalid username or password.")}catch(c){B(c instanceof Error?c.message:String(c))}finally{q(!1)}}},[g,K,he,k,ge,n]),O=o.useCallback(async()=>{if(!(g||k||!F||!be.trim()||!Be)){q(!0),B(null);try{const c=new URL(ge,window.location.origin),j=c.pathname.endsWith("/api/iam/v1/login")?c.href.replace(/\/api\/iam\/v1\/login$/,""):`${c.origin}`,M=await fetch(`${j}/api/iam/v1/users/${F}/mfa/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userUid:F,code:be.trim()})}),$=await M.json();if(!M.ok||!$?.success)throw new Error($?.message||"Failed to validate your MFA code.");n&&n(Be,K)}catch(c){const j=c instanceof Error?c.message:String(c);B(j),ie(j,{variant:"error"})}finally{q(!1)}}},[g,ie,K,k,ge,be,Be,F,n]),De=o.useCallback(c=>{c.key==="Enter"&&(F?O():Me())},[F,Me,O]),Ge=ae||k||g;return t.jsxs(p,{className:"signin-input-theme-scope",display:"flex",alignItems:D||h||!fe?"flex-start":"center",justifyContent:"center",minHeight:D||h||!fe?"auto":"100vh",bg:D?"transparent":"canvas.default",color:"fg.default",py:D?0:h?2:4,children:[t.jsx(aa,{}),t.jsxs(p,{width:"100%",maxWidth:440,p:0,children:[!D&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{display:"flex",alignItems:"center",gap:2,mb:h?2:3,justifyContent:"center",children:[st,t.jsx(ht,{sx:{fontSize:3},children:ot})]}),t.jsx(H,{as:"p",sx:{fontSize:1,color:"fg.muted",mb:h?2:3,textAlign:"center"},children:x})]}),(w||$e)&&t.jsxs(p,{mb:3,textAlign:"center",children:[w&&t.jsx(ht,{as:"h3",sx:{fontSize:2,mb:1},children:w}),$e&&t.jsx(H,{sx:{color:"fg.muted",fontSize:1},children:$e})]}),!F&&(W||U||f)&&t.jsxs(t.Fragment,{children:[W&&t.jsx(Q,{block:!0,size:"large",leadingVisual:Re==="github"?()=>t.jsx(_t,{size:"small"}):ta,disabled:Ge,onClick:()=>ve(Ht.github),sx:{mt:me,maxWidth:se,mx:"auto"},children:"Sign in with GitHub"}),U&&t.jsx(Q,{block:!0,size:"large",leadingVisual:Re==="google"?()=>t.jsx(_t,{size:"small"}):na,disabled:Ge,onClick:()=>ve(Ht.google),sx:{mt:me,maxWidth:se,mx:"auto"},children:"Sign in with Google"}),f&&t.jsx(Q,{block:!0,size:"large",leadingVisual:Re==="linkedin"?()=>t.jsx(_t,{size:"small"}):oa,disabled:Ge,onClick:()=>ve(Ht.linkedin),sx:{mt:me,maxWidth:se,mx:"auto"},children:"Sign in with LinkedIn"})]}),!F&&!at&&t.jsx(p,{mt:3,display:"flex",justifyContent:"center",children:t.jsx(Q,{leadingVisual:Dt,size:"large",block:!0,disabled:g||k||ae,onClick:()=>Ct(!0),sx:{maxWidth:se,mx:"auto"},children:yt})}),!F&&at&&t.jsxs(p,{mt:4,children:[t.jsxs(ue,{required:!0,sx:{mb:3},children:[t.jsx(ue.Label,{children:"Username"}),t.jsx(bt,{autoFocus:!0,block:!0,placeholder:"Your username",value:K,disabled:k||g,onChange:c=>Y(c.target.value),onKeyDown:De})]}),t.jsxs(ue,{required:!0,sx:{mb:3},children:[t.jsx(ue.Label,{children:"Password"}),t.jsx(bt,{block:!0,placeholder:"Your password",type:Te?"text":"password",value:he,disabled:k||g,onChange:c=>Ee(c.target.value),onKeyDown:De,trailingAction:t.jsx(bt.Action,{onClick:()=>wt(!Te),disabled:k||g,icon:Te?Zs:ea,"aria-label":Te?"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||g||!K||!he,onClick:Me,children:k?"Signing in…":"Sign In"}),nt&&t.jsx(wo,{as:"button",sx:{fontSize:1,cursor:g?"not-allowed":"pointer",background:"none",border:"none",opacity:g?.6:1},onClick:()=>{g||k||lt()},children:Z})]})]}),F&&t.jsxs(t.Fragment,{children:[t.jsxs(ue,{required:!0,sx:{mb:3,mt:2},children:[t.jsx(ue.Label,{children:"MFA Code"}),t.jsx(bt,{autoFocus:!0,block:!0,placeholder:"Your MFA code",value:be,disabled:k||g,onChange:c=>kt(c.target.value),onKeyDown:De})]}),t.jsx(Q,{variant:"primary",block:!0,disabled:k||g||!be.trim(),onClick:O,sx:{maxWidth:se,mx:"auto"},children:k?"Validating…":"Validate MFA Code"})]}),Ve&&t.jsx(H,{sx:{color:"danger.fg",fontSize:1,mt:3,display:"block"},children:Ve}),oe&&t.jsxs(p,{mt:4,pt:4,textAlign:"center",borderTop:"1px solid",borderColor:"border.muted",children:[t.jsx(ht,{as:"h3",sx:{fontSize:2,mb:2},children:Yt}),t.jsx(H,{as:"p",sx:{color:"fg.muted",fontSize:1,mb:3},children:pe}),t.jsx(p,{display:"flex",justifyContent:"center",children:t.jsx(Q,{variant:"primary",size:"large",leadingVisual:ko,disabled:g||k,onClick:rt,children:qt})})]}),St&&a&&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(H,{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:g||k||ae,onClick:()=>He(!0),sx:{maxWidth:se,mx:"auto"},children:"Sign in with an API Key"}),re&&t.jsx(p,{role:"dialog","aria-modal":"true","aria-labelledby":"signin-api-key-title",onKeyDown:c=>{c.key==="Escape"&&V()},onClick:V,position:"fixed",inset:0,zIndex:200,p:3,bg:"canvas.backdrop",display:"flex",alignItems:"center",justifyContent:"center",children:t.jsxs(p,{as:"form",onClick:c=>c.stopPropagation(),onSubmit:c=>{c.preventDefault(),ee()},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(ht,{id:"signin-api-key-title",sx:{fontSize:2,mb:2},children:"Enter your API Key"}),t.jsxs(ue,{required:!0,children:[t.jsx(ue.Label,{children:"API Key"}),t.jsx(jo,{block:!0,required:!0,autoFocus:!0,placeholder:"Paste your API key here",value:le,onInput:c=>ce(c.currentTarget.value),ref:We})]}),t.jsxs(p,{mt:3,display:"flex",justifyContent:"flex-end",gap:2,children:[t.jsx(Q,{type:"button",onClick:V,children:"Cancel"}),t.jsx(Q,{type:"submit",variant:"primary",disabled:!le.trim(),children:"Authenticate"})]})]})})]})]})]})};function ra(n){const{agentId:a,instructions:l,model:i,frontendTools:u,inference:x,subagents:y,sharing:L,onSubagentEvent:W,modeEffect:U}=n;return{type:"browser-vercel-ai",endpoint:"",agentId:a,enableConfigQuery:!1,options:{instructions:l,model:i,frontendTools:u,inference:x,subagents:y,sharing:L,onSubagentEvent:W,modeEffect:U}}}const zn=To((n,a)=>({pending:void 0,suggest:(l,i)=>{const u=l.trim();u&&n({pending:{text:u,submit:i?.submit??!1,nonce:(a().pending?.nonce??0)+1}})},consume:()=>n({pending:void 0})})),la=({state:n})=>Ro[n];function ca({agentName:n,sandboxStillRuns:a=!1,temporary:l=!0,onSignedIn:i,onSignUp:u}){const{configuration:x}=Bn(),y=o.useCallback(L=>{Ao.getState().checkIAMToken(L),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(H,{sx:{fontSize:2,fontWeight:"semibold",color:"fg.default"},children:l?"This demo runs on a shared key":"Your key has expired"})]}),t.jsxs(H,{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.`,a?" Your notebook is still running in this page.":""]}),t.jsx(ia,{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:x?.iamUrl?`${x.iamUrl}/api/iam/v1/login`:void 0,onSignIn:y,onSignUp:u})]})})}const da="https://r1.datalayer.run";function ua(n=!0){const{configuration:a}=Bn(),l=Gt(L=>L.token),i=a?.aiInferenceUrl||da,u=Mo(i,n&&!l),x=l||u.token,y=o.useMemo(()=>({inferenceUrl:i,token:x||void 0}),[i,x]);return{inference:y,needsSignIn:Po(y),anonymous:u,inferenceUrl:i}}const fa={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 _n(n){const a=n?.subagents;if(!a)return[];const l=(a.subagents??[]).map(i=>{const u=i.ref?Uo(i.ref):void 0;return{name:i.name,description:i.description||u?.description||i.name,instructions:i.instructions??u?.systemPrompt,model:i.model??u?.model??a.defaultModel,icon:u?.icon}});return a.includeGeneralPurpose?[...l,fa]:l}function pa(n){return n.replace(/^datalayer_/,"").replace(/_lexical$/,"")}function ma(n){const a=pa(n);return/^executeCodeIn(Notebook|Document)$/.test(a)||/^(read|list)[A-Z]/.test(a)}function ga(n,a){return n.filter(l=>a?.has(l.name)||ma(l.name))}function ha(n,a){const l=i=>a&&i.value.id===`${a}-tools`?0:i.value.id==="notebook-tools"?1:2;return n.map((i,u)=>({entry:i,index:u,rank:l(i)})).sort((i,u)=>i.rank-u.rank||i.index-u.index).map(i=>i.entry)}function ba(n,a,l){if(!l||!n.endsWith("-tools"))return!1;const i=n.slice(0,-6);return a.has(i)&&i!==l}const xa={type:"object",properties:{}};function va(n,a){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??xa,location:"frontend",handler:async u=>{if(!a)throw new Error(`${i.name}: the ${n.plugin??n.id} plugin is not mounted on this page.`);const x=Object.keys(u??{}).length>0?u:void 0,y=await a.executeCommand(i.command,x);return y===void 0?{ok:!0,command:i.command,argument:x}:y}}))}function Hn(n,a){return n.flatMap(l=>va(l,a))}function Sa(){const n=Lo(),a=Vn();return o.useMemo(()=>Hn(a,n),[a,n])}function ya(n){const a=n?.app_instance;if(!a||typeof a!="object")return"";const l=a.deployment_uid;return typeof l=="string"?l.trim():""}function Ca(n,a,l){return n||!a?n:{id:l,messages:[]}}const wa="var(--theme-accent)";function Wn({face:n,size:a}){return typeof n=="string"?t.jsx(Fo,{emoji:n,size:a,label:""}):t.jsx(t.Fragment,{children:n})}function ka({face:n,size:a,state:l}){const i=l==="thinking"||l==="working",u=l==="paused";return t.jsxs(p,{as:"span","aria-hidden":!0,"data-presence":l,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:a+8,height:a+8,flexShrink:0,fontSize:a,lineHeight:1,children:[t.jsx(p,{as:"span",position:"absolute",inset:0,borderRadius:"50%",boxShadow:u?"none":`0 0 0 2px ${wa}`,border:u?"2px dashed":"none",borderColor:"border.default",opacity:i||l==="waiting"||u?.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:u?.55:1,filter:u?"grayscale(0.6)":"none",transition:"opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)",children:t.jsx(Wn,{face:n,size:a})})]})}function ja({state:n}){return t.jsx(H,{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:la({state:n})})}const Ia=Kt(void 0),Ea=Kt(""),Ta=Kt({}),ne="",Ra=1400,Nn=parseInt(Js["--loop-face-large"],10);function La({workspace:n}){const a=Oo(),l=$o(),i=o.useRef(null),{setViewControls:u}=n,x=o.useRef(n.setThread);x.current=n.setThread;const y=o.useCallback(()=>{const e=i.current?.thread();return e&&x.current?.(e),e},[]),[L,W]=o.useState(null),U=zo(),f=U.getConfig(_o),St=f?.placeholder||a.placeholder,oe=f?.defaultSurface??"notebook",Ie=U.getConfig(No),[g,fe]=o.useState(ne),D=o.useRef(!1),w=N(Bo),$e=N(Vo),yt=N(Ho),pe=N(Wo)[0]?.value,G=Nt(pe?.promptStance??Ia)??pe?.prompt,ze=N(Do),X=Go(ze[0]?.value),Z=o.useRef(X);Z.current=X;const nt=o.useRef(""),me=N(Ko),se=o.useMemo(()=>Yo(()=>me.reduce((e,r)=>({...e,...r.value.extras.value}),{})),[me]),h=Nt(me.length>0?se:Ta),ot=o.useRef(new Set),st=qo(Ys,n),ge=!st.allowed,K=ge?st.reason??"Chat is unavailable for this sandbox":void 0,[Y,he]=o.useState(!1),[Ee,at]=o.useState(!1),[Ct,Te]=o.useState(!1),[wt,k]=o.useState({open:!1,pendingApproval:!1}),q=Jo(Y,wt,f?.presence?.paused===!0),ae=f?.presence?.onPresence;o.useEffect(()=>{ae?.(q),Z.current?.setPresence(q)},[ae,q]);const _e=o.useRef(f?.presence?.onSaying);_e.current=f?.presence?.onSaying;const Re=o.useRef({answering:!1}),it=o.useCallback(e=>{i.current=e,at(!!e)},[]),F=o.useCallback(e=>{const{open:r,pendingApproval:s}=Qo(e);k(ke=>ke.open===r&&ke.pendingApproval===s?ke:{open:r,pendingApproval:s});const m={saying:Zo(e),answering:Xo(e)},d=Re.current;(d.saying?.id!==m.saying?.id||d.saying?.text!==m.saying?.text||d.answering!==m.answering)&&(Re.current=m,_e.current?.(m));const _=Z.current;if(!_)return;_.items(e);const A=new Set(["complete","completed","done","error","failed","cancelled","canceled","rejected","denied","stopped"]),J={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 b;for(let ke=e.length-1;ke>=0;ke-=1){const gt=e[ke];if(typeof gt.toolName=="string"&&gt.toolCallId){A.has(String(gt.status).toLowerCase())||(b=gt);break}}if(!b){_.activity(void 0);return}const we=b.toolName.toLowerCase().replace(/^datalayer_/,"").replace(/_lexical$/,"").replace(/[^a-z]/g,""),vo=J[we]??`using ${b.toolName}`;_.activity(`${nt.current||"The agent"} is ${vo}…`)},[]),Ne=o.useRef(h);Ne.current=h;const be=o.useCallback(e=>{no(e),Z.current?.usage(e),Ne.current.onUsage?.(e)},[]),kt=o.useCallback(e=>{he(e),e||Z.current?.end("done")},[]),Be=o.useCallback(e=>{const r=Z.current;if(!r)return;let s=-1;for(let d=e.length-1;d>=0;d-=1)if(e[d].role==="user"){s=d;break}const m=e.slice(s+1).filter(d=>d.role==="assistant").map(es).filter(d=>d.trim().length>0).join(`
29
-
30
- `);r.assistant(m)},[]),Ae=o.useRef([]),Ve=o.useRef(!1),B=o.useRef(void 0),ie=o.useRef(void 0),re=o.useRef(void 0),He=N(ts),le=o.useRef(He);le.current=He;const ce=o.useCallback((e,r)=>{if(ie.current)return ie.current;const s=re.current;re.current=void 0;const m=ns(le.current.map(A=>A.value),s?{...r??{},voice:s}:r),d=m?.loop;if(Ve.current&&d?.files&&d.files.length>0){const A=B.current;if(!A)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 J;try{J=d.files.map(b=>({file:ss(String(b.name??"")),base64:os(String(b.data_url??""))}))}catch(b){return b instanceof Error?b.message:String(b)}A.execute(as(J)).then(b=>{if(!b.success){W(`The files could not be put in the sandbox: ${b.error??"it failed"}.`);return}ce(`${e}
31
-
32
- ${is(J.map(we=>we.file))}`,{...m,loop:Object.fromEntries(Object.entries(d).filter(([we])=>we!=="files"))})});return}Z.current?.begin(e,y());const _=i.current?.send;if(!_){Ae.current.push([e,m]);return}_(e,m)},[y]);o.useEffect(()=>{u(Ee?{busy:Y,stop:i.current?.stop,newChat:i.current?.newChat,send:ce}:null)},[Y,Ee,u,ce]),o.useEffect(()=>()=>u(null),[u]),o.useEffect(()=>n.prompts.subscribe(ce),[n.prompts,ce]),o.useEffect(()=>{if(!Ee||Ae.current.length===0)return;const e=Ae.current.splice(0,Ae.current.length);for(const[r,s]of e)y(),i.current?.send(r,s)},[Ee,y]);const We=o.useRef(!1),xe=o.useCallback(async e=>{W(null);const r=await rs(Ne.current,e);if(r){r.sent?Qe(""):W(r.refused);return}We.current||(We.current=!0,Ie?.firstPromptHook?.());const s=await n.submit(e);if(!s.handled){W(s.reason??null);return}Qe(""),s.result?.content&&W(s.result.content)},[n,Ie?.firstPromptHook]),C=o.useMemo(()=>w.find(e=>e.value.surfaceId===g)?.value,[w,g]),ve=o.useCallback(e=>{D.current=!0,fe(e)},[]);o.useEffect(()=>ls(ve),[ve]),o.useEffect(()=>{cs(w.map(e=>e.value.surfaceId))},[w]),o.useEffect(()=>{ds(g&&g!==ne?g:Qs)},[g]);const V=o.useMemo(()=>oe===ne||oe==="none"?void 0:w.find(e=>e.value.surfaceId===oe),[w,oe]);o.useEffect(()=>{D.current||!V||tt(V.value,n)&&fe(oe)},[V,n,oe]);const[ee,rt]=o.useState(null),lt=o.useRef(null),Me=f?.fullScreenTopOffset??0,{fullScreen:O,usingApi:De,toggle:Ge,topOffsetPx:c}=us(lt,{forceOverlay:!!Me,topOffset:Me}),[j,M]=o.useState(!1),$=o.useRef(!1);o.useEffect(()=>{!Y||$.current||O||($.current=!0,M(!0))},[Y,O]),o.useEffect(()=>{O&&M(!1)},[O]),o.useEffect(()=>{C&&!tt(C,n)&&(rt(C.surfaceId),fe(ne))},[C,n]);const Pe=o.useMemo(()=>{if(ee)return w.find(e=>e.value.surfaceId===ee)?.value;if(!D.current&&g===ne)return V?.value},[w,ee,g,V]);o.useEffect(()=>{if(!ee||g!==ne)return;const e=w.find(r=>r.value.surfaceId===ee);e&&tt(e.value,n)&&(rt(null),fe(ee))},[w,g,ee,n]);const I=n.agentId?.trim()||"default",R=fs(n.sandbox.target??"local");Ve.current=R;const v=ps(),te=Nt(v?.selected??Ea),S=v?.members.find(e=>e.id===te),Jt=N(ms)[0]?.value,jt=Jt?.specId,T=Pn(S?.specId??I)??(jt?Pn(jt):void 0),Ke=S?void 0:Jt,Qt=R&&!S?Ks(jt,T):void 0;nt.current=S?.name??T?.name??I;const Xt=N(gs),Zt=h.hiddenOpeners,en=h.hideOpeners,It=h.openers,Et=o.useMemo(()=>{if(en)return[];const e=new Set(Zt??[]),r=b=>e.size===0?b:b.filter(we=>!e.has(we.text));if(It)return r(It);const s=Xt.flatMap(b=>b.value.suggestions);if(s.length>0)return r(s);const m=r(T?.suggestions??[]),d=r(v?.team.suggestions??[]);if(d.length===0)return m;const _=new Set(d.map(b=>b.text)),A=v?.team.name??"Team",J=S?.name??T?.name??I;return[...d.map(b=>({...b,group:A})),...m.filter(b=>!_.has(b.text)).map(b=>({...b,group:J}))]},[Xt,v,T,S,I,Zt,en,It]),ct=o.useMemo(()=>Et.map(e=>({title:e.summary??e.text,message:e.message??e.text,group:e.group})),[Et]),Tt=Oe(T?.icon),z=f?.presence,Dn=Oe(v?.team.icon),tn=N(hs),dt=o.useMemo(()=>{const e=[],r=new Map,s=new Set,m=new Set(w.map(d=>d.value.surfaceId));for(const d of ha(tn,C?.surfaceId)){if(ba(d.value.id,m,C?.surfaceId))continue;let _;try{_=d.value.tools(n)}catch(A){console.warn(`[loop] frontend tools from '${d.plugin}' failed:`,A);continue}for(const A of _){const J=r.get(A.name);if(J){console.warn(`[loop] frontend tool '${A.name}' from '${d.plugin}' is shadowed by the one from '${J}'.`);continue}r.set(A.name,d.plugin),e.push(A),d.value.chatView&&s.add(A.name)}}for(const d of h.frontendTools??[])r.has(d.name)||(r.set(d.name,"chat-extras"),e.push(d),s.add(d.name));return C?e:ga(e,s)},[tn,n.surfaceId,n.agentId,h.frontendTools,C?.surfaceId,w]),Rt=Sa(),Ye=o.useMemo(()=>{if(Rt.length===0)return dt;const e=new Set(dt.map(r=>r.name));return[...dt,...Rt.filter(r=>!e.has(r.name))]},[dt,Rt]),nn=Vn(),At=h.agentToolBundles,Gn=o.useMemo(()=>{const e=h.frontendTools??[];if(!At?.length)return h.frontendTools;const r=Hn(nn.filter(m=>At.includes(m.id)),U),s=new Set(e.map(m=>m.name));return[...e,...r.filter(m=>!s.has(m.name))]},[h.frontendTools,At,nn,U]);B.current=R&&Ye.some(e=>e.name===bs)?U.getOutput(xt)?.sandbox:void 0;const E=xs(n.sandbox,n.serverUrl),on=N(vs),Kn=o.useMemo(()=>on.filter(e=>e.value.composer).map(e=>({name:e.value.name,description:e.value.description})),[on]),Yn=o.useMemo(()=>{if(!v||!S)return _n(T).map(s=>({name:s.name,description:s.description,icon:Oe(s.icon)}));const e=v.members.map(s=>({name:s.name,description:s.description,emoji:s.emoji,icon:Oe(s.icon),disabled:s.id===S.id,disabledReason:s.id===S.id?`You are already talking to ${s.name}`:void 0})),r=Un(v.team,S.id).filter(s=>!v.members.some(m=>m.name===s.name)).map(s=>({name:s.name,description:s.description,icon:Oe(s.icon)}));return[...e,...r]},[v,S,T]),{inference:sn,anonymous:qn}=ua(R),Jn=Gt(e=>e.user),Mt=R&&qn.status==="expired",an=!Jn,qe=Ss();ie.current=qe.disabled?qe.disableReason||"This conversation is closed here.":void 0;const Pt=E===void 0?ys(n.sandbox,a):void 0,Je=ge||Mt||!!Qt||!!Pt||qe.disabled,rn=Mt?an?a.demoKeyExpired:a.keyExpired:Qt??Pt??K??(qe.disabled?qe.disableReason:void 0),[Ut,Qe]=o.useState(""),[ln]=Cs(),Xe=o.useMemo(()=>f?.voice?ws(f.voice,ln):void 0,[f?.voice,ln]),[Qn,Xn]=o.useState(!1),[Zn,cn]=o.useState(),ut=Zn??Ke?.model??T?.model??n.model??"",Ue=ks(),dn=o.useRef(Ue),un=o.useRef(te),fn=o.useRef(Ue);fn.current=Ue,o.useEffect(()=>{un.current!==te&&(un.current=te,dn.current=fn.current,cn(void 0))},[te]);const eo=Ue&&Ue!==dn.current?Ue:null,[to,no]=o.useState(),oo=eo??to??null,so=Bt(je.inpromptMenu),pn=Bt(je.promptAction),mn=Bt(je.chatHeader),ao=o.useMemo(()=>v?.members.map(e=>({id:e.id,name:e.name,description:e.description,icon:Oe(e.icon)}))??[],[v]),Se=zn(e=>e.pending),[gn,io]=o.useState(0);o.useEffect(()=>js(()=>io(e=>e+1)),[]),o.useEffect(()=>{Se&&(Qe(Se.text),zn.getState().consume(),Se.submit&&xe(Se.text))},[Se]);const hn=U.getConfig(xt)?.datalayerCreatePayload,ye=!!(Ke?.createPayload?.app_spec||hn?.app_spec),Lt=ya(hn),ro=Gt(e=>e.token),Ft=U.getConfig(xt)?.datalayerVisitors,lo=Is(Ft),co=U.getConfig(xt)?.embedToken,Ce=Ft?lo.token:co||ro,uo=o.useMemo(()=>Es(f?.voice,Ce||void 0),[f?.voice,Ce]),de=!!(Lt||Ft);if(de&&!ye)throw new Error("A deployment’s page runs its application: its host gave no app_spec.");const[bn]=o.useState(Ln),P=o.useMemo(()=>Ca(f?.thread,Lt,bn),[f?.thread,Lt,bn]),[Le,xn]=o.useState(null),fo=!!(P?.fromRuntime&&Le?.given!==P.id);o.useEffect(()=>{if(!P?.fromRuntime||!ye||!E)return;let e=!0;return(async()=>{let r="";for(let s=0;s<4&&e;s+=1)try{const m=await Ts({agentBaseUrl:E,agentId:I,uid:P.id,token:Ce});e&&xn({given:P.id,thread:{...P,fromRuntime:!1,messages:m}});return}catch(m){r=m instanceof Error?m.message:String(m),await new Promise(d=>setTimeout(d,1500))}e&&xn({given:P.id,thread:{id:Ln(),messages:[],onStarted:P.onStarted},said:Fn.notOpened(r)})})(),()=>{e=!1}},[P?.id,P?.fromRuntime,ye,E,I,Ce]);const vn=P?.fromRuntime?Le?.given===P.id?Le.thread:void 0:P,Ot=o.useMemo(()=>R?ra({agentId:S?.specId??I,instructions:Rs(T,Ke?.instructions),model:ut||void 0,inference:sn,frontendTools:Ye,subagents:v&&S?Un(v.team,S.id):_n(T),sharing:v?.sharing,onSubagentEvent:e=>qs.getState().appendSubagentEvent(e),modeEffect:Ke?.modeEffect}):E!==void 0?{type:"ag-ui",endpoint:ye?`${E}/api/v1/apps/agents/${encodeURIComponent(I)}/ag-ui/`:`${E}/api/v1/ag-ui/${I}/`,...ye&&Ce?{authToken:Ce}:{},...ye?{uiSocket:`${E.replace(/^http/,"ws")}/api/v1/apps/ui`,uiFiles:`${E}/api/v1/apps/agents/${encodeURIComponent(I)}/files`,appSessions:`${E}/api/v1/apps/sessions`,...de?{ownRoutesOnly:!0}:{}}:{},agentId:I,configEndpoint:`${E}/api/v1/configure`,enableConfigQuery:!0}:void 0,[I,R,sn,S,Ye,v,T,Ke,ut,E,ye,Ce,de]),ft=As(!R,Ot?.type==="ag-ui"?Ot.configEndpoint:void 0,void 0,I),Ze=Ms(),pt=Ps(I),[Sn,$t]=o.useState(void 0),[po,mo]=o.useState(void 0);o.useEffect(()=>{if(R||E===void 0)return;const e=Us(E,I,de);if(!e){$t([]);return}let r=!1;return fetch(e).then(s=>s.ok?s.json():null).then(s=>{r||($t(s?Ls(s):[]),mo(s?Fs(s):void 0))}).catch(()=>{r||$t([])}),()=>{r=!0}},[E,I,R,de]);const go=o.useMemo(()=>Os(Sn,()=>Object.values($s).filter(e=>e.available&&zs(e)).map(e=>({id:e.id,name:e.name,provider:e.provider}))),[Sn]),yn=o.useMemo(()=>{const e=ft.data?.builtinTools??[],r=new Set(e.map(s=>s.name));return{runtime:e,frontend:Ye.filter(s=>!r.has(s.name)).map(s=>({id:s.name,name:s.name}))}},[ft.data?.builtinTools,Ye]),Cn=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(de)throw new Error("A deployment’s chat does not switch its runtime’s model.");cn(e),!(R||E===void 0)&&await fetch(`${E}/api/v1/configure/inference/provider`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({model:e})}).catch(()=>{})},[E,R,de]),wn=f?.promptPlacement==="bottom-chat",bo=f?.promptPlacement==="floating",Fe=f?.promptPlacement==="top",et=f?.hidePrompt===!0||h.hidePrompt===!0,xo={onSend:()=>{xe(Ut)},input:Ut,setInput:Qe,focusTrigger:Se||gn?(Se?.nonce??0)+gn:void 0,placement:bo||G==="floating"||G==="floating-top"||G==="floating-bottom"?"floating":"docked",floatingAnchor:G==="floating-top"?"top":"bottom",isLoading:Y,onStop:()=>n.viewControls.stop?.(),placeholder:rn??h.sendInstead?.says??St,typingSuggestions:Et.map(e=>e.text),suggestions:ct,disableInputPrompt:Je,connectionConfirmed:!Je,interim:Qn,padding:Fe||G==="floating-top"||G==="floating-bottom"||G==="docked-top"?2:3,promptVariant:"lexical",autoFocus:f?.autoFocusPrompt??!0,mentionableAgents:Yn,promptCommands:Kn,headerContent:so.length>0?t.jsx(vt,{slot:je.inpromptMenu,props:{workspace:n}}):void 0,footerExtras:pn.length>0||Xe&&Xe.input!=="off"?t.jsxs(t.Fragment,{children:[pn.length>0?t.jsx(vt,{slot:je.promptAction,props:{workspace:n}}):null,Xe&&Xe.input!=="off"?t.jsx(_s,{voice:Xe,input:Ut,setInput:Qe,disabled:Je,speaking:Ct,onStopSpeaking:()=>i.current?.stopSpeaking?.(),playbackLevel:()=>i.current?.voiceLevel?.()??0,running:Y,onStopRun:()=>(i.current?.interrupt??i.current?.stop)?.(),onInterrupted:()=>i.current?.markInterrupted(),onInterimChange:Xn,answers:!!(f?.voice?.output&&f.voice.output!=="off"&&f.voice.speechUrl),onSpoken:e=>{re.current=e},send:(e,r)=>{re.current=r,xe(e)}}):null]}):void 0,showAgentsMenu:!z,showInlineAgentsMenu:!1,agents:ao,selectedAgentId:te,onSelectAgent:e=>v?.select(e),showTokenUsage:h.showTokenUsage??f?.showTokenUsage??!0,showContextRing:!0,agentUsage:oo??void 0,showModelSelector:!z&&!de,models:go,decisions:po,selectedModel:ut,onModelSelect:e=>{ho(e)},showToolsMenu:!z,availableTools:yn.runtime,availableFrontendTools:yn.frontend,mcpServers:ft.data?.mcpServers??[],mcpStatusData:h.mcpStatusData??void 0,showSkillsMenu:!z,skills:Ze.data?.skills??[],skillsLoading:Ze.isLoading,enabledSkills:Cn,onToggleSkill:e=>Cn.has(e)?pt.disableSkill(e):pt.enableSkill(e),onToggleAllSkills:(e,r)=>e.forEach(s=>r?pt.enableSkill(s):pt.disableSkill(s)),codemodeEnabled:h.codemodeEnabled??!1,onToggleCodemode:h.onToggleCodemode,isA2AProtocol:!1,hasConfigData:!!ft.data,hasSkillsData:!!Ze.data},kn=$e[0]?.value.Component,zt=yt[0]?.value.Component,jn=!f?.hideHeader&&!!zt,mt=kn?t.jsx(kn,{workspace:n,composer:xo}):null,In=w.length>0&&f?.showSurfaceSelector!==!1?t.jsx(Aa,{surfaces:w.map(e=>e.value),active:C?.surfaceId??Pe?.surfaceId??ne,onChange:ve,workspace:n}):null,En=t.jsxs(t.Fragment,{children:[w.map(e=>{const r=e.value,s=C?.surfaceId===r.surfaceId;return s||ot.current.has(r.surfaceId)||tt(r,n)?(ot.current.add(r.surfaceId),t.jsx(p,{sx:s?{flex:"1 1 0",minWidth:0,minHeight:0}:{position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",zIndex:-1},children:t.jsx(Ns,{load:r.load,props:{surfaceId:r.surfaceId,workspace:n},fallback:t.jsxs(Wt,{children:["Loading ",r.title,"…"]}),errorFallback:d=>t.jsxs(Wt,{children:[r.title," failed to load: ",d.message]})})},r.surfaceId)):null}),!C&&Pe?t.jsx(p,{flex:"1 1 0",minWidth:0,minHeight:0,children:t.jsxs(Wt,{children:["Starting ",Pe.title,"…"]})}):null]}),Tn=t.jsx(t.Fragment,{children:t.jsxs(p,{flex:Fe&&C?"0 0 34%":"1 1 0",maxWidth:Fe&&C?460:void 0,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",borderLeft:C?"1px solid":void 0,borderColor:"border.default",position:"relative",children:[h.errorBanner?t.jsx(p,{flexShrink:0,px:3,py:2,fontSize:1,borderBottom:"1px solid",bg:h.errorBanner.variant==="warning"?"attention.subtle":"danger.subtle",color:h.errorBanner.variant==="warning"?"attention.fg":"danger.fg",borderColor:h.errorBanner.variant==="warning"?"attention.muted":"danger.muted",children:h.errorBanner.message}):null,Le?.said&&Le.given===P?.id?t.jsx(H,{as:"p",role:"status",sx:{m:0,px:3,py:2,fontSize:1,color:"fg.muted"},children:Le.said}):null,t.jsx(p,{flex:"1 1 auto",minHeight:0,display:"flex",children:fo?t.jsx(H,{as:"p",role:"status",sx:{m:0,p:3,fontSize:1,color:"fg.muted"},children:Fn.opening}):t.jsx(Bs,{themeVariant:f?.themeVariant,themeOverrides:f?.themeOverrides,colorMode:f?.colorMode,thread:vn,voice:uo,disabled:Je,disableReason:rn,protocol:Ot,frontendTools:R?void 0:Gn,initialModel:ut||void 0,title:z?.name??S?.name??T?.name??I,description:z?.welcome??T?.description,brandIcon:z?.face?t.jsx(ka,{face:z.face,size:20,state:q}):t.jsx(Tt,{size:20}),headerContent:z&&!Pt?t.jsx(ja,{state:q}):void 0,emptyState:{icon:z?.face?t.jsx("span",{"aria-hidden":!0,style:{fontSize:Nn,lineHeight:1},children:t.jsx(Wn,{face:z.face,size:Nn})}):t.jsx(Tt,{size:48}),title:z?.name??S?.name??T?.name??I,...v&&S?{sections:[{group:v.team.name,icon:t.jsx(Dn,{size:48}),title:v.team.name,subtitle:v.team.description},{group:S.name,icon:t.jsx(Tt,{size:32}),title:S.name,subtitle:T?.description}]}:null},suggestions:Fe||pe||f?.suggestionLabels===!1?[]:ct,showHeader:jn,headerButtons:{showNewChat:f?.headerButtons?.newChat??!1,showClear:f?.headerButtons?.clear??!1},renderHeader:zt?e=>t.jsx(zt,{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,mn.length>0?t.jsx(vt,{slot:je.chatHeader,props:{workspace:n}}):null,t.jsx(Vs,{icon:O?Hs:Ws,"aria-label":O?"Exit full screen":"Enter full screen",variant:"invisible",size:"small",onClick:()=>{M(!1),Ge()},sx:j?{"@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:C?void 0:n.surfaceId,showTurnFooter:h.showTokenUsage??f?.showTokenUsage??!0,onContextSnapshot:be,onLoadingChange:kt,onSpeakingChange:Te,onItemsChange:Be,onDisplayItemsChange:F,enableStreaming:!0},vn?.id)}),!jn&&mn.length>0?t.jsx(p,{hidden:!0,children:t.jsx(vt,{slot:je.chatHeader,props:{workspace:n}})}):null,wn&&!et?mt:null]})}),Rn=f?.suggestionLabels!==!1&&ct.length>0?t.jsx(p,{"aria-label":a.suggestedPrompts,display:"flex",flexWrap:"wrap",gap:2,px:2,pb:"6px",children:ct.map(e=>t.jsx(p,{as:"button",type:"button",title:e.message,disabled:Y||Je,onClick:()=>{xe(e.message)},appearance:"none",font:"inherit",fontSize:0,fontWeight:"semibold",lineHeight:1.25,px:"10px",py:"5px",width:On,flex:`0 0 ${On}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(Ds,{title:e.title,maxWidth:"100%",sx:{minWidth:0},children:e.title})},e.title))}):null,An=L?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:L}):null;return t.jsxs(p,{ref:lt,sx:{height:"100%",minHeight:0,display:"flex",flexDirection:"column",position:"relative",...O?{bg:"canvas.default"}:null,...O&&!De.current?{position:"fixed",top:c,right:0,bottom:0,left:0,height:"auto",zIndex:1e3}:null},children:[pe?t.jsx(pe.Component,{workspace:n,editors:En,hasEditor:!!C,transcript:Tn,prompt:et?null:mt,chips:et?null:Rn,picker:In,transient:An}):t.jsxs(t.Fragment,{children:[Fe&&!et?t.jsxs(p,{flex:"0 0 auto",borderBottom:"1px solid",borderColor:"border.default",children:[mt,Rn]}):null,In,t.jsxs(p,{flex:"1 1 auto",minHeight:0,display:"flex",position:"relative",children:[En,Tn]}),An,wn||et||Fe?null:mt]}),Mt?t.jsx(p,{position:"absolute",inset:0,zIndex:5,bg:"canvas.default",display:"flex",flexDirection:"column",minHeight:0,children:t.jsx(ca,{agentName:S?.name??T?.name,sandboxStillRuns:R,temporary:an,onSignedIn:()=>Gs.getState().clear()})}):null]})}function Aa({surfaces:n,active:a,onChange:l,workspace:i}){const u=[...n].sort((x,y)=>(x.order??100)-(y.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(H,{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:a===ne,onClick:()=>l(ne),children:"Chat"}),u.map(x=>{const y=tt(x,i),L=y?void 0:x.unavailableReason?.(i)??"Not available right now";return t.jsx(Vt.Button,{selected:a===x.surfaceId,"aria-disabled":!y,title:L??x.title,leadingIcon:x.icon,onClick:()=>{y&&l(x.surfaceId)},children:x.title},x.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{La as default};
@@ -1 +0,0 @@
1
- import{jP as ne,jQ as se,jR as ae,bq as ie,F as V,jS as le,j as t,jT as oe,jU as de,fl as F,jV as K,gK as ce,r as E,bB as T,eo as ue,I as ee,V as pe,cH as te,T as H,cL as he,U as me,A as xe,v as re,jW as Q,jX as fe,jY as ye,gP as ge,jZ as X,fn as be,j_ as je,B as Ce,cK as Te}from"../datalayer-app-main.js";import{F as Se,T as D,a as Y,g as A,b as Fe,e as Z,d as L,f as Be,h as ve,t as ke,i as we,c as Ae,j as Ie,A as De,s as Le,k as We,o as G,l as Ve,m as Oe,n as k,u as Re,p as _e,r as Ee,q as qe,v as $e}from"./index-zrM_sbHt.js";import{A as Ge,a as Pe}from"./ArrowUpIcon-DfyinHM7.js";import"./_baseRest-BmxuuM4H.js";import"./isSymbol-BLtK9CV6.js";import"./forEach-hknrtmxV.js";import"./uniqueId-BVuTZY3F.js";import"./toNumber-B1wj8-wx.js";import"./_baseClone-ByJL1tkX.js";import"./merge-B_wcPK4Y.js";import"./isEqual-B_c_I9Ri.js";const Me=r=>{const e=ie.c(24);let n,s,a,o;e[0]!==r?({children:n,disabled:s,onChange:a,...o}=r,e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=o):(n=e[1],s=e[2],a=e[3],o=e[4]);let m;if(e[5]!==n){const y=V.Children.toArray(n).filter(Ue).map(Ne).flat();m=V.Children.toArray(y).filter(ze).map(Ke).filter(Boolean),e[5]=n,e[6]=m}else m=e[6];const u=m,[d,c]=le(u);let x;e[7]!==d||e[8]!==c?(x=y=>{const{value:b,checked:j}=y.currentTarget;if(j){c([...d.current||[],b]);return}c((d.current||[]).filter(S=>S!==b))},e[7]=d,e[8]=c,e[9]=x):x=e[9];const i=x;let l;e[10]!==a||e[11]!==d||e[12]!==i?(l=y=>{a&&(i(y),a(d.current||[],y))},e[10]=a,e[11]=d,e[12]=i,e[13]=l):l=e[13];let h;e[14]!==s||e[15]!==l?(h={disabled:s,onChange:l},e[14]=s,e[15]=l,e[16]=h):h=e[16];let p;e[17]!==n||e[18]!==s||e[19]!==o?(p=t.jsx(oe,{disabled:s,...o,children:n}),e[17]=n,e[18]=s,e[19]=o,e[20]=p):p=e[20];let f;return e[21]!==h||e[22]!==p?(f=t.jsx(de.Provider,{value:h,children:p}),e[21]=h,e[22]=p,e[23]=f):f=e[23],f};var J=Object.assign(Me,{Caption:ae,Label:se,Validation:ne});function Ue(r){return V.isValidElement(r)&&r.type===F}function Ne(r){return V.isValidElement(r)?r.props.children:[]}function ze(r){return V.isValidElement(r)&&r.type===K}function Ke(r){return V.isValidElement(r)&&(r.props.checked||r.props.defaultChecked)&&r.props.value}const He=({name:r="slider",id:e="slider",min:n=0,max:s=10,value:a=5,label:o="label",step:m=1,markers:u=!1,displayValue:d=!0,disabled:c=!1,orientation:x="horizontal",width:i="200px",onChange:l})=>{const{colorMode:h}=ce(),p=s<n?n:n+(s-n)/2,[f,y]=E.useState(p);E.useEffect(()=>{y(a??p)},[a,p]);const b=S=>{const g=Number(S.target.value);y(g),l(g)},j={width:i,...x==="vertical"?{transform:"rotate(-90deg)"}:{},colorScheme:h=="day"?"light":"dark",accentColor:"var(--fgColor-accent)"};return t.jsxs(T,{display:"flex",alignItems:"center",children:[t.jsx("input",{type:"range",id:e,name:r,min:n,max:s,value:f,step:m??"any",list:"slider-markers",style:j,onChange:b,disabled:c}),u&&m&&t.jsx("datalist",{id:"slider-markers",children:Array.from({length:Math.floor((s-n)/m)+1},(S,g)=>n+g*m).map(S=>t.jsx("option",{value:S},`slider-marker-${S}`))}),o&&t.jsx(F.Label,{htmlFor:e,sx:{ml:2},children:o}),d&&x==="horizontal"&&t.jsx(ue,{sx:{ml:2},children:f})]})};function Ye(r){return E.forwardRef(({fields:e,widgets:n,templates:s,...a},o)=>(e={...r?.fields,...e},n={...r?.widgets,...n},s={...r?.templates,...s,ButtonTemplates:{...r?.templates?.ButtonTemplates,...s?.ButtonTemplates}},t.jsx(Se,{...r,...a,fields:e,widgets:n,templates:s,ref:o})))}function Qe({uiSchema:r,registry:e,...n}){const{translateString:s}=e;return t.jsx(ee,{variant:"default",size:"small",icon:pe,"aria-label":s(D.AddItemButton),...n})}function Xe(r){const{children:e,disabled:n,hasToolbar:s,hasMoveDown:a,hasMoveUp:o,hasRemove:m,index:u,onDropIndexClick:d,onReorderClick:c,readonly:x,uiSchema:i,registry:l}=r,{MoveDownButton:h,MoveUpButton:p,RemoveButton:f}=l.templates.ButtonTemplates,y={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold",minWidth:0};return t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},alignItems:"center",children:[t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},style:{overflow:"auto"},children:t.jsx(T,{mb:2,p:2,sx:{borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:e})}),s&&t.jsxs(T,{p:1,children:[(o||a)&&t.jsx(p,{style:y,disabled:n||x||!o,onClick:c(u,u-1),uiSchema:i,registry:l}),(o||a)&&t.jsx(h,{style:y,disabled:n||x||!a,onClick:c(u,u+1),uiSchema:i,registry:l}),m&&t.jsx(f,{style:y,disabled:n||x,onClick:d(u),uiSchema:i,registry:l})]})]})}function Ze(r){const{canAdd:e,disabled:n,idSchema:s,uiSchema:a,items:o,onAddClick:m,readonly:u,registry:d,required:c,schema:x,title:i}=r,l=Y(a),h=A("ArrayFieldDescriptionTemplate",d,l),p=A("ArrayFieldItemTemplate",d,l),f=A("ArrayFieldTitleTemplate",d,l),{ButtonTemplates:{AddButton:y}}=d.templates;return t.jsxs(T,{p:3,sx:{display:"flex",width:"100%",flexFlow:"row wrap",borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:[t.jsx(f,{idSchema:s,title:l.title||i,schema:x,uiSchema:a,required:c,registry:d}),t.jsx(h,{idSchema:s,description:l.description||x.description,schema:x,uiSchema:a,registry:d}),t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},children:[o&&o.map(({key:b,...j})=>t.jsx(p,{...j},b)),e&&t.jsx(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},justifyContent:"flex-end",children:t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsx(T,{mt:2,children:t.jsx(y,{className:"array-item-add",onClick:m,disabled:n||u,uiSchema:a,registry:d})})})})]},`array-item-list-${s.$id}`)]})}function Je(r){const{id:e,placeholder:n,required:s,readonly:a,disabled:o,type:m,label:u,value:d,onChange:c,onBlur:x,onFocus:i,autofocus:l,options:h,schema:p,uiSchema:f,rawErrors:y=[],formContext:b,registry:j,hideLabel:S,hideError:g,...C}=r,w=Fe(p,m,h),{step:I,min:O,max:R,...M}=w,q={...Array.isArray(p.examples)?{list:Z(e)}:void 0,...M,...I!==void 0?{step:I}:void 0,...O!==void 0?{min:O}:void 0,...R!==void 0?{max:R}:void 0},U=({target:{value:B}})=>c(B===""?h.emptyValue:B),N=({target:{value:B}})=>x(e,B),z=({target:{value:B}})=>i(e,B),{schemaUtils:$}=j,v=$.getDisplayLabel(p,f);return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{visuallyHidden:!v,htmlFor:e,children:u||p.title}),t.jsx(te,{id:e,name:e,placeholder:n,autoFocus:l,required:s,disabled:o||a,...q,value:d||d===0?d:"",validationStatus:y.length>0?"error":void 0,onChange:U,onBlur:N,onFocus:z,block:!0,...C,"aria-describedby":L(e,!!p.examples)}),Array.isArray(p.examples)&&t.jsx("datalist",{id:Z(e),children:p.examples.concat(p.default&&!p.examples.includes(p.default)?[p.default]:[]).map(B=>t.jsx("option",{value:B},B))})]})}function et(r){const{id:e,description:n}=r;return n?t.jsx(H,{id:e,as:"p",mt:1,children:n}):null}function tt({errors:r,registry:e}){const{translateString:n}=e;return t.jsx(T,{mb:3,sx:{borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:t.jsxs(T,{p:3,children:[t.jsx(T,{as:"h3",sx:{fontSize:3,fontWeight:"semibold",m:0},children:n(D.ErrorsLabel)}),t.jsx(t.Fragment,{children:r.map((s,a)=>t.jsx(he,{variant:"danger",sx:{marginTop:2},children:s.stack},a))})]})})}function P({color:r,title:e,icon:n,...s}){return r||(r="invisible"),t.jsx(ee,{variant:r,size:"small",icon:n,onClick:a=>a.preventDefault(),onSubmit:a=>a.preventDefault(),"aria-label":e,...s})}function rt(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.CopyButton),...r,icon:xe})}function nt(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.MoveDownButton),...r,icon:Pe})}function st(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.MoveUpButton),...r,icon:Ge})}function at(r){const{iconType:e,...n}=r,{registry:{translateString:s}}=n;return t.jsx(P,{title:s(D.RemoveButton),...n,icon:me})}function it(r){const{errors:e=[],idSchema:n}=r;if(e.length===0)return null;const s=Be(n);return t.jsx("div",{id:s,children:e.map((a,o)=>t.jsxs(H,{as:"p",mb:1,sx:{fontSize:"12px",display:"block",color:"danger.fg"},children:["•"," "+a]},o))})}function lt(r){const{idSchema:e,help:n}=r;if(!n)return null;const s=ve(e);return t.jsx(F.Caption,{id:s,children:n})}function ot(r){const{id:e,children:n,classNames:s,style:a,disabled:o,displayLabel:m,hidden:u,label:d,onDropPropertyClick:c,onKeyChange:x,readonly:i,required:l,rawErrors:h=[],errors:p,help:f,rawDescription:y,schema:b,uiSchema:j,registry:S}=r,g=Y(j),C=A("WrapIfAdditionalTemplate",S,g);return u?t.jsx("div",{style:{display:"none"},children:n}):t.jsx(C,{classNames:s,style:a,disabled:o,id:e,label:d,onDropPropertyClick:c,onKeyChange:x,readonly:i,required:l,schema:b,uiSchema:j,registry:S,children:t.jsxs(F,{required:l,children:[t.jsx(F.Label,{visuallyHidden:!0}),n,m&&y?t.jsx(F.Caption,{id:e,children:y}):null,p,f]})})}function dt(r){const{description:e,title:n,properties:s,required:a,disabled:o,readonly:m,uiSchema:u,idSchema:d,schema:c,formData:x,onAddClick:i,registry:l}=r,h=Y(u),p=A("TitleFieldTemplate",l,h),f=A("DescriptionFieldTemplate",l,h),{ButtonTemplates:{AddButton:y}}=l.templates;return t.jsxs(t.Fragment,{children:[(h.title||n)&&t.jsx(p,{id:ke(d),title:n,required:a,schema:c,uiSchema:u,registry:l}),(h.description||e)&&t.jsx(f,{id:we(d),description:h.description||e,schema:c,uiSchema:u,registry:l}),t.jsxs(T,{sx:{display:"flex",width:"100%",flexDirection:"column",flexFlow:"row wrap"},style:{marginTop:"10px"},children:[s.map((b,j)=>b.hidden?b.content:t.jsx(T,{sx:{flexBasis:"100%",flexGrow:0,maxWidth:"100%"},mb:1,children:b.content},j)),Ae(c,u,x)&&t.jsx(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},justifyContent:"flex-end",children:t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsx(y,{className:"object-property-expand",onClick:b=>{b.preventDefault(),i(c)()},disabled:o||m,uiSchema:u,registry:l})})})]})]})}function ct({uiSchema:r}){const{submitText:e,norender:n,props:s={}}=Ie(r);return n?null:t.jsx(T,{marginTop:2,children:t.jsx(re,{type:"submit",variant:"primary",...s,children:e})})}function ut({id:r,title:e}){return t.jsx(T,{id:r,my:2,children:t.jsx(T,{as:"h5",sx:{fontSize:1,fontWeight:"semibold",m:0,borderBottom:"1px solid",borderColor:"border.default",paddingBottom:1},children:e})})}function pt(r){const{children:e,classNames:n,style:s,disabled:a,id:o,label:m,onDropPropertyClick:u,onKeyChange:d,readonly:c,required:x,schema:i,uiSchema:l,registry:h}=r,{templates:p,translateString:f}=h,{RemoveButton:y}=p.ButtonTemplates,b=f(D.KeyLabel,[m]),j=De in i,S={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};if(!j)return t.jsx("div",{className:n,style:s,children:e});const g=({target:C})=>d(C.value);return t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},alignItems:"center",className:n,style:s,children:[t.jsx(T,{pr:2,sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsxs(F,{id:`${o}-key`,required:x,children:[t.jsx(F.Label,{children:b}),t.jsx(te,{defaultValue:m,disabled:a||c,name:`${o}-key`,onBlur:c?void 0:g,type:"text",block:!0})]})}),t.jsx(T,{pr:2,sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:e}),t.jsx(T,{children:t.jsx(y,{iconType:"default",style:S,disabled:a||c,onClick:u(m),uiSchema:l,registry:h})})]},`${o}-key`)}function ht(){return{ArrayFieldItemTemplate:Xe,ArrayFieldTemplate:Ze,BaseInputTemplate:Je,ButtonTemplates:{AddButton:Qe,CopyButton:rt,MoveDownButton:nt,MoveUpButton:st,RemoveButton:at,SubmitButton:ct},DescriptionFieldTemplate:et,ErrorListTemplate:tt,FieldErrorTemplate:it,FieldHelpTemplate:lt,FieldTemplate:ot,ObjectFieldTemplate:dt,TitleFieldTemplate:ut,WrapIfAdditionalTemplate:pt}}function mt(r){const{schema:e,id:n,value:s,disabled:a,readonly:o,label:m,autofocus:u,onChange:d,onBlur:c,onFocus:x}=r,i=Le(e),l=({target:{checked:f}})=>d(f),h=({target:{value:f}})=>c(n,f),p=({target:{value:f}})=>x(n,f);return t.jsxs(F,{id:n,children:[t.jsx(K,{checked:typeof s>"u"?!1:!!s,required:i,disabled:a||o,autoFocus:u,onChange:l,onBlur:h,onFocus:p,"aria-describedby":L(n)}),t.jsx(F.Label,{children:m||""})]})}function xt({schema:r,label:e,id:n,disabled:s,options:a,value:o,autofocus:m,readonly:u,required:d,onChange:c,onBlur:x,onFocus:i}){const{enumOptions:l,enumDisabled:h,inline:p,emptyValue:f}=a,y=Array.isArray(o)?o:[o],b=g=>({target:{checked:C}})=>{c(C?Ve(g,y,l):Oe(g,y,l))},j=({target:{value:g}})=>x(n,k(g,l,f)),S=({target:{value:g}})=>i(n,k(g,l,f));return t.jsxs(J,{required:d,children:[t.jsx(J.Label,{children:e||r.title}),Array.isArray(l)&&l.map((g,C)=>{const w=We(g.value,y),I=Array.isArray(h)&&h.indexOf(g.value)!==-1;return t.jsxs(F,{id:G(n,C),children:[t.jsx(K,{checked:w,disabled:s||I||u,autoFocus:m&&C===0,onChange:b(C),onBlur:j,onFocus:S,"aria-describedby":L(n)}),t.jsx(F.Label,{children:g.label})]},G(n,C))})]})}function ft(r){const{options:e,registry:n}=r,s=A("BaseInputTemplate",n,e);return t.jsx(s,{type:"date",InputLabelProps:{shrink:!0},...r})}function yt(r){const{options:e,registry:n}=r,s=A("BaseInputTemplate",n,e),a=Re(r.value),o=m=>{r.onChange(_e(m))};return t.jsx(s,{type:"datetime-local",...r,value:a,onChange:o})}function gt({id:r,schema:e,options:n,value:s,required:a,disabled:o,readonly:m,label:u,onChange:d,onBlur:c,onFocus:x}){const{enumOptions:i,enumDisabled:l,emptyValue:h}=n,p=({target:{value:b}})=>d(k(b,i,h)),f=({target:{value:b}})=>c(r,k(b,i,h)),y=({target:{value:b}})=>x(r,k(b,i,h));return t.jsxs(Q,{name:r,required:a,children:[t.jsx(Q.Label,{children:u||e.title}),t.jsx(t.Fragment,{children:Array.isArray(i)&&i.map((b,j)=>{const S=Array.isArray(l)&&l.indexOf(b.value)!==-1;return t.jsxs(F,{id:G(r,j),children:[t.jsx(fe,{value:String(j),onChange:p,onBlur:f,onFocus:y,"aria-describedby":L(r),disabled:o||S||m},j),t.jsx(F.Label,{children:b.label})]},G(r,j))})})]})}function bt(r){const{value:e,readonly:n,disabled:s,options:a,schema:o,onChange:m,label:u,id:d}=r,c={value:e,label:u,id:d,name:d,...Ee(o)},x=i=>{m(i??a.emptyValue)};return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{htmlFor:d,children:u||o.title}),t.jsx(He,{disabled:s||n,onChange:x,...c,"aria-describedby":L(d)})]})}function jt({schema:r,id:e,options:n,label:s,required:a,disabled:o,placeholder:m,readonly:u,value:d,multiple:c,autofocus:x,onChange:i,onBlur:l,onFocus:h,rawErrors:p=[],registry:f,uiSchema:y,hideError:b,formContext:j,...S}){const{enumOptions:g,enumDisabled:C,emptyValue:w}=n,[I,O]=E.useState(!1);c=typeof c>"u"?!1:!!c;const R=c?[]:"",M=typeof d>"u"||c&&d.length<1||!c&&d===R,q=g?.map(({value:v,label:B},W)=>{const _=Array.isArray(C)&&C.indexOf(v)!==-1;return{text:B,id:W,disabled:_}}),U=({target:{value:v}})=>i(k(v,g,w)),N=({target:{value:v}})=>l(e,k(v,g,w)),z=({target:{value:v}})=>h(e,k(v,g,w)),$=qe(d,g,c);return t.jsxs(F,{id:e,required:a,children:[t.jsx(F.Label,{visuallyHidden:!(s||r.title),htmlFor:e,children:s||r.title}),c&&Array.isArray(g)?t.jsx(ye,{placeholderText:(s||r.title)??"",renderAnchor:({children:v,"aria-labelledby":B,...W})=>t.jsx(re,{trailingAction:ge,"aria-labelledby":` ${B}`,...W,onClick:_=>{O(!I),_.preventDefault()},children:v||`Select ${s||r.title}`}),open:I,onOpenChange:O,items:q??[],selected:(q??[]).filter((v,B)=>$?.includes(String(B))),onSelectedChange:v=>{i(k(v.map(B=>B.id),g,w))},onFilterChange:()=>null,overlayProps:{width:"small"}}):t.jsx(X,{name:e,value:M?R:$,disabled:o||u,autoFocus:x,placeholder:s||r.title,validationStatus:p.length>0?"error":void 0,onChange:U,onBlur:N,onFocus:z,defaultValue:void 0,...S,"aria-describedby":L(e),children:Array.isArray(g)&&g.map(({value:v,label:B},W)=>{const _=Array.isArray(C)&&C.indexOf(v)!==-1;return t.jsx(X.Option,{value:String(W),disabled:_,children:B},W)})})]})}function Ct({id:r,placeholder:e,value:n,label:s,disabled:a,autofocus:o,readonly:m,onBlur:u,onFocus:d,onChange:c,options:x,schema:i,uiSchema:l,required:h,rawErrors:p=[],registry:f}){const{schemaUtils:y}=f,b=y.getDisplayLabel(i,l)&&(!!s||!!i.title),j=({target:{value:C}})=>c(C===""?x.emptyValue:C),S=({target:{value:C}})=>u(r,C),g=({target:{value:C}})=>d(r,C);return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{visuallyHidden:!b,htmlFor:r,children:s||i.title}),t.jsx(be,{id:r,name:r,value:n??"",placeholder:e,autoFocus:o,required:h,disabled:a||m,validationStatus:p.length>0?"error":void 0,onChange:j,onBlur:S,onFocus:g,block:!0,"aria-describedby":L(r)})]})}function Tt(){return{CheckboxWidget:mt,CheckboxesWidget:xt,DateWidget:ft,DateTimeWidget:yt,RadioWidget:gt,RangeWidget:bt,SelectWidget:jt,TextareaWidget:Ct}}function St(){return{templates:ht(),widgets:Tt()}}function Ft(){return Ye(St())}const Bt=Ft();function vt({id:r,value:e,label:n,disabled:s,readonly:a,onChange:o}){return t.jsxs(Ce,{display:"flex",flexDirection:"column",gap:1,children:[t.jsx(H,{as:"span",id:`${r}-label`,sx:{fontWeight:"semibold"},children:n}),t.jsx(Te,{size:"small","aria-labelledby":`${r}-label`,checked:!!e,disabled:s||a,onClick:()=>o(!e)})]})}function kt({id:r,value:e,label:n,disabled:s,readonly:a,placeholder:o,onChange:m}){const u=Array.isArray(e)?e.map(String):[],[d,c]=E.useState(""),x=()=>{const i=d.trim();i&&!u.includes(i)&&m([...u,i]),c("")};return t.jsxs(F,{id:r,disabled:s||a,children:[t.jsx(F.Label,{children:n}),t.jsx(je,{block:!0,placeholder:o,tokens:u.map((i,l)=>({id:l,text:i})),value:d,onChange:i=>c(i.target.value.replace(",","")),onKeyDown:i=>{(i.key==="Enter"||i.key===",")&&(i.preventDefault(),x())},onBlur:x,onTokenRemove:i=>{m(u.filter((l,h)=>h!==i))}})]})}const wt={switch:vt,tags:kt};function $t(r){return t.jsx(Bt,{...r,widgets:wt,validator:$e})}export{$t as default};