@marimo-team/islands 0.25.3-dev26 → 0.25.3-dev261

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 (796) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DfG3PRaJ.js → ConnectedDataExplorerComponent-DjlwdMQT.js} +120 -116
  2. package/dist/{ErrorBoundary-MDk-fuIJ.js → ErrorBoundary-m3vF1P4J.js} +16 -16
  3. package/dist/_baseSet-BfI5FjBM.js +328 -0
  4. package/dist/{abnfDiagram-VCTEODGH-B3w-XWX8.js → abnfDiagram-VCTEODGH-DzrZZXRD.js} +2 -2
  5. package/dist/any-language-editor-Be7dA2VK.js +75 -0
  6. package/dist/{architectureDiagram-5GKGNRK7-C18U9A6k.js → architectureDiagram-5GKGNRK7-iF_snyFL.js} +1 -1
  7. package/dist/{arrays-CN1djC4k.js → arrays-DoQ-AILx.js} +15 -27
  8. package/dist/assets/__vite-browser-external-BKBpimif.js +1 -0
  9. package/dist/assets/worker-CgoMtD-_.js +113 -0
  10. package/dist/{blockDiagram-I7D4REHJ-Cg25UrxT.js → blockDiagram-I7D4REHJ-Dkhe6_PP.js} +1 -1
  11. package/dist/{button-CvjkwdSk.js → button-0-RqY1DW.js} +229 -218
  12. package/dist/{capabilities-CQ5IjhzL.js → capabilities-B6yy_CBN.js} +2 -2
  13. package/dist/{chat-ui-w8SVynkn.js → chat-ui-Bl_I-evE.js} +822 -755
  14. package/dist/{check-BMKBBrdc.js → check-CSvxZk5I.js} +1 -1
  15. package/dist/{chunk-IMKFNOWR-CrS5bzqW.js → chunk-IMKFNOWR-B7xytD4B.js} +1 -1
  16. package/dist/{chunk-SHT3W25Y-StpvPvUG.js → chunk-SHT3W25Y-I8ZFP5L1.js} +1 -1
  17. package/dist/{chunk-SVP7TREG-CBXjbYZC.js → chunk-SVP7TREG-Di-uAPdT.js} +1 -1
  18. package/dist/{chunk-TICWLB2K-Dp6bIb-q.js → chunk-TICWLB2K-BFpUy0ud.js} +1 -1
  19. package/dist/{chunk-YOKDWASO-DPZk8vhS.js → chunk-YOKDWASO-DKplTrBY.js} +20 -20
  20. package/dist/{classDiagram-ZZMXUADV-BFYuxV5g.js → classDiagram-ZZMXUADV-Cqm4JGpx.js} +2 -2
  21. package/dist/{classDiagram-v2-VYDZK3BY-D_tjXVMl.js → classDiagram-v2-VYDZK3BY-DFHRJpN3.js} +2 -2
  22. package/dist/code-visibility-TqQbHmZ5.js +134 -0
  23. package/dist/{common-Bo1ahZJz.js → common-BY_oazL9.js} +9850 -9619
  24. package/dist/config-mwEjAmvP.js +636 -0
  25. package/dist/{copy-icon-BgUO8jsi.js → copy-icon-DD8bdw4L.js} +3 -3
  26. package/dist/createReducer-C_syF8Td.js +67 -0
  27. package/dist/{cynefinDiagram-5FMLGOSQ-DSgYrHB2.js → cynefinDiagram-5FMLGOSQ-cuGOeTBC.js} +1 -1
  28. package/dist/{dagre-GXQ25YYZ-GYlruCBf.js → dagre-GXQ25YYZ-DJ76aC4k.js} +3 -3
  29. package/dist/{dagre-BGSfXNEb.js → dagre-mqiMAsFY.js} +531 -680
  30. package/dist/{data-grid-overlay-editor-BcbqpDrL.js → data-grid-overlay-editor-CLQPFjyJ.js} +5 -5
  31. package/dist/{data-grid-types-BH_r7g7l.js → data-grid-types-0PJ-9N5n.js} +1 -1
  32. package/dist/{debounce-C3jyATpc.js → debounce-DrhhziJv.js} +2 -2
  33. package/dist/{diagram-S7CK7UJ4-DRu5LX5_.js → diagram-S7CK7UJ4-DLLc0sw7.js} +1 -1
  34. package/dist/{diagram-UQ7AKVKN-DD7uiejP.js → diagram-UQ7AKVKN-Tz_d6qmk.js} +1 -1
  35. package/dist/{diagram-VX7I27RA-ByH9KAJJ.js → diagram-VX7I27RA-D7SzPrDN.js} +1 -1
  36. package/dist/{diagram-Z3DM3KII-BsQHPRke.js → diagram-Z3DM3KII-qr37XV58.js} +1 -1
  37. package/dist/{dialog-Cc479ZEH.js → dialog-BHYPX87J.js} +26 -26
  38. package/dist/{dist-Bvs24R_E.js → dist-11T5wq3_.js} +31 -30
  39. package/dist/{dist-F8Ep36rk.js → dist-17ugwGZc.js} +59 -58
  40. package/dist/{dist-BMQf5zIS.js → dist-7cRjf--y.js} +123 -122
  41. package/dist/{dist-diIx5qJW.js → dist-B8pkfkzc.js} +31 -30
  42. package/dist/{dist-CN_BeG2I.js → dist-B9UoM_wq.js} +58 -57
  43. package/dist/{dist-CLdpGQVr.js → dist-BGuMTs1i.js} +118 -117
  44. package/dist/{dist-BK4Oj99o.js → dist-BHW11fni.js} +18 -17
  45. package/dist/dist-BLY4m1Wi.js +850 -0
  46. package/dist/{dist-PXYI_yuP.js → dist-BNlcVoxs.js} +24 -23
  47. package/dist/{dist-D6d86eNJ.js → dist-BQYe5Bju.js} +47 -46
  48. package/dist/{dist-CkTTIdBe.js → dist-BX1mn8na.js} +337 -337
  49. package/dist/{dist-DiDibOYr.js → dist-Bh0PTKUW.js} +151 -150
  50. package/dist/{dist-CSJ0MDRw.js → dist-CKaXK92p.js} +56 -55
  51. package/dist/{dist-C8fAKSH1.js → dist-CLhwfhpJ.js} +53 -52
  52. package/dist/{dist-DoE4XJBC.js → dist-CYeqK4Xw.js} +9801 -10649
  53. package/dist/{dist-BLfKmR-l.js → dist-Cxlp3WH6.js} +16 -15
  54. package/dist/{dist-D-wwqlzJ.js → dist-DSJPGj42.js} +158 -157
  55. package/dist/{dist-BorMD-uX.js → dist-DU9ICsWZ.js} +75 -74
  56. package/dist/{dist-DBtSl3sf.js → dist-DWv0ALBi.js} +47 -46
  57. package/dist/{dist-OR1OnN-y.js → dist-DiBpWEsB.js} +31 -30
  58. package/dist/{dist-CrSP_H1M.js → dist-DiLFTlnl.js} +242 -242
  59. package/dist/{dist-DpBpA_n1.js → dist-Lm-D-Vr6.js} +3 -3
  60. package/dist/{dist-CSbh1PNP.js → dist-cVDV5IuI.js} +23 -22
  61. package/dist/{dist-BuaRHxOc.js → dist-fRfaOoq8.js} +44 -43
  62. package/dist/{dist-Cg7gzw-a.js → dist-gTTI-9Px.js} +78 -77
  63. package/dist/dropdown-menu-Blu7V6Mk.js +6083 -0
  64. package/dist/{ebnfDiagram-PWID7BFC-CQRK5_eT.js → ebnfDiagram-PWID7BFC-BKOQb4J0.js} +2 -2
  65. package/dist/{erDiagram-RLTQ6QDP-BKtWrDVh.js → erDiagram-RLTQ6QDP-CM15Vq68.js} +1 -1
  66. package/dist/{error-banner-CFPHFw4h.js → error-banner-DbRFOd2O.js} +84 -83
  67. package/dist/error-entries-DFhMo601.js +2505 -0
  68. package/dist/{esm-D2gTsXEV.js → esm-BgKjMvWw.js} +530 -529
  69. package/dist/{esm-AMFssoNp.js → esm-CHjVSexr.js} +328 -329
  70. package/dist/feedback-button-DYk1f0In.js +374 -0
  71. package/dist/{flowDiagram-HODETNUW-1IN-ih2E.js → flowDiagram-HODETNUW-Dt3N5yFT.js} +2 -2
  72. package/dist/{formats-X4mMQWzX.js → formats-gGospKWJ.js} +6 -6
  73. package/dist/{ganttDiagram-EL5Y4UJY-BQT16JSc.js → ganttDiagram-EL5Y4UJY-Dh_4cBJZ.js} +2 -2
  74. package/dist/{glide-data-editor-h-P3W8Rc.js → glide-data-editor-D30zzaiO.js} +417 -415
  75. package/dist/{glide-utils-DM9zBO4W.js → glide-utils-qbkRZpEy.js} +16 -16
  76. package/dist/{globals-4XAS0Mmd.js → globals-BA0s7TxM.js} +3 -3
  77. package/dist/{graphlib-BmY_CCV9.js → graphlib-nlwT3Wvy.js} +177 -220
  78. package/dist/hasIn-C20JsQ2m.js +28 -0
  79. package/dist/{highlighted-body-KPVGNVTW-zwjq21tf.js → highlighted-body-KPVGNVTW-3Ziwfz-V.js} +2 -2
  80. package/dist/{error-entries-Damuuclv.js → html-to-image-BPs9Vo-H.js} +26928 -26781
  81. package/dist/{infoDiagram-27XIBGKW-CkB-zr4p.js → infoDiagram-27XIBGKW-C7axJMCl.js} +1 -1
  82. package/dist/isArrayLikeObject-B-HXCsex.js +626 -0
  83. package/dist/isEmpty-CdX7MTE1.js +14 -0
  84. package/dist/{ishikawaDiagram-5VMMS53U-wlyLjBmM.js → ishikawaDiagram-5VMMS53U-CdC9Eur7.js} +1 -1
  85. package/dist/{kanban-definition-UXKFOSKX-C2usY0i-.js → kanban-definition-UXKFOSKX-BHnMIgD7.js} +1 -1
  86. package/dist/{linear-Cnaq3Tfb.js → linear-DWERh7eI.js} +121 -73
  87. package/dist/{loader-BQOfjTIJ.js → loader-BVEtQ4F3.js} +12 -12
  88. package/dist/main.js +10241 -8111
  89. package/dist/{mermaid-BA-Z6wGL.js → mermaid-DFYN_PXd.js} +54 -54
  90. package/dist/mermaid-HWGCJPDP-Du3-HPQA.js +2 -0
  91. package/dist/{mindmap-definition-YA3MSWOX-nKOWS8RR.js → mindmap-definition-YA3MSWOX-BagHoCGU.js} +1 -1
  92. package/dist/{now-jM8-M7IR.js → now-BKZCLE5P.js} +12 -13
  93. package/dist/{number-overlay-editor-DVBm-B8V.js → number-overlay-editor-B1nffNQ2.js} +3 -3
  94. package/dist/{dist-CN8zI-XC.js → objectWithoutPropertiesLoose-ai5NUqGa.js} +262 -240
  95. package/dist/{objects-CzUgoMIF.js → objects-DCmMvZtn.js} +1 -3
  96. package/dist/{once-BtE-wKRL.js → once-NnpX_HnX.js} +1 -1
  97. package/dist/{pegDiagram-XKGWAZYB-Dac9EIKD.js → pegDiagram-XKGWAZYB-8IIZczip.js} +2 -2
  98. package/dist/pick-tCszMUbm.js +35 -0
  99. package/dist/{pieDiagram-E7YTZNPT-B7S-DsW_.js → pieDiagram-E7YTZNPT-CE6dKBIr.js} +1 -1
  100. package/dist/precisionRound-DhAzeRcm.js +49 -0
  101. package/dist/{process-output-CTPTtxXB.js → process-output-c6xaHokq.js} +4 -4
  102. package/dist/{quadrantDiagram-AXDQQJYC-Ccw0xMjN.js → quadrantDiagram-AXDQQJYC-Blrm7V7_.js} +1 -1
  103. package/dist/{railroadDiagram-O6MQD6OU-Cfa5Q-hr.js → railroadDiagram-O6MQD6OU-CkexPq3b.js} +2 -2
  104. package/dist/{react-vega-BED0DjiB.js → react-vega-C4T9Rb_w.js} +12284 -12270
  105. package/dist/{requirementDiagram-BXWQKSXE-d8zXCJIk.js → requirementDiagram-BXWQKSXE-B0-OkuAe.js} +1 -1
  106. package/dist/{reveal-component-DtPzCmeW.js → reveal-component-fg3-aYjk.js} +430 -407
  107. package/dist/schemas-CdscWNy_.js +4747 -0
  108. package/dist/select-CcidPqlM.js +1200 -0
  109. package/dist/{sequenceDiagram-WJ2MYXX4-b6pei3lJ.js → sequenceDiagram-WJ2MYXX4-Dxysg8DX.js} +1 -1
  110. package/dist/{spec-BJzgmvVa.js → spec-ZwfZcgsm.js} +41 -11
  111. package/dist/{stateDiagram-D77RDMKH-Be-xSpaZ.js → stateDiagram-D77RDMKH-DTEN3-OJ.js} +4 -4
  112. package/dist/{stateDiagram-v2-MP3YSRHH-5Y-FxesJ.js → stateDiagram-v2-MP3YSRHH-vktk3Xc5.js} +2 -2
  113. package/dist/static-state-BldGd99T.js +72 -0
  114. package/dist/strings-BYJNyKmg.js +507 -0
  115. package/dist/style.css +1 -1
  116. package/dist/{swimlanes-42K2YHIH-nRRl4NU0.js → swimlanes-42K2YHIH-Cjveh9OM.js} +1 -1
  117. package/dist/{swimlanesDiagram-VR7AAH4N-BS79510V.js → swimlanesDiagram-VR7AAH4N-Bdr7Ev_2.js} +2 -2
  118. package/dist/{swiper-component-DKntyn8p.js → swiper-component-Dvj-goaD.js} +2 -2
  119. package/dist/{time-BieKwdYS.js → time-BaMbJs4z.js} +18 -18
  120. package/dist/{timeline-definition-24CTP7MA-Cfzf8WPf.js → timeline-definition-24CTP7MA-KIuDcefn.js} +1 -1
  121. package/dist/toast-CkB5Jq9K.js +491 -0
  122. package/dist/{tooltip-CtBZ5q8p.js → tooltip-Bzl4k00l.js} +329 -305
  123. package/dist/use-restore-focus-CmflVLWJ.js +1672 -0
  124. package/dist/{useAsyncData-BD534XmW.js → useAsyncData-DsZMvNXn.js} +15 -14
  125. package/dist/{useDateFormatter-DkajGwwd.js → useDateFormatter-CYo5fm8s.js} +2 -2
  126. package/dist/{useDeepCompareMemoize-C72_RNsu.js → useDeepCompareMemoize-KMBBux8C.js} +1 -1
  127. package/dist/{useIframeCapabilities-DBETvvPl.js → useIframeCapabilities-BIolGsF1.js} +1 -1
  128. package/dist/useLifecycle-GNgvNwI-.js +112 -0
  129. package/dist/useTheme-BZ2GGLgm.js +339 -0
  130. package/dist/utils-DXkj82sK.js +813 -0
  131. package/dist/{vega-component-DfcYgj-Y.js → vega-component-DOtem7Hf.js} +171 -170
  132. package/dist/{vega-embed-container-BNHE18G9.js → vega-embed-container--LYZqguO.js} +2 -2
  133. package/dist/{vega-loader.browser-DNST6uVf.js → vega-loader.browser-B9Pz0EGP.js} +298 -507
  134. package/dist/{vennDiagram-4TSXK5OY-CeY6Z1xZ.js → vennDiagram-4TSXK5OY-DrIOUHfb.js} +1 -1
  135. package/dist/{wardleyDiagram-VM6X3IG4-Cxs9NtVi.js → wardleyDiagram-VM6X3IG4-CJNjf4OH.js} +1 -1
  136. package/dist/{xychartDiagram-S5SC5T6Z-DNWbvPK7.js → xychartDiagram-S5SC5T6Z-DEshFho-.js} +2 -2
  137. package/package.json +16 -20
  138. package/src/__mocks__/document.tsx +63 -0
  139. package/src/__mocks__/notebook.ts +3 -4
  140. package/src/__mocks__/partial.ts +26 -0
  141. package/src/__mocks__/requests.ts +1 -4
  142. package/src/__tests__/fixtures/pair-config.ts +1 -1
  143. package/src/__tests__/main.test.tsx +24 -1
  144. package/src/__tests__/module-entry.test.ts +44 -0
  145. package/src/__tests__/mount.test.ts +1 -21
  146. package/src/__tests__/{host-imports.test.ts → replica-imports.test.ts} +12 -11
  147. package/src/components/ai/__tests__/ai-model-dropdown.test.tsx +63 -0
  148. package/src/components/ai/ai-model-dropdown.tsx +11 -6
  149. package/src/components/app-config/__tests__/state.test.tsx +50 -0
  150. package/src/components/app-config/ai-config.tsx +156 -150
  151. package/src/components/app-config/app-config-button.tsx +6 -5
  152. package/src/components/app-config/app-config-form.tsx +5 -9
  153. package/src/components/app-config/common.tsx +7 -9
  154. package/src/components/app-config/data-form.tsx +112 -113
  155. package/src/components/app-config/mcp-config.tsx +30 -53
  156. package/src/components/app-config/user-config-form.css +91 -0
  157. package/src/components/app-config/user-config-form.tsx +266 -349
  158. package/src/components/chat/__tests__/capabilities-popover.test.tsx +0 -1
  159. package/src/components/chat/__tests__/chat-display.test.tsx +125 -0
  160. package/src/components/chat/__tests__/chat-markdown.test.tsx +43 -0
  161. package/src/components/chat/__tests__/chat-utils.test.ts +51 -1
  162. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  163. package/src/components/chat/__tests__/notebook-access-selector.test.tsx +64 -0
  164. package/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx +1 -1
  165. package/src/components/chat/acp/__tests__/agent-panel.test.tsx +22 -17
  166. package/src/components/chat/acp/__tests__/session-tabs.test.tsx +43 -0
  167. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  168. package/src/components/chat/acp/agent-panel.tsx +4 -3
  169. package/src/components/chat/acp/blocks.tsx +13 -12
  170. package/src/components/chat/acp/common.tsx +4 -5
  171. package/src/components/chat/acp/model-selector.tsx +1 -1
  172. package/src/components/chat/acp/session-tabs.tsx +8 -3
  173. package/src/components/chat/capabilities-popover.tsx +2 -11
  174. package/src/components/chat/chat-components.tsx +9 -4
  175. package/src/components/chat/chat-display.tsx +51 -6
  176. package/src/components/chat/chat-history-popover.tsx +6 -1
  177. package/src/components/chat/chat-markdown.tsx +15 -0
  178. package/src/components/chat/chat-panel.tsx +119 -214
  179. package/src/components/chat/chat-typography.css +108 -0
  180. package/src/components/chat/chat-utils.ts +12 -11
  181. package/src/components/chat/notebook-access-selector.stories.tsx +22 -0
  182. package/src/components/chat/notebook-access-selector.tsx +100 -0
  183. package/src/components/chat/reasoning-accordion.tsx +3 -3
  184. package/src/components/chat/tool-call/tool-activity-group.tsx +49 -0
  185. package/src/components/chat/tool-call/tool-history-row.tsx +3 -30
  186. package/src/components/chat/tool-call/tool-result.tsx +1 -1
  187. package/src/components/chat/use-chat-generation.ts +19 -0
  188. package/src/components/data-table/TableBottomBar.tsx +4 -1
  189. package/src/components/data-table/TableTopBar.tsx +2 -0
  190. package/src/components/data-table/__tests__/chart-spec-model.test.ts +195 -195
  191. package/src/components/data-table/__tests__/column-explorer.test.tsx +27 -1
  192. package/src/components/data-table/__tests__/columns.test.tsx +105 -0
  193. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  194. package/src/components/data-table/__tests__/data-table.test.tsx +1 -0
  195. package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
  196. package/src/components/data-table/__tests__/export-actions.test.tsx +105 -0
  197. package/src/components/data-table/__tests__/keyboard-selection.test.tsx +188 -0
  198. package/src/components/data-table/__tests__/pagination.test.tsx +28 -1
  199. package/src/components/data-table/__tests__/search-highlight.test.tsx +109 -0
  200. package/src/components/data-table/__tests__/url-detector.test.tsx +74 -0
  201. package/src/components/data-table/cell-selection/feature.ts +2 -2
  202. package/src/components/data-table/cell-selection/types.ts +2 -2
  203. package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
  204. package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +20 -20
  205. package/src/components/data-table/charts/__tests__/spec.test.ts +78 -52
  206. package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
  207. package/src/components/data-table/charts/chart-spec/spec.ts +68 -43
  208. package/src/components/data-table/charts/charts.tsx +40 -30
  209. package/src/components/data-table/charts/storage.ts +16 -5
  210. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
  211. package/src/components/data-table/column-formatting/types.ts +1 -2
  212. package/src/components/data-table/column-summary/chart-spec-model.tsx +23 -16
  213. package/src/components/data-table/column-summary/column-summary.tsx +2 -4
  214. package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
  215. package/src/components/data-table/columns.tsx +45 -46
  216. package/src/components/data-table/context-menu.tsx +36 -20
  217. package/src/components/data-table/data-table.tsx +17 -1
  218. package/src/components/data-table/date-popover.tsx +6 -4
  219. package/src/components/data-table/export-actions.tsx +76 -48
  220. package/src/components/data-table/pagination.tsx +44 -33
  221. package/src/components/data-table/range-focus/atoms.ts +4 -6
  222. package/src/components/data-table/range-focus/use-cell-range-selection.ts +65 -38
  223. package/src/components/data-table/range-focus/use-scroll-into-view.ts +21 -2
  224. package/src/components/data-table/renderers.tsx +16 -7
  225. package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +24 -1
  226. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +4 -4
  227. package/src/components/data-table/search-highlight.tsx +79 -0
  228. package/src/components/data-table/types.ts +1 -0
  229. package/src/components/data-table/url-detector.tsx +49 -9
  230. package/src/components/datasources/__tests__/column-actions.test.tsx +97 -0
  231. package/src/components/datasources/__tests__/column-preview.test.tsx +96 -5
  232. package/src/components/datasources/__tests__/datasources-interactions.test.tsx +181 -0
  233. package/src/components/datasources/__tests__/table-list.test.tsx +118 -0
  234. package/src/components/datasources/__tests__/utils.test.ts +57 -6
  235. package/src/components/datasources/column-preview.tsx +17 -12
  236. package/src/components/datasources/datasources.tsx +56 -43
  237. package/src/components/datasources/utils.ts +32 -23
  238. package/src/components/debugger/debugger-code.tsx +5 -0
  239. package/src/components/dependency-graph/custom-node.tsx +1 -1
  240. package/src/components/dependency-graph/dependency-graph-tree.tsx +8 -8
  241. package/src/components/dependency-graph/elements.ts +24 -21
  242. package/src/components/dependency-graph/minimap-content.tsx +13 -19
  243. package/src/components/dependency-graph/panels.tsx +4 -2
  244. package/src/components/dependency-graph/utils/__tests__/layout.test.ts +18 -11
  245. package/src/components/editor/SortableCell.tsx +1 -3
  246. package/src/components/editor/__tests__/Output.test.tsx +50 -32
  247. package/src/{core/attachments/__tests__/toast.test.tsx → components/editor/__tests__/agent-toast.test.tsx} +1 -1
  248. package/src/components/editor/__tests__/data-attributes.test.tsx +28 -14
  249. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
  250. package/src/components/editor/__tests__/output-persistence.test.tsx +6 -2
  251. package/src/components/editor/__tests__/package-alert.test.tsx +22 -1
  252. package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +69 -0
  253. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +21 -40
  254. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +41 -14
  255. package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +6 -24
  256. package/src/components/editor/actions/__tests__/useCellActionButton.test.tsx +113 -0
  257. package/src/components/editor/actions/name-cell-input.tsx +4 -3
  258. package/src/components/editor/actions/pair-with-agent-commands.ts +10 -7
  259. package/src/components/editor/actions/pair-with-agent-modal.tsx +29 -30
  260. package/src/components/editor/actions/pair-with-agent.tsx +16 -39
  261. package/src/components/editor/actions/useCellActionButton.tsx +37 -32
  262. package/src/components/editor/actions/useConfigActions.tsx +3 -4
  263. package/src/components/editor/actions/useNotebookActions.tsx +25 -29
  264. package/src/components/editor/actions/useRestartKernel.tsx +1 -1
  265. package/src/components/editor/actions/useSetCodeVisibility.ts +11 -12
  266. package/src/components/editor/actions/useSetOutputsExpanded.ts +14 -19
  267. package/src/components/editor/ai/ai-completion-editor.tsx +2 -1
  268. package/src/components/editor/ai/prompt-input.tsx +189 -0
  269. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +1 -1
  270. package/src/components/editor/alerts/connection-notice.tsx +1 -1
  271. package/src/components/editor/alerts/startup-logs-alert.tsx +1 -0
  272. package/src/components/editor/alerts/stdin-blocking-alert.tsx +1 -1
  273. package/src/components/editor/app-container.tsx +1 -1
  274. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +1 -1
  275. package/src/components/editor/cell/CreateCellButton.tsx +15 -21
  276. package/src/components/editor/cell/DeleteButton.tsx +3 -2
  277. package/src/components/editor/cell/RunButton.tsx +2 -2
  278. package/src/components/editor/cell/StagedAICell.tsx +13 -5
  279. package/src/components/editor/cell/StopButton.tsx +2 -2
  280. package/src/components/editor/cell/__tests__/useShouldShowInterrupt.test.ts +39 -0
  281. package/src/components/editor/cell/cell-actions.tsx +12 -1
  282. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  283. package/src/components/editor/cell/code/cell-editor.tsx +59 -165
  284. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  285. package/src/components/editor/cell/collapse.tsx +11 -4
  286. package/src/components/editor/cell/useAddCell.ts +4 -8
  287. package/src/components/editor/cell/useDeleteCell.tsx +10 -36
  288. package/src/components/editor/cell/useRunCells.ts +2 -5
  289. package/src/components/editor/cell/useShouldShowInterrupt.ts +2 -12
  290. package/src/components/editor/cell/useSplitCell.tsx +10 -6
  291. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +1 -1
  292. package/src/components/editor/chrome/components/feedback-button.tsx +2 -8
  293. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +31 -2
  294. package/src/components/editor/chrome/panels/__tests__/runtime-details.test.tsx +1 -1
  295. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +1 -1
  296. package/src/components/editor/chrome/panels/cache-panel.tsx +1 -0
  297. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +1 -1
  298. package/src/components/editor/chrome/panels/logs-panel.tsx +2 -1
  299. package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +84 -0
  300. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +39 -14
  301. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +3 -2
  302. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -7
  303. package/src/components/editor/chrome/panels/panel-header.tsx +13 -0
  304. package/src/components/editor/chrome/panels/secrets-panel.tsx +1 -0
  305. package/src/components/editor/chrome/panels/session-panel.tsx +1 -1
  306. package/src/components/editor/chrome/panels/snippets-panel.tsx +10 -12
  307. package/src/components/editor/chrome/panels/variable-panel.tsx +1 -5
  308. package/src/components/editor/chrome/types.ts +1 -1
  309. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +7 -9
  310. package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +92 -0
  311. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +102 -35
  312. package/src/components/editor/chrome/wrapper/__tests__/useAskAiAboutCell.test.tsx +58 -0
  313. package/src/components/editor/chrome/wrapper/app-chrome.tsx +89 -72
  314. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +4 -4
  315. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  316. package/src/components/editor/chrome/wrapper/footer-items/document-sync-status.tsx +54 -0
  317. package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +1 -1
  318. package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +1 -1
  319. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +1 -7
  320. package/src/components/editor/chrome/wrapper/footer.tsx +2 -2
  321. package/src/components/editor/chrome/wrapper/minimap-state.ts +1 -1
  322. package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +17 -10
  323. package/src/components/editor/chrome/wrapper/storage.ts +1 -1
  324. package/src/components/editor/chrome/wrapper/useAskAiAboutCell.ts +36 -0
  325. package/src/components/editor/columns/__tests__/cell-column.test.tsx +1 -1
  326. package/src/components/editor/columns/cell-column.tsx +1 -1
  327. package/src/components/editor/columns/sortable-column.tsx +2 -2
  328. package/src/components/editor/connections/components.tsx +5 -10
  329. package/src/components/editor/controls/Controls.tsx +4 -4
  330. package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
  331. package/src/components/editor/controls/__tests__/keyboard-shortcuts.test.tsx +61 -0
  332. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +10 -4
  333. package/src/components/editor/controls/command-palette.tsx +22 -10
  334. package/src/components/editor/controls/keyboard-shortcuts.tsx +14 -5
  335. package/src/components/editor/documentation.css +34 -11
  336. package/src/components/editor/dynamic-favicon.tsx +21 -40
  337. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +25 -20
  338. package/src/components/editor/errors/auto-fix.tsx +4 -8
  339. package/src/components/editor/errors/send-error-report-button.tsx +3 -6
  340. package/src/components/editor/file-tree/__tests__/file-explorer-interactions.test.tsx +6 -0
  341. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +47 -0
  342. package/src/components/editor/file-tree/__tests__/use-file-search.test.tsx +91 -0
  343. package/src/components/editor/file-tree/file-explorer.tsx +48 -15
  344. package/src/components/editor/file-tree/file-name-input.tsx +1 -0
  345. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  346. package/src/components/editor/file-tree/use-file-search.ts +35 -21
  347. package/src/components/editor/header/__tests__/filename-form.test.tsx +1 -4
  348. package/src/components/editor/header/__tests__/status.test.tsx +5 -3
  349. package/src/components/editor/header/app-header.tsx +1 -1
  350. package/src/components/editor/header/filename-form.tsx +1 -1
  351. package/src/components/editor/header/status.tsx +40 -20
  352. package/src/components/editor/links/__tests__/cell-link.test.tsx +148 -0
  353. package/src/components/editor/links/cell-link-list.tsx +1 -1
  354. package/src/components/editor/links/cell-link.tsx +17 -7
  355. package/src/components/editor/navigation/__tests__/clipboard.test.ts +60 -38
  356. package/src/components/editor/navigation/__tests__/navigation.test.ts +108 -85
  357. package/src/components/editor/navigation/__tests__/selection.test.ts +43 -21
  358. package/src/components/editor/navigation/clipboard.ts +17 -14
  359. package/src/components/editor/navigation/focus-utils.ts +23 -4
  360. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +17 -33
  361. package/src/components/editor/navigation/navigation.ts +71 -70
  362. package/src/components/editor/navigation/selection.ts +30 -29
  363. package/src/components/editor/notebook-banner.tsx +1 -0
  364. package/src/components/editor/notebook-cell.tsx +29 -32
  365. package/src/components/editor/output/MarimoErrorOutput.tsx +2 -1
  366. package/src/components/editor/output/MarimoTracebackOutput.tsx +19 -17
  367. package/src/components/editor/output/Outputs.css +8 -0
  368. package/src/components/editor/output/VideoOutput.tsx +6 -0
  369. package/src/components/editor/output/__tests__/VideoOutput.test.tsx +131 -0
  370. package/src/components/editor/output/__tests__/traceback.test.tsx +27 -1
  371. package/src/components/editor/output/ansi-reduce.ts +33 -20
  372. package/src/components/editor/output/console/ConsoleOutput.tsx +19 -25
  373. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +125 -69
  374. package/src/components/editor/package-alert.tsx +14 -7
  375. package/src/components/editor/renderers/__tests__/add-cell-buttons.test.tsx +18 -0
  376. package/src/components/editor/renderers/cell-array.tsx +32 -100
  377. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +12 -6
  378. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -1
  379. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +1 -1
  380. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +4 -4
  381. package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +7 -1
  382. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +1 -1
  383. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
  384. package/src/components/editor/stdin-blocking-alert.tsx +1 -1
  385. package/src/components/home/components.tsx +17 -31
  386. package/src/components/icons/__tests__/large-spinner.test.tsx +39 -0
  387. package/src/components/icons/large-spinner.tsx +3 -14
  388. package/src/components/icons/spinner.tsx +1 -1
  389. package/src/components/markdown/markdown-renderer.tsx +39 -28
  390. package/src/components/mcp/mcp-status-indicator.tsx +18 -14
  391. package/src/components/pages/__tests__/home-page.test.tsx +116 -0
  392. package/src/components/pages/edit-page.tsx +19 -17
  393. package/src/components/pages/home-page.tsx +164 -91
  394. package/src/components/scratchpad/scratchpad.test.tsx +89 -0
  395. package/src/components/scratchpad/scratchpad.tsx +43 -32
  396. package/src/components/scratchpad/state.ts +7 -0
  397. package/src/components/slides/__tests__/minimap-actions.test.tsx +22 -29
  398. package/src/components/slides/__tests__/minimap.test.ts +38 -19
  399. package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +37 -0
  400. package/src/components/slides/minimap.tsx +17 -12
  401. package/src/components/slides/reveal-component.tsx +58 -26
  402. package/src/components/slides/reveal-slides.css +5 -4
  403. package/src/components/slides/slide-cell-view.tsx +4 -5
  404. package/src/components/slides/slide-form.tsx +1 -0
  405. package/src/components/slides/slide-scroll-hint.tsx +3 -1
  406. package/src/components/sort/SortableCellsProvider.tsx +8 -25
  407. package/src/components/tracing/tracing-keyboard.test.tsx +85 -0
  408. package/src/components/tracing/tracing.tsx +46 -42
  409. package/src/components/ui/__tests__/draggable-popover.test.tsx +24 -0
  410. package/src/components/ui/__tests__/fullscreen.test.tsx +44 -2
  411. package/src/components/ui/__tests__/range-slider.test.tsx +165 -0
  412. package/src/components/ui/alert-dialog.tsx +1 -1
  413. package/src/components/ui/draggable-popover.tsx +24 -2
  414. package/src/components/ui/fullscreen.tsx +25 -1
  415. package/src/components/ui/range-slider.tsx +22 -9
  416. package/src/core/MarimoApp.tsx +3 -1
  417. package/src/core/ai/__tests__/staged-cells.test.ts +15 -482
  418. package/src/core/ai/context/context.ts +2 -0
  419. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +8 -12
  420. package/src/core/ai/context/providers/__tests__/cell.test.ts +49 -0
  421. package/src/core/ai/context/providers/cell-output.ts +2 -2
  422. package/src/core/ai/context/providers/cell.ts +54 -0
  423. package/src/core/ai/context/providers/datasource.ts +6 -2
  424. package/src/core/ai/staged-cells.ts +17 -294
  425. package/src/core/ai/state.ts +3 -0
  426. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +40 -88
  427. package/src/core/ai/tools/__tests__/registry.test.ts +17 -0
  428. package/src/core/ai/tools/base.ts +18 -15
  429. package/src/core/ai/tools/edit-notebook-tool.ts +86 -80
  430. package/src/core/ai/tools/registry.ts +13 -10
  431. package/src/core/ai/tools/sample-tool.ts +6 -7
  432. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -37
  433. package/src/core/cells/__tests__/actions.test.ts +624 -35
  434. package/src/core/cells/__tests__/add-missing-import.test.ts +7 -8
  435. package/src/core/cells/__tests__/arrange.test.ts +432 -0
  436. package/src/core/cells/__tests__/cell.test.ts +39 -0
  437. package/src/core/cells/__tests__/cells.test.ts +251 -2540
  438. package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
  439. package/src/core/cells/__tests__/document.test.ts +164 -0
  440. package/src/core/cells/__tests__/editor.test.ts +57 -0
  441. package/src/core/cells/__tests__/flush-document.test.ts +40 -0
  442. package/src/core/cells/__tests__/harness.ts +106 -0
  443. package/src/core/cells/__tests__/layout.test.ts +177 -0
  444. package/src/core/cells/__tests__/notebook-outline.test.ts +122 -0
  445. package/src/core/cells/__tests__/outputs.test.tsx +71 -53
  446. package/src/core/cells/__tests__/session.test.ts +445 -211
  447. package/src/core/cells/__tests__/utils.test.ts +9 -108
  448. package/src/core/cells/actions.ts +675 -6
  449. package/src/core/cells/add-missing-import.ts +47 -43
  450. package/src/core/cells/arrange.ts +529 -0
  451. package/src/core/cells/cell.ts +14 -3
  452. package/src/core/cells/cells.ts +126 -1363
  453. package/src/core/cells/columns.ts +38 -0
  454. package/src/core/cells/document.ts +178 -0
  455. package/src/core/cells/edit.ts +30 -0
  456. package/src/core/cells/editor.ts +82 -0
  457. package/src/core/cells/layout.ts +221 -0
  458. package/src/core/cells/outputs.ts +12 -28
  459. package/src/core/cells/pending-delete-service.ts +3 -7
  460. package/src/core/cells/session.ts +76 -53
  461. package/src/core/cells/types.ts +22 -6
  462. package/src/core/cells/utils.ts +10 -8
  463. package/src/core/codemirror/__tests__/format.test.ts +0 -34
  464. package/src/core/codemirror/__tests__/setup.test.ts +61 -29
  465. package/src/core/codemirror/ai/__tests__/resources.test.ts +117 -0
  466. package/src/core/codemirror/ai/resources.ts +1 -1
  467. package/src/core/codemirror/cells/__tests__/extensions.test.ts +2 -6
  468. package/src/core/codemirror/cells/extensions.ts +30 -28
  469. package/src/core/codemirror/cells/state.ts +2 -6
  470. package/src/core/codemirror/cm.ts +5 -1
  471. package/src/core/codemirror/config/types.ts +1 -1
  472. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +6 -7
  473. package/src/core/codemirror/copilot/getCodes.ts +2 -2
  474. package/src/core/codemirror/format.ts +6 -23
  475. package/src/core/codemirror/keymaps/vim.ts +4 -8
  476. package/src/core/codemirror/language/__tests__/sql.test.ts +22 -20
  477. package/src/core/codemirror/language/__tests__/utils.test.ts +187 -15
  478. package/src/core/codemirror/language/cell-code.ts +114 -0
  479. package/src/core/codemirror/language/extension.ts +52 -35
  480. package/src/core/codemirror/language/languages/markdown.ts +8 -6
  481. package/src/core/codemirror/language/languages/python.ts +19 -13
  482. package/src/core/codemirror/language/languages/sql/sql.ts +16 -24
  483. package/src/core/codemirror/language/panel/panel.tsx +1 -0
  484. package/src/core/codemirror/language/types.ts +7 -7
  485. package/src/core/codemirror/language/utils.ts +9 -39
  486. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +1 -2
  487. package/src/core/codemirror/lsp/notebook-lsp.ts +6 -5
  488. package/src/core/codemirror/lsp/utils.ts +1 -1
  489. package/src/core/codemirror/misc/__tests__/paste.test.ts +3 -1
  490. package/src/core/codemirror/misc/paste.ts +1 -1
  491. package/src/core/codemirror/placeholder/__tests__/extensions.test.ts +16 -0
  492. package/src/core/codemirror/placeholder/extensions.ts +57 -19
  493. package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
  494. package/src/core/codemirror/readonly/extension.ts +2 -2
  495. package/src/core/codemirror/utils.ts +1 -0
  496. package/src/core/config/__tests__/app-config.test.ts +64 -0
  497. package/src/core/config/__tests__/config-schema.test.ts +56 -6
  498. package/src/core/config/config-schema.ts +17 -4
  499. package/src/core/config/config.ts +65 -20
  500. package/src/core/config/feature-flag.tsx +0 -2
  501. package/src/core/datasets/__tests__/data-source-discovery.test.ts +5 -5
  502. package/src/core/datasets/data-source-discovery.ts +4 -6
  503. package/src/core/documentation/doc-lookup.ts +1 -1
  504. package/src/core/edit-app.tsx +21 -28
  505. package/src/core/errors/error-entries.ts +4 -1
  506. package/src/core/export/hooks.ts +1 -1
  507. package/src/core/export/layout.ts +2 -2
  508. package/src/core/hotkeys/actions.ts +2 -4
  509. package/src/core/hotkeys/hotkeys.ts +2 -1
  510. package/src/core/islands/__tests__/bootstrap.test.ts +69 -17
  511. package/src/core/islands/__tests__/bridge.test.ts +85 -27
  512. package/src/core/islands/bootstrap.ts +46 -53
  513. package/src/core/islands/bridge.ts +84 -25
  514. package/src/core/islands/components/__tests__/IslandControls.test.tsx +7 -5
  515. package/src/core/islands/components/web-components.tsx +1 -1
  516. package/src/core/islands/worker/__tests__/controller.test.ts +62 -4
  517. package/src/core/islands/worker/controller.ts +4 -10
  518. package/src/core/islands/worker/worker.tsx +33 -33
  519. package/src/core/kernel/__tests__/RuntimeState.test.ts +1 -1
  520. package/src/core/kernel/__tests__/handlers.test.ts +7 -153
  521. package/src/core/kernel/handlers.ts +19 -72
  522. package/src/core/meta/__tests__/code-visibility.test.tsx +78 -70
  523. package/src/core/meta/code-visibility.ts +18 -9
  524. package/src/core/network/__tests__/connection.test.ts +1 -1
  525. package/src/core/network/__tests__/requests-lazy.test.ts +1 -3
  526. package/src/core/network/connection-notice.ts +1 -1
  527. package/src/core/network/connection.ts +1 -1
  528. package/src/core/network/requests-lazy.ts +2 -5
  529. package/src/core/network/requests-network.ts +5 -31
  530. package/src/core/network/requests-static.ts +1 -4
  531. package/src/core/network/requests-toasting.tsx +1 -4
  532. package/src/core/network/types.ts +6 -14
  533. package/src/core/network/useConnectionNotice.ts +8 -2
  534. package/src/core/notebook/__tests__/operations.test.ts +51 -0
  535. package/src/core/notebook/attachments.ts +38 -0
  536. package/src/core/notebook/document/__tests__/codemirror.test.ts +759 -0
  537. package/src/core/notebook/document/__tests__/draft.test.ts +363 -0
  538. package/src/core/notebook/document/__tests__/fixtures.ts +92 -0
  539. package/src/core/notebook/document/__tests__/hooks.test.tsx +391 -0
  540. package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +61 -0
  541. package/src/core/notebook/document/__tests__/model.test.ts +247 -0
  542. package/src/core/notebook/document/__tests__/protocol-fixtures.ts +38 -0
  543. package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +230 -0
  544. package/src/core/notebook/document/__tests__/scenario-fixture.ts +43 -0
  545. package/src/core/notebook/document/__tests__/scenarios.test.ts +205 -0
  546. package/src/core/notebook/document/__tests__/state.test.ts +459 -0
  547. package/src/core/notebook/document/__tests__/submission.test.ts +203 -0
  548. package/src/core/notebook/document/__tests__/test-host.test.ts +92 -0
  549. package/src/core/notebook/document/__tests__/test-host.ts +247 -0
  550. package/src/core/notebook/document/__tests__/test-notebook.ts +149 -0
  551. package/src/core/notebook/document/__tests__/user.ts +61 -0
  552. package/src/core/notebook/document/codemirror.ts +216 -0
  553. package/src/core/notebook/document/draft.ts +502 -0
  554. package/src/core/notebook/document/hooks.tsx +118 -0
  555. package/src/core/notebook/document/index.ts +24 -0
  556. package/src/core/notebook/document/model.ts +102 -0
  557. package/src/core/notebook/document/select.ts +41 -0
  558. package/src/core/notebook/document/state.ts +378 -0
  559. package/src/core/notebook/document/sync.ts +369 -0
  560. package/src/core/notebook/index.ts +19 -0
  561. package/src/core/notebook/operations.ts +30 -0
  562. package/src/core/notebook/replica/AGENTS.md +11 -0
  563. package/src/core/{host → notebook/replica}/__tests__/attachments.test.ts +9 -10
  564. package/src/core/{host → notebook/replica}/__tests__/document.test.ts +18 -16
  565. package/src/core/notebook/replica/__tests__/executions.test.ts +200 -0
  566. package/src/core/notebook/replica/__tests__/fixtures.ts +79 -0
  567. package/src/core/notebook/replica/__tests__/replica.test.ts +559 -0
  568. package/src/core/notebook/replica/__tests__/results.test.ts +193 -0
  569. package/src/core/notebook/replica/__tests__/runtime.test.ts +78 -0
  570. package/src/core/notebook/replica/backend.ts +19 -0
  571. package/src/core/notebook/replica/connection.ts +42 -0
  572. package/src/core/notebook/replica/index.ts +20 -0
  573. package/src/core/notebook/replica/replica.ts +336 -0
  574. package/src/core/{host → notebook/replica}/resources/attachments.ts +6 -3
  575. package/src/core/{host → notebook/replica}/resources/document.ts +3 -3
  576. package/src/core/notebook/replica/resources/executions.ts +157 -0
  577. package/src/core/notebook/replica/resources/results.ts +48 -0
  578. package/src/core/notebook/replica/resources/runtime.ts +14 -0
  579. package/src/core/packages/__tests__/useSandboxController.test.tsx +1 -1
  580. package/src/core/packages/useSandboxController.ts +1 -1
  581. package/src/core/run-app.tsx +48 -51
  582. package/src/core/runtime/__tests__/adapter.test.ts +1 -1
  583. package/src/core/runtime/__tests__/createWsUrl.test.ts +77 -7
  584. package/src/core/runtime/__tests__/runtime.test.ts +32 -74
  585. package/src/core/runtime/adapter.ts +1 -1
  586. package/src/core/runtime/config.ts +2 -2
  587. package/src/core/runtime/runtime.ts +33 -46
  588. package/src/core/runtime/types.ts +0 -2
  589. package/src/core/saving/__tests__/document.test.tsx +123 -0
  590. package/src/core/saving/__tests__/state.test.ts +111 -0
  591. package/src/core/saving/__tests__/useAutoSave.test.tsx +67 -0
  592. package/src/core/saving/document.ts +33 -0
  593. package/src/core/saving/filename.ts +1 -1
  594. package/src/core/saving/save-component.tsx +39 -60
  595. package/src/core/saving/state.ts +38 -39
  596. package/src/core/saving/useAutoSave.ts +17 -53
  597. package/src/core/session/__tests__/backend.test.ts +236 -0
  598. package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +184 -0
  599. package/src/core/{websocket → session}/__tests__/useNotebookSession.hook.test.tsx +213 -262
  600. package/src/core/session/active-notebook.ts +28 -0
  601. package/src/core/session/backend.ts +123 -0
  602. package/src/core/session/embedded.ts +7 -0
  603. package/src/core/{websocket → session}/types.ts +2 -2
  604. package/src/core/session/useNotebookReplica.ts +74 -0
  605. package/src/core/{websocket → session}/useNotebookSession.tsx +77 -64
  606. package/src/core/state/__tests__/jotai.test.tsx +108 -0
  607. package/src/core/state/jotai.ts +1 -1
  608. package/src/core/static/__tests__/files.test.ts +38 -10
  609. package/src/core/static/files.ts +2 -0
  610. package/src/core/{websocket → transports}/__tests__/connection-state.test.ts +1 -13
  611. package/src/core/transports/__tests__/server.test.ts +408 -0
  612. package/src/core/transports/__tests__/static.test.ts +306 -0
  613. package/src/core/transports/__tests__/wasm.test.ts +166 -0
  614. package/src/core/{websocket → transports}/connection-state.ts +9 -16
  615. package/src/core/transports/server.ts +152 -0
  616. package/src/core/transports/static.ts +166 -0
  617. package/src/core/transports/wasm.ts +97 -0
  618. package/src/core/vscode/__tests__/vscode-bindings.test.ts +125 -0
  619. package/src/core/vscode/vscode-bindings.ts +14 -2
  620. package/src/core/wasm/__tests__/bridge.test.ts +210 -64
  621. package/src/core/wasm/__tests__/worker.test.ts +188 -0
  622. package/src/core/wasm/bridge.ts +119 -72
  623. package/src/core/wasm/rpc.ts +15 -3
  624. package/src/core/wasm/store.ts +3 -3
  625. package/src/core/wasm/worker/bootstrap.ts +55 -51
  626. package/src/core/wasm/worker/getMarimoWheel.ts +1 -1
  627. package/src/core/wasm/worker/save-worker.ts +9 -10
  628. package/src/core/wasm/worker/types.ts +30 -18
  629. package/src/core/wasm/worker/worker.ts +118 -72
  630. package/src/css/app/codemirror.css +1 -1
  631. package/src/css/common.css +1 -1
  632. package/src/css/globals.css +66 -22
  633. package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
  634. package/src/hooks/__tests__/useDebounce.test.tsx +51 -0
  635. package/src/hooks/__tests__/useDeepCompareMemoize.test.tsx +39 -0
  636. package/src/hooks/__tests__/useDelayElapsed.test.tsx +28 -0
  637. package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +20 -0
  638. package/src/hooks/__tests__/useScript.test.tsx +77 -0
  639. package/src/hooks/__tests__/useStateForKey.test.tsx +257 -0
  640. package/src/hooks/useAsyncData.ts +3 -3
  641. package/src/hooks/useDataSourceDiscovery.ts +6 -4
  642. package/src/hooks/useDebounce.ts +6 -10
  643. package/src/hooks/useDeepCompareMemoize.ts +1 -1
  644. package/src/hooks/useDelayElapsed.ts +14 -10
  645. package/src/hooks/useElapsedTime.ts +3 -3
  646. package/src/hooks/useEventListener.ts +1 -2
  647. package/src/hooks/useInputHistory.ts +4 -7
  648. package/src/hooks/useInternalStateWithSync.ts +6 -6
  649. package/src/hooks/useResizeObserver.ts +4 -7
  650. package/src/hooks/useScript.ts +67 -70
  651. package/src/hooks/useStateForKey.ts +93 -0
  652. package/src/mount.tsx +20 -15
  653. package/src/plugins/__tests__/plugin-object-schemas.test.ts +104 -0
  654. package/src/plugins/core/registerReactComponent.tsx +1 -1
  655. package/src/plugins/impl/CodeEditorPlugin.tsx +1 -1
  656. package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
  657. package/src/plugins/impl/DataTablePlugin.tsx +69 -37
  658. package/src/plugins/impl/DropdownPlugin.tsx +2 -6
  659. package/src/plugins/impl/FileBrowserPlugin.tsx +4 -16
  660. package/src/plugins/impl/FormPlugin.tsx +1 -1
  661. package/src/plugins/impl/RangeSliderPlugin.tsx +16 -2
  662. package/src/plugins/impl/RefreshPlugin.tsx +1 -0
  663. package/src/plugins/impl/SliderPlugin.tsx +6 -8
  664. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +387 -1
  665. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +45 -0
  666. package/src/plugins/impl/__tests__/RangeSliderPlugin.test.tsx +109 -0
  667. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +24 -3
  668. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +153 -0
  669. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  670. package/src/plugins/impl/anywidget/model.ts +3 -1
  671. package/src/plugins/impl/anywidget/registry.ts +18 -14
  672. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  673. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  674. package/src/plugins/impl/chat/__tests__/chat-prompts.test.tsx +93 -0
  675. package/src/plugins/impl/chat/chat-ui.tsx +15 -12
  676. package/src/plugins/impl/code/any-language-editor.tsx +2 -2
  677. package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
  678. package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
  679. package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +1 -1
  680. package/src/plugins/impl/data-explorer/components/column-summary.tsx +4 -2
  681. package/src/plugins/impl/data-explorer/state/reducer.ts +1 -1
  682. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -2
  683. package/src/plugins/impl/data-frames/__tests__/sidebar.test.tsx +160 -0
  684. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +66 -66
  685. package/src/plugins/impl/data-frames/panel.tsx +44 -16
  686. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  687. package/src/plugins/impl/panel/PanelPlugin.tsx +16 -17
  688. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  689. package/src/plugins/impl/panel/utils.ts +17 -0
  690. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +2 -5
  691. package/src/plugins/impl/plotly/selection.ts +25 -19
  692. package/src/plugins/impl/vega/VegaPlugin.tsx +2 -3
  693. package/src/plugins/impl/vega/make-selectable.ts +4 -7
  694. package/src/plugins/layout/DownloadPlugin.tsx +7 -11
  695. package/src/plugins/layout/RoutesPlugin.tsx +1 -1
  696. package/src/plugins/layout/__test__/DownloadPlugin.test.tsx +205 -0
  697. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  698. package/src/stories/button.stories.tsx +1 -0
  699. package/src/stories/cell.stories.tsx +2 -5
  700. package/src/stories/data-table.stories.tsx +31 -0
  701. package/src/stories/editor.stories.tsx +24 -17
  702. package/src/stories/form-wrapper.stories.tsx +2 -2
  703. package/src/stories/layout/vertical/one-column.stories.tsx +28 -23
  704. package/src/stories/runtime-story.tsx +23 -17
  705. package/src/stories/select.stories.tsx +2 -2
  706. package/src/stories/switchable-multi-select.stories.tsx +1 -1
  707. package/src/utils/__tests__/arrays.test.ts +35 -0
  708. package/src/utils/__tests__/batch-requests.test.ts +3 -3
  709. package/src/utils/__tests__/{createReducer.test.ts → createReducer.test.tsx} +127 -1
  710. package/src/utils/__tests__/download.test.tsx +183 -23
  711. package/src/utils/__tests__/numbers.test.ts +105 -1
  712. package/src/utils/__tests__/objects.test.ts +21 -0
  713. package/src/utils/arrays.ts +11 -2
  714. package/src/utils/blob.ts +1 -1
  715. package/src/utils/createReducer.ts +115 -79
  716. package/src/utils/download.ts +67 -6
  717. package/src/utils/maps.ts +0 -3
  718. package/src/utils/numbers.ts +79 -18
  719. package/src/utils/objects.ts +4 -9
  720. package/src/utils/tracer.ts +9 -5
  721. package/src/utils/zod-utils.ts +1 -3
  722. package/dist/_baseMerge-BiGRwuqv.js +0 -165
  723. package/dist/any-language-editor-D4q-IFcM.js +0 -76
  724. package/dist/assets/__vite-browser-external-BXYkiFsk.js +0 -1
  725. package/dist/assets/worker-HPY9fbhz.js +0 -114
  726. package/dist/code-visibility-XgDUZz2f.js +0 -138
  727. package/dist/dropdown-menu-DHP9P4VE.js +0 -4678
  728. package/dist/feedback-button-CoWyGXbB.js +0 -379
  729. package/dist/hasIn-o2Us0uVx.js +0 -132
  730. package/dist/html-to-image-BdA59IUD.js +0 -3251
  731. package/dist/isArrayLikeObject-BZl-15ir.js +0 -450
  732. package/dist/isEmpty-BSZ1LaUo.js +0 -35
  733. package/dist/isSymbol-kQcfYbNX.js +0 -8
  734. package/dist/label-DoysmLMW.js +0 -281
  735. package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +0 -2
  736. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +0 -23
  737. package/dist/pick-CJeoxYOS.js +0 -51
  738. package/dist/precisionRound-DMIVQrt2.js +0 -97
  739. package/dist/select-DemoKT4G.js +0 -1344
  740. package/dist/toDate-B5mIgxwZ.js +0 -1185
  741. package/dist/toast-PkdZraM8.js +0 -1830
  742. package/dist/use-restore-focus-CKjfFjLM.js +0 -6369
  743. package/dist/useLifecycle-BGWzTwHK.js +0 -169
  744. package/dist/useTheme-BhQvec43.js +0 -904
  745. package/src/components/editor/ai/__tests__/staged-cell-submission.test.ts +0 -106
  746. package/src/components/editor/ai/add-cell-with-ai.tsx +0 -506
  747. package/src/components/editor/ai/staged-cell-submission.ts +0 -46
  748. package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +0 -64
  749. package/src/components/editor/cell/code/__tests__/rtc-editor-config.test.ts +0 -50
  750. package/src/components/editor/chrome/wrapper/footer-items/rtc-status.tsx +0 -65
  751. package/src/components/editor/navigation/__tests__/state.test.ts +0 -81
  752. package/src/components/editor/navigation/state.ts +0 -65
  753. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +0 -656
  754. package/src/core/ai/tools/run-cells-tool.ts +0 -303
  755. package/src/core/attachments/state.ts +0 -18
  756. package/src/core/cells/__tests__/apply-transaction.test.ts +0 -991
  757. package/src/core/cells/__tests__/document-changes.test.ts +0 -1140
  758. package/src/core/cells/__tests__/document-roundtrip.test.ts +0 -392
  759. package/src/core/cells/document-changes.ts +0 -944
  760. package/src/core/codemirror/rtc/extension.ts +0 -453
  761. package/src/core/codemirror/rtc/loro/__tests__/sync.test.ts +0 -52
  762. package/src/core/codemirror/rtc/loro/awareness.ts +0 -531
  763. package/src/core/codemirror/rtc/loro/colors.ts +0 -38
  764. package/src/core/codemirror/rtc/loro/sync.ts +0 -168
  765. package/src/core/host/AGENTS.md +0 -11
  766. package/src/core/host/__tests__/events.test.ts +0 -46
  767. package/src/core/host/__tests__/fixtures.ts +0 -39
  768. package/src/core/host/__tests__/notebook-client.test.ts +0 -433
  769. package/src/core/host/__tests__/protocol.test.ts +0 -214
  770. package/src/core/host/__tests__/stream.test.ts +0 -209
  771. package/src/core/host/connection.ts +0 -81
  772. package/src/core/host/events.ts +0 -61
  773. package/src/core/host/notebook-client.ts +0 -290
  774. package/src/core/host/protocol.ts +0 -1943
  775. package/src/core/host/resources/resource.ts +0 -47
  776. package/src/core/host/stream.ts +0 -211
  777. package/src/core/rtc/state.ts +0 -34
  778. package/src/core/state/__tests__/jotai.test.ts +0 -25
  779. package/src/core/wasm/worker/message-buffer.ts +0 -33
  780. package/src/core/websocket/__tests__/createConnectionTransport.test.ts +0 -49
  781. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +0 -170
  782. package/src/core/websocket/state.ts +0 -7
  783. package/src/core/websocket/transports/__tests__/basic.test.ts +0 -275
  784. package/src/core/websocket/transports/__tests__/sse.test.ts +0 -335
  785. package/src/core/websocket/transports/__tests__/transport.test.ts +0 -308
  786. package/src/core/websocket/transports/__tests__/ws.test.ts +0 -125
  787. package/src/core/websocket/transports/basic.ts +0 -102
  788. package/src/core/websocket/transports/create.ts +0 -31
  789. package/src/core/websocket/transports/sse.ts +0 -308
  790. package/src/core/websocket/transports/transport.ts +0 -50
  791. package/src/core/websocket/transports/ws.ts +0 -98
  792. package/src/core/websocket/useNotebookClient.ts +0 -88
  793. package/src/utils/__tests__/id-tree.test.ts +0 -2145
  794. package/src/utils/id-tree.tsx +0 -1134
  795. /package/src/{core/attachments/toast.ts → components/editor/agent-toast.ts} +0 -0
  796. /package/src/core/{websocket → session}/connection-utils.ts +0 -0
