@marimo-team/frontend 0.23.10 → 0.23.11-dev1

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 (23) hide show
  1. package/dist/assets/{add-cell-with-ai-Bd_3tPEt.js → add-cell-with-ai-C2OtCghK.js} +20 -20
  2. package/dist/assets/{agent-panel-Dm0KI1sF.js → agent-panel-D6ryE8xb.js} +6 -6
  3. package/dist/assets/{cell-editor-B3aYYyAI.js → cell-editor-XNa3wJ3P.js} +15 -12
  4. package/dist/assets/{chat-display-DI0jRLIv.js → chat-display-CezkHLLR.js} +1 -1
  5. package/dist/assets/{chat-panel-BU4HHdf5.js → chat-panel-DEBTPtwE.js} +2 -2
  6. package/dist/assets/{chat-ui-C7igY2w5.js → chat-ui-CIr1o1hq.js} +4 -4
  7. package/dist/assets/{command-palette-Bjv1Z7v8.js → command-palette-_VEEjmkI.js} +1 -1
  8. package/dist/assets/{edit-page-BeWwLeT8.js → edit-page-D-02q6iz.js} +4 -4
  9. package/dist/assets/{hooks-DyMacA-R.js → hooks-5gNQitDd.js} +1 -1
  10. package/dist/assets/{index-fNBoXCyz.js → index-CGCBsDqs.js} +3 -3
  11. package/dist/assets/{layout-dRNPwA-7.js → layout-D3pd3R21.js} +2 -2
  12. package/dist/assets/{panels-BTEEcvYR.js → panels-CTy3hq0L.js} +1 -1
  13. package/dist/assets/{reveal-component-DGQQBmed.js → reveal-component-lTtEZQh1.js} +1 -1
  14. package/dist/assets/{run-page-yFxABzXq.js → run-page-BB6ghGfO.js} +1 -1
  15. package/dist/assets/{scratchpad-panel-B_nxW99u.js → scratchpad-panel-Bvb8RxUv.js} +1 -1
  16. package/dist/assets/{useNotebookActions-Dw6tY2qa.js → useNotebookActions-BIQkawja.js} +1 -1
  17. package/dist/index.html +1 -1
  18. package/package.json +1 -1
  19. package/src/components/editor/ai/ai-completion-editor.tsx +6 -5
  20. package/src/core/ai/__tests__/strip-wrapping-backticks.test.ts +133 -0
  21. package/src/core/ai/stream-completion-text.ts +48 -0
  22. package/src/core/ai/strip-wrapping-backticks.ts +88 -0
  23. package/src/core/codemirror/ai/request.ts +2 -14
