@malloy-publisher/server 0.0.88 → 0.0.89

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.
@@ -1,14 +1,14 @@
1
- import http from "http";
2
- import { AddressInfo } from "net";
3
- import { URL } from "url";
4
- import path from "path";
5
1
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
6
2
  import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
7
3
  import {
8
- Request,
9
4
  Notification,
5
+ Request,
10
6
  Result,
11
7
  } from "@modelcontextprotocol/sdk/types.js";
8
+ import http from "http";
9
+ import { AddressInfo } from "net";
10
+ import path from "path";
11
+ import { URL } from "url";
12
12
 
13
13
  // --- Real Server Import ---
14
14
  // Import the actual configured Express app instance
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.umd-CSPhcx55.js","assets/index-CobAY3LE.js","assets/index-CcIq0aEZ.css"])))=>i.map(i=>d[i]);
2
- import{j as a,r as c,_ as w}from"./index-CobAY3LE.js";const x=async e=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:d}=await w(async()=>{const{MalloyRenderer:i}=await import("./index.umd-CSPhcx55.js").then(l=>l.i);return{MalloyRenderer:i}},__vite__mapDeps([0,1,2]));return new d({onClick:e}).createViz()};function m({result:e,height:d,isFillElement:i,onSizeChange:l,onDrill:y}){const u=c.useRef(null),[g,f]=c.useState(!1);return c.useLayoutEffect(()=>{if(!u.current||!e)return;let t=!0;const r=u.current;for(;r.firstChild;)r.removeChild(r.firstChild);return x(y).then(o=>{if(!t)return;const n=new MutationObserver(s=>{for(const h of s)if(h.type==="childList"&&h.addedNodes.length>0&&Array.from(h.addedNodes).some(p=>p.nodeType===Node.ELEMENT_NODE)){n.disconnect(),setTimeout(()=>{t&&f(!0)},50);break}});n.observe(r,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(e)),o.render(r)}catch(s){console.error("Error rendering visualization:",s),n.disconnect(),t&&f(!0)}}).catch(o=>{console.error("Failed to create renderer:",o),t&&f(!0)}),()=>{t=!1}},[e,y]),c.useEffect(()=>{if(!u.current||!g)return;const t=u.current,r=()=>{if(t){const s=t.offsetHeight;s>0?l&&l(s):i&&t.firstChild&&(t.firstChild.offsetHeight==0?i(!0):i(!1))}},o=setTimeout(r,100);let n=null;return n=new MutationObserver(r),n.observe(t,{childList:!0,subtree:!0,attributes:!0}),()=>{clearTimeout(o),n?.disconnect()}},[l,e,i,g]),a.jsx("div",{ref:u,style:{width:"100%",height:d?`${d}px`:"100%"}})}function E(e){return typeof window>"u"?a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading..."}):a.jsx(c.Suspense,{fallback:a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading visualization..."}),children:a.jsx(m,{...e})})}export{E as default};