@marimo-team/frontend 0.25.3-dev96 → 0.25.3-dev97
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.
- package/dist/assets/{CellStatus-Dc8AR1al.js → CellStatus-fK4n2NPc.js} +1 -1
- package/dist/assets/{ErrorBoundary-DBQW23V4.js → ErrorBoundary-CAEGdoFW.js} +2 -2
- package/dist/assets/{JsonOutput-nLzWQ-0V.js → JsonOutput-CyAKmZDD.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-DAFgeK_G.js → MarimoErrorOutput-CgZvP0p0.js} +1 -1
- package/dist/assets/{RenderHTML-DwolbpuI.js → RenderHTML-DQvxDDNS.js} +1 -1
- package/dist/assets/{RunButton-BN3_mnoU.js → RunButton-BBDnDL6G.js} +1 -1
- package/dist/assets/{add-cell-with-ai-CRbG5cTT.js → add-cell-with-ai-Clg5FELx.js} +1 -1
- package/dist/assets/{add-connection-dialog-CzCmVM_b.js → add-connection-dialog-BqdWmD-7.js} +1 -1
- package/dist/assets/{agent-panel-zpTxANfi.js → agent-panel-5RxG5Y82.js} +3 -3
- package/dist/assets/{ai-model-dropdown-DL56ImUU.js → ai-model-dropdown-Bvl1ktQq.js} +1 -1
- package/dist/assets/{app-config-button-BRBtaFi_.js → app-config-button-0QTeQ2Mv.js} +1 -1
- package/dist/assets/{blob-CuL-H1JC.js → blob-5VcB8K_t.js} +1 -1
- package/dist/assets/{cell-editor-C6QIY1Q-.js → cell-editor-Byw5y-oI.js} +1 -1
- package/dist/assets/{cell-link-C9tkvy6x.js → cell-link-C5yYyzuF.js} +1 -1
- package/dist/assets/{cells-B23_t5uX.js → cells-D_11MjVB.js} +13 -13
- package/dist/assets/{chat-display-DSezZ1qo.js → chat-display-BCR_ySiV.js} +1 -1
- package/dist/assets/{chat-panel-CocbwA2Q.js → chat-panel-RPRvBsaU.js} +1 -1
- package/dist/assets/{chat-ui-DXvDBccG.js → chat-ui-CGviVaRA.js} +2 -2
- package/dist/assets/{column-preview-BUQ_YMaE.js → column-preview-xe533-Cn.js} +1 -1
- package/dist/assets/{command-palette-HbIlNTLD.js → command-palette-BB9bWdWp.js} +1 -1
- package/dist/assets/{common-XXWicvmo.js → common-CaeItbcI.js} +1 -1
- package/dist/assets/{components-D1a5GeNf.js → components-G6frbw0c.js} +1 -1
- package/dist/assets/{datasource-Qo_t5PqI.js → datasource-deuXnlU-.js} +1 -1
- package/dist/assets/{dependency-graph-panel-DHrm4LUL.js → dependency-graph-panel-CIykLnJe.js} +1 -1
- package/dist/assets/{documentation-panel-BoNI3vXT.js → documentation-panel-2PQ8kQLa.js} +1 -1
- package/dist/assets/{download-Cm3InGht.js → download-dK52bLxZ.js} +1 -1
- package/dist/assets/{edit-page-BVkC2MyU.js → edit-page-C2phWLKH.js} +5 -5
- package/dist/assets/{error-entries-DEkB-8EY.js → error-entries-3GVk2KjS.js} +1 -1
- package/dist/assets/{error-panel-D7GInT--.js → error-panel-CzDRGPeC.js} +1 -1
- package/dist/assets/{feedback-button-sC38i-D1.js → feedback-button-C5NgWpFg.js} +1 -1
- package/dist/assets/feedback-button-CONwLFpw.js +1 -0
- package/dist/assets/{file-explorer-panel-2XFMubVM.js → file-explorer-panel-B50xDnTZ.js} +1 -1
- package/dist/assets/{file-name-input-DPs3KKM-.js → file-name-input-DqwMSgGU.js} +1 -1
- package/dist/assets/{floating-outline-C7MSAu6q.js → floating-outline-ChmAuvxz.js} +1 -1
- package/dist/assets/{gallery-page-B3fJlerH.js → gallery-page-CiL8aMS1.js} +1 -1
- package/dist/assets/{glide-data-editor-DrhzXms_.js → glide-data-editor-CqRclBkp.js} +1 -1
- package/dist/assets/{home-page-CajAhF9Q.js → home-page-BgZVl4dP.js} +1 -1
- package/dist/assets/{hooks-DteA-neM.js → hooks-DM5n7Osw.js} +1 -1
- package/dist/assets/{index-YQHSwyF3.js → index-vCxv6WVQ.js} +18 -18
- package/dist/assets/{layout-DEFRD3k3.js → layout-BpP8nTjb.js} +4 -4
- package/dist/assets/{logs-panel-BpM3pLdf.js → logs-panel-B5eVAZtH.js} +1 -1
- package/dist/assets/{markdown-renderer-C5aIPuRT.js → markdown-renderer-BWUzqkJM.js} +1 -1
- package/dist/assets/{name-cell-input-Dd8oSXnd.js → name-cell-input-DXW68gRW.js} +1 -1
- package/dist/assets/{outline-panel-kFr3Fo2d.js → outline-panel-DPxJhJ_A.js} +1 -1
- package/dist/assets/{packages-panel-Ce_wBuIJ.js → packages-panel-gBE2FWQr.js} +1 -1
- package/dist/assets/{panel-accordion-state-BO2rN4A5.js → panel-accordion-state-CCF5Gxnc.js} +1 -1
- package/dist/assets/{panels-Cy18qaTN.js → panels-BQYMF6p_.js} +1 -1
- package/dist/assets/{process-output-CDhnnF3f.js → process-output-Cw9IDcKQ.js} +1 -1
- package/dist/assets/{readonly-code-display-ChOK6mhE.js → readonly-code-display-DYcZQ28T.js} +1 -1
- package/dist/assets/{readonly-python-code-CVwB1OHZ.js → readonly-python-code-RFuQP50v.js} +1 -1
- package/dist/assets/{reveal-component-DE-4w0ik.js → reveal-component-yRrDmCQz.js} +2 -2
- package/dist/assets/{run-page-C6qwGqj6.js → run-page-CY65WUOu.js} +1 -1
- package/dist/assets/{runtime-details-state-BRSVs8um.js → runtime-details-state-pobtu6TO.js} +1 -1
- package/dist/assets/scratchpad-panel-H44_pvb_.js +1 -0
- package/dist/assets/{session-panel-B0CkZ3wl.js → session-panel-Bnd1iXkO.js} +1 -1
- package/dist/assets/{snippets-panel-CN-U1niV.js → snippets-panel-DKApxKx9.js} +1 -1
- package/dist/assets/{state-BRL89qqy.js → state-Bl9BiY_s.js} +1 -1
- package/dist/assets/{state-BoRCcWOg.js → state-Dv059B3A.js} +1 -1
- package/dist/assets/{tracing-CqxmObxN.js → tracing-Clwy4SlW.js} +1 -1
- package/dist/assets/{tracing-panel-Bn8xJSPi.js → tracing-panel-BwjLG_aC.js} +2 -2
- package/dist/assets/{tree-actions-DoPCJTpj.js → tree-actions-BZNTQ12N.js} +1 -1
- package/dist/assets/{useAddCell-DKb7o70l.js → useAddCell-Cjuqk2YR.js} +1 -1
- package/dist/assets/{useCellActionButton-CSNFulkR.js → useCellActionButton-MoWLvuGe.js} +1 -1
- package/dist/assets/{useDeleteCell-BPQ6Xcbj.js → useDeleteCell-BC-MW7d1.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-4SMlwjEg.js → useDependencyPanelTab-CZU7i-B3.js} +1 -1
- package/dist/assets/{useNotebookActions-B4kq9-P4.js → useNotebookActions-wFxVdRXQ.js} +1 -1
- package/dist/assets/{useRunCells-BV6nl_Ok.js → useRunCells-ByaWxoIt.js} +1 -1
- package/dist/assets/{useSplitCell-Ca364Rrx.js → useSplitCell-YJIystwv.js} +1 -1
- package/dist/index.html +20 -20
- package/package.json +1 -1
- package/src/components/chat/acp/blocks.tsx +2 -2
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
- package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
- package/src/components/data-table/charts/charts.tsx +21 -6
- package/src/components/data-table/charts/storage.ts +16 -5
- package/src/components/editor/output/ansi-reduce.ts +6 -0
- package/src/components/editor/output/console/ConsoleOutput.tsx +11 -7
- package/src/components/editor/package-alert.tsx +4 -4
- package/src/components/scratchpad/scratchpad.tsx +2 -2
- package/src/components/slides/reveal-component.tsx +4 -2
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -0
- package/src/core/cells/__tests__/cell.test.ts +39 -0
- package/src/core/cells/__tests__/cells.test.ts +3 -1
- package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
- package/src/core/cells/cell.ts +14 -3
- package/src/core/cells/cells.ts +1 -0
- package/src/core/cells/types.ts +10 -1
- package/src/plugins/impl/chat/chat-ui.tsx +1 -1
- package/dist/assets/feedback-button-Cz9BdS49.js +0 -1
- package/dist/assets/scratchpad-panel--SxH2dnk.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{_ as r}from"./useEventListener-CjDeLqFC.js";import{m as i,u as a}from"./config-CD1IuZFJ.js";import{n as o,t as s}from"./cn-ldLVeaqm.js";import{t as c}from"./jsx-runtime-B74pBk57.js";import{o as l}from"./switch-DYjBfpNJ.js";import{t as u}from"./tooltip-CkGm8X7m.js";import{r as d}from"./button-D8gVKwe-.js";import{t as f}from"./createLucideIcon-DfJ2oMlA.js";import{i as p}from"./useDeleteCell-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{_ as r}from"./useEventListener-CjDeLqFC.js";import{m as i,u as a}from"./config-CD1IuZFJ.js";import{n as o,t as s}from"./cn-ldLVeaqm.js";import{t as c}from"./jsx-runtime-B74pBk57.js";import{o as l}from"./switch-DYjBfpNJ.js";import{t as u}from"./tooltip-CkGm8X7m.js";import{r as d}from"./button-D8gVKwe-.js";import{t as f}from"./createLucideIcon-DfJ2oMlA.js";import{i as p}from"./useDeleteCell-BC-MW7d1.js";import{Et as m,Ft as h,Kt as g,Pt as _,St as v,Ut as y,V as b,wt as x,zt as S}from"./input-DmHMEZGh.js";import{t as C}from"./square-BPmgQFnh.js";import{r as w}from"./requests-BIFR-h4M.js";import{t as T}from"./I18nProvider-Cg2I_s1_.js";import{a as E}from"./renderShortcut-rUwGqKgC.js";import{t as D}from"./useDelayElapsed-BlsDT4TV.js";var O=f(`hard-drive-download`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m16 6-4 4-4-4`,key:`6wukr`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),k=e(t(),1);function A(e,t){let{"aria-label":n,"aria-labelledby":r,orientation:i=`horizontal`}=e,[a,o]=(0,k.useState)(!1);g(()=>{o(!!(t.current&&t.current.parentElement?.closest(`[role="toolbar"]`)))});let{direction:s}=T(),c=s===`rtl`&&i===`horizontal`,u=l(t),d=e=>{if(v(e.currentTarget,m(e))){if(i===`horizontal`&&e.key===`ArrowRight`||i===`vertical`&&e.key===`ArrowDown`)c?u.focusPrevious():u.focusNext();else if(i===`horizontal`&&e.key===`ArrowLeft`||i===`vertical`&&e.key===`ArrowUp`)c?u.focusNext():u.focusPrevious();else if(e.key===`Tab`){f.current=x(),e.shiftKey?u.focusFirst():u.focusLast();return}else return;e.stopPropagation(),e.preventDefault()}},f=(0,k.useRef)(null),p=e=>{!v(e.currentTarget,e.relatedTarget)&&!f.current&&(f.current=m(e))},h=e=>{f.current&&!v(e.currentTarget,e.relatedTarget)&&v(t.current,m(e))&&(f.current?.focus(),f.current=null)};return{toolbarProps:{...b(e,{labelable:!0}),role:a?`group`:`toolbar`,"aria-orientation":i,"aria-label":n,"aria-labelledby":n==null?r:void 0,onKeyDownCapture:a?void 0:d,onFocusCapture:a?void 0:h,onBlurCapture:a?void 0:p}}}var j=(0,k.createContext)({}),M=(0,k.forwardRef)(function(e,t){[e,t]=_(e,t,j);let{toolbarProps:n}=A(e,t),r=h({...e,values:{orientation:e.orientation||`horizontal`},defaultClassName:`react-aria-Toolbar`}),i=b(e,{global:!0});return delete i.id,k.createElement(S.div,{...y(i,r,n),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`horizontal`},r.children)}),N=n(),P=c(),F=200;function I(e){let t=D(e?F:0);return e&&t}var L=o(`rounded-full shadow-xs-solid border p-[5px] transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 [&>svg]:size-3 active:shadow-none bg-background`,{variants:{variant:{default:`hover:bg-accent hover:text-accent-foreground`,stale:`bg-(--yellow-3) hover:bg-(--yellow-4) text-(--yellow-11)`,green:`hover:bg-(--grass-2) hover:text-(--grass-11) hover:border-[var(--grass-7)],`,disabled:`opacity-50 cursor-not-allowed`,danger:`hover:bg-(--red-3) hover:text-(--red-11)`}},defaultVariants:{variant:`default`}}),R=e=>{let t=(0,N.c)(22),n,r,i,a,o,c,l,f,p;if(t[0]!==e){let{children:u,tooltip:m,disabled:h,variant:g,..._}=e;n=u,p=m;let v=h!==void 0&&h;r=`button`,i=v,a=_,o=e=>{!d.hasModifier(e)&&(e.key===`Enter`||e.key===` `)&&e.stopPropagation(),_.onKeyDown?.(e)},c=e=>{v||_.onClick?.(e)},l=d.preventFocus,f=s(L({variant:g}),_.className),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=f,t[9]=p}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],f=t[8],p=t[9];let m;t[10]!==n||t[11]!==r||t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==c||t[16]!==l||t[17]!==f?(m=(0,P.jsx)(`button`,{type:r,disabled:i,...a,onKeyDown:o,onClick:c,onMouseDown:l,className:f,children:n}),t[10]=n,t[11]=r,t[12]=i,t[13]=a,t[14]=o,t[15]=c,t[16]=l,t[17]=f,t[18]=m):m=t[18];let h=m;if(p){let e;return t[19]!==h||t[20]!==p?(e=(0,P.jsx)(u,{content:p,side:`top`,delayDuration:200,usePortal:!1,children:h}),t[19]=h,t[20]=p,t[21]=e):e=t[21],e}return h},z=e=>{let t=(0,N.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=s(`flex items-center gap-1 bg-background m-[2px] rounded-full`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,P.jsx)(M,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},B=e=>{let t=(0,N.c)(9),{connectionState:n,status:a}=e,{sendInterrupt:o}=w(),s=I(a===`running`),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=E(`global.interrupt`),t[0]=c):c=t[0];let l;t[1]!==n||t[2]!==s?(l=i(n)||!s,t[1]=n,t[2]=s,t[3]=l):l=t[3];let u=s?o:r.NOOP,d=s?`stale`:`disabled`,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,P.jsx)(C,{strokeWidth:1.5}),t[4]=f):f=t[4];let p;return t[5]!==l||t[6]!==u||t[7]!==d?(p=(0,P.jsx)(R,{tooltip:c,disabled:l,onClick:u,variant:d,"data-testid":`run-button`,children:f}),t[5]=l,t[6]=u,t[7]=d,t[8]=p):p=t[8],p};function V({connectionState:e,needsRun:t,loading:n,inactive:r}){return i(e)?`disabled`:t&&!n?`stale`:n||r?`disabled`:`green`}var H=e=>{let t=(0,N.c)(27),{onClick:n,connectionState:r,needsRun:o,status:s,config:c,edited:l}=e,u=s===`disabled-transitively`,d=s===`running`||s===`queued`,f,m;t[0]!==u||t[1]!==c.disabled||t[2]!==r||t[3]!==l||t[4]!==d||t[5]!==o?(f=i(r)||d||!c.disabled&&u&&!l,m=V({connectionState:r,needsRun:o,loading:d,inactive:f}),t[0]=u,t[1]=c.disabled,t[2]=r,t[3]=l,t[4]=d,t[5]=o,t[6]=f,t[7]=m):(f=t[6],m=t[7]);let h=m;if(c.disabled){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(O,{}),t[8]=e):e=t[8];let r;return t[9]!==f||t[10]!==n||t[11]!==h?(r=(0,P.jsx)(R,{tooltip:`Add code to notebook`,disabled:f,onClick:n,variant:h,"data-testid":`run-button`,children:e}),t[9]=f,t[10]=n,t[11]=h,t[12]=r):r=t[12],r}if(!c.disabled&&u&&!l){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(p,{strokeWidth:1.2}),t[13]=e):e=t[13];let r;return t[14]!==f||t[15]!==n||t[16]!==h?(r=(0,P.jsx)(R,{disabled:f,tooltip:`This cell can't be run because it has a disabled ancestor`,onClick:n,variant:h,"data-testid":`run-button`,children:e}),t[14]=f,t[15]=n,t[16]=h,t[17]=r):r=t[17],r}let g;if(i(r)){let e;t[18]===r?e=t[19]:(e=a(r),t[18]=r,t[19]=e),g=e}else if(s===`queued`)g=`This cell is already queued to run`;else if(s===`running`)g=`This cell is already running.`;else{let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=E(`cell.run`),t[20]=e):e=t[20],g=e}let _;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,P.jsx)(p,{strokeWidth:1.2}),t[21]=_):_=t[21];let v;return t[22]!==f||t[23]!==n||t[24]!==g||t[25]!==h?(v=(0,P.jsx)(R,{tooltip:g,disabled:f,onClick:n,variant:h,"data-testid":`run-button`,children:_}),t[22]=f,t[23]=n,t[24]=g,t[25]=h,t[26]=v):v=t[26],v};export{I as a,R as i,B as n,z as r,H as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{a as n,c as r,d as i,f as a,l as o,r as s,t as c}from"./useEvent-BDjgaBtz.js";import{t as l}from"./react-DVplv7_D.js";import{Bt as u,D as d,Fa as f,Fi as p,In as m,Pi as h,Qr as g,Ti as _,Va as v,Z as y,Zn as b,_a as x,b as S,bo as C,da as ee,f as te,ft as ne,ir as w,ja as T,ji as E,qa as re,ti as ie,yo as ae}from"./cells-
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{a as n,c as r,d as i,f as a,l as o,r as s,t as c}from"./useEvent-BDjgaBtz.js";import{t as l}from"./react-DVplv7_D.js";import{Bt as u,D as d,Fa as f,Fi as p,In as m,Pi as h,Qr as g,Ti as _,Va as v,Z as y,Zn as b,_a as x,b as S,bo as C,da as ee,f as te,ft as ne,ir as w,ja as T,ji as E,qa as re,ti as ie,yo as ae}from"./cells-D_11MjVB.js";import{B as oe,C as se,D as ce,F as le,H as ue,I as D,M as de,N as O,O as fe,R as pe,S as me,T as he,b as ge,j as _e,k as ve,q as ye,v as be,w as xe,y as Se,z as Ce}from"./schemas-ChRqMOTL.js";import{t as we}from"./compiler-runtime-BrajqUja.js";import{t as Te}from"./config-DpY86_Yq.js";import{f as Ee,g as k}from"./useEventListener-CjDeLqFC.js";import{o as De}from"./session-CMLIzZKw.js";import{A as Oe,O as ke,o as Ae}from"./config-CD1IuZFJ.js";import{t as je}from"./cn-ldLVeaqm.js";import{t as Me}from"./jsx-runtime-B74pBk57.js";import{a as Ne,c as Pe,p as Fe,r as Ie,t as Le}from"./dropdown-menu-DS6umAnH.js";import{t as Re}from"./tooltip-CkGm8X7m.js";import{t as ze}from"./button-D8gVKwe-.js";import{t as Be}from"./createLucideIcon-DfJ2oMlA.js";import{i as Ve,r as He}from"./paths-bkIFVj8h.js";import{r as Ue,t as We}from"./fileToBase64-BgBraYAr.js";import{M as Ge,m as Ke,t as qe}from"./ai-model-dropdown-Bvl1ktQq.js";import{r as Je}from"./useNumberFormatter-D7O_26UI.js";import{f as Ye,n as Xe}from"./markdown-renderer-BWUzqkJM.js";import{t as Ze}from"./file-BPBVl9pl.js";import{t as Qe}from"./image-wZvTj8WY.js";import{t as $e}from"./spinner-DyNE-o8o.js";import{i as et,t as tt}from"./useDeleteCell-BC-MW7d1.js";import{r as nt}from"./input-DmHMEZGh.js";import{a as rt,c as it,i as at,n as ot,o as st,s as ct,t as lt}from"./datasource-deuXnlU-.js";import{t as ut}from"./use-toast-Wu434mLr.js";import{$t as dt,Et as ft,Gt as pt,Jt as mt,Kt as ht,Qt as gt,Tt as _t,at as vt,dt as yt,st as bt,tn as xt,ut as St}from"./dist-Cny7_yZb.js";import{t as Ct}from"./createReducer-CaI_Oa0v.js";import{h as wt,n as Tt,o as Et,r as Dt}from"./dist-qhAY4L2r.js";import{t as Ot}from"./requests-BIFR-h4M.js";import{a as kt}from"./dist-LSsCJjA3.js";import{t as At}from"./uuid-k9DpjH68.js";import{r as jt}from"./useTheme-BAA27lh7.js";import{n as Mt}from"./useRunCells-ByaWxoIt.js";import{n as Nt}from"./blob-5VcB8K_t.js";import{a as Pt}from"./errors-CNsgAw6m.js";import{i as Ft,r as It,t as Lt}from"./error-entries-3GVk2KjS.js";import{i as Rt}from"./cell-link-C5yYyzuF.js";import{t as zt}from"./html-to-image-D_0rd3_B.js";import{n as Bt}from"./renderShortcut-rUwGqKgC.js";import{n as Vt}from"./icons-CiZ_8zS-.js";import{r as Ht,t as Ut}from"./esm-CI_o7NhW.js";import{t as Wt}from"./process-output-Cw9IDcKQ.js";var Gt=Be(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Kt=Be(`paperclip`,[[`path`,{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`,key:`1miecu`}]]),qt=Be(`send-horizontal`,[[`path`,{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`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),A=we(),Jt=`vercel.ai.error`,Yt=Symbol.for(Jt),Xt,Zt,j=class e extends (Zt=Error,Xt=Yt,Zt){constructor({name:e,message:t,cause:n}){super(t),this[Xt]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Jt)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}},Qt=`AI_APICallError`,$t=`vercel.ai.error.${Qt}`,en=Symbol.for($t),tn,nn,rn=class extends (nn=j,tn=en,nn){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}){super({name:Qt,message:e,cause:o}),this[tn]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=s,this.data=c}static isInstance(e){return j.hasMarker(e,$t)}},an=`AI_EmptyResponseBodyError`,on=`vercel.ai.error.${an}`,sn=Symbol.for(on),cn,ln,un=class extends (ln=j,cn=sn,ln){constructor({message:e=`Empty response body`}={}){super({name:an,message:e}),this[cn]=!0}static isInstance(e){return j.hasMarker(e,on)}};function dn(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var fn=`AI_InvalidArgumentError`,pn=`vercel.ai.error.${fn}`,mn=Symbol.for(pn),hn,gn,_n=class extends (gn=j,hn=mn,gn){constructor({message:e,cause:t,argument:n}){super({name:fn,message:e,cause:t}),this[hn]=!0,this.argument=n}static isInstance(e){return j.hasMarker(e,pn)}},vn=`AI_JSONParseError`,yn=`vercel.ai.error.${vn}`,bn=Symbol.for(yn),xn,Sn,Cn=class extends (Sn=j,xn=bn,Sn){constructor({text:e,cause:t}){super({name:vn,message:`JSON parsing failed: Text: ${e}.
|
|
2
2
|
Error message: ${dn(t)}`,cause:t}),this[xn]=!0,this.text=e}static isInstance(e){return j.hasMarker(e,yn)}},wn=`AI_TypeValidationError`,Tn=`vercel.ai.error.${wn}`,En=Symbol.for(Tn),Dn,On,M=class e extends (On=j,Dn=En,On){constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:wn,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${dn(t)}`,cause:t}),this[Dn]=!0,this.value=e,this.context=n}static isInstance(e){return j.hasMarker(e,Tn)}static wrap({value:t,cause:n,context:r}){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({value:t,cause:n,context:r})}},kn=`AI_UnsupportedFunctionalityError`,An=`vercel.ai.error.${kn}`,jn=Symbol.for(An),Mn,Nn,Pn=class extends (Nn=j,Mn=jn,Nn){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:kn,message:t}),this[Mn]=!0,this.functionality=e}static isInstance(e){return j.hasMarker(e,An)}},Fn=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},In=10,Ln=13,Rn=32;function zn(e){}function Bn(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");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;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(`
|
|
4
4
|
`)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){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`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{At as n,Mt as r,gi as i,jn as a,jt as o,kt as s,qa as c,wn as l,yt as u}from"./cells-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{At as n,Mt as r,gi as i,jn as a,jt as o,kt as s,qa as c,wn as l,yt as u}from"./cells-D_11MjVB.js";import{C as d,I as f,N as p,O as m,T as h}from"./schemas-ChRqMOTL.js";import{r as g}from"./coerce-DWjFeXOY.js";import{t as _}from"./compiler-runtime-BrajqUja.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{i as ee,n as te,r as ne,t as re}from"./tabs-CY8E4r9U.js";import{i as b,t as ie}from"./tooltip-CkGm8X7m.js";import{t as ae}from"./components-DCo7mAWO.js";import{a as x,l as oe,p as S,r as C,s as w}from"./write-secret-modal-BEx-EUlh.js";import{t as se}from"./plus-C5silF6g.js";import{Jt as ce,Qt as le,Xt as ue,Yt as de,nn as fe,tn as pe}from"./input-DmHMEZGh.js";import{r as T}from"./strings-C25fhMR_.js";import{t as me}from"./useIframeCapabilities-Czr9e4uG.js";var E=e(t(),1),D=_();function O(){return f().optional().describe(l.of({label:`Password`,inputType:`password`,optionRegex:`(password|passwd|pgpassword|db.?pass(word)?)`}))}function k(e,t){let n=f();return n=t?n.nonempty():n.optional(),n=n.describe(l.of({label:e||`Token`,inputType:`password`,optionRegex:`(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))`})),n}function A(){return f().optional().describe(l.of({label:`Warehouse Name`,optionRegex:`(warehouse|snowflake.?warehouse)`}))}function j(e,t){let n=f();return n=t?n.nonempty():n.optional(),n.describe(l.of({label:e||`URI`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}function M(e){return f().nonempty().describe(l.of({label:e||`Host`,optionRegex:`^(?!.*(kubernetes|gpg)).*(host(name)?|pghost|db.?host|database.?host|mysql.?host|postgres.?host|server.?host)`}))}function N(){return f().describe(l.of({label:`Database`,optionRegex:`(database|db.?name|pgdatabase|^DB$|^DATABASE$)`}))}function he(){return f().describe(l.of({label:`Schema`,optionRegex:`(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)`}))}function P(){return f().nonempty().describe(l.of({label:`Username`,optionRegex:`(username|pguser|db.?user|^USER$|_USER$)`}))}function F(e){let t=g().describe(l.of({label:`Port`,inputType:`number`,placeholder:e?.toString()})).transform(Number).refine(e=>e>=0&&e<=65535,{message:`Port must be between 0 and 65535`});return e===void 0?t:t.default(e)}function ge(){return d().default(!1).describe(l.of({label:`Read Only`}))}var _e=p({type:m(`postgres`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),ssl:d().default(!1).describe(l.of({label:`Use SSL`}))}).describe(l.of({direction:`two-columns`})),ve=p({type:m(`mysql`),host:M(),port:F(3306),database:N(),username:P(),password:O(),ssl:d().default(!1).describe(l.of({label:`Use SSL`}))}).describe(l.of({direction:`two-columns`})),ye=p({type:m(`sqlite`),database:N().describe(l.of({label:`Database Path`}))}).describe(l.of({direction:`two-columns`})),be=p({type:m(`duckdb`),database:N().describe(l.of({label:`Database Path`})),read_only:ge()}).describe(l.of({direction:`two-columns`})),I=p({type:m(`motherduck`),database:N().default(`my_db`).describe(l.of({label:`Database Name`})),token:k()}).describe(l.of({direction:`two-columns`})),L=p({type:m(`snowflake`),account:f().nonempty().describe(l.of({label:`Account`,optionRegex:`(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)`})),warehouse:f().optional().describe(l.of({label:`Warehouse`,optionRegex:`(snowflake.?warehouse|warehouse)`})),database:N(),schema:f().optional().describe(l.of({label:`Schema`,optionRegex:`(snowflake.?schema|^SCHEMA$|_SCHEMA$)`})),role:f().optional().describe(l.of({label:`Role`})),authType:h(`type`,[p({type:m(`Password`),username:P(),password:O(),enable_mfa:d().default(!1).describe(l.of({label:`Enable MFA (Duo Push)`}))}),p({type:m(`SSO (Browser)`),username:P()}),p({type:m(`Key Pair`),username:P(),private_key_path:f().nonempty().describe(l.of({label:`Private Key Path`,placeholder:`/path/to/rsa_key.p8`})),private_key_passphrase:f().optional().describe(l.of({label:`Private Key Passphrase`,inputType:`password`,optionRegex:`(passphrase|private.?key.?passphrase|key.?passphrase)`}))}),p({type:m(`OAuth / PAT`),token:k(`Token`,!0)})]).default({type:`Password`,username:`username`,enable_mfa:!1}).describe(l.of({special:`tabs`}))}).describe(l.of({direction:`two-columns`})),R=p({type:m(`bigquery`),project:f().nonempty().describe(l.of({label:`Project ID`,optionRegex:`(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)`})),dataset:f().nonempty().describe(l.of({label:`Dataset`,optionRegex:`(bigquery.?dataset|dataset)`})),credentials_json:f().describe(l.of({label:`Credentials JSON`,special:`secret_textarea`}))}).describe(l.of({direction:`two-columns`})),z=p({type:m(`clickhouse_connect`),host:M(),port:F(8123).optional(),username:P(),password:O(),secure:d().default(!1).describe(l.of({label:`Use HTTPs`})),proxy_path:f().optional().describe(l.of({label:`Proxy Path`,placeholder:`/clickhouse`}))}).describe(l.of({direction:`two-columns`})),B=p({type:m(`timeplus`),host:M().default(`localhost`),port:F(8123).optional(),username:P().default(`default`),password:O().default(``)}).describe(l.of({direction:`two-columns`})),V=p({type:m(`chdb`),database:N().describe(l.of({label:`Database Path`})),read_only:ge()}).describe(l.of({direction:`two-columns`})),H=p({type:m(`trino`),host:M(),port:F(8080),database:N(),schema:he().optional(),username:P(),password:O(),async_support:d().default(!1).describe(l.of({label:`Async Support`}))}).describe(l.of({direction:`two-columns`})),U=p({type:m(`iceberg`),name:f().describe(l.of({label:`Catalog Name`})),catalog:h(`type`,[p({type:m(`REST`),warehouse:A(),uri:f().optional().describe(l.of({label:`URI`,placeholder:`https://`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`})),token:k()}),p({type:m(`SQL`),warehouse:A(),uri:f().optional().describe(l.of({label:`URI`,placeholder:`jdbc:iceberg://host:port/database`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}),p({type:m(`Hive`),warehouse:A(),uri:j()}),p({type:m(`Glue`),warehouse:A(),uri:j()}),p({type:m(`DynamoDB`),"dynamodb.profile-name":f().optional().describe(l.of({label:`Profile Name`})),"dynamodb.region":f().optional().describe(l.of({label:`Region`})),"dynamodb.access-key-id":f().optional().describe(l.of({label:`Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),"dynamodb.secret-access-key":f().optional().describe(l.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),"dynamodb.session-token":f().optional().describe(l.of({label:`Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))})]).default({type:`REST`,token:void 0}).describe(l.of({special:`tabs`}))}),W=p({type:m(`datafusion`),sessionContext:d().optional().describe(l.of({label:`Use Session Context`}))}),G=p({type:m(`pyspark`),host:M().optional(),port:F().optional()}),K=p({type:m(`redshift`),host:M(),port:F(5439),connectionType:h(`type`,[p({type:m(`IAM credentials`),region:f().describe(l.of({label:`Region`})),aws_access_key_id:f().nonempty().describe(l.of({label:`AWS Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),aws_secret_access_key:f().nonempty().describe(l.of({label:`AWS Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),aws_session_token:f().optional().describe(l.of({label:`AWS Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))}),p({type:m(`DB credentials`),user:P(),password:O()})]).default({type:`IAM credentials`,aws_access_key_id:``,aws_secret_access_key:``,region:``}),database:N()}).describe(l.of({direction:`two-columns`})),q=p({type:m(`databricks`),access_token:k(`Access Token`,!0),server_hostname:M(`Server Hostname`),http_path:j(`HTTP Path`,!0),catalog:f().optional().describe(l.of({label:`Catalog`})),schema:f().optional().describe(l.of({label:`Schema`}))}).describe(l.of({direction:`two-columns`})),xe=p({type:m(`supabase`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),disable_client_pooling:d().default(!1).describe(l.of({label:`Disable Client-Side Pooling`}))}).describe(l.of({direction:`two-columns`})),Se=h(`type`,[_e,ve,ye,be,I,L,R,z,B,V,H,U,W,G,K,q,xe]),Ce={sqlmodel:`SQLModel`,sqlalchemy:`SQLAlchemy`,duckdb:`DuckDB`,clickhouse_connect:`ClickHouse Connect`,chdb:`chDB`,pyiceberg:`PyIceberg`,ibis:`Ibis`,motherduck:`MotherDuck`,redshift:`Redshift`,databricks:`Databricks`},J=class{connection;orm;secrets;constructor(e,t,n){this.connection=e,this.orm=t,this.secrets=n}get imports(){let e=new Set(this.generateImports());switch(this.orm){case`sqlalchemy`:e.add(`import sqlalchemy`);break;case`sqlmodel`:e.add(`import sqlmodel`);break;case`duckdb`:e.add(`import duckdb`);break;case`ibis`:e.add(`import ibis`)}return e}},we=e=>`_${e}`,Te=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t,n){if(e=we(e),w(t)){let r=oe(t),i=n?`os.environ.get("${r}", "${n}")`:`os.environ.get("${r}")`;return this.secrets[e]=i,e}if(n!=null){let r=`os.environ.get("${t}", "${n}")`;return this.secrets[e]=r,e}return typeof t==`number`||typeof t==`number`?`${t}`:typeof t==`boolean`?Y(t):t?`"${t}"`:``}printInFString(e,t,n){if(t===void 0)return``;if(typeof t==`number`)return`${t}`;if(typeof t==`boolean`)return Y(t);let r=this.print(e,t,n);return r.startsWith(`"`)&&r.endsWith(`"`)?r.slice(1,-1):`{${r}}`}printPassword(e,t,n,r){let i=n?this.printInFString.bind(this):this.print.bind(this);return w(e)?i(r||`password`,e):i(r||`password`,t,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?``:Object.entries(this.secrets).map(([e,t])=>`${e} = ${t}`).join(`
|
|
2
2
|
`)}},Ee=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.connection.ssl?`, connect_args={'sslmode': 'require'}`:``,t=this.secrets.printPassword(this.connection.password,`POSTGRES_PASSWORD`,!0),n=this.secrets.printInFString(`username`,this.connection.username),r=this.secrets.printInFString(`host`,this.connection.host),a=this.secrets.printInFString(`port`,this.connection.port),o=this.secrets.printInFString(`database`,this.connection.database);return i(`
|
|
3
3
|
DATABASE_URL = f"postgresql://${n}:${t}@${r}:${a}/${o}"
|
|
4
4
|
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|