@@ -1 +1 @@
1
- var O=Object.defineProperty;var V=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var b=(t,e,i)=>V(t,typeof e!="symbol"?e+"":e,i);import{u as I}from"./useEvent-D91BmmQi.js";import{o as j}from"./cells-DOA0Gew8.js";import{t as P}from"./compiler-runtime-B3qBwwSJ.js";import{_ as k,d as E}from"./useEventListener-DvoEXWke.js";import{o as T}from"./utils-CvI-39U6.js";import{v as _,w as N}from"./config-ClMcu_sV.js";import{s as z,u as D}from"./download-DhxnAw14.js";import{r as $}from"./requests-DIwGYs0l.js";import{P as B}from"./layout-dRNPwA-7.js";import{t as H}from"./Deferred-CP7vq682.js";import{t as L}from"./use-toast-CJ1Tj2eC.js";import{t as M}from"./useInterval-COQ3SSh0.js";var R=class{constructor(){b(this,"capturedInputs",new Map);b(this,"inFlight",new Map)}cancelEntry(t){t.controller.abort(),t.deferred.status==="pending"&&t.deferred.resolve(void 0)}needsCapture(t,e){if(this.capturedInputs.get(t)===e)return!1;let i=this.inFlight.get(t);return!(i&&i.inputValue===e)}waitForInFlight(t,e){let i=this.inFlight.get(t);return i&&i.inputValue===e?i.deferred.promise:null}startCapture(t,e){let i=this.inFlight.get(t);i&&this.cancelEntry(i);let n=new AbortController,l=new H,u={controller:n,inputValue:e,deferred:l};return this.inFlight.set(t,u),{signal:n.signal,markCaptured:p=>{this.inFlight.get(t)===u&&(l.resolve(p),this.capturedInputs.set(t,e),this.inFlight.delete(t))},markFailed:()=>{this.inFlight.get(t)===u&&(l.resolve(void 0),this.inFlight.delete(t))}}}prune(t){for(let e of this.capturedInputs.keys())t.has(e)||this.capturedInputs.delete(e);for(let[e,i]of this.inFlight)t.has(e)||(this.cancelEntry(i),this.inFlight.delete(e))}get isCapturing(){return this.inFlight.size>0}abort(){for(let t of this.inFlight.values())this.cancelEntry(t);this.inFlight.clear()}reset(){this.abort(),this.capturedInputs.clear()}},Y=P(),S=5e3;function q(){let t=(0,Y.c)(14),e=I(T),{state:i}=I(_),n=e.auto_download.includes("markdown"),l=e.auto_download.includes("html"),u=e.auto_download.includes("ipynb"),p=i===N.OPEN,m=!n||!p,d=!l||!p,h=!u||!p,{autoExportAsHTML:a,autoExportAsIPYNB:s,autoExportAsMarkdown:r,updateCellOutputs:o}=$(),c=x(),f;t[0]===r?f=t[1]:(f=async()=>{await r({download:!1})},t[0]=r,t[1]=f);let g;t[2]===m?g=t[3]:(g={delayMs:S,whenVisible:!0,disabled:m},t[2]=m,t[3]=g),M(f,g);let w;t[4]===a?w=t[5]:(w=async()=>{await a({download:!1,includeCode:!0,files:B.INSTANCE.filenames()})},t[4]=a,t[5]=w);let v;t[6]===d?v=t[7]:(v={delayMs:S,whenVisible:!0,disabled:d},t[6]=d,t[7]=v),M(w,v);let F;t[8]!==s||t[9]!==c||t[10]!==o?(F=async()=>{await A({takeScreenshots:()=>c({progress:D.indeterminate()}),updateCellOutputs:o}),await s({download:!1})},t[8]=s,t[9]=c,t[10]=o,t[11]=F):F=t[11];let y;t[12]===h?y=t[13]:(y={delayMs:S,whenVisible:!0,disabled:h,skipIfRunning:!0},t[12]=h,t[13]=y),M(F,y)}var G=new Set(["text/html","application/vnd.vegalite.v5+json","application/vnd.vega.v5+json","application/vnd.vegalite.v6+json","application/vnd.vega.v6+json"]);const C=new R;function x(){let t=I(j);return async e=>{var d,h;let{progress:i}=e,n=new Set(E.keys(t));C.prune(n);let l=[],u=[];for(let[a,s]of E.entries(t)){let r=(d=s.output)==null?void 0:d.data;if((h=s.output)!=null&&h.mimetype&&G.has(s.output.mimetype)&&r)if(C.needsCapture(a,r))l.push([a,r]);else{let o=C.waitForInFlight(a,r);o&&u.push({cellId:a,promise:o})}}if(l.length===0&&u.length===0)return{};l.length>0&&i.addTotal(l.length);let p={};for(let[a,s]of l){let r=C.startCapture(a,s);try{let o=await z(a);if(r.signal.aborted)continue;if(!o){k.error(`Failed to capture screenshot for cell ${a}`),r.markFailed();continue}let c=["image/png",o];p[a]=c,r.markCaptured(c)}catch(o){k.error(`Error screenshotting cell ${a}:`,o),r.markFailed()}finally{i.increment(1)}}let m=await Promise.allSettled(u.map(({promise:a})=>a));for(let[a,{cellId:s}]of u.entries()){let r=m[a];r.status==="fulfilled"&&r.value&&(p[s]=r.value)}return p}}async function A(t){let{takeScreenshots:e,updateCellOutputs:i}=t;try{let n=await e();E.size(n)>0&&await i({cellIdsToOutput:n})}catch(n){k.error("Error updating cell outputs with screenshots:",n),L({title:"Failed to capture cell outputs",description:"Some outputs may not appear in the PDF. Continuing with export.",variant:"danger"})}}export{q as n,x as r,A as t};
1
+ var O=Object.defineProperty;var V=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var b=(t,e,i)=>V(t,typeof e!="symbol"?e+"":e,i);import{u as I}from"./useEvent-D91BmmQi.js";import{o as j}from"./cells-DOA0Gew8.js";import{t as P}from"./compiler-runtime-B3qBwwSJ.js";import{_ as k,d as E}from"./useEventListener-DvoEXWke.js";import{o as T}from"./utils-CvI-39U6.js";import{v as _,w as N}from"./config-ClMcu_sV.js";import{s as z,u as D}from"./download-DhxnAw14.js";import{r as $}from"./requests-DIwGYs0l.js";import{P as B}from"./layout-D3pd3R21.js";import{t as H}from"./Deferred-CP7vq682.js";import{t as L}from"./use-toast-CJ1Tj2eC.js";import{t as M}from"./useInterval-COQ3SSh0.js";var R=class{constructor(){b(this,"capturedInputs",new Map);b(this,"inFlight",new Map)}cancelEntry(t){t.controller.abort(),t.deferred.status==="pending"&&t.deferred.resolve(void 0)}needsCapture(t,e){if(this.capturedInputs.get(t)===e)return!1;let i=this.inFlight.get(t);return!(i&&i.inputValue===e)}waitForInFlight(t,e){let i=this.inFlight.get(t);return i&&i.inputValue===e?i.deferred.promise:null}startCapture(t,e){let i=this.inFlight.get(t);i&&this.cancelEntry(i);let n=new AbortController,l=new H,u={controller:n,inputValue:e,deferred:l};return this.inFlight.set(t,u),{signal:n.signal,markCaptured:p=>{this.inFlight.get(t)===u&&(l.resolve(p),this.capturedInputs.set(t,e),this.inFlight.delete(t))},markFailed:()=>{this.inFlight.get(t)===u&&(l.resolve(void 0),this.inFlight.delete(t))}}}prune(t){for(let e of this.capturedInputs.keys())t.has(e)||this.capturedInputs.delete(e);for(let[e,i]of this.inFlight)t.has(e)||(this.cancelEntry(i),this.inFlight.delete(e))}get isCapturing(){return this.inFlight.size>0}abort(){for(let t of this.inFlight.values())this.cancelEntry(t);this.inFlight.clear()}reset(){this.abort(),this.capturedInputs.clear()}},Y=P(),S=5e3;function q(){let t=(0,Y.c)(14),e=I(T),{state:i}=I(_),n=e.auto_download.includes("markdown"),l=e.auto_download.includes("html"),u=e.auto_download.includes("ipynb"),p=i===N.OPEN,m=!n||!p,d=!l||!p,h=!u||!p,{autoExportAsHTML:a,autoExportAsIPYNB:s,autoExportAsMarkdown:r,updateCellOutputs:o}=$(),c=x(),f;t[0]===r?f=t[1]:(f=async()=>{await r({download:!1})},t[0]=r,t[1]=f);let g;t[2]===m?g=t[3]:(g={delayMs:S,whenVisible:!0,disabled:m},t[2]=m,t[3]=g),M(f,g);let w;t[4]===a?w=t[5]:(w=async()=>{await a({download:!1,includeCode:!0,files:B.INSTANCE.filenames()})},t[4]=a,t[5]=w);let v;t[6]===d?v=t[7]:(v={delayMs:S,whenVisible:!0,disabled:d},t[6]=d,t[7]=v),M(w,v);let F;t[8]!==s||t[9]!==c||t[10]!==o?(F=async()=>{await A({takeScreenshots:()=>c({progress:D.indeterminate()}),updateCellOutputs:o}),await s({download:!1})},t[8]=s,t[9]=c,t[10]=o,t[11]=F):F=t[11];let y;t[12]===h?y=t[13]:(y={delayMs:S,whenVisible:!0,disabled:h,skipIfRunning:!0},t[12]=h,t[13]=y),M(F,y)}var G=new Set(["text/html","application/vnd.vegalite.v5+json","application/vnd.vega.v5+json","application/vnd.vegalite.v6+json","application/vnd.vega.v6+json"]);const C=new R;function x(){let t=I(j);return async e=>{var d,h;let{progress:i}=e,n=new Set(E.keys(t));C.prune(n);let l=[],u=[];for(let[a,s]of E.entries(t)){let r=(d=s.output)==null?void 0:d.data;if((h=s.output)!=null&&h.mimetype&&G.has(s.output.mimetype)&&r)if(C.needsCapture(a,r))l.push([a,r]);else{let o=C.waitForInFlight(a,r);o&&u.push({cellId:a,promise:o})}}if(l.length===0&&u.length===0)return{};l.length>0&&i.addTotal(l.length);let p={};for(let[a,s]of l){let r=C.startCapture(a,s);try{let o=await z(a);if(r.signal.aborted)continue;if(!o){k.error(`Failed to capture screenshot for cell ${a}`),r.markFailed();continue}let c=["image/png",o];p[a]=c,r.markCaptured(c)}catch(o){k.error(`Error screenshotting cell ${a}:`,o),r.markFailed()}finally{i.increment(1)}}let m=await Promise.allSettled(u.map(({promise:a})=>a));for(let[a,{cellId:s}]of u.entries()){let r=m[a];r.status==="fulfilled"&&r.value&&(p[s]=r.value)}return p}}async function A(t){let{takeScreenshots:e,updateCellOutputs:i}=t;try{let n=await e();E.size(n)>0&&await i({cellIdsToOutput:n})}catch(n){k.error("Error updating cell outputs with screenshots:",n),L({title:"Failed to capture cell outputs",description:"Some outputs may not appear in the PDF. Continuing with export.",variant:"danger"})}}export{q as n,x as r,A as t};