@@ -1,28 +1,29 @@
1
1
  import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
2
- import { c as n, g as r, h as i, t as a } from "./button-CvjkwdSk.js";
2
+ import { c as n, g as r, h as i, t as a } from "./button-0-RqY1DW.js";
3
3
  import { t as o } from "./react-sHtZdjeP.js";
4
4
  import { t as s } from "./compiler-runtime-CldRdSsv.js";
5
- import { i as c, t as l } from "./copy-icon-BgUO8jsi.js";
6
- import { F as u, H as d, U as f, V as p, X as m, Y as h, Z as g, _, a as v, c as y, d as b, f as x, g as S, h as C, l as w, m as T, n as E, p as D, r as O, t as k, v as A, x as ee, y as te, z as ne } from "./html-to-image-BdA59IUD.js";
7
- import { h as j, t as re } from "./tooltip-CtBZ5q8p.js";
8
- import { Ct as ie, Et as ae, Ht as oe, L as se, Lt as ce, Nt as le, St as ue, X as de, cn as fe, ct as pe, dn as me, en as he, et as ge, h as _e, i as ve, ln as ye, mn as be, mt as xe, r as Se, rt as Ce, st as we, t as Te, w as Ee, xt as De } from "./error-entries-Damuuclv.js";
9
- import { A as Oe, C as ke, M as Ae, b as je } from "./select-DemoKT4G.js";
10
- import { _ as Me, f as Ne, h as Pe, i as Fe, n as Ie, t as Le } from "./dropdown-menu-DHP9P4VE.js";
11
- import { C as Re, d as ze } from "./toDate-B5mIgxwZ.js";
12
- import { d as Be, f as Ve, i as He, n as Ue, t as We, u as Ge } from "./process-output-CTPTtxXB.js";
13
- import { t as Ke } from "./jsx-runtime-3BD1kT0s.js";
14
- import { A as qe, B as Je, C as Ye, E as Xe, I as Ze, L as Qe, M as $e, N as et, O as tt, P as nt, S as rt, T as it, U as at, V as ot, b as st, k as ct, w as lt, x as ut, y as dt, z as ft } from "./use-restore-focus-CKjfFjLM.js";
15
- import { n as pt } from "./error-banner-CFPHFw4h.js";
16
- import { t as mt } from "./label-DoysmLMW.js";
17
- import { t as ht } from "./isEmpty-BSZ1LaUo.js";
18
- import { A as gt, T as _t, n as vt } from "./useTheme-BhQvec43.js";
19
- import { $ as yt, Mt as bt, Pt as xt, Rt as St, Vt as Ct, Z as wt, ht as Tt, jt as Et, mt as Dt, nt as Ot, tt as kt, zt as At } from "./dist-DoE4XJBC.js";
20
- import { t as jt } from "./objects-CzUgoMIF.js";
21
- import { n as Mt, o as Nt, r as Pt } from "./dist-CkTTIdBe.js";
22
- import { n as Ft } from "./dist-CrSP_H1M.js";
23
- import { n as It, t as Lt } from "./esm-AMFssoNp.js";
24
- import { t as Rt } from "./useAsyncData-BD534XmW.js";
25
- var zt = j("ban", [["circle", {
5
+ import { i as c, t as l } from "./copy-icon-DD8bdw4L.js";
6
+ import { Dt as u, G as d, Ht as f, I as p, J as m, Kt as h, Nt as g, Pt as _, Q as v, S as y, Tt as b, Vt as x, _ as S, a as C, b as w, dt as T, f as E, ft as ee, g as D, h as te, ht as ne, it as re, l as ie, lt as ae, m as O, n as oe, p as k, q as se, r as ce, t as le, u as ue, ut as de, v as fe, y as pe, yt as me, zt as he } from "./html-to-image-BPs9Vo-H.js";
7
+ import { m as A, t as ge } from "./tooltip-Bzl4k00l.js";
8
+ import { M as _e, d as ve } from "./select-CcidPqlM.js";
9
+ import { _ as ye, f as be, h as xe, i as Se, n as Ce, t as we } from "./dropdown-menu-Blu7V6Mk.js";
10
+ import { a as Te, l as Ee } from "./config-mwEjAmvP.js";
11
+ import { F as De, G as Oe, M as ke, et as Ae, h as je, i as Me, r as Ne, st as Pe, t as Fe, wt as Ie, zt as Le } from "./error-entries-DFhMo601.js";
12
+ import { d as Re, f as ze, i as Be, n as Ve, t as He, u as Ue } from "./process-output-c6xaHokq.js";
13
+ import { i as We, s as Ge, t as Ke } from "./strings-BYJNyKmg.js";
14
+ import { t as qe } from "./jsx-runtime-3BD1kT0s.js";
15
+ import { n as Je } from "./error-banner-DbRFOd2O.js";
16
+ import { n as Ye, r as Xe } from "./useTheme-BZ2GGLgm.js";
17
+ import { t as Ze } from "./isEmpty-CdX7MTE1.js";
18
+ import { C as Qe, D as $e, x as et } from "./utils-DXkj82sK.js";
19
+ import { t as tt } from "./objects-DCmMvZtn.js";
20
+ import { Dt as nt, Et as rt, St as it, U as at, V as ot, W as st, bt as ct, kt as lt, nt as ut, rt as dt, yt as ft, z as pt } from "./dist-CYeqK4Xw.js";
21
+ import { B as mt, C as ht, D as gt, F as _t, H as vt, I as yt, M as bt, N as xt, O as St, R as Ct, S as wt, T as Tt, b as Et, j as Dt, k as Ot, v as kt, w as At, x as jt, y as Mt, z as Nt } from "./schemas-CdscWNy_.js";
22
+ import { n as Pt, o as Ft, r as It } from "./dist-BX1mn8na.js";
23
+ import { n as Lt } from "./dist-DiLFTlnl.js";
24
+ import { n as Rt, t as zt } from "./esm-CHjVSexr.js";
25
+ import { t as Bt } from "./useAsyncData-DsZMvNXn.js";
26
+ var Vt = A("ban", [["circle", {
26
27
  cx: "12",
27
28
  cy: "12",
28
29
  r: "10",
@@ -30,7 +31,7 @@ var zt = j("ban", [["circle", {
30
31
  }], ["path", {
31
32
  d: "M4.929 4.929 19.07 19.071",
32
33
  key: "196cmz"
33
- }]]), Bt = j("bot-message-square", [
34
+ }]]), Ht = A("bot-message-square", [
34
35
  ["path", {
35
36
  d: "M12 6V2H8",
36
37
  key: "1155em"
@@ -55,13 +56,7 @@ var zt = j("ban", [["circle", {
55
56
  d: "M9 11v2",
56
57
  key: "1ueba0"
57
58
  }]
58
- ]), Vt = j("circle-check-big", [["path", {
59
- d: "M21.801 10A10 10 0 1 1 17 3.335",
60
- key: "yps3ct"
61
- }], ["path", {
62
- d: "m9 11 3 3L22 4",
63
- key: "1pflzl"
64
- }]]), Ht = j("circle-slash", [["circle", {
59
+ ]), Ut = A("circle-slash", [["circle", {
65
60
  cx: "12",
66
61
  cy: "12",
67
62
  r: "10",
@@ -72,22 +67,22 @@ var zt = j("ban", [["circle", {
72
67
  y1: "15",
73
68
  y2: "9",
74
69
  key: "1dfufj"
75
- }]]), Ut = j("paperclip", [["path", {
70
+ }]]), Wt = A("paperclip", [["path", {
76
71
  d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
77
72
  key: "1miecu"
78
- }]]), Wt = j("rotate-cw", [["path", {
73
+ }]]), Gt = A("rotate-cw", [["path", {
79
74
  d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
80
75
  key: "1p45f6"
81
76
  }], ["path", {
82
77
  d: "M21 3v5h-5",
83
78
  key: "1q7to0"
84
- }]]), Gt = j("send-horizontal", [["path", {
79
+ }]]), Kt = A("send-horizontal", [["path", {
85
80
  d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",
86
81
  key: "117uat"
87
82
  }], ["path", {
88
83
  d: "M6 12h16",
89
84
  key: "s4cdu5"
90
- }]]), Kt = j("settings", [["path", {
85
+ }]]), qt = A("settings", [["path", {
91
86
  d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
92
87
  key: "1i5ecw"
93
88
  }], ["circle", {
@@ -95,7 +90,7 @@ var zt = j("ban", [["circle", {
95
90
  cy: "12",
96
91
  r: "3",
97
92
  key: "1v7zrd"
98
- }]]), qt = j("shield-question-mark", [
93
+ }]]), Jt = A("shield-question-mark", [
99
94
  ["path", {
100
95
  d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
101
96
  key: "oel41y"
@@ -108,66 +103,66 @@ var zt = j("ban", [["circle", {
108
103
  d: "M12 17h.01",
109
104
  key: "p32p05"
110
105
  }]
111
- ]), M = s(), Jt = "vercel.ai.error", Yt = Symbol.for(Jt), Xt, Zt, N = class e extends (Zt = Error, Xt = Yt, Zt) {
106
+ ]), j = s(), Yt = "vercel.ai.error", Xt = Symbol.for(Yt), Zt, Qt, M = class e extends (Qt = Error, Zt = Xt, Qt) {
112
107
  constructor({ name: e, message: t, cause: n }) {
113
- super(t), this[Xt] = !0, this.name = e, this.cause = n;
108
+ super(t), this[Zt] = !0, this.name = e, this.cause = n;
114
109
  }
115
110
  static isInstance(t) {
116
- return e.hasMarker(t, Jt);
111
+ return e.hasMarker(t, Yt);
117
112
  }
118
113
  static hasMarker(e, t) {
119
114
  let n = Symbol.for(t);
120
115
  return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
121
116
  }
122
- }, Qt = "AI_APICallError", $t = `vercel.ai.error.${Qt}`, en = Symbol.for($t), tn, nn, rn = class extends (nn = N, tn = en, nn) {
117
+ }, $t = "AI_APICallError", en = `vercel.ai.error.${$t}`, tn = Symbol.for(en), nn, rn, an = class extends (rn = M, nn = tn, rn) {
123
118
  constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) {
124
119
  super({
125
- name: Qt,
120
+ name: $t,
126
121
  message: e,
127
122
  cause: o
128
- }), this[tn] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
123
+ }), this[nn] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
129
124
  }
130
125
  static isInstance(e) {
131
- return N.hasMarker(e, $t);
126
+ return M.hasMarker(e, en);
132
127
  }
133
- }, an = "AI_EmptyResponseBodyError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = N, cn = sn, ln) {
128
+ }, on = "AI_EmptyResponseBodyError", sn = `vercel.ai.error.${on}`, cn = Symbol.for(sn), ln, un, dn = class extends (un = M, ln = cn, un) {
134
129
  constructor({ message: e = "Empty response body" } = {}) {
135
130
  super({
136
- name: an,
131
+ name: on,
137
132
  message: e
138
- }), this[cn] = !0;
133
+ }), this[ln] = !0;
139
134
  }
140
135
  static isInstance(e) {
141
- return N.hasMarker(e, on);
136
+ return M.hasMarker(e, sn);
142
137
  }
143
138
  };
144
- function dn(e) {
139
+ function fn(e) {
145
140
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
146
141
  }
147
- var fn = "AI_InvalidArgumentError", pn = `vercel.ai.error.${fn}`, mn = Symbol.for(pn), hn, gn, _n = class extends (gn = N, hn = mn, gn) {
142
+ var pn = "AI_InvalidArgumentError", mn = `vercel.ai.error.${pn}`, hn = Symbol.for(mn), gn, _n, vn = class extends (_n = M, gn = hn, _n) {
148
143
  constructor({ message: e, cause: t, argument: n }) {
149
144
  super({
150
- name: fn,
145
+ name: pn,
151
146
  message: e,
152
147
  cause: t
153
- }), this[hn] = !0, this.argument = n;
148
+ }), this[gn] = !0, this.argument = n;
154
149
  }
155
150
  static isInstance(e) {
156
- return N.hasMarker(e, pn);
151
+ return M.hasMarker(e, mn);
157
152
  }
158
- }, vn = "AI_JSONParseError", yn = `vercel.ai.error.${vn}`, bn = Symbol.for(yn), xn, Sn, Cn = class extends (Sn = N, xn = bn, Sn) {
153
+ }, yn = "AI_JSONParseError", bn = `vercel.ai.error.${yn}`, xn = Symbol.for(bn), Sn, Cn, wn = class extends (Cn = M, Sn = xn, Cn) {
159
154
  constructor({ text: e, cause: t }) {
160
155
  super({
161
- name: vn,
156
+ name: yn,
162
157
  message: `JSON parsing failed: Text: ${e}.
163
- Error message: ${dn(t)}`,
158
+ Error message: ${fn(t)}`,
164
159
  cause: t
165
- }), this[xn] = !0, this.text = e;
160
+ }), this[Sn] = !0, this.text = e;
166
161
  }
167
162
  static isInstance(e) {
168
- return N.hasMarker(e, yn);
163
+ return M.hasMarker(e, bn);
169
164
  }
170
- }, wn = "AI_TypeValidationError", Tn = `vercel.ai.error.${wn}`, En = Symbol.for(Tn), Dn, On, P = class e extends (On = N, Dn = En, On) {
165
+ }, Tn = "AI_TypeValidationError", En = `vercel.ai.error.${Tn}`, Dn = Symbol.for(En), On, kn, N = class e extends (kn = M, On = Dn, kn) {
171
166
  constructor({ value: e, cause: t, context: n }) {
172
167
  let r = "Type validation failed";
173
168
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -176,14 +171,14 @@ Error message: ${dn(t)}`,
176
171
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
177
172
  }
178
173
  super({
179
- name: wn,
174
+ name: Tn,
180
175
  message: `${r}: Value: ${JSON.stringify(e)}.
181
- Error message: ${dn(t)}`,
176
+ Error message: ${fn(t)}`,
182
177
  cause: t
183
- }), this[Dn] = !0, this.value = e, this.context = n;
178
+ }), this[On] = !0, this.value = e, this.context = n;
184
179
  }
185
180
  static isInstance(e) {
186
- return N.hasMarker(e, Tn);
181
+ return M.hasMarker(e, En);
187
182
  }
188
183
  static wrap({ value: t, cause: n, context: r }) {
189
184
  return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
@@ -192,25 +187,25 @@ Error message: ${dn(t)}`,
192
187
  context: r
193
188
  });
194
189
  }
195
- }, kn = "AI_UnsupportedFunctionalityError", An = `vercel.ai.error.${kn}`, jn = Symbol.for(An), Mn, Nn, Pn = class extends (Nn = N, Mn = jn, Nn) {
190
+ }, An = "AI_UnsupportedFunctionalityError", jn = `vercel.ai.error.${An}`, Mn = Symbol.for(jn), Nn, Pn, Fn = class extends (Pn = M, Nn = Mn, Pn) {
196
191
  constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
197
192
  super({
198
- name: kn,
193
+ name: An,
199
194
  message: t
200
- }), this[Mn] = !0, this.functionality = e;
195
+ }), this[Nn] = !0, this.functionality = e;
201
196
  }
202
197
  static isInstance(e) {
203
- return N.hasMarker(e, An);
198
+ return M.hasMarker(e, jn);
204
199
  }
205
- }, Fn = class extends Error {
200
+ }, In = class extends Error {
206
201
  constructor(e, t) {
207
202
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
208
203
  }
209
- }, In = 10, Ln = 13, Rn = 32;
210
- function zn(e) {}
211
- function Bn(e) {
204
+ }, Ln = 10, Rn = 13, zn = 32;
205
+ function Bn(e) {}
206
+ function Vn(e) {
212
207
  if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
213
- let { onEvent: t = zn, onError: n = zn, onRetry: r = zn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
208
+ let { onEvent: t = Bn, onError: n = Bn, onRetry: r = Bn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
214
209
  function m(e) {
215
210
  if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
216
211
  if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
@@ -229,7 +224,7 @@ function Bn(e) {
229
224
  n !== "" && (o.push(n), s = n.length), h();
230
225
  }
231
226
  function h() {
232
- a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Fn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
227
+ a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new In(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
233
228
  }
234
229
  function g(e) {
235
230
  let n = 0;
@@ -245,9 +240,9 @@ function Bn(e) {
245
240
  continue;
246
241
  }
247
242
  let i = e.charCodeAt(n);
248
- if (Vn(e, n, i)) {
249
- let i = e.charCodeAt(n + 5) === Rn ? n + 6 : n + 5, a = e.slice(i, r);
250
- if (d === 0 && e.charCodeAt(r + 1) === In) {
243
+ if (Hn(e, n, i)) {
244
+ let i = e.charCodeAt(n + 5) === zn ? n + 6 : n + 5, a = e.slice(i, r);
245
+ if (d === 0 && e.charCodeAt(r + 1) === Ln) {
251
246
  t({
252
247
  id: l,
253
248
  event: f,
@@ -257,7 +252,7 @@ function Bn(e) {
257
252
  }
258
253
  u = d === 0 ? a : `${u}
259
254
  ${a}`, d++;
260
- } else Hn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Rn ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
255
+ } else Un(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === zn ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
261
256
  n = r + 1, r = e.indexOf("\n", n);
262
257
  }
263
258
  return e.slice(n);
@@ -265,7 +260,7 @@ ${a}`, d++;
265
260
  for (; n < e.length;) {
266
261
  let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
267
262
  if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
268
- _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Ln && e.charCodeAt(n) === In && n++;
263
+ _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Rn && e.charCodeAt(n) === Ln && n++;
269
264
  }
270
265
  return e.slice(n);
271
266
  }
@@ -275,25 +270,25 @@ ${a}`, d++;
275
270
  return;
276
271
  }
277
272
  let r = e.charCodeAt(t);
278
- if (Vn(e, t, r)) {
279
- let r = e.charCodeAt(t + 5) === Rn ? t + 6 : t + 5, i = e.slice(r, n);
273
+ if (Hn(e, t, r)) {
274
+ let r = e.charCodeAt(t + 5) === zn ? t + 6 : t + 5, i = e.slice(r, n);
280
275
  u = d === 0 ? i : `${u}
281
276
  ${i}`, d++;
282
277
  return;
283
278
  }
284
- if (Hn(e, t, r)) {
285
- f = e.slice(e.charCodeAt(t + 6) === Rn ? t + 7 : t + 6, n) || void 0;
279
+ if (Un(e, t, r)) {
280
+ f = e.slice(e.charCodeAt(t + 6) === zn ? t + 7 : t + 6, n) || void 0;
286
281
  return;
287
282
  }
288
283
  if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
289
- let r = e.slice(e.charCodeAt(t + 3) === Rn ? t + 4 : t + 3, n);
284
+ let r = e.slice(e.charCodeAt(t + 3) === zn ? t + 4 : t + 3, n);
290
285
  l = r.includes("\0") ? void 0 : r;
291
286
  return;
292
287
  }
293
288
  if (r === 58) {
294
289
  if (i) {
295
290
  let r = e.slice(t, n);
296
- i(r.slice(e.charCodeAt(t + 1) === Rn ? 2 : 1));
291
+ i(r.slice(e.charCodeAt(t + 1) === zn ? 2 : 1));
297
292
  }
298
293
  return;
299
294
  }
@@ -302,7 +297,7 @@ ${i}`, d++;
302
297
  v(a, "", a);
303
298
  return;
304
299
  }
305
- let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Rn ? 2 : 1;
300
+ let s = a.slice(0, o), c = a.charCodeAt(o + 1) === zn ? 2 : 1;
306
301
  v(s, a.slice(o + c), a);
307
302
  }
308
303
  function v(e, t, i) {
@@ -318,13 +313,13 @@ ${t}`, d++;
318
313
  l = t.includes("\0") ? void 0 : t;
319
314
  break;
320
315
  case "retry":
321
- /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Fn(`Invalid \`retry\` value: "${t}"`, {
316
+ /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new In(`Invalid \`retry\` value: "${t}"`, {
322
317
  type: "invalid-retry",
323
318
  value: t,
324
319
  line: i
325
320
  }));
326
321
  break;
327
- default: n(new Fn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
322
+ default: n(new In(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
328
323
  type: "unknown-field",
329
324
  field: e,
330
325
  value: t,
@@ -351,20 +346,20 @@ ${t}`, d++;
351
346
  reset: b
352
347
  };
353
348
  }
354
- function Vn(e, t, n) {
349
+ function Hn(e, t, n) {
355
350
  return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
356
351
  }
357
- function Hn(e, t, n) {
352
+ function Un(e, t, n) {
358
353
  return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
359
354
  }
360
355
  //#endregion
361
356
  //#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
362
- var Un = class extends TransformStream {
357
+ var Wn = class extends TransformStream {
363
358
  constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
364
359
  let i;
365
360
  super({
366
361
  start(a) {
367
- i = Bn({
362
+ i = Vn({
368
363
  onEvent: (e) => {
369
364
  a.enqueue(e);
370
365
  },
@@ -383,8 +378,8 @@ var Un = class extends TransformStream {
383
378
  }
384
379
  };
385
380
  new TextDecoder();
386
- var { btoa: Wn, atob: Gn } = globalThis;
387
- function Kn(e) {
381
+ var { btoa: Gn, atob: Kn } = globalThis;
382
+ function qn(e) {
388
383
  if (e == null) return {};
389
384
  let t = {};
390
385
  if (e instanceof Headers) e.forEach((e, n) => {
@@ -396,28 +391,28 @@ function Kn(e) {
396
391
  }
397
392
  return t;
398
393
  }
399
- var F = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
394
+ var P = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
400
395
  let i = () => {
401
396
  let e = n.length, r = Array(t);
402
397
  for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
403
398
  return r.join("");
404
399
  };
405
400
  if (e == null) return i;
406
- if (n.includes(r)) throw new _n({
401
+ if (n.includes(r)) throw new vn({
407
402
  argument: "separator",
408
403
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
409
404
  });
410
405
  return () => `${e}${r}${i()}`;
411
- }, qn = F();
412
- function Jn(e) {
406
+ }, Jn = P();
407
+ function Yn(e) {
413
408
  return globalThis.Buffer?.isBuffer(e) ?? !1;
414
409
  }
415
- var Yn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Xn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
416
- function Zn(e) {
410
+ var Xn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Zn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
411
+ function Qn(e) {
417
412
  let t = JSON.parse(e);
418
- return typeof t != "object" || !t || Yn.test(e) === !1 && Xn.test(e) === !1 ? t : Qn(t);
413
+ return typeof t != "object" || !t || Xn.test(e) === !1 && Zn.test(e) === !1 ? t : $n(t);
419
414
  }
420
- function Qn(e) {
415
+ function $n(e) {
421
416
  let t = [e];
422
417
  for (; t.length;) {
423
418
  let e = t;
@@ -432,33 +427,33 @@ function Qn(e) {
432
427
  }
433
428
  return e;
434
429
  }
435
- function $n(e) {
430
+ function er(e) {
436
431
  let { stackTraceLimit: t } = Error;
437
432
  try {
438
433
  Error.stackTraceLimit = 0;
439
434
  } catch {
440
- return Zn(e);
435
+ return Qn(e);
441
436
  }
442
437
  try {
443
- return Zn(e);
438
+ return Qn(e);
444
439
  } finally {
445
440
  Error.stackTraceLimit = t;
446
441
  }
447
442
  }
448
- function er(e) {
443
+ function tr(e) {
449
444
  if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
450
445
  let { additionalProperties: t } = e;
451
- e.additionalProperties = t != null && typeof t != "boolean" && tr(t);
446
+ e.additionalProperties = t != null && typeof t != "boolean" && F(t);
452
447
  let { properties: n } = e;
453
- if (n != null) for (let e of Object.keys(n)) n[e] = tr(n[e]);
448
+ if (n != null) for (let e of Object.keys(n)) n[e] = F(n[e]);
454
449
  }
455
- e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(tr) : tr(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(tr)), e.allOf != null && (e.allOf = e.allOf.map(tr)), e.oneOf != null && (e.oneOf = e.oneOf.map(tr));
450
+ e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(F) : F(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(F)), e.allOf != null && (e.allOf = e.allOf.map(F)), e.oneOf != null && (e.oneOf = e.oneOf.map(F));
456
451
  let { definitions: t } = e;
457
- if (t != null) for (let e of Object.keys(t)) t[e] = tr(t[e]);
452
+ if (t != null) for (let e of Object.keys(t)) t[e] = F(t[e]);
458
453
  return e;
459
454
  }
460
- function tr(e) {
461
- return typeof e == "boolean" ? e : er(e);
455
+ function F(e) {
456
+ return typeof e == "boolean" ? e : tr(e);
462
457
  }
463
458
  var nr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), rr = {
464
459
  name: void 0,
@@ -1218,7 +1213,7 @@ function ti(e) {
1218
1213
  function ni(e) {
1219
1214
  return $r(() => {
1220
1215
  if (!ri(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1221
- return er(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1216
+ return tr(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1222
1217
  }, { validate: async (t) => {
1223
1218
  let n = await e["~standard"].validate(t);
1224
1219
  return "value" in n ? {
@@ -1226,7 +1221,7 @@ function ni(e) {
1226
1221
  value: n.value
1227
1222
  } : {
1228
1223
  success: !1,
1229
- error: new P({
1224
+ error: new N({
1230
1225
  value: t,
1231
1226
  cause: n.issues
1232
1227
  })
@@ -1251,12 +1246,12 @@ function ii(e, t) {
1251
1246
  }
1252
1247
  function ai(e, t) {
1253
1248
  let n = t?.useReferences ?? !1;
1254
- return $r(() => er(at(e, {
1249
+ return $r(() => tr(vt(e, {
1255
1250
  target: "draft-7",
1256
1251
  io: "input",
1257
1252
  reused: n ? "ref" : "inline"
1258
1253
  })), { validate: async (t) => {
1259
- let n = await ot(e, t);
1254
+ let n = await mt(e, t);
1260
1255
  return n.success ? {
1261
1256
  success: !0,
1262
1257
  value: n.data
@@ -1278,7 +1273,7 @@ async function ci({ value: e, schema: t, context: n }) {
1278
1273
  schema: t,
1279
1274
  context: n
1280
1275
  });
1281
- if (!r.success) throw P.wrap({
1276
+ if (!r.success) throw N.wrap({
1282
1277
  value: e,
1283
1278
  cause: r.error,
1284
1279
  context: n
@@ -1300,7 +1295,7 @@ async function li({ value: e, schema: t, context: n }) {
1300
1295
  rawValue: e
1301
1296
  } : {
1302
1297
  success: !1,
1303
- error: P.wrap({
1298
+ error: N.wrap({
1304
1299
  value: e,
1305
1300
  cause: t.error,
1306
1301
  context: n
@@ -1310,7 +1305,7 @@ async function li({ value: e, schema: t, context: n }) {
1310
1305
  } catch (t) {
1311
1306
  return {
1312
1307
  success: !1,
1313
- error: P.wrap({
1308
+ error: N.wrap({
1314
1309
  value: e,
1315
1310
  cause: t,
1316
1311
  context: n
@@ -1321,7 +1316,7 @@ async function li({ value: e, schema: t, context: n }) {
1321
1316
  }
1322
1317
  async function ui({ text: e, schema: t }) {
1323
1318
  try {
1324
- let n = $n(e);
1319
+ let n = er(e);
1325
1320
  return t == null ? {
1326
1321
  success: !0,
1327
1322
  value: n,
@@ -1333,7 +1328,7 @@ async function ui({ text: e, schema: t }) {
1333
1328
  } catch (t) {
1334
1329
  return {
1335
1330
  success: !1,
1336
- error: Cn.isInstance(t) ? t : new Cn({
1331
+ error: wn.isInstance(t) ? t : new wn({
1337
1332
  text: e,
1338
1333
  cause: t
1339
1334
  }),
@@ -1342,7 +1337,7 @@ async function ui({ text: e, schema: t }) {
1342
1337
  }
1343
1338
  }
1344
1339
  function di({ stream: e, schema: t }) {
1345
- return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Un()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1340
+ return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Wn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1346
1341
  e !== "[DONE]" && n.enqueue(await ui({
1347
1342
  text: e,
1348
1343
  schema: t
@@ -1358,7 +1353,7 @@ var fi = Object.defineProperty, pi = (e, t) => {
1358
1353
  get: t[n],
1359
1354
  enumerable: !0
1360
1355
  });
1361
- }, mi = "AI_InvalidArgumentError", hi = `vercel.ai.error.${mi}`, gi = Symbol.for(hi), _i, vi, yi = class extends (vi = N, _i = gi, vi) {
1356
+ }, mi = "AI_InvalidArgumentError", hi = `vercel.ai.error.${mi}`, gi = Symbol.for(hi), _i, vi, yi = class extends (vi = M, _i = gi, vi) {
1362
1357
  constructor({ parameter: e, value: t, message: n }) {
1363
1358
  super({
1364
1359
  name: mi,
@@ -1366,9 +1361,9 @@ var fi = Object.defineProperty, pi = (e, t) => {
1366
1361
  }), this[_i] = !0, this.parameter = e, this.value = t;
1367
1362
  }
1368
1363
  static isInstance(e) {
1369
- return N.hasMarker(e, hi);
1364
+ return M.hasMarker(e, hi);
1370
1365
  }
1371
- }, bi = "AI_NoObjectGeneratedError", xi = `vercel.ai.error.${bi}`, Si = Symbol.for(xi), Ci, wi, H = class extends (wi = N, Ci = Si, wi) {
1366
+ }, bi = "AI_NoObjectGeneratedError", xi = `vercel.ai.error.${bi}`, Si = Symbol.for(xi), Ci, wi, H = class extends (wi = M, Ci = Si, wi) {
1372
1367
  constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
1373
1368
  super({
1374
1369
  name: bi,
@@ -1377,9 +1372,9 @@ var fi = Object.defineProperty, pi = (e, t) => {
1377
1372
  }), this[Ci] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1378
1373
  }
1379
1374
  static isInstance(e) {
1380
- return N.hasMarker(e, xi);
1375
+ return M.hasMarker(e, xi);
1381
1376
  }
1382
- }, Ti = "AI_UIMessageStreamError", Ei = `vercel.ai.error.${Ti}`, Di = Symbol.for(Ei), Oi, ki, Ai = class extends (ki = N, Oi = Di, ki) {
1377
+ }, Ti = "AI_UIMessageStreamError", Ei = `vercel.ai.error.${Ti}`, Di = Symbol.for(Ei), Oi, ki, Ai = class extends (ki = M, Oi = Di, ki) {
1383
1378
  constructor({ chunkType: e, chunkId: t, message: n }) {
1384
1379
  super({
1385
1380
  name: Ti,
@@ -1387,7 +1382,7 @@ var fi = Object.defineProperty, pi = (e, t) => {
1387
1382
  }), this[Oi] = !0, this.chunkType = e, this.chunkId = t;
1388
1383
  }
1389
1384
  static isInstance(e) {
1390
- return N.hasMarker(e, Ei);
1385
+ return M.hasMarker(e, Ei);
1391
1386
  }
1392
1387
  };
1393
1388
  function ji({ warning: e, provider: t, model: n }) {
@@ -1446,23 +1441,23 @@ function Ii(e, t) {
1446
1441
  return n;
1447
1442
  }
1448
1443
  var U = {
1449
- array: Ye,
1450
- boolean: lt,
1451
- custom: it,
1452
- discriminatedUnion: Xe,
1453
- enum: dt,
1454
- instanceof: st,
1455
- lazy: tt,
1456
- literal: ct,
1457
- looseObject: qe,
1458
- never: $e,
1459
- null: ut,
1460
- number: et,
1461
- object: nt,
1462
- record: Ze,
1463
- string: Qe,
1464
- union: ft,
1465
- unknown: Je
1444
+ array: wt,
1445
+ boolean: ht,
1446
+ custom: At,
1447
+ discriminatedUnion: Tt,
1448
+ enum: kt,
1449
+ instanceof: Mt,
1450
+ lazy: gt,
1451
+ literal: St,
1452
+ looseObject: Ot,
1453
+ never: Dt,
1454
+ null: Et,
1455
+ number: bt,
1456
+ object: xt,
1457
+ record: _t,
1458
+ string: yt,
1459
+ union: Ct,
1460
+ unknown: Nt
1466
1461
  }, Li = U.lazy(() => U.union([
1467
1462
  U.null(),
1468
1463
  U.string(),
@@ -1474,7 +1469,7 @@ var U = {
1474
1469
  U.string(),
1475
1470
  U.instanceof(Uint8Array),
1476
1471
  U.instanceof(ArrayBuffer),
1477
- U.custom(Jn, { message: "Must be a Buffer" })
1472
+ U.custom(Yn, { message: "Must be a Buffer" })
1478
1473
  ]), zi = U.record(U.string(), U.string()), Bi = U.object({
1479
1474
  type: U.literal("text"),
1480
1475
  text: U.string(),
@@ -1999,7 +1994,7 @@ var aa = () => ({
1999
1994
  let o = i.value;
2000
1995
  if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new H({
2001
1996
  message: "No object generated: response did not match schema.",
2002
- cause: new P({
1997
+ cause: new N({
2003
1998
  value: o,
2004
1999
  cause: "response must be an object with an elements array"
2005
2000
  }),
@@ -2092,11 +2087,11 @@ function ca({ name: e, value: t }) {
2092
2087
  }
2093
2088
  }
2094
2089
  function la({ value: e, minItems: t, maxItems: n }) {
2095
- if (t != null && e.length < t) return new P({
2090
+ if (t != null && e.length < t) return new N({
2096
2091
  value: e,
2097
2092
  cause: `elements array must contain at least ${t} items`
2098
2093
  });
2099
- if (n != null && e.length > n) return new P({
2094
+ if (n != null && e.length > n) return new N({
2100
2095
  value: e,
2101
2096
  cause: `elements array must contain at most ${n} items`
2102
2097
  });
@@ -2131,7 +2126,7 @@ var ua = ({ options: e, name: t, description: n }) => ({
2131
2126
  let i = r.value;
2132
2127
  if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new H({
2133
2128
  message: "No object generated: response did not match schema.",
2134
- cause: new P({
2129
+ cause: new N({
2135
2130
  value: i,
2136
2131
  cause: "response must be an object that contains a choice value."
2137
2132
  }),
@@ -2187,10 +2182,10 @@ var ua = ({ options: e, name: t, description: n }) => ({
2187
2182
  },
2188
2183
  createElementStreamTransform() {}
2189
2184
  });
2190
- new TextEncoder(), new TextEncoder(), F({
2185
+ new TextEncoder(), new TextEncoder(), P({
2191
2186
  prefix: "aitxt",
2192
2187
  size: 24
2193
- }), F({
2188
+ }), P({
2194
2189
  prefix: "call",
2195
2190
  size: 24
2196
2191
  });
@@ -2900,25 +2895,25 @@ async function Da({ stream: e, onError: t, abortSignal: n }) {
2900
2895
  n?.removeEventListener("abort", i), r.releaseLock();
2901
2896
  }
2902
2897
  }
2903
- F({
2898
+ P({
2904
2899
  prefix: "aitxt",
2905
2900
  size: 24
2906
- }), F({
2901
+ }), P({
2907
2902
  prefix: "call",
2908
2903
  size: 24
2909
- }), F({
2904
+ }), P({
2910
2905
  prefix: "aitxt",
2911
2906
  size: 24
2912
- }), F({
2907
+ }), P({
2913
2908
  prefix: "call",
2914
2909
  size: 24
2915
- }), U.record(U.string(), Li.optional()), U.record(U.string(), U.string()), F({
2910
+ }), U.record(U.string(), Li.optional()), U.record(U.string(), U.string()), P({
2916
2911
  prefix: "call",
2917
2912
  size: 24
2918
- }), F({
2913
+ }), P({
2919
2914
  prefix: "call",
2920
2915
  size: 24
2921
- }), new TextEncoder(), F({
2916
+ }), new TextEncoder(), P({
2922
2917
  prefix: "aiobj",
2923
2918
  size: 24
2924
2919
  });
@@ -2944,7 +2939,7 @@ var { atob: Oa } = globalThis, ka = class {
2944
2939
  });
2945
2940
  }
2946
2941
  };
2947
- F({
2942
+ P({
2948
2943
  prefix: "aiobj",
2949
2944
  size: 24
2950
2945
  }), U.object({
@@ -2964,13 +2959,13 @@ F({
2964
2959
  description: U.string().optional(),
2965
2960
  parameters: U.record(U.string(), U.unknown())
2966
2961
  })).optional()
2967
- }), F({
2962
+ }), P({
2968
2963
  prefix: "call",
2969
2964
  size: 24
2970
2965
  });
2971
2966
  async function Aa({ response: e, url: t, fallbackMessage: n }) {
2972
2967
  let r = await e.text();
2973
- return new rn({
2968
+ return new an({
2974
2969
  message: r || n,
2975
2970
  url: t,
2976
2971
  requestBodyValues: void 0,
@@ -2980,7 +2975,7 @@ async function Aa({ response: e, url: t, fallbackMessage: n }) {
2980
2975
  }
2981
2976
  async function ja(e) {
2982
2977
  if (e == null) return [];
2983
- if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Pn({
2978
+ if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Fn({
2984
2979
  functionality: "FileList",
2985
2980
  message: "FileList is not supported in the current environment"
2986
2981
  });
@@ -3009,8 +3004,8 @@ var Na = class {
3009
3004
  }
3010
3005
  async sendMessages({ abortSignal: e, ...t }) {
3011
3006
  let n = await V(this.body), r = await V(this.headers), i = await V(this.credentials), a = {
3012
- ...Kn(r),
3013
- ...Kn(t.headers)
3007
+ ...qn(r),
3008
+ ...qn(t.headers)
3014
3009
  }, o = await this.prepareSendMessagesRequest?.call(this, {
3015
3010
  api: this.api,
3016
3011
  id: t.chatId,
@@ -3024,7 +3019,7 @@ var Na = class {
3024
3019
  requestMetadata: t.metadata,
3025
3020
  trigger: t.trigger,
3026
3021
  messageId: t.messageId
3027
- }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Kn(o.headers), l = o?.body === void 0 ? {
3022
+ }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : qn(o.headers), l = o?.body === void 0 ? {
3028
3023
  ...n,
3029
3024
  ...t.body,
3030
3025
  id: t.chatId,
@@ -3046,13 +3041,13 @@ var Na = class {
3046
3041
  url: s,
3047
3042
  fallbackMessage: "Failed to fetch the chat response."
3048
3043
  });
3049
- if (!d.body) throw new un({ message: "The response body is empty." });
3044
+ if (!d.body) throw new dn({ message: "The response body is empty." });
3050
3045
  return this.processResponseStream(d.body);
3051
3046
  }
3052
3047
  async reconnectToStream(e) {
3053
3048
  let t = await V(this.body), n = await V(this.headers), r = await V(this.credentials), i = {
3054
- ...Kn(n),
3055
- ...Kn(e.headers)
3049
+ ...qn(n),
3050
+ ...qn(e.headers)
3056
3051
  }, a = await this.prepareReconnectToStreamRequest?.call(this, {
3057
3052
  api: this.api,
3058
3053
  id: e.chatId,
@@ -3063,7 +3058,7 @@ var Na = class {
3063
3058
  headers: i,
3064
3059
  credentials: r,
3065
3060
  requestMetadata: e.metadata
3066
- }), o = a?.api ?? Ma(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Kn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3061
+ }), o = a?.api ?? Ma(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : qn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3067
3062
  method: "GET",
3068
3063
  headers: s,
3069
3064
  credentials: c,
@@ -3075,7 +3070,7 @@ var Na = class {
3075
3070
  url: o,
3076
3071
  fallbackMessage: "Failed to fetch the chat response."
3077
3072
  });
3078
- if (!l.body) throw new un({ message: "The response body is empty." });
3073
+ if (!l.body) throw new dn({ message: "The response body is empty." });
3079
3074
  return this.processResponseStream(l.body);
3080
3075
  }
3081
3076
  }, Pa = class extends Na {
@@ -3092,7 +3087,7 @@ var Na = class {
3092
3087
  } }));
3093
3088
  }
3094
3089
  }, Fa = class {
3095
- constructor({ generateId: e = qn, id: t = e(), transport: n = new Pa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3090
+ constructor({ generateId: e = Jn, id: t = e(), transport: n = new Pa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3096
3091
  this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new ka(), this.sendMessage = async (e, t) => {
3097
3092
  if (e == null) {
3098
3093
  await this.makeRequest({
@@ -3375,7 +3370,7 @@ var Ra = /* @__PURE__ */ t(((e, t) => {
3375
3370
  };
3376
3371
  }
3377
3372
  t.exports = n;
3378
- })), K = /* @__PURE__ */ e(o(), 1), za = /* @__PURE__ */ e(Ra(), 1), q = Ke(), Ba = (e, t, n) => {
3373
+ })), K = /* @__PURE__ */ e(o(), 1), za = /* @__PURE__ */ e(Ra(), 1), q = qe(), Ba = (e, t, n) => {
3379
3374
  if (!t.has(e)) throw TypeError("Cannot " + n);
3380
3375
  }, J = (e, t, n) => (Ba(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Y = (e, t, n) => {
3381
3376
  if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
@@ -3549,8 +3544,60 @@ function io(e) {
3549
3544
  }
3550
3545
  }
3551
3546
  //#endregion
3547
+ //#region src/components/chat/chat-markdown.tsx
3548
+ function ao(e) {
3549
+ let t = (0, j.c)(3), { content: n } = e, r = et(Xe)?.mode, i = r !== "agent" && r !== "code_mode", a;
3550
+ return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, q.jsx)(ce, {
3551
+ content: n,
3552
+ allowNotebookInsertion: i
3553
+ }), t[0] = n, t[1] = i, t[2] = a) : a = t[2], a;
3554
+ }
3555
+ //#endregion
3556
+ //#region src/core/ai/context/providers/cell.ts
3557
+ var oo = class extends te {
3558
+ title = "Cells";
3559
+ mentionPrefix = "@";
3560
+ contextType = "cell";
3561
+ store;
3562
+ constructor(e) {
3563
+ super(), this.store = e;
3564
+ }
3565
+ getItems() {
3566
+ let e = this.store.get(je);
3567
+ return e.cellIds.map((t, n) => {
3568
+ let r = e.cellData[t];
3569
+ return {
3570
+ uri: this.asURI(t),
3571
+ name: Pe(r.name, n),
3572
+ type: this.contextType,
3573
+ description: "Cell code",
3574
+ data: {
3575
+ cellId: t,
3576
+ code: r.code
3577
+ }
3578
+ };
3579
+ });
3580
+ }
3581
+ formatCompletion(e) {
3582
+ return {
3583
+ ...this.createBasicCompletion(e),
3584
+ label: `${this.mentionPrefix}${e.name}`
3585
+ };
3586
+ }
3587
+ formatContext(e) {
3588
+ return O({
3589
+ type: "cell",
3590
+ data: {
3591
+ cellId: e.data.cellId,
3592
+ name: e.name
3593
+ },
3594
+ details: e.data.code || "This cell is empty."
3595
+ });
3596
+ }
3597
+ };
3598
+ //#endregion
3552
3599
  //#region src/core/ai/context/providers/cell-output.ts
3553
- function ao(e, t) {
3600
+ function so(e, t) {
3554
3601
  return e ? !!([
3555
3602
  "image/",
3556
3603
  "video/",
@@ -3566,7 +3613,7 @@ function ao(e, t) {
3566
3613
  "<marimo-ui-element"
3567
3614
  ].some((e) => t.includes(e))) : !1;
3568
3615
  }
3569
- var oo = class extends T {
3616
+ var co = class extends te {
3570
3617
  title = "Cell Outputs";
3571
3618
  mentionPrefix = "@";
3572
3619
  contextType = "cell-output";
@@ -3575,9 +3622,9 @@ var oo = class extends T {
3575
3622
  super(), this.store = e;
3576
3623
  }
3577
3624
  getItems() {
3578
- let e = this.store.get(_e), t = [];
3579
- for (let n of e.cellIds.inOrderIds) {
3580
- let r = lo(n, e), i = r.cellOutput;
3625
+ let e = this.store.get(je), t = [];
3626
+ for (let n of e.cellIds) {
3627
+ let r = fo(n, e), i = r.cellOutput;
3581
3628
  if (!i) continue;
3582
3629
  let a = i.output.mimetype || "unknown";
3583
3630
  t.push({
@@ -3599,9 +3646,9 @@ var oo = class extends T {
3599
3646
  label: `@${n}`,
3600
3647
  displayLabel: n,
3601
3648
  detail: `${t.outputType} output`,
3602
- boost: t.outputType === "media" ? b.HIGH : b.MEDIUM,
3649
+ boost: t.outputType === "media" ? E.HIGH : E.MEDIUM,
3603
3650
  type: this.contextType,
3604
- section: x.CELL_OUTPUT,
3651
+ section: k.CELL_OUTPUT,
3605
3652
  apply: `@${n}`,
3606
3653
  info: () => {
3607
3654
  let e = document.createElement("div");
@@ -3638,7 +3685,7 @@ var oo = class extends T {
3638
3685
  outputType: t.outputType,
3639
3686
  mimetype: t.output.mimetype
3640
3687
  }, o = `Cell Code:\n${i}\n\n`;
3641
- return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), D({
3688
+ return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), O({
3642
3689
  type: this.contextType,
3643
3690
  data: a,
3644
3691
  details: o
@@ -3646,14 +3693,14 @@ var oo = class extends T {
3646
3693
  }
3647
3694
  async getAttachments(e) {
3648
3695
  let t = e[0].data.cellId, n = e[0].data.cellName;
3649
- return so(e.map((e) => e.data.cellOutput), t, n);
3696
+ return lo(e.map((e) => e.data.cellOutput), t, n);
3650
3697
  }
3651
3698
  };
3652
- async function so(e, t, n) {
3699
+ async function lo(e, t, n) {
3653
3700
  let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
3654
3701
  if (i.length === 0) return [];
3655
3702
  let a = i.flatMap((e) => {
3656
- let i = document.getElementById(oe.create(t));
3703
+ let i = document.getElementById(Ie.create(t));
3657
3704
  return i ? {
3658
3705
  cellId: t,
3659
3706
  cellName: n,
@@ -3666,15 +3713,15 @@ async function so(e, t, n) {
3666
3713
  type: "file",
3667
3714
  filename: `${n}-output-screenshot`,
3668
3715
  mediaType: "image/png",
3669
- url: await k(e.element)
3716
+ url: await le(e.element)
3670
3717
  })));
3671
3718
  } catch (e) {
3672
3719
  return r.error("Error downloading cell output images:", e), [];
3673
3720
  }
3674
3721
  }
3675
- function co(e) {
3676
- if (v(e)) return null;
3677
- let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = We(e), i, a = !1;
3722
+ function uo(e) {
3723
+ if (C(e)) return null;
3724
+ let t = e.mimetype, n = so(t, String(e.data)) ? "media" : "text", r = He(e), i, a = !1;
3678
3725
  return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
3679
3726
  processedContent: r,
3680
3727
  imageUrl: i,
@@ -3683,11 +3730,11 @@ function co(e) {
3683
3730
  output: e
3684
3731
  };
3685
3732
  }
3686
- function lo(e, t, n) {
3687
- let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.inOrderIds.indexOf(e), s = se(a.name, o), c;
3688
- r && (c = i.consoleOutputs.map((e) => co(e)).filter((e) => e !== null));
3733
+ function fo(e, t, n) {
3734
+ let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s = Pe(a.name, o), c;
3735
+ r && (c = i.consoleOutputs.map((e) => uo(e)).filter((e) => e !== null));
3689
3736
  let l, u = i.output;
3690
- return u && !v(u) && (l = co(u) ?? void 0), {
3737
+ return u && !C(u) && (l = uo(u) ?? void 0), {
3691
3738
  cellId: e,
3692
3739
  cellName: s,
3693
3740
  cellCode: a.code,
@@ -3697,31 +3744,31 @@ function lo(e, t, n) {
3697
3744
  }
3698
3745
  //#endregion
3699
3746
  //#region src/core/ai/context/providers/error.ts
3700
- function uo(e, t) {
3747
+ function po(e, t) {
3701
3748
  let n = [`Code:\n${e.cellCode}`];
3702
- if (e.tracebackHtml && n.push(`Traceback:\n${Ee(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Se(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3703
- let r = w(e.cellId, t);
3749
+ if (e.tracebackHtml && n.push(`Traceback:\n${Ae(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Ne(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3750
+ let r = ue(e.cellId, t);
3704
3751
  r && n.push(`Database schema:\n${r}`);
3705
3752
  }
3706
3753
  return n.join("\n\n");
3707
3754
  }
3708
- function fo(e, t) {
3709
- return D({
3755
+ function mo(e, t) {
3756
+ return O({
3710
3757
  type: "error",
3711
3758
  data: {
3712
3759
  name: e.cellName || `Cell ${e.cellId}`,
3713
3760
  cellId: e.cellId
3714
3761
  },
3715
- details: uo(e, t)
3762
+ details: po(e, t)
3716
3763
  });
3717
3764
  }
3718
- function po(e) {
3719
- return e.errorData.length === 1 ? Te(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Ee(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
3765
+ function ho(e) {
3766
+ return e.errorData.length === 1 ? Fe(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Ae(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
3720
3767
  }
3721
- function mo(e) {
3768
+ function go(e) {
3722
3769
  return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
3723
3770
  }
3724
- var ho = new xe("error", "errors"), go = class extends T {
3771
+ var _o = new re("error", "errors"), vo = class extends te {
3725
3772
  title = "Errors";
3726
3773
  mentionPrefix = "@";
3727
3774
  contextType = "error";
@@ -3730,7 +3777,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3730
3777
  super(), this.store = e;
3731
3778
  }
3732
3779
  getItems() {
3733
- let e = ve(this.store);
3780
+ let e = Me(this.store);
3734
3781
  if (e.length === 0) return [];
3735
3782
  let t = [{
3736
3783
  uri: this.asURI("all"),
@@ -3744,13 +3791,13 @@ var ho = new xe("error", "errors"), go = class extends T {
3744
3791
  }];
3745
3792
  for (let n of e) t.push({
3746
3793
  uri: this.asURI(n.cellId),
3747
- name: mo(n),
3794
+ name: go(n),
3748
3795
  type: this.contextType,
3749
3796
  data: {
3750
3797
  type: "cell-error",
3751
3798
  error: n
3752
3799
  },
3753
- description: po(n)
3800
+ description: ho(n)
3754
3801
  });
3755
3802
  return t;
3756
3803
  }
@@ -3760,10 +3807,10 @@ var ho = new xe("error", "errors"), go = class extends T {
3760
3807
  return {
3761
3808
  label: "@Errors",
3762
3809
  displayLabel: "Errors",
3763
- detail: `${t} ${ho.pluralize(t)}`,
3810
+ detail: `${t} ${_o.pluralize(t)}`,
3764
3811
  type: "error",
3765
3812
  apply: "@error://all",
3766
- section: x.ERROR,
3813
+ section: k.ERROR,
3767
3814
  info: () => {
3768
3815
  let e = document.createElement("div");
3769
3816
  e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
@@ -3772,7 +3819,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3772
3819
  let r = document.createElement("div");
3773
3820
  r.classList.add("font-bold", "text-base"), r.textContent = "Errors", n.append(r);
3774
3821
  let i = document.createElement("div");
3775
- return i.classList.add("text-sm", "text-muted-foreground"), i.textContent = `${t} ${ho.pluralize(t)}`, n.append(i), e.append(n), e;
3822
+ return i.classList.add("text-sm", "text-muted-foreground"), i.textContent = `${t} ${_o.pluralize(t)}`, n.append(i), e.append(n), e;
3776
3823
  }
3777
3824
  };
3778
3825
  }
@@ -3780,33 +3827,33 @@ var ho = new xe("error", "errors"), go = class extends T {
3780
3827
  let { error: t } = e.data;
3781
3828
  return {
3782
3829
  ...this.createBasicCompletion(e, {
3783
- detail: po(t),
3830
+ detail: ho(t),
3784
3831
  type: "error"
3785
3832
  }),
3786
- section: x.ERROR
3833
+ section: k.ERROR
3787
3834
  };
3788
3835
  }
3789
3836
  return {
3790
3837
  label: "Error",
3791
3838
  displayLabel: "Error",
3792
- section: x.ERROR
3839
+ section: k.ERROR
3793
3840
  };
3794
3841
  }
3795
3842
  formatContext(e) {
3796
- return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => fo(e, this.store)).join("\n\n");
3843
+ return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => mo(e, this.store)).join("\n\n");
3797
3844
  }
3798
- }, _o = le(), vo = {
3845
+ }, yo = b(), bo = {
3799
3846
  maxDepth: 3,
3800
3847
  maxResults: 20,
3801
3848
  defaultResultsLimit: 5,
3802
3849
  includeDirectories: !1
3803
- }, yo = class extends T {
3850
+ }, xo = class extends te {
3804
3851
  title = "Files";
3805
3852
  mentionPrefix = "#";
3806
3853
  contextType = "file";
3807
3854
  apiRequests;
3808
3855
  config;
3809
- constructor(e, t = vo) {
3856
+ constructor(e, t = bo) {
3810
3857
  super(), this.apiRequests = e, this.config = t;
3811
3858
  }
3812
3859
  createCompletionSource() {
@@ -3902,12 +3949,12 @@ var ho = new xe("error", "errors"), go = class extends T {
3902
3949
  return {
3903
3950
  ...this.createBasicCompletion(e),
3904
3951
  type: "file",
3905
- section: x.FILE,
3906
- boost: t.isDirectory ? b.MEDIUM : b.LOW,
3952
+ section: k.FILE,
3953
+ boost: t.isDirectory ? E.MEDIUM : E.LOW,
3907
3954
  detail: t.path,
3908
3955
  displayLabel: `${i} ${n}`,
3909
3956
  apply: async (e, i, a, o) => {
3910
- let s = e.state.facet(_o)?.addAttachment;
3957
+ let s = e.state.facet(yo)?.addAttachment;
3911
3958
  if (!s) {
3912
3959
  r.warn("No addAttachment callback provided");
3913
3960
  return;
@@ -3917,7 +3964,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3917
3964
  description: e.message
3918
3965
  }), null));
3919
3966
  if (!l) return;
3920
- let u = l.mimeType || "text/plain", d = Ge({
3967
+ let u = l.mimeType || "text/plain", d = Ue({
3921
3968
  contents: l.contents ?? "",
3922
3969
  mimeType: u,
3923
3970
  isBase64: l.isBase64 ?? !1
@@ -3926,7 +3973,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3926
3973
  from: a,
3927
3974
  to: o,
3928
3975
  insert: ""
3929
- } }), Nt(e);
3976
+ } }), Ft(e);
3930
3977
  },
3931
3978
  info: () => {
3932
3979
  let e = document.createElement("div");
@@ -3940,7 +3987,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3940
3987
  }
3941
3988
  formatContext(e) {
3942
3989
  let { data: t, name: n } = e;
3943
- return D({
3990
+ return O({
3944
3991
  type: this.contextType,
3945
3992
  data: {
3946
3993
  name: n,
@@ -3950,7 +3997,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3950
3997
  details: t.isDirectory ? "Directory containing files and subdirectories" : "File"
3951
3998
  });
3952
3999
  }
3953
- }, bo = class extends T {
4000
+ }, So = class extends te {
3954
4001
  title = "Tables";
3955
4002
  mentionPrefix = "@";
3956
4003
  contextType = "data";
@@ -3980,7 +4027,7 @@ var ho = new xe("error", "errors"), go = class extends T {
3980
4027
  l += `${t}\n`;
3981
4028
  }
3982
4029
  }
3983
- return D({
4030
+ return O({
3984
4031
  type: this.contextType,
3985
4032
  data: {
3986
4033
  name: o,
@@ -3995,12 +4042,12 @@ var ho = new xe("error", "errors"), go = class extends T {
3995
4042
  label: `@${t}`,
3996
4043
  displayLabel: t,
3997
4044
  detail: n.source === "memory" ? "in-memory" : n.source,
3998
- boost: n.source_type === "local" ? b.LOCAL_TABLE : b.REMOTE_TABLE,
3999
- type: ie(n),
4045
+ boost: n.source_type === "local" ? E.LOCAL_TABLE : E.REMOTE_TABLE,
4046
+ type: ee(n),
4000
4047
  apply: `@${t}`,
4001
4048
  section: {
4002
- name: ie(n) === "dataframe" ? "Dataframe" : "Table",
4003
- rank: x.TABLE.rank
4049
+ name: ee(n) === "dataframe" ? "Dataframe" : "Table",
4050
+ rank: k.TABLE.rank
4004
4051
  },
4005
4052
  info: () => this.createTableInfoElement(t, n)
4006
4053
  };
@@ -4058,7 +4105,7 @@ var ho = new xe("error", "errors"), go = class extends T {
4058
4105
  return e.classList.add("text-xs", "px-1.5", "py-0.5", "rounded-full", "font-medium", ...t.split(" ")), e;
4059
4106
  }
4060
4107
  }
4061
- }, xo = class extends T {
4108
+ }, Co = class extends te {
4062
4109
  title = "Variables";
4063
4110
  mentionPrefix = "@";
4064
4111
  contextType = "variable";
@@ -4085,13 +4132,13 @@ var ho = new xe("error", "errors"), go = class extends T {
4085
4132
  displayLabel: n.name,
4086
4133
  detail: n.dataType ?? "",
4087
4134
  type: this.contextType,
4088
- section: x.VARIABLE,
4089
- info: () => de(n)
4135
+ section: k.VARIABLE,
4136
+ info: () => ae(n)
4090
4137
  };
4091
4138
  }
4092
4139
  formatContext(e) {
4093
4140
  let { data: t } = e, { variable: n } = t;
4094
- return D({
4141
+ return O({
4095
4142
  type: this.contextType,
4096
4143
  data: {
4097
4144
  name: n.name,
@@ -4103,16 +4150,16 @@ var ho = new xe("error", "errors"), go = class extends T {
4103
4150
  };
4104
4151
  //#endregion
4105
4152
  //#region src/core/ai/context/context.ts
4106
- function So(e) {
4107
- let t = e.get(ue), n = e.get(De), r = e.get(pe);
4108
- return new C().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new y(t.connectionsMap, n));
4153
+ function wo(e) {
4154
+ let t = e.get(T), n = e.get(de), r = e.get(me);
4155
+ return new D().register(new So(n)).register(new Co(r, n)).register(new vo(e)).register(new co(e)).register(new oo(e)).register(new ie(t.connectionsMap, n));
4109
4156
  }
4110
- function Co() {
4111
- return new yo(ae());
4157
+ function To() {
4158
+ return new xo(Oe());
4112
4159
  }
4113
4160
  //#endregion
4114
4161
  //#region src/components/editor/ai/completion-utils.ts
4115
- function wo(e, t = []) {
4162
+ function Eo(e, t = []) {
4116
4163
  return (n) => {
4117
4164
  let r = e.map((e) => n.matchBefore(e)).find(Boolean);
4118
4165
  return !r || r && r.from === r.to && !n.explicit ? null : {
@@ -4123,15 +4170,15 @@ function wo(e, t = []) {
4123
4170
  }
4124
4171
  //#endregion
4125
4172
  //#region src/components/chat/chat-utils.ts
4126
- async function To(e) {
4173
+ async function Do(e) {
4127
4174
  return await Promise.all(e.map(async (e) => ({
4128
4175
  type: "file",
4129
4176
  mediaType: e.type,
4130
4177
  filename: e.name,
4131
- url: await Ue(e, "dataUrl")
4178
+ url: await Ve(e, "dataUrl")
4132
4179
  })));
4133
4180
  }
4134
- function Eo(e) {
4181
+ function Oo(e) {
4135
4182
  let t = e.at(-1);
4136
4183
  if (!t || t.role !== "assistant") return !1;
4137
4184
  let n = t.parts.at(-1);
@@ -4139,8 +4186,8 @@ function Eo(e) {
4139
4186
  }
4140
4187
  //#endregion
4141
4188
  //#region src/components/chat/chat-components.tsx
4142
- var Do = (e) => {
4143
- let t = (0, M.c)(6), { attachment: n } = e;
4189
+ var ko = (e) => {
4190
+ let t = (0, j.c)(6), { attachment: n } = e;
4144
4191
  if (n.mediaType?.startsWith("image/")) {
4145
4192
  let e = n.filename || "Attachment", r;
4146
4193
  return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, q.jsx)("img", {
@@ -4150,14 +4197,14 @@ var Do = (e) => {
4150
4197
  }), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
4151
4198
  }
4152
4199
  let r;
4153
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, q.jsx)(Ve, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4200
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, q.jsx)(ze, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4154
4201
  let i = n.filename || "Attachment", a;
4155
4202
  return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4156
4203
  className: "flex flex-row gap-1 items-center text-xs",
4157
4204
  children: [r, i]
4158
4205
  }), t[4] = i, t[5] = a), a;
4159
- }, Oo = (e) => {
4160
- let t = (0, M.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4206
+ }, Ao = (e) => {
4207
+ let t = (0, j.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4161
4208
  t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, q.jsx)("span", {
4162
4209
  className: "truncate font-medium",
4163
4210
  children: r
@@ -4178,7 +4225,7 @@ var Do = (e) => {
4178
4225
  s
4179
4226
  ] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
4180
4227
  let l = c;
4181
- if (a && ze(a)) {
4228
+ if (a && Te(a)) {
4182
4229
  let e = i ?? r, n;
4183
4230
  return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, q.jsx)("a", {
4184
4231
  href: a,
@@ -4195,13 +4242,13 @@ var Do = (e) => {
4195
4242
  title: u,
4196
4243
  children: l
4197
4244
  }), t[12] = l, t[13] = u, t[14] = d) : d = t[14], d;
4198
- }, ko = (e) => {
4199
- let t = (0, M.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = K.useState("");
4245
+ }, jo = (e) => {
4246
+ let t = (0, j.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = K.useState("");
4200
4247
  if (!n && !o) return null;
4201
4248
  let l = o ? "reasoning" : s, u;
4202
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4249
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)(Ht, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4203
4250
  let d = o ? "Thinking" : "View reasoning", f = n.length > 0 && ` (${n.length} chars)`, p;
4204
- t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, q.jsx)(te, {
4251
+ t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, q.jsx)(w, {
4205
4252
  className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
4206
4253
  children: /* @__PURE__ */ (0, q.jsxs)("span", {
4207
4254
  className: "flex items-center gap-2",
@@ -4213,18 +4260,18 @@ var Do = (e) => {
4213
4260
  })
4214
4261
  }), t[1] = d, t[2] = f, t[3] = p) : p = t[3];
4215
4262
  let m;
4216
- t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, q.jsx)(_, {
4263
+ t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, q.jsx)(fe, {
4217
4264
  className: "pb-2 px-2",
4218
4265
  children: /* @__PURE__ */ (0, q.jsx)("div", {
4219
- className: "bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",
4266
+ className: "bg-muted/30 border border-muted/50 rounded-md p-3 text-muted-foreground relative",
4220
4267
  children: /* @__PURE__ */ (0, q.jsx)("div", {
4221
4268
  className: "pr-6",
4222
- children: /* @__PURE__ */ (0, q.jsx)(O, { content: n })
4269
+ children: /* @__PURE__ */ (0, q.jsx)(ao, { content: n })
4223
4270
  })
4224
4271
  })
4225
4272
  }), t[4] = n, t[5] = m);
4226
4273
  let h;
4227
- t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, q.jsxs)(A, {
4274
+ t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, q.jsxs)(pe, {
4228
4275
  value: "reasoning",
4229
4276
  className: "border-0",
4230
4277
  children: [p, m]
@@ -4241,13 +4288,44 @@ var Do = (e) => {
4241
4288
  };
4242
4289
  //#endregion
4243
4290
  //#region src/components/chat/tool-call/shared.ts
4244
- function Ao(e) {
4291
+ function Mo(e) {
4245
4292
  return e.replace("tool-", "");
4246
4293
  }
4247
4294
  //#endregion
4295
+ //#region src/components/chat/tool-call/tool-activity-group.tsx
4296
+ function No(e) {
4297
+ let t = (0, j.c)(7), { tools: n, isActive: r, children: i } = e, a = n.some(Fo), o = n.every(Po), s = n.length, c = a ? r ? o ? "Editing notebook…" : "Working…" : "Stopped before completing all steps" : o ? `Edited notebook · ${s} ${s === 1 ? "operation" : "operations"}` : `Completed ${s} ${s === 1 ? "step" : "steps"}`, l;
4298
+ t[0] === c ? l = t[1] : (l = /* @__PURE__ */ (0, q.jsx)(w, {
4299
+ className: "h-auto pl-0 pr-2 py-1 gap-2 rounded text-xs font-normal text-muted-foreground hover:bg-(--slate-2) hover:text-foreground hover:no-underline",
4300
+ children: c
4301
+ }), t[0] = c, t[1] = l);
4302
+ let u;
4303
+ t[2] === i ? u = t[3] : (u = /* @__PURE__ */ (0, q.jsx)(fe, {
4304
+ className: "pb-2 pl-3 border-l border-border",
4305
+ children: i
4306
+ }), t[2] = i, t[3] = u);
4307
+ let d;
4308
+ return t[4] !== l || t[5] !== u ? (d = /* @__PURE__ */ (0, q.jsx)(S, {
4309
+ type: "single",
4310
+ collapsible: !0,
4311
+ className: "my-1 w-full",
4312
+ children: /* @__PURE__ */ (0, q.jsxs)(pe, {
4313
+ value: "activity",
4314
+ className: "border-0",
4315
+ children: [l, u]
4316
+ })
4317
+ }), t[4] = l, t[5] = u, t[6] = d) : d = t[6], d;
4318
+ }
4319
+ function Po(e) {
4320
+ return Mo(e.toolName) === "edit_notebook_tool";
4321
+ }
4322
+ function Fo(e) {
4323
+ return e.state !== "output-available";
4324
+ }
4325
+ //#endregion
4248
4326
  //#region src/components/chat/tool-call/tool-args.tsx
4249
- var jo = (e) => {
4250
- let t = (0, M.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4327
+ var Io = (e) => {
4328
+ let t = (0, j.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4251
4329
  if (n == null) return null;
4252
4330
  let a;
4253
4331
  t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, q.jsx)("h3", {
@@ -4266,20 +4344,20 @@ var jo = (e) => {
4266
4344
  className: "space-y-2",
4267
4345
  children: [a, s]
4268
4346
  }), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
4269
- }, Mo = (e) => {
4270
- let t = (0, M.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4347
+ }, Lo = (e) => {
4348
+ let t = (0, j.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4271
4349
  t[0] === c ? l = t[1] : (l = i("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
4272
4350
  let u;
4273
- t[2] === n ? u = t[3] : (u = Ao(n), t[2] = n, t[3] = u);
4351
+ t[2] === n ? u = t[3] : (u = Mo(n), t[2] = n, t[3] = u);
4274
4352
  let d = `Approval required for ${u}`, f;
4275
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(qt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4353
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(Jt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4276
4354
  let p;
4277
4355
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, q.jsx)("span", {
4278
4356
  className: "font-semibold",
4279
4357
  children: "Approval required:"
4280
4358
  }), t[5] = p) : p = t[5];
4281
4359
  let m;
4282
- t[6] === n ? m = t[7] : (m = Ao(n), t[6] = n, t[7] = m);
4360
+ t[6] === n ? m = t[7] : (m = Mo(n), t[6] = n, t[7] = m);
4283
4361
  let h;
4284
4362
  t[8] === m ? h = t[9] : (h = /* @__PURE__ */ (0, q.jsxs)("div", {
4285
4363
  className: "flex items-start gap-2",
@@ -4296,7 +4374,7 @@ var jo = (e) => {
4296
4374
  })]
4297
4375
  }), t[8] = m, t[9] = h);
4298
4376
  let g;
4299
- t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[10] = r, t[11] = g);
4377
+ t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, q.jsx)(Io, { input: r }), t[10] = r, t[11] = g);
4300
4378
  let _;
4301
4379
  t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, q.jsx)(a, {
4302
4380
  size: "xs",
@@ -4332,86 +4410,86 @@ var jo = (e) => {
4332
4410
  y
4333
4411
  ]
4334
4412
  }), t[21] = l, t[22] = y, t[23] = d, t[24] = h, t[25] = g, t[26] = b) : b = t[26], b;
4335
- }, No = (e) => {
4336
- let t = (0, M.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = K.useState(o), u = K.useRef(o), d, f;
4413
+ }, Ro = (e) => {
4414
+ let t = (0, j.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = K.useState(o), u = K.useRef(o), d, f;
4337
4415
  t[0] === o ? (d = t[1], f = t[2]) : (d = () => {
4338
4416
  u.current && !o && l(!1), u.current = o;
4339
4417
  }, f = [o], t[0] = o, t[1] = d, t[2] = f), K.useEffect(d, f);
4340
4418
  let p;
4341
4419
  t[3] === s ? p = t[4] : (p = i("rounded-md border border-(--red-6) bg-(--red-2)", s), t[3] = s, t[4] = p);
4342
4420
  let m;
4343
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => l(Po), t[5] = m) : m = t[5];
4344
- let h;
4345
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, q.jsx)(be, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4421
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => l(zo), t[5] = m) : m = t[5];
4346
4422
  let g;
4347
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, q.jsx)("span", {
4423
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, q.jsx)(h, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = g) : g = t[6];
4424
+ let _;
4425
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ (0, q.jsx)("span", {
4348
4426
  className: "font-semibold",
4349
4427
  children: "Failed:"
4350
- }), t[7] = g) : g = t[7];
4351
- let _;
4352
- t[8] === n ? _ = t[9] : (_ = Ao(n), t[8] = n, t[9] = _);
4428
+ }), t[7] = _) : _ = t[7];
4353
4429
  let v;
4354
- t[10] === _ ? v = t[11] : (v = /* @__PURE__ */ (0, q.jsxs)("span", {
4430
+ t[8] === n ? v = t[9] : (v = Mo(n), t[8] = n, t[9] = v);
4431
+ let y;
4432
+ t[10] === v ? y = t[11] : (y = /* @__PURE__ */ (0, q.jsxs)("span", {
4355
4433
  className: "flex-1 text-left",
4356
4434
  children: [
4357
- g,
4435
+ _,
4358
4436
  " ",
4359
4437
  /* @__PURE__ */ (0, q.jsx)("code", {
4360
4438
  className: "font-mono",
4361
- children: _
4439
+ children: v
4362
4440
  })
4363
4441
  ]
4364
- }), t[10] = _, t[11] = v);
4365
- let y = c && "rotate-180", b;
4366
- t[12] === y ? b = t[13] : (b = i("h-3.5 w-3.5 shrink-0 transition-transform", y), t[12] = y, t[13] = b);
4367
- let x;
4368
- t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, q.jsx)(Ae, { className: b }), t[14] = b, t[15] = x);
4442
+ }), t[10] = v, t[11] = y);
4443
+ let b = c && "rotate-180", x;
4444
+ t[12] === b ? x = t[13] : (x = i("h-3.5 w-3.5 shrink-0 transition-transform", b), t[12] = b, t[13] = x);
4369
4445
  let S;
4370
- t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, q.jsxs)("button", {
4446
+ t[14] === x ? S = t[15] : (S = /* @__PURE__ */ (0, q.jsx)(_e, { className: x }), t[14] = x, t[15] = S);
4447
+ let C;
4448
+ t[16] !== c || t[17] !== S || t[18] !== y ? (C = /* @__PURE__ */ (0, q.jsxs)("button", {
4371
4449
  type: "button",
4372
4450
  onClick: m,
4373
4451
  className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-(--red-11) hover:bg-(--red-3) rounded-md transition-colors",
4374
4452
  "aria-expanded": c,
4375
4453
  children: [
4376
- h,
4377
- v,
4378
- x
4454
+ g,
4455
+ y,
4456
+ S
4379
4457
  ]
4380
- }), t[16] = c, t[17] = x, t[18] = v, t[19] = S) : S = t[19];
4381
- let C;
4382
- t[20] !== a || t[21] !== r || t[22] !== c ? (C = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4458
+ }), t[16] = c, t[17] = S, t[18] = y, t[19] = C) : C = t[19];
4459
+ let w;
4460
+ t[20] !== a || t[21] !== r || t[22] !== c ? (w = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4383
4461
  className: "px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3",
4384
- children: [/* @__PURE__ */ (0, q.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, q.jsxs)("div", { children: [/* @__PURE__ */ (0, q.jsx)("h3", {
4462
+ children: [/* @__PURE__ */ (0, q.jsx)(Io, { input: r }), a && /* @__PURE__ */ (0, q.jsxs)("div", { children: [/* @__PURE__ */ (0, q.jsx)("h3", {
4385
4463
  className: "text-xs font-semibold text-(--red-11) mb-1",
4386
4464
  children: "Error"
4387
4465
  }), /* @__PURE__ */ (0, q.jsx)("pre", {
4388
4466
  className: "bg-(--red-2) border border-(--red-6) rounded p-2 text-xs text-(--red-11) leading-relaxed overflow-auto scrollbar-thin max-h-64 whitespace-pre-wrap",
4389
4467
  children: a
4390
4468
  })] })]
4391
- }), t[20] = a, t[21] = r, t[22] = c, t[23] = C) : C = t[23];
4392
- let w;
4393
- return t[24] !== S || t[25] !== C || t[26] !== p ? (w = /* @__PURE__ */ (0, q.jsxs)("div", {
4469
+ }), t[20] = a, t[21] = r, t[22] = c, t[23] = w) : w = t[23];
4470
+ let T;
4471
+ return t[24] !== C || t[25] !== w || t[26] !== p ? (T = /* @__PURE__ */ (0, q.jsxs)("div", {
4394
4472
  className: p,
4395
- children: [S, C]
4396
- }), t[24] = S, t[25] = C, t[26] = p, t[27] = w) : w = t[27], w;
4473
+ children: [C, w]
4474
+ }), t[24] = C, t[25] = w, t[26] = p, t[27] = T) : T = t[27], T;
4397
4475
  };
4398
- function Po(e) {
4476
+ function zo(e) {
4399
4477
  return !e;
4400
4478
  }
4401
4479
  //#endregion
4402
4480
  //#region src/components/chat/tool-call/tool-result.tsx
4403
- function Fo(e) {
4404
- return e == null || typeof e == "object" && ht(e);
4405
- }
4406
- var Io = qe({
4407
- status: Qe().default("success"),
4408
- auth_required: lt().default(!1),
4409
- action_url: rt().optional(),
4410
- next_steps: rt().optional(),
4411
- meta: rt().optional(),
4412
- message: Qe().nullish()
4413
- }), Lo = (e) => {
4414
- let t = (0, M.c)(12), { data: n } = e, r;
4481
+ function Bo(e) {
4482
+ return e == null || typeof e == "object" && Ze(e);
4483
+ }
4484
+ var Vo = Ot({
4485
+ status: yt().default("success"),
4486
+ auth_required: ht().default(!1),
4487
+ action_url: jt().optional(),
4488
+ next_steps: jt().optional(),
4489
+ meta: jt().optional(),
4490
+ message: yt().nullish()
4491
+ }), Ho = (e) => {
4492
+ let t = (0, j.c)(12), { data: n } = e, r;
4415
4493
  if (t[0] !== n) {
4416
4494
  let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
4417
4495
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)("h3", {
@@ -4420,7 +4498,7 @@ var Io = qe({
4420
4498
  }), t[2] = u) : u = t[2];
4421
4499
  let d;
4422
4500
  t[3] === e ? d = t[4] : (d = /* @__PURE__ */ (0, q.jsx)("span", {
4423
- className: "text-xs px-2 py-0.5 bg-(--grass-2) text-(--grass-11) rounded-full font-medium capitalize",
4501
+ className: "text-xs text-muted-foreground capitalize",
4424
4502
  children: e
4425
4503
  }), t[3] = e, t[4] = d);
4426
4504
  let f;
@@ -4439,7 +4517,7 @@ var Io = qe({
4439
4517
  let m;
4440
4518
  t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4441
4519
  className: "flex items-start gap-2",
4442
- children: [/* @__PURE__ */ (0, q.jsx)(fe, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, q.jsx)("div", {
4520
+ children: [/* @__PURE__ */ (0, q.jsx)(x, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, q.jsx)("div", {
4443
4521
  className: "text-xs text-foreground",
4444
4522
  children: c
4445
4523
  })]
@@ -4450,19 +4528,19 @@ var Io = qe({
4450
4528
  m,
4451
4529
  l && /* @__PURE__ */ (0, q.jsx)("div", {
4452
4530
  className: "space-y-3",
4453
- children: Object.entries(l).map(zo)
4531
+ children: Object.entries(l).map(Wo)
4454
4532
  })
4455
4533
  ]
4456
4534
  }), t[0] = n, t[1] = r;
4457
4535
  } else r = t[1];
4458
4536
  return r;
4459
- }, Ro = (e) => {
4460
- let t = (0, M.c)(8), { result: n } = e, r;
4461
- t[0] === n ? r = t[1] : (r = Io.safeParse(n), t[0] = n, t[1] = r);
4537
+ }, Uo = (e) => {
4538
+ let t = (0, j.c)(8), { result: n } = e, r;
4539
+ t[0] === n ? r = t[1] : (r = Vo.safeParse(n), t[0] = n, t[1] = r);
4462
4540
  let i = r;
4463
4541
  if (i.success) {
4464
4542
  let e;
4465
- return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(Lo, { data: i.data }), t[2] = i.data, t[3] = e), e;
4543
+ return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(Ho, { data: i.data }), t[2] = i.data, t[3] = e), e;
4466
4544
  }
4467
4545
  let a;
4468
4546
  t[4] === n ? a = t[5] : (a = typeof n == "string" ? n : JSON.stringify(n, null, 2), t[4] = n, t[5] = a);
@@ -4472,9 +4550,9 @@ var Io = qe({
4472
4550
  children: a
4473
4551
  }), t[6] = a, t[7] = o), o;
4474
4552
  };
4475
- function zo(e) {
4553
+ function Wo(e) {
4476
4554
  let [t, n] = e;
4477
- return Fo(n) ? null : /* @__PURE__ */ (0, q.jsxs)("div", {
4555
+ return Bo(n) ? null : /* @__PURE__ */ (0, q.jsxs)("div", {
4478
4556
  className: "space-y-1.5",
4479
4557
  children: [/* @__PURE__ */ (0, q.jsx)("span", {
4480
4558
  className: "text-xs text-muted-foreground",
@@ -4487,125 +4565,107 @@ function zo(e) {
4487
4565
  }
4488
4566
  //#endregion
4489
4567
  //#region src/components/chat/tool-call/tool-history-row.tsx
4490
- var Bo = {
4568
+ var Go = {
4491
4569
  "input-streaming": "Generating",
4492
4570
  "input-available": "Running",
4493
4571
  "approval-responded": "Awaiting result",
4494
4572
  "output-available": "Done",
4495
4573
  "output-denied": "Denied"
4496
- }, Vo = /* @__PURE__ */ new Set([
4574
+ }, Ko = /* @__PURE__ */ new Set([
4497
4575
  "input-streaming",
4498
4576
  "input-available",
4499
4577
  "approval-responded"
4500
- ]), Ho = (e) => {
4501
- let t = (0, M.c)(5), { state: n, interrupted: r } = e;
4578
+ ]), qo = (e) => {
4579
+ let t = (0, j.c)(4), { state: n, interrupted: r } = e;
4502
4580
  if (r) {
4503
4581
  let e;
4504
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Ht, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4582
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Ut, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4505
4583
  }
4506
4584
  switch (n) {
4507
4585
  case "input-streaming":
4508
4586
  case "input-available":
4509
4587
  case "approval-responded": {
4510
4588
  let e;
4511
- return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(g, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4512
- }
4513
- case "output-available": {
4514
- let e;
4515
- return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Vt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
4589
+ return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(he, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4516
4590
  }
4591
+ case "output-available": return null;
4517
4592
  case "output-denied": {
4518
4593
  let e;
4519
- return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(zt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
4594
+ return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Vt, { className: "h-3 w-3 text-muted-foreground" }), t[2] = e) : e = t[2], e;
4520
4595
  }
4521
4596
  default: {
4522
- ke(n);
4597
+ We(n);
4523
4598
  let e;
4524
- return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(h, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
4599
+ return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(g, { className: "h-3 w-3" }), t[3] = e) : e = t[3], e;
4525
4600
  }
4526
4601
  }
4527
- };
4528
- function Uo(e) {
4529
- switch (e) {
4530
- case "output-available": return "text-(--grass-11)/80";
4531
- case "output-denied": return "text-muted-foreground";
4532
- case "input-streaming":
4533
- case "input-available":
4534
- case "approval-responded": return "";
4535
- default: return ke(e), "";
4536
- }
4537
- }
4538
- var Wo = (e) => {
4539
- let t = (0, M.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4540
- t[0] !== f || t[1] !== r ? (p = !f && Vo.has(r), t[0] = f, t[1] = r, t[2] = p) : p = t[2];
4602
+ }, Jo = (e) => {
4603
+ let t = (0, j.c)(28), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4604
+ t[0] !== f || t[1] !== r ? (p = !f && Ko.has(r), t[0] = f, t[1] = r, t[2] = p) : p = t[2];
4541
4605
  let m = p, h = `tool-${d}`, g;
4542
4606
  t[3] === l ? g = t[4] : (g = i("w-full", l), t[3] = l, t[4] = g);
4543
- let v;
4544
- t[5] !== m || t[6] !== r ? (v = i("h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline", m ? "text-muted-foreground" : Uo(r)), t[5] = m, t[6] = r, t[7] = v) : v = t[7];
4545
- let y;
4546
- t[8] !== m || t[9] !== r ? (y = /* @__PURE__ */ (0, q.jsx)(Ho, {
4607
+ let _;
4608
+ t[5] !== m || t[6] !== r ? (_ = /* @__PURE__ */ (0, q.jsx)(qo, {
4547
4609
  state: r,
4548
4610
  interrupted: m
4549
- }), t[8] = m, t[9] = r, t[10] = y) : y = t[10];
4550
- let b = m ? "Interrupted" : Bo[r], x;
4551
- t[11] === n ? x = t[12] : (x = Ao(n), t[11] = n, t[12] = x);
4552
- let C;
4553
- t[13] === x ? C = t[14] : (C = /* @__PURE__ */ (0, q.jsx)("code", {
4611
+ }), t[5] = m, t[6] = r, t[7] = _) : _ = t[7];
4612
+ let v = m ? "Interrupted" : Go[r], y;
4613
+ t[8] === n ? y = t[9] : (y = Mo(n), t[8] = n, t[9] = y);
4614
+ let b;
4615
+ t[10] === y ? b = t[11] : (b = /* @__PURE__ */ (0, q.jsx)("code", {
4554
4616
  className: "font-mono text-xs",
4555
- children: x
4556
- }), t[13] = x, t[14] = C);
4557
- let w;
4558
- t[15] !== C || t[16] !== y || t[17] !== b ? (w = /* @__PURE__ */ (0, q.jsxs)("span", {
4559
- className: "flex items-center gap-1",
4560
- children: [
4561
- y,
4562
- b,
4563
- ":",
4564
- C
4565
- ]
4566
- }), t[15] = C, t[16] = y, t[17] = b, t[18] = w) : w = t[18];
4567
- let T;
4568
- t[19] !== w || t[20] !== v ? (T = /* @__PURE__ */ (0, q.jsx)(te, {
4569
- className: v,
4570
- children: w
4571
- }), t[19] = w, t[20] = v, t[21] = T) : T = t[21];
4572
- let E;
4573
- t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, q.jsx)(_, {
4617
+ children: y
4618
+ }), t[10] = y, t[11] = b);
4619
+ let x;
4620
+ t[12] !== _ || t[13] !== v || t[14] !== b ? (x = /* @__PURE__ */ (0, q.jsx)(w, {
4621
+ className: "h-auto pl-0 pr-2 py-1 gap-2 rounded text-xs font-normal text-muted-foreground hover:bg-(--slate-2) hover:text-foreground hover:no-underline",
4622
+ children: /* @__PURE__ */ (0, q.jsxs)("span", {
4623
+ className: "flex items-center gap-1",
4624
+ children: [
4625
+ _,
4626
+ v,
4627
+ ":",
4628
+ b
4629
+ ]
4630
+ })
4631
+ }), t[12] = _, t[13] = v, t[14] = b, t[15] = x) : x = t[15];
4632
+ let C;
4633
+ t[16] !== s || t[17] !== a || t[18] !== o || t[19] !== r ? (C = /* @__PURE__ */ (0, q.jsx)(fe, {
4574
4634
  className: "py-2 px-2",
4575
- children: /* @__PURE__ */ (0, q.jsx)(Go, {
4635
+ children: /* @__PURE__ */ (0, q.jsx)(Yo, {
4576
4636
  state: r,
4577
4637
  input: a,
4578
4638
  result: o,
4579
4639
  approval: s
4580
4640
  })
4581
- }), t[22] = s, t[23] = a, t[24] = o, t[25] = r, t[26] = E) : E = t[26];
4582
- let D;
4583
- t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, q.jsxs)(A, {
4641
+ }), t[16] = s, t[17] = a, t[18] = o, t[19] = r, t[20] = C) : C = t[20];
4642
+ let T;
4643
+ t[21] !== x || t[22] !== C ? (T = /* @__PURE__ */ (0, q.jsxs)(pe, {
4584
4644
  value: "tool-call",
4585
4645
  className: "border-0",
4586
- children: [T, E]
4587
- }), t[27] = T, t[28] = E, t[29] = D) : D = t[29];
4588
- let O;
4589
- return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, q.jsx)(S, {
4646
+ children: [x, C]
4647
+ }), t[21] = x, t[22] = C, t[23] = T) : T = t[23];
4648
+ let E;
4649
+ return t[24] !== T || t[25] !== h || t[26] !== g ? (E = /* @__PURE__ */ (0, q.jsx)(S, {
4590
4650
  type: "single",
4591
4651
  collapsible: !0,
4592
4652
  className: g,
4593
- children: D
4594
- }, h), t[30] = D, t[31] = h, t[32] = g, t[33] = O) : O = t[33], O;
4595
- }, Go = (e) => {
4596
- let t = (0, M.c)(16), { state: n, input: r, result: i, approval: a } = e;
4653
+ children: T
4654
+ }, h), t[24] = T, t[25] = h, t[26] = g, t[27] = E) : E = t[27], E;
4655
+ }, Yo = (e) => {
4656
+ let t = (0, j.c)(16), { state: n, input: r, result: i, approval: a } = e;
4597
4657
  switch (n) {
4598
4658
  case "input-streaming":
4599
4659
  case "input-available":
4600
4660
  case "approval-responded": {
4601
4661
  let e;
4602
- return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[0] = r, t[1] = e), e;
4662
+ return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, q.jsx)(Io, { input: r }), t[0] = r, t[1] = e), e;
4603
4663
  }
4604
4664
  case "output-available": {
4605
4665
  let e;
4606
- t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[2] = r, t[3] = e);
4666
+ t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(Io, { input: r }), t[2] = r, t[3] = e);
4607
4667
  let n;
4608
- t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, q.jsx)(Ro, { result: i }), t[4] = i, t[5] = n);
4668
+ t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, q.jsx)(Uo, { result: i }), t[4] = i, t[5] = n);
4609
4669
  let a;
4610
4670
  return t[6] !== e || t[7] !== n ? (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4611
4671
  className: "space-y-3",
@@ -4614,7 +4674,7 @@ var Wo = (e) => {
4614
4674
  }
4615
4675
  case "output-denied": {
4616
4676
  let e;
4617
- t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[9] = r, t[10] = e);
4677
+ t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, q.jsx)(Io, { input: r }), t[9] = r, t[10] = e);
4618
4678
  let n = a?.reason ? `: ${a.reason}` : ".", i;
4619
4679
  t[11] === n ? i = t[12] : (i = /* @__PURE__ */ (0, q.jsxs)("div", {
4620
4680
  className: "bg-muted/40 border border-border rounded-md p-3 text-xs text-muted-foreground leading-relaxed",
@@ -4626,15 +4686,15 @@ var Wo = (e) => {
4626
4686
  children: [e, i]
4627
4687
  }), t[13] = e, t[14] = i, t[15] = o) : o = t[15], o;
4628
4688
  }
4629
- default: return ke(n), null;
4689
+ default: return We(n), null;
4630
4690
  }
4631
- }, Ko = (e) => {
4632
- let t = (0, M.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4691
+ }, Xo = (e) => {
4692
+ let t = (0, j.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4633
4693
  switch (r) {
4634
4694
  case "approval-requested": {
4635
4695
  if (s != null && c != null) {
4636
4696
  let e;
4637
- return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Mo, {
4697
+ return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Lo, {
4638
4698
  toolName: n,
4639
4699
  input: o,
4640
4700
  approval: s,
@@ -4643,7 +4703,7 @@ var Wo = (e) => {
4643
4703
  }), t[0] = s, t[1] = u, t[2] = o, t[3] = c, t[4] = n, t[5] = e) : e = t[5], e;
4644
4704
  }
4645
4705
  let e;
4646
- return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4706
+ return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Jo, {
4647
4707
  toolName: n,
4648
4708
  state: "input-available",
4649
4709
  input: o,
@@ -4654,7 +4714,7 @@ var Wo = (e) => {
4654
4714
  }
4655
4715
  case "output-error": {
4656
4716
  let e;
4657
- return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(No, {
4717
+ return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Ro, {
4658
4718
  toolName: n,
4659
4719
  input: o,
4660
4720
  errorText: a,
@@ -4668,7 +4728,7 @@ var Wo = (e) => {
4668
4728
  case "output-available":
4669
4729
  case "output-denied": {
4670
4730
  let e;
4671
- return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4731
+ return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Jo, {
4672
4732
  toolName: n,
4673
4733
  state: r,
4674
4734
  input: o,
@@ -4679,17 +4739,38 @@ var Wo = (e) => {
4679
4739
  isActive: m
4680
4740
  }), t[18] = s, t[19] = u, t[20] = l, t[21] = o, t[22] = m, t[23] = i, t[24] = r, t[25] = n, t[26] = e) : e = t[26], e;
4681
4741
  }
4682
- default: return ke(r), null;
4683
- }
4684
- }, qo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
4685
- return /* @__PURE__ */ (0, q.jsx)(q.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
4686
- function o(o, s) {
4687
- if (Jo(o)) return /* @__PURE__ */ (0, q.jsx)(Ko, {
4742
+ default: return We(r), null;
4743
+ }
4744
+ }, Zo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
4745
+ let o = [], s = [], c = () => {
4746
+ s.length !== 0 && (o.push(/* @__PURE__ */ (0, q.jsx)(No, {
4747
+ tools: s.map(({ part: e }) => ({
4748
+ toolName: e.type === "dynamic-tool" ? e.toolName : e.type,
4749
+ state: e.state
4750
+ })),
4751
+ isActive: i && n,
4752
+ children: s.map(({ part: e, index: t }) => l(e, t))
4753
+ }, s[0].index)), s = []);
4754
+ };
4755
+ return e.parts.forEach((e, t) => {
4756
+ if (!(e.type === "step-start" || $o(e) || e.type === "text" && !e.text.trim())) {
4757
+ if ((Qo(e) || e.type === "dynamic-tool") && e.state !== "output-error" && e.state !== "output-denied" && e.state !== "approval-requested") {
4758
+ s.push({
4759
+ part: e,
4760
+ index: t
4761
+ });
4762
+ return;
4763
+ }
4764
+ c(), o.push(l(e, t));
4765
+ }
4766
+ }), c(), o;
4767
+ function l(o, s) {
4768
+ if (Qo(o)) return /* @__PURE__ */ (0, q.jsx)(Xo, {
4688
4769
  index: s,
4689
4770
  toolName: o.type,
4690
4771
  result: o.output,
4691
4772
  errorText: o.state === "output-error" ? o.errorText : void 0,
4692
- className: "my-2",
4773
+ className: "my-1",
4693
4774
  state: o.state,
4694
4775
  input: o.input,
4695
4776
  approval: o.approval,
@@ -4697,21 +4778,21 @@ var Wo = (e) => {
4697
4778
  isLive: n,
4698
4779
  isActive: i
4699
4780
  }, s);
4700
- if (Yo(o)) return r.debug("Found data part", o), null;
4781
+ if ($o(o)) return r.debug("Found data part", o), null;
4701
4782
  switch (o.type) {
4702
- case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, q.jsx)(K.Fragment, { children: u({ html: o.text }) }, s) : /* @__PURE__ */ (0, q.jsx)(O, { content: o.text }, s);
4703
- case "reasoning": return /* @__PURE__ */ (0, q.jsx)(ko, {
4783
+ case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, q.jsx)(K.Fragment, { children: p({ html: o.text }) }, s) : /* @__PURE__ */ (0, q.jsx)(ao, { content: o.text }, s);
4784
+ case "reasoning": return /* @__PURE__ */ (0, q.jsx)(jo, {
4704
4785
  reasoning: o.text,
4705
4786
  index: s,
4706
4787
  isStreaming: t && n && s === (e.parts.length || 0) - 1
4707
4788
  }, s);
4708
- case "file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: o }, s);
4709
- case "reasoning-file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: {
4789
+ case "file": return /* @__PURE__ */ (0, q.jsx)(ko, { attachment: o }, s);
4790
+ case "reasoning-file": return /* @__PURE__ */ (0, q.jsx)(ko, { attachment: {
4710
4791
  type: "file",
4711
4792
  mediaType: o.mediaType,
4712
4793
  url: o.url
4713
4794
  } }, s);
4714
- case "dynamic-tool": return /* @__PURE__ */ (0, q.jsx)(Ko, {
4795
+ case "dynamic-tool": return /* @__PURE__ */ (0, q.jsx)(Xo, {
4715
4796
  toolName: o.toolName,
4716
4797
  result: o.output,
4717
4798
  errorText: o.state === "output-error" ? o.errorText : void 0,
@@ -4722,13 +4803,13 @@ var Wo = (e) => {
4722
4803
  isLive: n,
4723
4804
  isActive: i
4724
4805
  }, s);
4725
- case "source-document": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4726
- icon: /* @__PURE__ */ (0, q.jsx)(ye, { className: "h-3 w-3 shrink-0" }),
4806
+ case "source-document": return /* @__PURE__ */ (0, q.jsx)(Ao, {
4807
+ icon: /* @__PURE__ */ (0, q.jsx)(f, { className: "h-3 w-3 shrink-0" }),
4727
4808
  title: o.title,
4728
4809
  subtitle: o.filename
4729
4810
  }, s);
4730
- case "source-url": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4731
- icon: /* @__PURE__ */ (0, q.jsx)(me, { className: "h-3 w-3 shrink-0" }),
4811
+ case "source-url": return /* @__PURE__ */ (0, q.jsx)(Ao, {
4812
+ icon: /* @__PURE__ */ (0, q.jsx)(Le, { className: "h-3 w-3 shrink-0" }),
4732
4813
  title: o.title ?? o.url,
4733
4814
  subtitle: o.title ? o.url : void 0,
4734
4815
  href: o.url
@@ -4738,24 +4819,24 @@ var Wo = (e) => {
4738
4819
  children: o.kind
4739
4820
  }, s);
4740
4821
  case "step-start": return null;
4741
- default: return ke(o), null;
4822
+ default: return We(o), null;
4742
4823
  }
4743
4824
  }
4744
4825
  };
4745
- function Jo(e) {
4826
+ function Qo(e) {
4746
4827
  return e.type.startsWith("tool-");
4747
4828
  }
4748
- function Yo(e) {
4829
+ function $o(e) {
4749
4830
  return e.type.startsWith("data-");
4750
4831
  }
4751
4832
  //#endregion
4752
4833
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/utils/facet.js
4753
- function Xo(e) {
4754
- return bt.define({ combine: (t) => t[0] ?? e });
4834
+ function es(e) {
4835
+ return ct.define({ combine: (t) => t[0] ?? e });
4755
4836
  }
4756
4837
  //#endregion
4757
4838
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/prompt-history/extension.js
4758
- var Zo = Xo({}), Qo = St.define(), $o = St.define(), es = 50, ts = At.define({
4839
+ var ts = es({}), ns = rt.define(), rs = rt.define(), is = 50, as = nt.define({
4759
4840
  create() {
4760
4841
  return {
4761
4842
  prompts: [],
@@ -4765,15 +4846,15 @@ var Zo = Xo({}), Qo = St.define(), $o = St.define(), es = 50, ts = At.define({
4765
4846
  },
4766
4847
  update(e, t) {
4767
4848
  let n = { ...e };
4768
- t.docChanged && e.navigationIndex !== -1 && (t.effects.some((e) => e.is($o) || e.is(Qo)) || (n.navigationIndex = -1, n.originalText = ""));
4769
- for (let r of t.effects) if (r.is(Qo)) {
4849
+ t.docChanged && e.navigationIndex !== -1 && (t.effects.some((e) => e.is(rs) || e.is(ns)) || (n.navigationIndex = -1, n.originalText = ""));
4850
+ for (let r of t.effects) if (r.is(ns)) {
4770
4851
  let i = r.value.trim();
4771
- i && (n.prompts = [i, ...e.prompts.filter((e) => e !== i)].slice(0, es), t.state.facet(Zo).save?.(n.prompts)), n.navigationIndex = -1, n.originalText = "";
4772
- } else r.is($o) && (n.navigationIndex = r.value.index, n.originalText = r.value.originalText);
4852
+ i && (n.prompts = [i, ...e.prompts.filter((e) => e !== i)].slice(0, is), t.state.facet(ts).save?.(n.prompts)), n.navigationIndex = -1, n.originalText = "";
4853
+ } else r.is(rs) && (n.navigationIndex = r.value.index, n.originalText = r.value.originalText);
4773
4854
  return n;
4774
4855
  }
4775
- }), ns = (e) => {
4776
- let t = e.state.field(ts), n = e.state.doc;
4856
+ }), os = (e) => {
4857
+ let t = e.state.field(as), n = e.state.doc;
4777
4858
  if (t.prompts.length === 0) return !1;
4778
4859
  let r, i = t.originalText;
4779
4860
  if (t.navigationIndex === -1) {
@@ -4787,13 +4868,13 @@ var Zo = Xo({}), Qo = St.define(), $o = St.define(), es = 50, ts = At.define({
4787
4868
  to: e.state.doc.length,
4788
4869
  insert: a
4789
4870
  },
4790
- effects: $o.of({
4871
+ effects: rs.of({
4791
4872
  index: r,
4792
4873
  originalText: i
4793
4874
  })
4794
4875
  }), !0;
4795
- }, rs = (e) => {
4796
- let t = e.state.field(ts);
4876
+ }, ss = (e) => {
4877
+ let t = e.state.field(as);
4797
4878
  if (t.navigationIndex === -1) return !1;
4798
4879
  let n, r;
4799
4880
  return t.navigationIndex === 0 ? (n = t.originalText, r = -1) : (r = t.navigationIndex - 1, n = t.prompts[r] ?? ""), e.dispatch({
@@ -4802,41 +4883,41 @@ var Zo = Xo({}), Qo = St.define(), $o = St.define(), es = 50, ts = At.define({
4802
4883
  to: e.state.doc.length,
4803
4884
  insert: n
4804
4885
  },
4805
- effects: $o.of({
4886
+ effects: rs.of({
4806
4887
  index: r,
4807
4888
  originalText: t.originalText
4808
4889
  })
4809
4890
  }), !0;
4810
4891
  };
4811
- function is(e = {}) {
4812
- let { storage: t, defaultKeymap: n = !0 } = e, r = [ts.init(() => ({
4892
+ function cs(e = {}) {
4893
+ let { storage: t, defaultKeymap: n = !0 } = e, r = [as.init(() => ({
4813
4894
  prompts: t?.load?.() ?? [],
4814
4895
  navigationIndex: -1,
4815
4896
  originalText: ""
4816
- })), Zo.of(t ?? {})];
4817
- return n && r.push(Tt.of([{
4897
+ })), ts.of(t ?? {})];
4898
+ return n && r.push(dt.of([{
4818
4899
  key: "ArrowUp",
4819
- run: ns
4900
+ run: os
4820
4901
  }, {
4821
4902
  key: "ArrowDown",
4822
- run: rs
4903
+ run: ss
4823
4904
  }])), r;
4824
4905
  }
4825
4906
  //#endregion
4826
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4827
- var as = St.define(), Q = At.define({
4907
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4908
+ var ls = rt.define(), Q = nt.define({
4828
4909
  create() {
4829
4910
  return /* @__PURE__ */ new Map();
4830
4911
  },
4831
4912
  update(e, t) {
4832
4913
  let n = !1, r = e;
4833
- for (let i of t.effects) if (i.is(as)) {
4914
+ for (let i of t.effects) if (i.is(ls)) {
4834
4915
  n ||= (r = new Map(e), !0);
4835
4916
  for (let [e, t] of i.value) r.set(e, t);
4836
4917
  }
4837
4918
  return r;
4838
4919
  }
4839
- }), os = At.define({
4920
+ }), us = nt.define({
4840
4921
  create() {
4841
4922
  return {
4842
4923
  onResourceClick: void 0,
@@ -4848,14 +4929,14 @@ var as = St.define(), Q = At.define({
4848
4929
  update(e) {
4849
4930
  return e;
4850
4931
  }
4851
- }), ss = St.define();
4852
- At.define({
4932
+ }), ds = rt.define();
4933
+ nt.define({
4853
4934
  create() {
4854
4935
  return /* @__PURE__ */ new Map();
4855
4936
  },
4856
4937
  update(e, t) {
4857
4938
  let n = !1, r = e;
4858
- for (let i of t.effects) if (i.is(ss)) {
4939
+ for (let i of t.effects) if (i.is(ds)) {
4859
4940
  n ||= (r = new Map(e), !0);
4860
4941
  for (let [e, t] of i.value) r.set(e, t);
4861
4942
  }
@@ -4863,13 +4944,13 @@ At.define({
4863
4944
  }
4864
4945
  });
4865
4946
  //#endregion
4866
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
4867
- var cs = (e, t) => async (n) => {
4947
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
4948
+ var fs = (e, t) => async (n) => {
4868
4949
  let r = n.matchBefore(/@(\w+)?/);
4869
4950
  if (!r || r.from === r.to && !n.explicit) return null;
4870
4951
  let i = await e();
4871
4952
  if (i.length === 0) return null;
4872
- let a = as.of(new Map(i.map((e) => [e.uri, e])));
4953
+ let a = ls.of(new Map(i.map((e) => [e.uri, e])));
4873
4954
  n.view && n.view.dispatch({ effects: a });
4874
4955
  let o = i.map((e) => ({
4875
4956
  label: `@${e.name}`,
@@ -4891,13 +4972,13 @@ var cs = (e, t) => async (n) => {
4891
4972
  from: r.from,
4892
4973
  options: o
4893
4974
  };
4894
- }, ls = /@[\w-]+:\/\/(?!\/)[^\s]+/;
4975
+ }, ps = /@[\w-]+:\/\/(?!\/)[^\s]+/;
4895
4976
  function $(e) {
4896
- return e.matchAll(new RegExp(ls.source, "g"));
4977
+ return e.matchAll(new RegExp(ps.source, "g"));
4897
4978
  }
4898
4979
  //#endregion
4899
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4900
- var us = class extends Ot {
4980
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4981
+ var ms = class extends st {
4901
4982
  resource;
4902
4983
  view;
4903
4984
  constructor(e, t) {
@@ -4909,7 +4990,7 @@ var us = class extends Ot {
4909
4990
  toDOM() {
4910
4991
  let e = document.createElement("span");
4911
4992
  e.className = "cm-resource-widget", e.textContent = `@${this.resource.name}`;
4912
- let t = this.view.state.field(os, !1), n = t?.onResourceClick, r = t?.onResourceMouseOver, i = t?.onResourceMouseOut;
4993
+ let t = this.view.state.field(us, !1), n = t?.onResourceClick, r = t?.onResourceMouseOver, i = t?.onResourceMouseOut;
4913
4994
  return n && (e.style.cursor = "pointer", e.addEventListener("click", (e) => {
4914
4995
  e.preventDefault(), e.stopPropagation(), n(this.resource);
4915
4996
  })), r && e.addEventListener("mouseover", (e) => {
@@ -4918,7 +4999,7 @@ var us = class extends Ot {
4918
4999
  e.preventDefault(), e.stopPropagation(), i(this.resource);
4919
5000
  }), e;
4920
5001
  }
4921
- }, ds = class extends Ot {
5002
+ }, hs = class extends st {
4922
5003
  uri;
4923
5004
  view;
4924
5005
  constructor(e, t) {
@@ -4932,29 +5013,29 @@ var us = class extends Ot {
4932
5013
  return e.className = "cm-not-found-resource-widget", e.textContent = `@${this.uri.split("://")[1] ?? this.uri}`, e;
4933
5014
  }
4934
5015
  };
4935
- function fs(e) {
5016
+ function gs(e) {
4936
5017
  let t = e.state.field(Q), n = [];
4937
5018
  for (let { from: r, to: i } of e.visibleRanges) {
4938
5019
  let a = e.state.doc.sliceString(r, i);
4939
5020
  for (let i of $(a)) {
4940
5021
  let a = r + i.index, o = i[0].slice(1), s = t.get(o);
4941
- s ? n.push(wt.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(wt.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
5022
+ s ? n.push(pt.replace({ widget: new ms(s, e) }).range(a, a + i[0].length)) : n.push(pt.replace({ widget: new hs(o, e) }).range(a, a + i[0].length));
4942
5023
  }
4943
5024
  }
4944
- return wt.set(n);
5025
+ return pt.set(n);
4945
5026
  }
4946
- var ps = kt.fromClass(class {
5027
+ var _s = at.fromClass(class {
4947
5028
  decorations;
4948
5029
  constructor(e) {
4949
- this.decorations = fs(e);
5030
+ this.decorations = gs(e);
4950
5031
  }
4951
5032
  update(e) {
4952
- (e.docChanged || e.viewportChanged || e.transactions.some((e) => e.effects.some((e) => e.is(as)))) && (this.decorations = fs(e.view));
5033
+ (e.docChanged || e.viewportChanged || e.transactions.some((e) => e.effects.some((e) => e.is(ls)))) && (this.decorations = gs(e.view));
4953
5034
  }
4954
5035
  }, { decorations: (e) => e.decorations });
4955
5036
  //#endregion
4956
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
4957
- function ms(e) {
5037
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
5038
+ function vs(e) {
4958
5039
  let t = document.createElement("div");
4959
5040
  t.className = "cm-tooltip-cursor";
4960
5041
  let n = document.createElement("div");
@@ -4968,7 +5049,7 @@ function ms(e) {
4968
5049
  }
4969
5050
  return { dom: t };
4970
5051
  }
4971
- function hs(e, t, n, r = 0) {
5052
+ function ys(e, t, n, r = 0) {
4972
5053
  for (let i of $(e)) {
4973
5054
  let e = r + i.index, a = e + i[0].length;
4974
5055
  if (t >= e && t <= a) {
@@ -4982,22 +5063,22 @@ function hs(e, t, n, r = 0) {
4982
5063
  }
4983
5064
  return null;
4984
5065
  }
4985
- function gs(e) {
4986
- return Dt((t, n) => {
4987
- let { from: r, text: i } = t.state.doc.lineAt(n), a = hs(i, n, t.state.field(Q), r);
5066
+ function bs(e) {
5067
+ return ut((t, n) => {
5068
+ let { from: r, text: i } = t.state.doc.lineAt(n), a = ys(i, n, t.state.field(Q), r);
4988
5069
  return a ? {
4989
5070
  pos: a.start,
4990
5071
  end: a.end,
4991
5072
  above: !0,
4992
5073
  create() {
4993
- return (e.createTooltip ?? ms)(a.resource);
5074
+ return (e.createTooltip ?? vs)(a.resource);
4994
5075
  }
4995
5076
  } : null;
4996
5077
  });
4997
5078
  }
4998
5079
  //#endregion
4999
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
5000
- function _s(e, t) {
5080
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
5081
+ function xs(e, t) {
5001
5082
  let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, i.to), o = Array.from($(a));
5002
5083
  if (o.length === 0) return null;
5003
5084
  for (let e of o) {
@@ -5010,7 +5091,7 @@ function _s(e, t) {
5010
5091
  }
5011
5092
  return null;
5012
5093
  }
5013
- function vs(e, t) {
5094
+ function Ss(e, t) {
5014
5095
  let n = e.field(Q), r = e.doc, i = r.lineAt(t).to, a = r.sliceString(t, i), o = Array.from($(a));
5015
5096
  if (o.length === 0) return null;
5016
5097
  let s = o[0];
@@ -5022,7 +5103,7 @@ function vs(e, t) {
5022
5103
  uri: u
5023
5104
  } : null;
5024
5105
  }
5025
- function ys(e, t) {
5106
+ function Cs(e, t) {
5026
5107
  let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, i.to), o = Array.from($(a));
5027
5108
  for (let e of o) {
5028
5109
  let r = i.from + e.index, a = r + e[0].length, o = e[0].slice(1);
@@ -5034,7 +5115,7 @@ function ys(e, t) {
5034
5115
  }
5035
5116
  return null;
5036
5117
  }
5037
- function bs(e, t) {
5118
+ function ws(e, t) {
5038
5119
  let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, t), o = Array.from($(a)), s = null;
5039
5120
  for (let e of o) {
5040
5121
  let r = i.from + e.index, a = r + e[0].length, o = e[0].slice(1);
@@ -5042,7 +5123,7 @@ function bs(e, t) {
5042
5123
  }
5043
5124
  return s;
5044
5125
  }
5045
- function xs(e, t) {
5126
+ function Ts(e, t) {
5046
5127
  let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, i.to), o = Array.from($(a));
5047
5128
  for (let e of o) {
5048
5129
  let r = i.from + e.index, a = r + e[0].length, o = e[0].slice(1);
@@ -5053,8 +5134,8 @@ function xs(e, t) {
5053
5134
  }
5054
5135
  return null;
5055
5136
  }
5056
- var Ss = Et.transactionFilter.of((e) => {
5057
- let t = e.annotation(Ct.userEvent);
5137
+ var Es = ft.transactionFilter.of((e) => {
5138
+ let t = e.annotation(lt.userEvent);
5058
5139
  if (!t) return e;
5059
5140
  let n = e.startState.selection.main;
5060
5141
  if (!n.empty) return e;
@@ -5102,7 +5183,7 @@ var Ss = Et.transactionFilter.of((e) => {
5102
5183
  }
5103
5184
  if (t === "delete.backward" || t === "delete.forward") {
5104
5185
  let r = null;
5105
- return t === "delete.backward" ? r = _s(e.startState, n.head) : t === "delete.forward" && (r = vs(e.startState, n.head)), r ? [{
5186
+ return t === "delete.backward" ? r = xs(e.startState, n.head) : t === "delete.forward" && (r = Ss(e.startState, n.head)), r ? [{
5106
5187
  changes: {
5107
5188
  from: r.from,
5108
5189
  to: r.to,
@@ -5115,11 +5196,11 @@ var Ss = Et.transactionFilter.of((e) => {
5115
5196
  if (e.selection?.main.empty && n.empty && !t.startsWith("input") && t !== "input.type") {
5116
5197
  let t = n.head, r = e.selection.main.head, i = null;
5117
5198
  if (r < t) {
5118
- let n = ys(e.startState, t);
5119
- i = n && t > n.from ? n.from : bs(e.startState, t);
5199
+ let n = Cs(e.startState, t);
5200
+ i = n && t > n.from ? n.from : ws(e.startState, t);
5120
5201
  } else if (r > t) {
5121
- let n = ys(e.startState, t);
5122
- i = n && t < n.to ? n.to : xs(e.startState, t);
5202
+ let n = Cs(e.startState, t);
5203
+ i = n && t < n.to ? n.to : Ts(e.startState, t);
5123
5204
  }
5124
5205
  if (i !== null && i !== r) return [{
5125
5206
  selection: { anchor: i },
@@ -5127,8 +5208,8 @@ var Ss = Et.transactionFilter.of((e) => {
5127
5208
  }];
5128
5209
  }
5129
5210
  return e;
5130
- }), Cs = 150;
5131
- function ws(e, t) {
5211
+ }), Ds = 150;
5212
+ function Os(e, t) {
5132
5213
  let n = /* @__PURE__ */ new Set();
5133
5214
  for (let r of $(e)) {
5134
5215
  let e = r[0].slice(1);
@@ -5136,13 +5217,13 @@ function ws(e, t) {
5136
5217
  }
5137
5218
  return [...n];
5138
5219
  }
5139
- function Ts(e) {
5220
+ function ks(e) {
5140
5221
  return [...e].sort().join("\n");
5141
5222
  }
5142
- function Es(e) {
5223
+ function As(e) {
5143
5224
  return !$(e).next().done;
5144
5225
  }
5145
- function Ds(e) {
5226
+ function js(e) {
5146
5227
  let t = [], n = [];
5147
5228
  return e.changes.iterChanges((r, i, a, o) => {
5148
5229
  let s = e.startState.doc.lineAt(r), c = e.startState.doc.lineAt(i === r ? r : i - 1);
@@ -5154,8 +5235,8 @@ function Ds(e) {
5154
5235
  after: n.join("\n")
5155
5236
  };
5156
5237
  }
5157
- function Os(e, t) {
5158
- let n = t.debounceMs ?? Cs, { logger: r, resolve: i } = t;
5238
+ function Ms(e, t) {
5239
+ let n = t.debounceMs ?? Ds, { logger: r, resolve: i } = t;
5159
5240
  return class {
5160
5241
  view;
5161
5242
  timer;
@@ -5168,8 +5249,8 @@ function Os(e, t) {
5168
5249
  }
5169
5250
  update(e) {
5170
5251
  if (e.docChanged) {
5171
- let t = Ds(e);
5172
- if (Es(t.before)) {
5252
+ let t = js(e);
5253
+ if (As(t.before)) {
5173
5254
  this.maybeSchedule(e.view);
5174
5255
  return;
5175
5256
  }
@@ -5181,11 +5262,11 @@ function Os(e, t) {
5181
5262
  }
5182
5263
  maybeSchedule(e, t) {
5183
5264
  let r = t ?? e.state.doc.toString();
5184
- if (!Es(r)) {
5265
+ if (!As(r)) {
5185
5266
  t === void 0 && (this.lastKey = "", this.clearTimer());
5186
5267
  return;
5187
5268
  }
5188
- let i = Ts(ws(r, e.state.field(Q)));
5269
+ let i = ks(Os(r, e.state.field(Q)));
5189
5270
  if (i === "") {
5190
5271
  t === void 0 && (this.lastKey = "", this.clearTimer());
5191
5272
  return;
@@ -5211,12 +5292,12 @@ function Os(e, t) {
5211
5292
  try {
5212
5293
  do {
5213
5294
  this.rerun = !1;
5214
- let n = ws(t.state.doc.toString(), t.state.field(Q));
5295
+ let n = Os(t.state.doc.toString(), t.state.field(Q));
5215
5296
  if (n.length === 0) {
5216
5297
  this.lastKey = "";
5217
5298
  break;
5218
5299
  }
5219
- this.lastKey = Ts(n);
5300
+ this.lastKey = ks(n);
5220
5301
  let r = i ? await i(n) : await e();
5221
5302
  if (this.destroyed) return;
5222
5303
  let a = new Set(n), o = r.filter((e) => a.has(e.uri));
@@ -5224,7 +5305,7 @@ function Os(e, t) {
5224
5305
  if (this.rerun) continue;
5225
5306
  break;
5226
5307
  }
5227
- t.dispatch({ effects: as.of(new Map(o.map((e) => [e.uri, e]))) }), this.rerun = !0;
5308
+ t.dispatch({ effects: ls.of(new Map(o.map((e) => [e.uri, e]))) }), this.rerun = !0;
5228
5309
  } while (this.rerun);
5229
5310
  } catch (e) {
5230
5311
  this.lastKey = "", r?.error("Failed to sync resources:", e);
@@ -5235,12 +5316,12 @@ function Os(e, t) {
5235
5316
  }
5236
5317
  };
5237
5318
  }
5238
- function ks(e, t = {}) {
5239
- return kt.fromClass(Os(e, t));
5319
+ function Ns(e, t = {}) {
5320
+ return at.fromClass(Ms(e, t));
5240
5321
  }
5241
5322
  //#endregion
5242
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5243
- var As = yt.baseTheme({
5323
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5324
+ var Ps = ot.baseTheme({
5244
5325
  ".cm-resource-widget": {
5245
5326
  background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
5246
5327
  borderRadius: "4px",
@@ -5256,148 +5337,133 @@ var As = yt.baseTheme({
5256
5337
  color: "light-dark(#b00020,#ff8080)",
5257
5338
  fontWeight: "500"
5258
5339
  }
5259
- }), js = "_none_", Ms = [{
5340
+ }), Fs = "_none_", Is = [{
5260
5341
  uri: "",
5261
5342
  name: "No resources",
5262
- type: js,
5343
+ type: Fs,
5263
5344
  data: {}
5264
- }], Ns = {
5345
+ }], Ls = {
5265
5346
  info: "Variables, dataframes, and tables will appear here.",
5266
5347
  apply: () => {}
5267
5348
  };
5268
- function Ps(e) {
5269
- let t = So(e).getAllItems();
5270
- return t.length === 0 ? Ms : t;
5349
+ function Rs(e) {
5350
+ let t = wo(e).getAllItems();
5351
+ return t.length === 0 ? Is : t;
5271
5352
  }
5272
- function Fs(e) {
5273
- let { language: t, store: n, onAddFiles: i } = e, a = () => Ps(n);
5353
+ function zs(e) {
5354
+ let { language: t, store: n, onAddFiles: i } = e, a = () => Rs(n);
5274
5355
  return [
5275
- t.data.of({ autocomplete: cs(async () => a(), (e) => e.type === js ? Ns : So(n).getProvider(e.type)?.formatCompletion(e) || {}) }),
5276
- xt.high(Tt.of([{
5356
+ t.data.of({ autocomplete: fs(async () => a(), (e) => e.type === Fs ? Ls : wo(n).getProvider(e.type)?.formatCompletion(e) || {}) }),
5357
+ it.high(dt.of([{
5277
5358
  key: "Tab",
5278
5359
  preventDefault: !0,
5279
- run: (e) => Mt(e)
5360
+ run: (e) => Pt(e)
5280
5361
  }])),
5281
- _o.of({ addAttachment: (e) => i?.([e]) }),
5282
- ...i ? [t.data.of({ autocomplete: Co().createCompletionSource() })] : [],
5283
- ps,
5284
- Ss,
5285
- ks(a, { logger: r }),
5362
+ yo.of({ addAttachment: (e) => i?.([e]) }),
5363
+ ...i ? [t.data.of({ autocomplete: To().createCompletionSource() })] : [],
5364
+ _s,
5365
+ Es,
5366
+ Ns(a, { logger: r }),
5286
5367
  Q.init(() => {
5287
- let e = Ps(n);
5368
+ let e = Rs(n);
5288
5369
  return new Map(e.map((e) => [e.uri, e]));
5289
5370
  }),
5290
- As,
5291
- gs({ createTooltip: (e) => {
5292
- let t = So(n).getProvider(e.type);
5293
- if (!t) return r.warn("No provider found for resource", e), Is(e.description || e.name);
5371
+ Ps,
5372
+ bs({ createTooltip: (e) => {
5373
+ let t = wo(n).getProvider(e.type);
5374
+ if (!t) return r.warn("No provider found for resource", e), Bs(e.description || e.name);
5294
5375
  let i = t.formatCompletion(e), a = e.description || e.name;
5295
- if (!i?.info) return Is(a);
5296
- if (typeof i.info == "string") return Is(i.info);
5376
+ if (!i?.info) return Bs(a);
5377
+ if (typeof i.info == "string") return Bs(i.info);
5297
5378
  let o = i.info(i);
5298
- return o ? "dom" in o ? { dom: o.dom } : "then" in o ? (r.warn("info is a promise. This is not supported", o), Is(a)) : { dom: o } : Is(a);
5379
+ return o ? "dom" in o ? { dom: o.dom } : "then" in o ? (r.warn("info is a promise. This is not supported", o), Bs(a)) : { dom: o } : Bs(a);
5299
5380
  } })
5300
5381
  ];
5301
5382
  }
5302
- function Is(e) {
5383
+ function Bs(e) {
5303
5384
  let t = document.createElement("div");
5304
- return t.innerHTML = e, { dom: t };
5305
- }
5306
- he("marimo:ai-language", "python", we);
5307
- var Ls = "marimo:ai-prompt-history", Rs = new ce(Ye(Qe()), () => []), zs = (e) => {
5308
- let t = (0, M.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = _t(), { theme: _ } = vt(), v;
5309
- t[0] === f ? v = t[1] : (v = (e) => f ? wo([f.triggerCompletionRegex], f.completions)(e) : null, t[0] = f, t[1] = v);
5310
- let y = gt(v), b, x, S, C;
5311
- if (t[2] !== y || t[3] !== d || t[4] !== g) {
5312
- let e = Ft();
5313
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Pt({}), t[9] = b) : b = t[9], x = e, S = Fs({
5385
+ return t.textContent = e, { dom: t };
5386
+ }
5387
+ //#endregion
5388
+ //#region src/components/editor/ai/prompt-input.tsx
5389
+ var Vs = "marimo:ai-prompt-history", Hs = new De(wt(yt()), () => []), Us = (e) => {
5390
+ let t = (0, j.c)(28), { value: n, placeholder: r, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: m } = e, h = $e(l), g = $e(d), _ = Qe(), { theme: y } = Ye(), b;
5391
+ t[0] === p ? b = t[1] : (b = (e) => p ? Eo([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = b);
5392
+ let x = $e(b), S;
5393
+ if (t[2] !== x || t[3] !== g || t[4] !== h || t[5] !== f || t[6] !== a || t[7] !== _) {
5394
+ let e = Lt(), n;
5395
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (n = It({}), t[9] = n) : n = t[9];
5396
+ let r = zs({
5314
5397
  language: e.language,
5315
- store: g,
5316
- onAddFiles: d
5317
- }), C = e.language.data.of({ autocomplete: y }), t[2] = y, t[3] = d, t[4] = g, t[5] = b, t[6] = x, t[7] = S, t[8] = C;
5318
- } else b = t[5], x = t[6], S = t[7], C = t[8];
5319
- let w;
5320
- t[10] === Symbol.for("react.memo_cache_sentinel") ? (w = is({ storage: {
5321
- load: Bs,
5322
- save: Vs
5323
- } }), t[10] = w) : w = t[10];
5324
- let T;
5325
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = It(), t[11] = T) : T = t[11];
5326
- let E;
5327
- t[12] === m ? E = t[13] : (E = xt.highest(Tt.of([{
5328
- preventDefault: !0,
5329
- stopPropagation: !0,
5330
- any: (e, t) => {
5331
- let n = t.metaKey || t.ctrlKey || t.shiftKey;
5332
- if (t.key === "Enter" && !n) return m(t, e.state.doc.toString()), t.preventDefault(), t.stopPropagation(), !0;
5333
- if (t.key === "Enter" && t.shiftKey) {
5334
- let n = e.state.selection.main.from;
5335
- return e.dispatch({
5336
- changes: {
5337
- from: n,
5338
- to: n,
5339
- insert: "\n"
5340
- },
5341
- selection: {
5342
- anchor: n + 1,
5343
- head: n + 1
5344
- }
5345
- }), t.preventDefault(), t.stopPropagation(), !0;
5398
+ store: _,
5399
+ onAddFiles: f
5400
+ }), i = e.language.data.of({ autocomplete: x }), o;
5401
+ t[10] === Symbol.for("react.memo_cache_sentinel") ? (o = cs({ storage: {
5402
+ load: Ws,
5403
+ save: Gs
5404
+ } }), t[10] = o) : o = t[10];
5405
+ let s;
5406
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (s = Rt(), t[11] = s) : s = t[11];
5407
+ let c;
5408
+ t[12] === h ? c = t[13] : (c = it.highest(dt.of([{
5409
+ preventDefault: !0,
5410
+ stopPropagation: !0,
5411
+ any: (e, t) => {
5412
+ let n = t.metaKey || t.ctrlKey || t.shiftKey;
5413
+ return t.key === "Enter" && !n ? (h(t, e.state.doc.toString()), t.preventDefault(), t.stopPropagation(), !0) : t.key === "Enter" && t.shiftKey ? (e.dispatch(e.state.replaceSelection("\n")), t.preventDefault(), t.stopPropagation(), !0) : !1;
5346
5414
  }
5347
- return !1;
5348
- }
5349
- }])), t[12] = m, t[13] = E);
5350
- let D;
5351
- t[14] === h ? D = t[15] : (D = Tt.of([{
5352
- key: "Escape",
5353
- preventDefault: !0,
5354
- stopPropagation: !0,
5355
- run: () => (h(), !0)
5356
- }]), t[14] = h, t[15] = D);
5357
- let O;
5358
- t[16] !== b || t[17] !== x || t[18] !== S || t[19] !== C || t[20] !== E || t[21] !== D ? (O = [
5359
- b,
5360
- x,
5361
- S,
5362
- C,
5363
- w,
5364
- yt.lineWrapping,
5365
- T,
5366
- E,
5367
- D
5368
- ], t[16] = b, t[17] = x, t[18] = S, t[19] = C, t[20] = E, t[21] = D, t[22] = O) : O = t[22];
5369
- let k = O, A;
5370
- t[23] === o ? A = t[24] : (A = i("flex-1 font-sans overflow-auto my-1", o), t[23] = o, t[24] = A);
5371
- let ee = _ === "dark" ? "dark" : "light", te = r || "Generate with AI, @ to include context", ne;
5372
- return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== A || t[31] !== ee || t[32] !== te || t[33] !== n ? (ne = /* @__PURE__ */ (0, q.jsx)(Lt, {
5373
- ref: a,
5374
- className: A,
5415
+ }])), t[12] = h, t[13] = c);
5416
+ let l;
5417
+ t[14] === g ? l = t[15] : (l = dt.of([{
5418
+ key: "Escape",
5419
+ preventDefault: !0,
5420
+ stopPropagation: !0,
5421
+ run: () => (g(), !0)
5422
+ }]), t[14] = g, t[15] = l), S = [
5423
+ ...a ? v(a) : [],
5424
+ n,
5425
+ e,
5426
+ r,
5427
+ i,
5428
+ o,
5429
+ ot.lineWrapping,
5430
+ s,
5431
+ c,
5432
+ l
5433
+ ], t[2] = x, t[3] = g, t[4] = h, t[5] = f, t[6] = a, t[7] = _, t[8] = S;
5434
+ } else S = t[8];
5435
+ let C = S, w;
5436
+ t[16] === s ? w = t[17] : (w = i("mo-ai-prompt flex-1 font-sans text-sm leading-6 overflow-auto my-1", s), t[16] = s, t[17] = w);
5437
+ let T = y === "dark" ? "dark" : "light", E = a ? void 0 : r || "Generate with AI, @ to include context", ee;
5438
+ return t[18] !== C || t[19] !== o || t[20] !== m || t[21] !== c || t[22] !== u || t[23] !== w || t[24] !== T || t[25] !== E || t[26] !== n ? (ee = /* @__PURE__ */ (0, q.jsx)(zt, {
5439
+ ref: o,
5440
+ className: w,
5375
5441
  width: "100%",
5376
- maxHeight: p,
5442
+ maxHeight: m,
5377
5443
  value: n,
5378
5444
  basicSetup: !1,
5379
- extensions: k,
5380
- onChange: s,
5381
- onKeyDown: l,
5382
- theme: ee,
5383
- placeholder: te
5384
- }), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = A, t[31] = ee, t[32] = te, t[33] = n, t[34] = ne) : ne = t[34], ne;
5445
+ extensions: C,
5446
+ onChange: c,
5447
+ onKeyDown: u,
5448
+ theme: T,
5449
+ placeholder: E
5450
+ }), t[18] = C, t[19] = o, t[20] = m, t[21] = c, t[22] = u, t[23] = w, t[24] = T, t[25] = E, t[26] = n, t[27] = ee) : ee = t[27], ee;
5385
5451
  };
5386
- function Bs() {
5387
- return Rs.get(Ls);
5452
+ function Ws() {
5453
+ return Hs.get(Vs);
5388
5454
  }
5389
- function Vs(e) {
5390
- return Rs.set(Ls, e);
5455
+ function Gs(e) {
5456
+ return Hs.set(Vs, e);
5391
5457
  }
5392
5458
  //#endregion
5393
5459
  //#region src/plugins/impl/chat/chat-ui.tsx
5394
- var Hs = f, Us = nt({
5395
- type: ct("stream_chunk"),
5396
- message_id: Qe(),
5397
- content: rt().nullable().transform((e) => e),
5398
- is_final: lt().optional()
5460
+ var Ks = u, qs = xt({
5461
+ type: St("stream_chunk"),
5462
+ message_id: yt(),
5463
+ content: jt().nullable().transform((e) => e),
5464
+ is_final: ht().optional()
5399
5465
  });
5400
- function Ws(e, t) {
5466
+ function Js(e, t) {
5401
5467
  let { controllerRef: n, activeRequestIdRef: i } = t, a = n.current;
5402
5468
  if (a === null) return "dropped-no-controller";
5403
5469
  let o = i.current;
@@ -5406,15 +5472,17 @@ function Ws(e, t) {
5406
5472
  activeRequestId: o
5407
5473
  }), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), n.current = null, i.current = null, "closed") : "enqueued");
5408
5474
  }
5409
- var Gs = (e) => {
5410
- let [t, o] = (0, K.useState)(""), [s, c] = (0, K.useState)(e.config), [u, d] = (0, K.useState)(e.config), [f, p] = (0, K.useState)(void 0), h = (0, K.useRef)(null), g = (0, K.useRef)(null), _ = (0, K.useRef)(null), v = (0, K.useRef)(null);
5475
+ var Ys = (e) => {
5476
+ let [t, o] = (0, K.useState)(""), [s, c] = (0, K.useState)(e.config), [u, d] = (0, K.useState)(e.config), [f, p] = (0, K.useState)(void 0), m = (0, K.useRef)(null), h = (0, K.useRef)(null), g = (0, K.useRef)(null), v = (0, K.useRef)(null);
5411
5477
  Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config), d(e.config));
5412
5478
  let y = (0, K.useRef)(s);
5413
- y.current = s;
5479
+ (0, K.useLayoutEffect)(() => {
5480
+ y.current = s;
5481
+ }, [s]);
5414
5482
  let b = (0, K.useRef)(null), x = (0, K.useRef)(null), S = (0, K.useRef)(null), [C, w] = (0, K.useState)(null), T = () => {
5415
5483
  S.current = null, w(null);
5416
- }, { data: D } = Rt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: ee, status: te, stop: ne, error: j, regenerate: ie, clearError: ae, addToolApprovalResponse: oe } = eo({
5417
- sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
5484
+ }, { data: E } = Bt(async () => (await e.get_chat_history({})).messages, []), ee = e.value.length > 0 ? e.value : E, { messages: D, sendMessage: te, setMessages: re, status: ie, stop: ae, error: O, regenerate: k, clearError: se, addToolApprovalResponse: ce } = eo({
5485
+ sendAutomaticallyWhen: ({ messages: e }) => Oo(e),
5418
5486
  transport: new Pa({ fetch: async (t, n) => {
5419
5487
  if (n === void 0) return fetch(t);
5420
5488
  let i = JSON.parse(n.body), a = n.signal, o = {
@@ -5429,7 +5497,7 @@ var Gs = (e) => {
5429
5497
  let t = i.messages.map((e) => ({
5430
5498
  ...e,
5431
5499
  content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
5432
- })), n = Ce();
5500
+ })), n = ne();
5433
5501
  T();
5434
5502
  let s = new ReadableStream({
5435
5503
  start(t) {
@@ -5465,9 +5533,9 @@ var Gs = (e) => {
5465
5533
  return new Response(t, { status: 400 });
5466
5534
  }
5467
5535
  } }),
5468
- messages: O,
5536
+ messages: ee,
5469
5537
  onFinish: ({ messages: t, isAbort: n, finishReason: i }) => {
5470
- if (p(void 0), h.current && (h.current.value = ""), r.debug("Finished streaming message:", {
5538
+ if (p(void 0), m.current && (m.current.value = ""), r.debug("Finished streaming message:", {
5471
5539
  finishReason: i,
5472
5540
  isAbort: n
5473
5541
  }), n) {
@@ -5489,45 +5557,46 @@ var Gs = (e) => {
5489
5557
  r.error("An error occurred:", e);
5490
5558
  }
5491
5559
  });
5492
- n(e.host, He.TYPE, (e) => {
5493
- let t = Us.safeParse(e.detail.message);
5560
+ n(e.host, Be.TYPE, (e) => {
5561
+ let t = qs.safeParse(e.detail.message);
5494
5562
  if (t.success) {
5495
5563
  if (t.data.content && t.data.message_id === x.current) {
5496
5564
  let e = no(t.data.content);
5497
5565
  e !== void 0 && (S.current = e);
5498
5566
  }
5499
- Ws(t.data, {
5567
+ Js(t.data, {
5500
5568
  controllerRef: b,
5501
5569
  activeRequestIdRef: x
5502
5570
  });
5503
5571
  }
5504
5572
  });
5505
- let se = te === "submitted" || te === "streaming", ce = (t) => {
5506
- let n = k.findIndex((e) => e.id === t);
5573
+ let le = ie === "submitted" || ie === "streaming", ue = (t) => {
5574
+ let n = D.findIndex((e) => e.id === t);
5507
5575
  if (n !== -1) {
5508
- let r = k.filter((e) => e.id !== t);
5509
- e.delete_chat_message({ index: n }), ee(r), e.setValue(r), r.length === 0 && T();
5576
+ let r = D.filter((e) => e.id !== t);
5577
+ e.delete_chat_message({ index: n }), re(r), e.setValue(r), r.length === 0 && T();
5510
5578
  }
5511
- }, le = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, ue = {
5579
+ }, de = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, fe = {
5512
5580
  triggerCompletionRegex: /^\/(\w+)?/,
5513
5581
  completions: e.prompts.map((e) => ({
5514
5582
  label: `/${e}`,
5515
5583
  displayLabel: e,
5516
5584
  apply: e
5517
5585
  }))
5518
- }, de = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5586
+ }, pe = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5519
5587
  (0, K.useEffect)(() => {
5520
5588
  v.current?.scrollTo({
5521
5589
  top: v.current.scrollHeight,
5522
5590
  behavior: "smooth"
5523
5591
  });
5524
- }, [k.length, v]);
5525
- let fe = _.current?.view, pe = () => {
5526
- if (fe) {
5527
- let e = fe.state.doc.length;
5528
- fe.dispatch({ changes: {
5592
+ }, [D.length, v]);
5593
+ let me = () => {
5594
+ let e = g.current?.view;
5595
+ if (e) {
5596
+ let t = e.state.doc.length;
5597
+ e.dispatch({ changes: {
5529
5598
  from: 0,
5530
- to: e,
5599
+ to: t,
5531
5600
  insert: ""
5532
5601
  } });
5533
5602
  }
@@ -5540,23 +5609,24 @@ var Gs = (e) => {
5540
5609
  /* @__PURE__ */ (0, q.jsx)("div", {
5541
5610
  className: "absolute top-0 right-0 flex justify-end z-10 border border-(--slate-6) bg-inherit rounded-bl-lg",
5542
5611
  children: /* @__PURE__ */ (0, q.jsx)(a, {
5612
+ "aria-label": "Reset chat",
5543
5613
  variant: "text",
5544
5614
  size: "icon",
5545
- disabled: k.length === 0,
5615
+ disabled: D.length === 0,
5546
5616
  onClick: () => {
5547
- ee([]), e.setValue([]), e.delete_chat_history({}), ae(), T();
5617
+ re([]), e.setValue([]), e.delete_chat_history({}), se(), T();
5548
5618
  },
5549
- children: /* @__PURE__ */ (0, q.jsx)(Wt, { className: "h-3 w-3" })
5619
+ children: /* @__PURE__ */ (0, q.jsx)(Gt, { className: "h-3 w-3" })
5550
5620
  })
5551
5621
  }),
5552
5622
  /* @__PURE__ */ (0, q.jsxs)("div", {
5553
5623
  className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
5554
5624
  ref: v,
5555
5625
  children: [
5556
- k.length === 0 && /* @__PURE__ */ (0, q.jsxs)("div", {
5626
+ D.length === 0 && /* @__PURE__ */ (0, q.jsxs)("div", {
5557
5627
  className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
5558
5628
  children: [
5559
- /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-12 w-12 mb-4" }),
5629
+ /* @__PURE__ */ (0, q.jsx)(Ht, { className: "h-12 w-12 mb-4" }),
5560
5630
  /* @__PURE__ */ (0, q.jsx)("h3", {
5561
5631
  className: "text-lg font-semibold mb-2",
5562
5632
  children: "No messages yet"
@@ -5567,48 +5637,49 @@ var Gs = (e) => {
5567
5637
  })
5568
5638
  ]
5569
5639
  }),
5570
- k.map((e, t) => {
5571
- let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), r = t === k.length - 1;
5640
+ D.map((e, t) => {
5641
+ let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), r = t === D.length - 1;
5572
5642
  return /* @__PURE__ */ (0, q.jsxs)("div", {
5573
5643
  className: i("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
5574
5644
  children: [/* @__PURE__ */ (0, q.jsx)("div", {
5575
5645
  className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-(--sky-11) text-(--slate-1) whitespace-pre-wrap" : "bg-(--slate-4) text-(--slate-12)"}`,
5576
- children: qo({
5646
+ children: Zo({
5577
5647
  message: e,
5578
- isStreamingReasoning: te === "streaming",
5648
+ isStreamingReasoning: ie === "streaming",
5579
5649
  isLast: r,
5580
- isActive: se,
5581
- addToolApprovalResponse: r ? oe : void 0
5650
+ isActive: le,
5651
+ addToolApprovalResponse: r ? ce : void 0
5582
5652
  })
5583
5653
  }), /* @__PURE__ */ (0, q.jsxs)("div", {
5584
- className: "flex justify-end text-xs gap-2 invisible group-hover:visible",
5654
+ className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
5585
5655
  children: [/* @__PURE__ */ (0, q.jsx)(l, {
5586
5656
  value: n,
5587
5657
  className: "h-3 w-3",
5588
5658
  buttonClassName: "text-xs text-(--slate-9) hover:text-(--slate-11)"
5589
5659
  }), /* @__PURE__ */ (0, q.jsx)("button", {
5590
5660
  type: "button",
5591
- onClick: () => ce(e.id),
5661
+ "aria-label": "Delete message",
5662
+ onClick: () => ue(e.id),
5592
5663
  className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
5593
- children: /* @__PURE__ */ (0, q.jsx)(m, { className: "h-3 w-3 text-(--red-9)" })
5664
+ children: /* @__PURE__ */ (0, q.jsx)(_, { className: "h-3 w-3 text-(--red-9)" })
5594
5665
  })]
5595
5666
  })]
5596
- }, `${e.id}-${t}`);
5667
+ }, e.id);
5597
5668
  }),
5598
- se && /* @__PURE__ */ (0, q.jsx)("div", {
5669
+ le && /* @__PURE__ */ (0, q.jsx)("div", {
5599
5670
  className: "flex items-center justify-center mb-4",
5600
- children: /* @__PURE__ */ (0, q.jsx)(E, { size: "small" })
5671
+ children: /* @__PURE__ */ (0, q.jsx)(oe, { size: "small" })
5601
5672
  }),
5602
- j && /* @__PURE__ */ (0, q.jsxs)("div", {
5673
+ O && /* @__PURE__ */ (0, q.jsxs)("div", {
5603
5674
  className: "flex items-center justify-center space-x-2 mb-4",
5604
- children: [/* @__PURE__ */ (0, q.jsx)(pt, { error: j }), /* @__PURE__ */ (0, q.jsx)(a, {
5675
+ children: [/* @__PURE__ */ (0, q.jsx)(Je, { error: O }), /* @__PURE__ */ (0, q.jsx)(a, {
5605
5676
  variant: "outline",
5606
5677
  size: "sm",
5607
- onClick: () => ie(),
5678
+ onClick: () => k(),
5608
5679
  children: "Retry"
5609
5680
  })]
5610
5681
  }),
5611
- C && !se && !j && /* @__PURE__ */ (0, q.jsx)("div", {
5682
+ C && !le && !O && /* @__PURE__ */ (0, q.jsx)("div", {
5612
5683
  className: "flex justify-center py-2",
5613
5684
  children: /* @__PURE__ */ (0, q.jsx)("span", {
5614
5685
  className: "text-xs text-muted-foreground",
@@ -5620,43 +5691,44 @@ var Gs = (e) => {
5620
5691
  /* @__PURE__ */ (0, q.jsxs)("form", {
5621
5692
  onSubmit: async (n) => {
5622
5693
  if (n.preventDefault(), e.disabled) return;
5623
- let r = f ? await To(f) : void 0;
5624
- A({
5694
+ let r = f ? await Do(f) : void 0;
5695
+ te({
5625
5696
  role: "user",
5626
5697
  parts: [{
5627
5698
  type: "text",
5628
5699
  text: t
5629
5700
  }, ...r ?? []]
5630
- }), pe();
5701
+ }), me();
5631
5702
  },
5632
- ref: g,
5703
+ ref: h,
5633
5704
  inert: e.disabled || void 0,
5634
5705
  className: i("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
5635
5706
  children: [
5636
- e.showConfigurationControls && /* @__PURE__ */ (0, q.jsx)(qs, {
5707
+ e.showConfigurationControls && /* @__PURE__ */ (0, q.jsx)(Zs, {
5637
5708
  config: s,
5638
5709
  onChange: c
5639
5710
  }),
5640
- e.prompts.length > 0 && /* @__PURE__ */ (0, q.jsx)(Js, {
5711
+ e.prompts.length > 0 && /* @__PURE__ */ (0, q.jsx)(Qs, {
5641
5712
  prompts: e.prompts,
5642
5713
  onSelect: (e) => {
5643
5714
  o(e), requestAnimationFrame(() => {
5644
- fe?.focus(), ge(fe);
5715
+ let e = g.current?.view;
5716
+ e?.focus(), ke(e);
5645
5717
  });
5646
5718
  }
5647
5719
  }),
5648
- /* @__PURE__ */ (0, q.jsx)(zs, {
5720
+ /* @__PURE__ */ (0, q.jsx)(Us, {
5649
5721
  className: "rounded-sm mr-2",
5650
- placeholder: de,
5722
+ placeholder: pe,
5651
5723
  value: t,
5652
- inputRef: _,
5724
+ inputRef: g,
5653
5725
  maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
5654
5726
  onChange: o,
5655
5727
  onSubmit: (e, t) => {
5656
- t.trim() && g.current?.requestSubmit();
5728
+ t.trim() && h.current?.requestSubmit();
5657
5729
  },
5658
5730
  onClose: () => {},
5659
- additionalCompletions: ue
5731
+ additionalCompletions: fe
5660
5732
  }),
5661
5733
  f && f.length === 1 && /* @__PURE__ */ (0, q.jsx)("span", {
5662
5734
  title: f[0].name,
@@ -5673,19 +5745,19 @@ var Gs = (e) => {
5673
5745
  variant: "text",
5674
5746
  size: "sm",
5675
5747
  onClick: () => {
5676
- p(void 0), h.current && (h.current.value = "");
5748
+ p(void 0), m.current && (m.current.value = "");
5677
5749
  },
5678
- children: /* @__PURE__ */ (0, q.jsx)(Oe, { className: "size-3" })
5750
+ children: /* @__PURE__ */ (0, q.jsx)(Ge, { className: "size-3" })
5679
5751
  }),
5680
- le && /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [/* @__PURE__ */ (0, q.jsx)(a, {
5752
+ de && /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [/* @__PURE__ */ (0, q.jsx)(a, {
5681
5753
  type: "button",
5682
5754
  variant: "text",
5683
5755
  size: "sm",
5684
- onClick: () => h.current?.click(),
5685
- children: /* @__PURE__ */ (0, q.jsx)(Ut, { className: "h-4" })
5756
+ onClick: () => m.current?.click(),
5757
+ children: /* @__PURE__ */ (0, q.jsx)(Wt, { className: "h-4" })
5686
5758
  }), /* @__PURE__ */ (0, q.jsx)("input", {
5687
5759
  type: "file",
5688
- ref: h,
5760
+ ref: m,
5689
5761
  className: "hidden",
5690
5762
  multiple: !0,
5691
5763
  accept: Array.isArray(e.allowAttachments) ? e.allowAttachments.join(",") : void 0,
@@ -5693,15 +5765,15 @@ var Gs = (e) => {
5693
5765
  e.target.files && p([...e.target.files]);
5694
5766
  }
5695
5767
  })] }),
5696
- se ? /* @__PURE__ */ (0, q.jsx)(re, {
5768
+ le ? /* @__PURE__ */ (0, q.jsx)(ge, {
5697
5769
  content: "Stop generating",
5698
5770
  children: /* @__PURE__ */ (0, q.jsx)(a, {
5699
5771
  type: "button",
5700
5772
  variant: "link",
5701
5773
  size: "xs",
5702
- onClick: () => ne(),
5774
+ onClick: () => ae(),
5703
5775
  className: "text-(--red-9) hover:text-(--red-11)",
5704
- children: /* @__PURE__ */ (0, q.jsx)(Be, { className: "h-4 w-4 fill-current" })
5776
+ children: /* @__PURE__ */ (0, q.jsx)(Re, { className: "h-4 w-4 fill-current" })
5705
5777
  })
5706
5778
  }) : /* @__PURE__ */ (0, q.jsx)(a, {
5707
5779
  type: "submit",
@@ -5710,13 +5782,13 @@ var Gs = (e) => {
5710
5782
  size: "xs",
5711
5783
  className: "text-(--slate-11)",
5712
5784
  "aria-label": "Send message",
5713
- children: /* @__PURE__ */ (0, q.jsx)(Gt, { className: "h-4 w-4" })
5785
+ children: /* @__PURE__ */ (0, q.jsx)(Kt, { className: "h-4 w-4" })
5714
5786
  })
5715
5787
  ]
5716
5788
  })
5717
5789
  ]
5718
5790
  });
5719
- }, Ks = {
5791
+ }, Xs = {
5720
5792
  max_tokens: {
5721
5793
  min: 1,
5722
5794
  max: 4096,
@@ -5749,12 +5821,12 @@ var Gs = (e) => {
5749
5821
  max: 2,
5750
5822
  description: "Penalizes new tokens (-2: favor, 2: avoid)"
5751
5823
  }
5752
- }, qs = (e) => {
5753
- let t = (0, M.c)(16), { config: n, onChange: r } = e, [i, o] = (0, K.useState)(!1), s;
5824
+ }, Zs = (e) => {
5825
+ let t = (0, j.c)(16), { config: n, onChange: r } = e, [i, o] = (0, K.useState)(!1), s;
5754
5826
  t[0] !== n || t[1] !== r ? (s = (e, t) => {
5755
5827
  let i = t === null || Number.isNaN(t) ? null : t;
5756
5828
  if (i !== null) {
5757
- let { min: t, max: n } = Ks[e];
5829
+ let { min: t, max: n } = Xs[e];
5758
5830
  i = Math.max(t, Math.min(n, i));
5759
5831
  }
5760
5832
  let a = {
@@ -5768,23 +5840,23 @@ var Gs = (e) => {
5768
5840
  e.key === "Enter" && (e.preventDefault(), o(!1));
5769
5841
  }, t[3] = l) : l = t[3];
5770
5842
  let u = l, f;
5771
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(re, {
5843
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(ge, {
5772
5844
  content: "Configuration",
5773
- children: /* @__PURE__ */ (0, q.jsx)(d, {
5845
+ children: /* @__PURE__ */ (0, q.jsx)(m, {
5774
5846
  asChild: !0,
5775
5847
  children: /* @__PURE__ */ (0, q.jsx)(a, {
5776
5848
  variant: "outline",
5777
5849
  size: "sm",
5778
5850
  className: "border-none shadow-none hover:bg-transparent",
5779
- children: /* @__PURE__ */ (0, q.jsx)(Kt, { className: "h-3 w-3" })
5851
+ children: /* @__PURE__ */ (0, q.jsx)(qt, { className: "h-3 w-3" })
5780
5852
  })
5781
5853
  })
5782
5854
  }), t[4] = f) : f = t[4];
5783
- let m;
5784
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, q.jsx)("h4", {
5855
+ let p;
5856
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, q.jsx)("h4", {
5785
5857
  className: "font-bold leading-none",
5786
5858
  children: "Configuration"
5787
- }), t[5] = m) : m = t[5];
5859
+ }), t[5] = p) : p = t[5];
5788
5860
  let h;
5789
5861
  if (t[6] !== n || t[7] !== c) {
5790
5862
  let e;
@@ -5792,187 +5864,182 @@ var Gs = (e) => {
5792
5864
  let [t, n] = e;
5793
5865
  return /* @__PURE__ */ (0, q.jsxs)("div", {
5794
5866
  className: "grid grid-cols-3 items-center gap-1",
5795
- children: [/* @__PURE__ */ (0, q.jsxs)(mt, {
5867
+ children: [/* @__PURE__ */ (0, q.jsxs)(ve, {
5796
5868
  htmlFor: t,
5797
5869
  className: "flex w-full justify-between col-span-3 align-end",
5798
- children: [je.startCase(t), /* @__PURE__ */ (0, q.jsx)(re, {
5870
+ children: [Ke.startCase(t), /* @__PURE__ */ (0, q.jsx)(ge, {
5799
5871
  delayDuration: 200,
5800
5872
  side: "top",
5801
5873
  content: /* @__PURE__ */ (0, q.jsx)("div", {
5802
5874
  className: "text-xs flex flex-col",
5803
- children: Ks[t].description
5875
+ children: Xs[t].description
5804
5876
  }),
5805
- children: /* @__PURE__ */ (0, q.jsx)(Re, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5877
+ children: /* @__PURE__ */ (0, q.jsx)(Ee, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5806
5878
  })]
5807
- }), /* @__PURE__ */ (0, q.jsx)(Me, {
5879
+ }), /* @__PURE__ */ (0, q.jsx)(ye, {
5808
5880
  id: t,
5809
5881
  "aria-label": t,
5810
5882
  value: n ?? NaN,
5811
5883
  placeholder: "null",
5812
- minValue: Ks[t].min,
5813
- maxValue: Ks[t].max,
5814
- step: Ks[t].step ?? 1,
5884
+ minValue: Xs[t].min,
5885
+ maxValue: Xs[t].max,
5886
+ step: Xs[t].step ?? 1,
5815
5887
  onChange: (e) => c(t, e),
5816
5888
  onKeyDown: u,
5817
5889
  className: "col-span-3"
5818
5890
  })]
5819
5891
  }, t);
5820
- }, t[9] = c, t[10] = e), h = jt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5892
+ }, t[9] = c, t[10] = e), h = tt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5821
5893
  } else h = t[8];
5822
5894
  let g;
5823
- t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, q.jsx)(p, {
5895
+ t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, q.jsx)(se, {
5824
5896
  className: "w-70 border",
5825
5897
  children: /* @__PURE__ */ (0, q.jsxs)("div", {
5826
5898
  className: "grid gap-3",
5827
- children: [m, h]
5899
+ children: [p, h]
5828
5900
  })
5829
5901
  }), t[11] = h, t[12] = g);
5830
5902
  let _;
5831
- return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5903
+ return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(d, {
5832
5904
  open: i,
5833
5905
  onOpenChange: o,
5834
5906
  children: [f, g]
5835
5907
  }), t[13] = i, t[14] = g, t[15] = _) : _ = t[15], _;
5836
- }, Js = (e) => {
5837
- let t = (0, M.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, K.useState)(!1), [s, c] = (0, K.useState)(""), l;
5908
+ }, Qs = (e) => {
5909
+ let t = (0, j.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, K.useState)(!1), [s, c] = (0, K.useState)(""), l;
5838
5910
  t[0] === r ? l = t[1] : (l = (e) => {
5839
5911
  [...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
5840
5912
  }, t[0] = r, t[1] = l);
5841
- let u = l, d;
5842
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, q.jsx)(re, {
5913
+ let u = l, f;
5914
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(ge, {
5843
5915
  content: "Select a prompt",
5844
- children: /* @__PURE__ */ (0, q.jsx)(Ne, {
5916
+ children: /* @__PURE__ */ (0, q.jsx)(be, {
5845
5917
  asChild: !0,
5846
5918
  children: /* @__PURE__ */ (0, q.jsx)(a, {
5847
5919
  variant: "outline",
5848
5920
  size: "sm",
5849
5921
  className: "border-none shadow-none hover:bg-transparent",
5850
- children: /* @__PURE__ */ (0, q.jsx)(ee, { className: "h-3 w-3" })
5922
+ children: /* @__PURE__ */ (0, q.jsx)(y, { className: "h-3 w-3" })
5851
5923
  })
5852
5924
  })
5853
- }), t[2] = d) : d = t[2];
5854
- let f;
5925
+ }), t[2] = f) : f = t[2];
5926
+ let p;
5855
5927
  if (t[3] !== u || t[4] !== n) {
5856
5928
  let e;
5857
- t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, q.jsx)(Fe, {
5929
+ t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, q.jsx)(Se, {
5858
5930
  onSelect: () => u(e),
5859
5931
  className: "whitespace-normal text-left",
5860
5932
  children: e
5861
- }, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
5862
- } else f = t[5];
5933
+ }, t), t[6] = u, t[7] = e), p = n.map(e), t[3] = u, t[4] = n, t[5] = p;
5934
+ } else p = t[5];
5863
5935
  let m;
5864
- t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, q.jsx)(Hs, { children: /* @__PURE__ */ (0, q.jsxs)(Le, { children: [d, /* @__PURE__ */ (0, q.jsx)(Ie, {
5936
+ t[8] === p ? m = t[9] : (m = /* @__PURE__ */ (0, q.jsx)(Ks, { children: /* @__PURE__ */ (0, q.jsxs)(we, { children: [f, /* @__PURE__ */ (0, q.jsx)(Ce, {
5865
5937
  side: "right",
5866
5938
  align: "end",
5867
- onCloseAutoFocus: Xs,
5939
+ onCloseAutoFocus: ec,
5868
5940
  className: "w-64 max-h-96 overflow-y-auto",
5869
- children: f
5870
- })] }) }), t[8] = f, t[9] = m);
5941
+ children: p
5942
+ })] }) }), t[8] = p, t[9] = m);
5871
5943
  let h;
5872
5944
  t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = () => o(!1), t[10] = h) : h = t[10];
5873
5945
  let g;
5874
- t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, q.jsx)(p, {
5946
+ t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, q.jsx)(se, {
5875
5947
  side: "right",
5876
5948
  align: "end",
5877
5949
  className: "min-w-80 px-2",
5878
- children: /* @__PURE__ */ (0, q.jsx)(Ys, {
5950
+ children: /* @__PURE__ */ (0, q.jsx)($s, {
5879
5951
  prompt: s,
5880
5952
  onClose: h,
5881
5953
  onSelect: r
5882
- })
5954
+ }, s)
5883
5955
  }), t[11] = r, t[12] = s, t[13] = g) : g = t[13];
5884
5956
  let _;
5885
- return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5957
+ return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(d, {
5886
5958
  open: i,
5887
5959
  onOpenChange: o,
5888
5960
  children: [m, g]
5889
5961
  }), t[14] = i, t[15] = m, t[16] = g, t[17] = _) : _ = t[17], _;
5890
- }, Ys = (e) => {
5891
- let t = (0, M.c)(32), { prompt: n, onClose: r, onSelect: i } = e, o;
5892
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {}, t[0] = o) : o = t[0];
5893
- let [s, c] = (0, K.useState)(o), l, u;
5894
- t[1] === n ? (l = t[2], u = t[3]) : (l = () => {
5895
- let e = [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {});
5896
- c(e);
5897
- }, u = [n], t[1] = n, t[2] = l, t[3] = u), (0, K.useEffect)(l, u);
5898
- let d;
5899
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = (e, t) => {
5962
+ }, $s = (e) => {
5963
+ let t = (0, j.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
5964
+ t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(tc, {}), t[0] = n, t[1] = o);
5965
+ let [s, c] = (0, K.useState)(o), l;
5966
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
5900
5967
  c((n) => ({
5901
5968
  ...n,
5902
5969
  [e]: t
5903
5970
  }));
5904
- }, t[4] = d) : d = t[4];
5905
- let f = d, p;
5906
- if (t[5] !== n || t[6] !== s) {
5971
+ }, t[2] = l) : l = t[2];
5972
+ let u = l, d;
5973
+ if (t[3] !== n || t[4] !== s) {
5907
5974
  let e;
5908
- t[8] === Symbol.for("react.memo_cache_sentinel") ? (e = /{{(\w+)}}/g, t[8] = e) : e = t[8];
5975
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (e = /{{(\w+)}}/g, t[6] = e) : e = t[6];
5909
5976
  let r;
5910
- t[9] === s ? r = t[10] : (r = (e, t) => s[t] || `{{${t}}}`, t[9] = s, t[10] = r), p = n.replaceAll(e, r), t[5] = n, t[6] = s, t[7] = p;
5911
- } else p = t[7];
5977
+ t[7] === s ? r = t[8] : (r = (e, t) => s[t] || `{{${t}}}`, t[7] = s, t[8] = r), d = n.replaceAll(e, r), t[3] = n, t[4] = s, t[5] = d;
5978
+ } else d = t[5];
5979
+ let f = d, p;
5980
+ t[9] === s ? p = t[10] : (p = Object.values(s).some(nc), t[9] = s, t[10] = p);
5912
5981
  let m = p, h;
5913
- t[11] === s ? h = t[12] : (h = Object.values(s).some(Qs), t[11] = s, t[12] = h);
5982
+ t[11] !== r || t[12] !== i || t[13] !== f ? (h = () => {
5983
+ i(f), r();
5984
+ }, t[11] = r, t[12] = i, t[13] = f, t[14] = h) : h = t[14];
5914
5985
  let g = h, _;
5915
- t[13] !== r || t[14] !== i || t[15] !== m ? (_ = () => {
5916
- i(m), r();
5917
- }, t[13] = r, t[14] = i, t[15] = m, t[16] = _) : _ = t[16];
5918
- let v = _, y;
5919
- t[17] === s ? y = t[18] : (y = Object.entries(s), t[17] = s, t[18] = y);
5920
- let b;
5921
- t[19] !== v || t[20] !== g || t[21] !== y ? (b = y.map((e, t) => {
5986
+ t[15] === s ? _ = t[16] : (_ = Object.entries(s), t[15] = s, t[16] = _);
5987
+ let v;
5988
+ t[17] !== g || t[18] !== m || t[19] !== _ ? (v = _.map((e, t) => {
5922
5989
  let [n, r] = e;
5923
5990
  return /* @__PURE__ */ (0, q.jsxs)("div", {
5924
5991
  className: "grid grid-cols-4 items-center gap-2",
5925
- children: [/* @__PURE__ */ (0, q.jsx)(mt, {
5992
+ children: [/* @__PURE__ */ (0, q.jsx)(ve, {
5926
5993
  htmlFor: n,
5927
5994
  className: "font-semibold text-base",
5928
5995
  children: n
5929
- }), /* @__PURE__ */ (0, q.jsx)(Pe, {
5996
+ }), /* @__PURE__ */ (0, q.jsx)(xe, {
5930
5997
  id: n,
5931
5998
  value: r,
5932
- onChange: (e) => f(n, e.target.value),
5999
+ onChange: (e) => u(n, e.target.value),
5933
6000
  rootClassName: "col-span-3 w-full",
5934
6001
  className: "m-0",
5935
6002
  placeholder: `Enter value for ${n}`,
5936
6003
  autoFocus: t === 0,
5937
6004
  onKeyDown: (e) => {
5938
- e.key === "Enter" && !g && v();
6005
+ e.key === "Enter" && !m && g();
5939
6006
  }
5940
6007
  })]
5941
6008
  }, n);
5942
- }), t[19] = v, t[20] = g, t[21] = y, t[22] = b) : b = t[22];
5943
- let x;
5944
- t[23] === m ? x = t[24] : (x = /* @__PURE__ */ (0, q.jsx)("div", {
6009
+ }), t[17] = g, t[18] = m, t[19] = _, t[20] = v) : v = t[20];
6010
+ let y;
6011
+ t[21] === f ? y = t[22] : (y = /* @__PURE__ */ (0, q.jsx)("div", {
5945
6012
  className: "grid gap-2 prose dark:prose-invert",
5946
6013
  children: /* @__PURE__ */ (0, q.jsx)("blockquote", {
5947
6014
  className: "text-sm",
5948
- children: m
6015
+ children: f
5949
6016
  })
5950
- }), t[23] = m, t[24] = x);
5951
- let S;
5952
- t[25] !== v || t[26] !== g ? (S = /* @__PURE__ */ (0, q.jsx)(a, {
5953
- onClick: v,
6017
+ }), t[21] = f, t[22] = y);
6018
+ let b;
6019
+ t[23] !== g || t[24] !== m ? (b = /* @__PURE__ */ (0, q.jsx)(a, {
6020
+ onClick: g,
5954
6021
  size: "xs",
5955
- disabled: g,
6022
+ disabled: m,
5956
6023
  children: "Submit"
5957
- }), t[25] = v, t[26] = g, t[27] = S) : S = t[27];
5958
- let C;
5959
- return t[28] !== x || t[29] !== S || t[30] !== b ? (C = /* @__PURE__ */ (0, q.jsxs)("div", {
6024
+ }), t[23] = g, t[24] = m, t[25] = b) : b = t[25];
6025
+ let x;
6026
+ return t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ (0, q.jsxs)("div", {
5960
6027
  className: "grid gap-4",
5961
6028
  children: [
5962
- b,
5963
- x,
5964
- S
6029
+ v,
6030
+ y,
6031
+ b
5965
6032
  ]
5966
- }), t[28] = x, t[29] = S, t[30] = b, t[31] = C) : C = t[31], C;
6033
+ }), t[26] = v, t[27] = y, t[28] = b, t[29] = x) : x = t[29], x;
5967
6034
  };
5968
- function Xs(e) {
6035
+ function ec(e) {
5969
6036
  return e.preventDefault();
5970
6037
  }
5971
- function Zs(e, t) {
6038
+ function tc(e, t) {
5972
6039
  return e[t[1]] = "", e;
5973
6040
  }
5974
- function Qs(e) {
6041
+ function nc(e) {
5975
6042
  return e == null || e.trim() === "";
5976
6043
  }
5977
6044
  //#endregion
5978
- export { Gs as Chatbot };
6045
+ export { Ys as Chatbot };