@waniwani/sdk 0.0.6 → 0.0.7

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/mcp/react.js CHANGED
@@ -59,7 +59,7 @@ import{a as $}from"../chunk-SCDEAZN4.js";import{b as T}from"../chunk-OVQDB7QX.js
59
59
  0 25px 50px -12px rgba(0, 0, 0, 0.6),
60
60
  0 0 0 1px rgba(255, 255, 255, 0.05),
61
61
  inset 0 1px 0 rgba(255, 255, 255, 0.04)
62
- `},children:[s("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid rgba(255, 255, 255, 0.06)"},children:[s("div",{className:"flex items-center gap-2",children:[o(q,{className:"w-4 h-4 text-gray-400"}),o("span",{className:"text-sm font-medium text-white",children:"Dev Controls"})]}),s("div",{className:"flex items-center gap-2",children:[o("span",{className:"text-[10px] font-medium text-gray-500 px-1.5 py-0.5 rounded",style:{background:"rgba(255, 255, 255, 0.04)",border:"1px solid rgba(255, 255, 255, 0.06)"},children:typeof navigator<"u"&&navigator.platform?.includes("Mac")?"\u2318\u21E7D":"Ctrl+Shift+D"}),o("button",{type:"button",onClick:y,className:"p-1 rounded-md text-gray-500 hover:text-gray-300 hover:bg-white/5 transition-colors",children:o(Te,{className:"w-4 h-4"})})]})]}),s("div",{className:"p-4 space-y-5 overflow-y-auto",style:{maxHeight:"calc(100vh - 200px)"},children:[s("div",{children:[o("label",{htmlFor:"display-mode",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Display Mode"}),o(V,{options:ve,value:f,onChange:he})]}),s("div",{children:[o("label",{htmlFor:"theme",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Theme"}),o(V,{options:ke,value:n,onChange:xe})]}),s("div",{children:[o("label",{htmlFor:"safe-area",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Safe Area (Chat Input)"}),s("button",{type:"button",onClick:()=>h(!r),className:`w-full flex items-center justify-between px-3 py-2.5 rounded-lg text-xs font-medium transition-all duration-150 ${r?"text-emerald-400":"text-gray-400"}`,style:{background:r?"rgba(34, 197, 94, 0.1)":"rgba(255, 255, 255, 0.04)",border:r?"1px solid rgba(34, 197, 94, 0.3)":"1px solid rgba(255, 255, 255, 0.06)"},children:[o("span",{children:"Mock ChatGPT Input Bar"}),o("span",{className:`px-2 py-0.5 rounded text-[10px] font-semibold ${r?"bg-emerald-500/20 text-emerald-400":"bg-gray-500/20 text-gray-500"}`,children:r?"ON":"OFF"})]}),r&&s("p",{className:"text-[10px] text-gray-500 mt-1.5",children:["bottom: ",L,"px"]})]}),s("div",{children:[o("label",{htmlFor:"widget-props",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Widget Props"}),o("textarea",{value:P,onChange:a=>be(a.target.value),onBlur:we,className:"dev-json-editor w-full min-h-[160px] text-xs text-gray-200 p-3 rounded-lg resize-none focus:outline-none transition-colors",style:{background:"rgba(0, 0, 0, 0.3)",border:C?"1px solid rgba(239, 68, 68, 0.5)":"1px solid rgba(255, 255, 255, 0.06)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",lineHeight:1.6},onFocus:a=>{C||(a.target.style.borderColor="rgba(99, 102, 241, 0.5)")},onBlurCapture:a=>{C||(a.target.style.borderColor="rgba(255, 255, 255, 0.06)")},spellCheck:!1}),C&&s("p",{className:"text-red-400 text-[11px] mt-1.5 flex items-center gap-1",children:[o("svg",{"aria-hidden":"true","aria-label":"Error",className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:o("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7 4.5h2v4H7v-4zm0 5h2v2H7v-2z"})}),C]})]}),s("button",{type:"button",onClick:ye,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-gray-400 transition-all duration-150 hover:text-gray-200",style:{background:"rgba(255, 255, 255, 0.04)",border:"1px solid rgba(255, 255, 255, 0.06)"},onMouseEnter:a=>{a.currentTarget.style.background="rgba(255, 255, 255, 0.08)",a.currentTarget.style.borderColor="rgba(255, 255, 255, 0.1)"},onMouseLeave:a=>{a.currentTarget.style.background="rgba(255, 255, 255, 0.04)",a.currentTarget.style.borderColor="rgba(255, 255, 255, 0.06)"},children:[o(De,{className:"w-3.5 h-3.5"}),"Reset to Defaults"]})]})]})]}),r&&s("div",{className:"fixed bottom-0 left-0 right-0 z-[9998] flex items-center justify-center pointer-events-none",style:{height:`${L}px`,background:"linear-gradient(to top, #1a1a1a 0%, #1a1a1a 80%, transparent 100%)"},children:[s("div",{className:"w-full max-w-2xl mx-4 px-4 py-3 rounded-2xl bg-[#2f2f2f] border border-[#424242] flex items-center gap-3",children:[o("div",{className:"w-8 h-8 rounded-full bg-[#424242] flex items-center justify-center",children:o("svg",{"aria-hidden":"true",className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),o("div",{className:"flex-1 text-gray-400 text-sm",children:"Ask anything..."}),o("div",{className:"w-8 h-8 rounded-full bg-[#424242] flex items-center justify-center",children:o("svg",{"aria-hidden":"true",className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})})})]}),s("div",{className:"absolute bottom-1 text-[10px] text-gray-600 font-mono",children:["Mock SafeArea: bottom=",L,"px"]})]})]})}import{useCallback as Fe}from"react";import D,{createContext as Le,useCallback as Q,useContext as Pe,useEffect as He,useState as _,useSyncExternalStore as je}from"react";async function X(){let{detectPlatform:e}=await import("../platform-4QZXTYT5.js");if(e()==="openai"){let{OpenAIWidgetClient:i}=await import("../openai-client-UL6T463M.js");return new i}else{let{MCPAppsWidgetClient:i}=await import("../mcp-apps-client-BU7EN3Z2.js");return new i}}var Z=Le(null);function ee({children:e,loading:t=null,onError:i}){let[m,u]=_(null),[c,g]=_(null),[f,p]=_(!0);return He(()=>{let n=!0;async function d(){try{let r=await X();await r.connect(),n&&(u(r),p(!1))}catch(r){n&&(console.log("error",r),g(r instanceof Error?r:new Error(String(r))),p(!1))}}return d(),()=>{n=!1}},[]),c&&i?D.createElement(D.Fragment,null,i(c)):f||!m?D.createElement(D.Fragment,null,t):D.createElement(Z.Provider,{value:m},e)}function l(e){let t=Pe(Z);if(!t)throw new Error("useWidgetClient must be used within a WidgetProvider");let i=Q(c=>e==="toolOutput"?t.onToolResult(()=>c()):e==="theme"?t.onThemeChange(()=>c()):e==="displayMode"?t.onDisplayModeChange(()=>c()):e==="safeArea"?t.onSafeAreaChange(()=>c()):e==="maxHeight"?t.onMaxHeightChange(()=>c()):e==="toolResponseMetadata"?t.onToolResponseMetadataChange(()=>c()):e==="widgetState"?t.onWidgetStateChange(()=>c()):()=>{},[t,e]),m=Q(()=>e==="toolOutput"?t.getToolOutput():e==="theme"?t.getTheme():e==="displayMode"?t.getDisplayMode():e==="locale"?t.getLocale():e==="safeArea"?t.getSafeArea():e==="maxHeight"?t.getMaxHeight():e==="toolResponseMetadata"?t.getToolResponseMetadata():e==="widgetState"?t.getWidgetState():null,[t,e]),u=je(i,m,m);return e?u:t}function te(){let e=l();return Fe((t,i)=>e.callTool(t,i),[e])}function oe(){return l("displayMode")}import{useSyncExternalStore as Ke}from"react";function ne(){return Ke(()=>()=>{},()=>typeof window>"u"?!1:window.__isChatGptApp===!0,()=>!1)}function re(){return l("locale")}function ae(){return l("maxHeight")}import{useCallback as Be}from"react";function ie(){let e=l();return Be(t=>e.openExternal(t),[e])}import{useCallback as _e}from"react";function se(){let e=l();return _e(t=>e.requestDisplayMode(t),[e])}function le(){return l("safeArea")}import{useCallback as ze}from"react";function de(){let e=l();return ze(t=>e.sendFollowUp(t),[e])}function ue(){return l("theme")}function ce(){return l("toolOutput")}function pe(){return l("toolResponseMetadata")}import{useCallback as Ge,useEffect as $e,useState as Je}from"react";function me(e){let t=l("widgetState"),[i,m]=Je(()=>t??(typeof e=="function"?e():e??null));$e(()=>{m(t)},[t]);let u=Ge(c=>{m(g=>{let f=typeof c=="function"?c(g):c;return $()==="openai"&&f!=null&&window.openai?.setWidgetState(f),f})},[]);return[i,u]}import{jsx as k,jsxs as ge}from"react/jsx-runtime";var qe=()=>ge("div",{className:"flex flex-col items-center justify-center h-full min-h-[120px] gap-4",children:[ge("div",{className:"flex gap-2",children:[k("div",{className:"w-3 h-3 rounded-full bg-gradient-to-r from-blue-400 to-cyan-400 animate-bounce [animation-delay:-0.3s]"}),k("div",{className:"w-3 h-3 rounded-full bg-gradient-to-r from-cyan-400 to-teal-400 animate-bounce [animation-delay:-0.15s]"}),k("div",{className:"w-3 h-3 rounded-full bg-gradient-to-r from-teal-400 to-emerald-400 animate-bounce"})]}),k("p",{className:"text-sm font-medium text-transparent bg-clip-text bg-gradient-to-r from-slate-400 via-slate-200 to-slate-400 bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",children:"Loading widget..."}),k("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:k("div",{className:"w-16 h-16 rounded-full border-2 border-blue-400/20 animate-ping"})}),k("style",{children:`
62
+ `},children:[s("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid rgba(255, 255, 255, 0.06)"},children:[s("div",{className:"flex items-center gap-2",children:[o(q,{className:"w-4 h-4 text-gray-400"}),o("span",{className:"text-sm font-medium text-white",children:"Dev Controls"})]}),s("div",{className:"flex items-center gap-2",children:[o("span",{className:"text-[10px] font-medium text-gray-500 px-1.5 py-0.5 rounded",style:{background:"rgba(255, 255, 255, 0.04)",border:"1px solid rgba(255, 255, 255, 0.06)"},children:typeof navigator<"u"&&navigator.platform?.includes("Mac")?"\u2318\u21E7D":"Ctrl+Shift+D"}),o("button",{type:"button",onClick:y,className:"p-1 rounded-md text-gray-500 hover:text-gray-300 hover:bg-white/5 transition-colors",children:o(Te,{className:"w-4 h-4"})})]})]}),s("div",{className:"p-4 space-y-5 overflow-y-auto",style:{maxHeight:"calc(100vh - 200px)"},children:[s("div",{children:[o("label",{htmlFor:"display-mode",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Display Mode"}),o(V,{options:ve,value:f,onChange:he})]}),s("div",{children:[o("label",{htmlFor:"theme",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Theme"}),o(V,{options:ke,value:n,onChange:xe})]}),s("div",{children:[o("label",{htmlFor:"safe-area",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Safe Area (Chat Input)"}),s("button",{type:"button",onClick:()=>h(!r),className:`w-full flex items-center justify-between px-3 py-2.5 rounded-lg text-xs font-medium transition-all duration-150 ${r?"text-emerald-400":"text-gray-400"}`,style:{background:r?"rgba(34, 197, 94, 0.1)":"rgba(255, 255, 255, 0.04)",border:r?"1px solid rgba(34, 197, 94, 0.3)":"1px solid rgba(255, 255, 255, 0.06)"},children:[o("span",{children:"Mock ChatGPT Input Bar"}),o("span",{className:`px-2 py-0.5 rounded text-[10px] font-semibold ${r?"bg-emerald-500/20 text-emerald-400":"bg-gray-500/20 text-gray-500"}`,children:r?"ON":"OFF"})]}),r&&s("p",{className:"text-[10px] text-gray-500 mt-1.5",children:["bottom: ",L,"px"]})]}),s("div",{children:[o("label",{htmlFor:"widget-props",className:"text-[11px] font-medium uppercase tracking-wider text-gray-500 block mb-2",children:"Widget Props"}),o("textarea",{value:P,onChange:a=>be(a.target.value),onBlur:we,className:"dev-json-editor w-full min-h-[160px] text-xs text-gray-200 p-3 rounded-lg resize-none focus:outline-none transition-colors",style:{background:"rgba(0, 0, 0, 0.3)",border:C?"1px solid rgba(239, 68, 68, 0.5)":"1px solid rgba(255, 255, 255, 0.06)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",lineHeight:1.6},onFocus:a=>{C||(a.target.style.borderColor="rgba(99, 102, 241, 0.5)")},onBlurCapture:a=>{C||(a.target.style.borderColor="rgba(255, 255, 255, 0.06)")},spellCheck:!1}),C&&s("p",{className:"text-red-400 text-[11px] mt-1.5 flex items-center gap-1",children:[o("svg",{"aria-hidden":"true","aria-label":"Error",className:"w-3 h-3",viewBox:"0 0 16 16",fill:"currentColor",children:o("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7 4.5h2v4H7v-4zm0 5h2v2H7v-2z"})}),C]})]}),s("button",{type:"button",onClick:ye,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-gray-400 transition-all duration-150 hover:text-gray-200",style:{background:"rgba(255, 255, 255, 0.04)",border:"1px solid rgba(255, 255, 255, 0.06)"},onMouseEnter:a=>{a.currentTarget.style.background="rgba(255, 255, 255, 0.08)",a.currentTarget.style.borderColor="rgba(255, 255, 255, 0.1)"},onMouseLeave:a=>{a.currentTarget.style.background="rgba(255, 255, 255, 0.04)",a.currentTarget.style.borderColor="rgba(255, 255, 255, 0.06)"},children:[o(De,{className:"w-3.5 h-3.5"}),"Reset to Defaults"]})]})]})]}),r&&s("div",{className:"fixed bottom-0 left-0 right-0 z-[9998] flex items-center justify-center pointer-events-none",style:{height:`${L}px`,background:"linear-gradient(to top, #1a1a1a 0%, #1a1a1a 80%, transparent 100%)"},children:[s("div",{className:"w-full max-w-2xl mx-4 px-4 py-3 rounded-2xl bg-[#2f2f2f] border border-[#424242] flex items-center gap-3",children:[o("div",{className:"w-8 h-8 rounded-full bg-[#424242] flex items-center justify-center",children:o("svg",{"aria-hidden":"true",className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),o("div",{className:"flex-1 text-gray-400 text-sm",children:"Ask anything..."}),o("div",{className:"w-8 h-8 rounded-full bg-[#424242] flex items-center justify-center",children:o("svg",{"aria-hidden":"true",className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})})})]}),s("div",{className:"absolute bottom-1 text-[10px] text-gray-600 font-mono",children:["Mock SafeArea: bottom=",L,"px"]})]})]})}import{useCallback as Fe}from"react";import D,{createContext as Le,useCallback as Q,useContext as Pe,useEffect as He,useState as _,useSyncExternalStore as je}from"react";async function X(){let{detectPlatform:e}=await import("../platform-4QZXTYT5.js");if(e()==="openai"){let{OpenAIWidgetClient:i}=await import("../openai-client-UL6T463M.js");return new i}else{let{MCPAppsWidgetClient:i}=await import("../mcp-apps-client-DZ3L5O3U.js");return new i}}var Z=Le(null);function ee({children:e,loading:t=null,onError:i}){let[m,u]=_(null),[c,g]=_(null),[f,p]=_(!0);return He(()=>{let n=!0;async function d(){try{let r=await X();await r.connect(),n&&(u(r),p(!1))}catch(r){n&&(console.log("error",r),g(r instanceof Error?r:new Error(String(r))),p(!1))}}return d(),()=>{n=!1}},[]),c&&i?D.createElement(D.Fragment,null,i(c)):f||!m?D.createElement(D.Fragment,null,t):D.createElement(Z.Provider,{value:m},e)}function l(e){let t=Pe(Z);if(!t)throw new Error("useWidgetClient must be used within a WidgetProvider");let i=Q(c=>e==="toolOutput"?t.onToolResult(()=>c()):e==="theme"?t.onThemeChange(()=>c()):e==="displayMode"?t.onDisplayModeChange(()=>c()):e==="safeArea"?t.onSafeAreaChange(()=>c()):e==="maxHeight"?t.onMaxHeightChange(()=>c()):e==="toolResponseMetadata"?t.onToolResponseMetadataChange(()=>c()):e==="widgetState"?t.onWidgetStateChange(()=>c()):()=>{},[t,e]),m=Q(()=>e==="toolOutput"?t.getToolOutput():e==="theme"?t.getTheme():e==="displayMode"?t.getDisplayMode():e==="locale"?t.getLocale():e==="safeArea"?t.getSafeArea():e==="maxHeight"?t.getMaxHeight():e==="toolResponseMetadata"?t.getToolResponseMetadata():e==="widgetState"?t.getWidgetState():null,[t,e]),u=je(i,m,m);return e?u:t}function te(){let e=l();return Fe((t,i)=>e.callTool(t,i),[e])}function oe(){return l("displayMode")}import{useSyncExternalStore as Ke}from"react";function ne(){return Ke(()=>()=>{},()=>typeof window>"u"?!1:window.__isChatGptApp===!0,()=>!1)}function re(){return l("locale")}function ae(){return l("maxHeight")}import{useCallback as Be}from"react";function ie(){let e=l();return Be(t=>e.openExternal(t),[e])}import{useCallback as _e}from"react";function se(){let e=l();return _e(t=>e.requestDisplayMode(t),[e])}function le(){return l("safeArea")}import{useCallback as ze}from"react";function de(){let e=l();return ze(t=>e.sendFollowUp(t),[e])}function ue(){return l("theme")}function ce(){return l("toolOutput")}function pe(){return l("toolResponseMetadata")}import{useCallback as Ge,useEffect as $e,useState as Je}from"react";function me(e){let t=l("widgetState"),[i,m]=Je(()=>t??(typeof e=="function"?e():e??null));$e(()=>{m(t)},[t]);let u=Ge(c=>{m(g=>{let f=typeof c=="function"?c(g):c;return $()==="openai"&&f!=null&&window.openai?.setWidgetState(f),f})},[]);return[i,u]}import{jsx as k,jsxs as ge}from"react/jsx-runtime";var qe=()=>ge("div",{className:"flex flex-col items-center justify-center h-full min-h-[120px] gap-4",children:[ge("div",{className:"flex gap-2",children:[k("div",{className:"w-3 h-3 rounded-full bg-gradient-to-r from-blue-400 to-cyan-400 animate-bounce [animation-delay:-0.3s]"}),k("div",{className:"w-3 h-3 rounded-full bg-gradient-to-r from-cyan-400 to-teal-400 animate-bounce [animation-delay:-0.15s]"}),k("div",{className:"w-3 h-3 rounded-full bg-gradient-to-r from-teal-400 to-emerald-400 animate-bounce"})]}),k("p",{className:"text-sm font-medium text-transparent bg-clip-text bg-gradient-to-r from-slate-400 via-slate-200 to-slate-400 bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",children:"Loading widget..."}),k("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:k("div",{className:"w-16 h-16 rounded-full border-2 border-blue-400/20 animate-ping"})}),k("style",{children:`
63
63
  @keyframes shimmer {
64
64
  0% { background-position: 200% 0; }
65
65
  100% { background-position: -200% 0; }
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{App as l,PostMessageTransport as s}from"@modelcontextprotocol/ext-apps";var n=class{app;toolResultCallback=null;themeChangeCallback=null;displayModeChangeCallback=null;hostContext;latestToolResult=null;constructor(){this.app=new l({name:"WaniWani Widget",version:"1.0.0"},{},{autoResize:!0}),this.app.ontoolresult=e=>{let t={content:e.content,structuredContent:e.structuredContent};this.latestToolResult=t,this.toolResultCallback?.(t)},this.app.onhostcontextchanged=e=>{this.hostContext={...this.hostContext,...e},e.theme&&this.themeChangeCallback?.(e.theme),e.displayMode&&this.displayModeChangeCallback?.(e.displayMode)}}async connect(){await this.app.connect(new s(window.parent,window.parent)),this.hostContext=this.app.getHostContext()}getToolOutput(){return this.latestToolResult?.structuredContent?this.latestToolResult.structuredContent:null}onToolResult(e){return this.toolResultCallback=e,()=>{this.toolResultCallback=null}}async callTool(e,t){let o=await this.app.callServerTool({name:e,arguments:t});return{content:o.content,structuredContent:o.structuredContent}}openExternal(e){this.app.sendOpenLink({url:e}).catch(t=>{console.error("Failed to open link:",t)})}sendFollowUp(e){this.app.sendMessage({role:"user",content:[{type:"text",text:e}]}).catch(t=>{console.error("Failed to send follow-up message:",t)})}getTheme(){return this.hostContext?.theme??"light"}onThemeChange(e){return this.themeChangeCallback=e,()=>{this.themeChangeCallback=null}}getLocale(){return this.hostContext?.locale??"en"}getDisplayMode(){return this.hostContext?.displayMode??"inline"}async requestDisplayMode(e){return(await this.app.requestDisplayMode({mode:e})).mode}onDisplayModeChange(e){return this.displayModeChangeCallback=e,()=>{this.displayModeChangeCallback=null}}getSafeArea(){return null}onSafeAreaChange(){return()=>{}}getMaxHeight(){return null}onMaxHeightChange(){return()=>{}}getToolResponseMetadata(){return null}onToolResponseMetadataChange(){return()=>{}}getWidgetState(){return null}onWidgetStateChange(){return()=>{}}};export{n as MCPAppsWidgetClient};
3
+ //# sourceMappingURL=mcp-apps-client-DZ3L5O3U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/mcp/widgets/@utils/mcp-apps-client.ts"],"sourcesContent":["import type { McpUiHostContext } from \"@modelcontextprotocol/ext-apps\";\nimport { App, PostMessageTransport } from \"@modelcontextprotocol/ext-apps\";\nimport type {\n\tDisplayMode,\n\tSafeArea,\n\tTheme,\n\tUnknownObject,\n} from \"../../hooks/@types\";\nimport type {\n\tToolCallResult,\n\tToolResult,\n\tUnifiedWidgetClient,\n} from \"./widget-client\";\n\n/**\n * MCP Apps widget client implementation.\n * Uses the @modelcontextprotocol/ext-apps App class for communication.\n */\nexport class MCPAppsWidgetClient implements UnifiedWidgetClient {\n\tprivate app: App;\n\tprivate toolResultCallback: ((result: ToolResult) => void) | null = null;\n\tprivate themeChangeCallback: ((theme: Theme) => void) | null = null;\n\tprivate displayModeChangeCallback: ((mode: DisplayMode) => void) | null =\n\t\tnull;\n\tprivate hostContext: McpUiHostContext | undefined;\n\tprivate latestToolResult: ToolResult | null = null;\n\n\tconstructor() {\n\t\tthis.app = new App(\n\t\t\t{ name: \"WaniWani Widget\", version: \"1.0.0\" },\n\t\t\t{}, // capabilities\n\t\t\t{ autoResize: true },\n\t\t);\n\n\t\t// Set up notification handlers\n\t\tthis.app.ontoolresult = (params) => {\n\t\t\tconst result: ToolResult = {\n\t\t\t\tcontent: params.content,\n\t\t\t\tstructuredContent: params.structuredContent as\n\t\t\t\t\t| Record<string, unknown>\n\t\t\t\t\t| undefined,\n\t\t\t};\n\t\t\tthis.latestToolResult = result;\n\t\t\tthis.toolResultCallback?.(result);\n\t\t};\n\n\t\tthis.app.onhostcontextchanged = (params) => {\n\t\t\tthis.hostContext = { ...this.hostContext, ...params };\n\t\t\tif (params.theme) {\n\t\t\t\tthis.themeChangeCallback?.(params.theme as Theme);\n\t\t\t}\n\t\t\tif (params.displayMode) {\n\t\t\t\tthis.displayModeChangeCallback?.(params.displayMode as DisplayMode);\n\t\t\t}\n\t\t};\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tawait this.app.connect(\n\t\t\tnew PostMessageTransport(window.parent, window.parent),\n\t\t);\n\t\tthis.hostContext = this.app.getHostContext();\n\t}\n\n\tgetToolOutput<T = Record<string, unknown>>(): T | null {\n\t\t// In MCP Apps, tool output comes through ontoolresult notification\n\t\t// Return the latest cached result\n\t\tif (this.latestToolResult?.structuredContent) {\n\t\t\treturn this.latestToolResult.structuredContent as T;\n\t\t}\n\t\treturn null;\n\t}\n\n\tonToolResult(callback: (result: ToolResult) => void): () => void {\n\t\tthis.toolResultCallback = callback;\n\t\treturn () => {\n\t\t\tthis.toolResultCallback = null;\n\t\t};\n\t}\n\n\tasync callTool(\n\t\tname: string,\n\t\targs: Record<string, unknown>,\n\t): Promise<ToolCallResult> {\n\t\tconst result = await this.app.callServerTool({\n\t\t\tname,\n\t\t\targuments: args,\n\t\t});\n\t\treturn {\n\t\t\tcontent: result.content,\n\t\t\tstructuredContent: result.structuredContent as\n\t\t\t\t| Record<string, unknown>\n\t\t\t\t| undefined,\n\t\t};\n\t}\n\n\topenExternal(url: string): void {\n\t\tthis.app.sendOpenLink({ url }).catch((err: unknown) => {\n\t\t\tconsole.error(\"Failed to open link:\", err);\n\t\t});\n\t}\n\n\tsendFollowUp(prompt: string): void {\n\t\tthis.app\n\t\t\t.sendMessage({\n\t\t\t\trole: \"user\",\n\t\t\t\tcontent: [{ type: \"text\", text: prompt }],\n\t\t\t})\n\t\t\t.catch((err: unknown) => {\n\t\t\t\tconsole.error(\"Failed to send follow-up message:\", err);\n\t\t\t});\n\t}\n\n\tgetTheme(): Theme {\n\t\treturn (this.hostContext?.theme as Theme) ?? \"light\";\n\t}\n\n\tonThemeChange(callback: (theme: Theme) => void): () => void {\n\t\tthis.themeChangeCallback = callback;\n\t\treturn () => {\n\t\t\tthis.themeChangeCallback = null;\n\t\t};\n\t}\n\n\tgetLocale(): string {\n\t\treturn (this.hostContext?.locale as string | undefined) ?? \"en\";\n\t}\n\n\tgetDisplayMode(): DisplayMode {\n\t\treturn (this.hostContext?.displayMode as DisplayMode) ?? \"inline\";\n\t}\n\n\tasync requestDisplayMode(mode: DisplayMode): Promise<DisplayMode> {\n\t\tconst result = await this.app.requestDisplayMode({ mode });\n\t\treturn result.mode as DisplayMode;\n\t}\n\n\tonDisplayModeChange(callback: (mode: DisplayMode) => void): () => void {\n\t\tthis.displayModeChangeCallback = callback;\n\t\treturn () => {\n\t\t\tthis.displayModeChangeCallback = null;\n\t\t};\n\t}\n\n\t// OPENAI specific methods\n\tgetSafeArea(): SafeArea | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonSafeAreaChange(): () => void {\n\t\treturn () => {};\n\t}\n\n\t// OPENAI specific methods\n\tgetMaxHeight(): number | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonMaxHeightChange(): () => void {\n\t\treturn () => {};\n\t}\n\n\t// MCP Apps specific methods\n\tgetToolResponseMetadata(): UnknownObject | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonToolResponseMetadataChange(): () => void {\n\t\treturn () => {};\n\t}\n\n\t// MCP Apps specific methods\n\tgetWidgetState(): UnknownObject | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonWidgetStateChange(): () => void {\n\t\treturn () => {};\n\t}\n}\n"],"mappings":";AACA,OAAS,OAAAA,EAAK,wBAAAC,MAA4B,iCAiBnC,IAAMC,EAAN,KAAyD,CACvD,IACA,mBAA4D,KAC5D,oBAAuD,KACvD,0BACP,KACO,YACA,iBAAsC,KAE9C,aAAc,CACb,KAAK,IAAM,IAAIF,EACd,CAAE,KAAM,kBAAmB,QAAS,OAAQ,EAC5C,CAAC,EACD,CAAE,WAAY,EAAK,CACpB,EAGA,KAAK,IAAI,aAAgBG,GAAW,CACnC,IAAMC,EAAqB,CAC1B,QAASD,EAAO,QAChB,kBAAmBA,EAAO,iBAG3B,EACA,KAAK,iBAAmBC,EACxB,KAAK,qBAAqBA,CAAM,CACjC,EAEA,KAAK,IAAI,qBAAwBD,GAAW,CAC3C,KAAK,YAAc,CAAE,GAAG,KAAK,YAAa,GAAGA,CAAO,EAChDA,EAAO,OACV,KAAK,sBAAsBA,EAAO,KAAc,EAE7CA,EAAO,aACV,KAAK,4BAA4BA,EAAO,WAA0B,CAEpE,CACD,CAEA,MAAM,SAAyB,CAC9B,MAAM,KAAK,IAAI,QACd,IAAIF,EAAqB,OAAO,OAAQ,OAAO,MAAM,CACtD,EACA,KAAK,YAAc,KAAK,IAAI,eAAe,CAC5C,CAEA,eAAuD,CAGtD,OAAI,KAAK,kBAAkB,kBACnB,KAAK,iBAAiB,kBAEvB,IACR,CAEA,aAAaI,EAAoD,CAChE,YAAK,mBAAqBA,EACnB,IAAM,CACZ,KAAK,mBAAqB,IAC3B,CACD,CAEA,MAAM,SACLC,EACAC,EAC0B,CAC1B,IAAMH,EAAS,MAAM,KAAK,IAAI,eAAe,CAC5C,KAAAE,EACA,UAAWC,CACZ,CAAC,EACD,MAAO,CACN,QAASH,EAAO,QAChB,kBAAmBA,EAAO,iBAG3B,CACD,CAEA,aAAaI,EAAmB,CAC/B,KAAK,IAAI,aAAa,CAAE,IAAAA,CAAI,CAAC,EAAE,MAAOC,GAAiB,CACtD,QAAQ,MAAM,uBAAwBA,CAAG,CAC1C,CAAC,CACF,CAEA,aAAaC,EAAsB,CAClC,KAAK,IACH,YAAY,CACZ,KAAM,OACN,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAMA,CAAO,CAAC,CACzC,CAAC,EACA,MAAOD,GAAiB,CACxB,QAAQ,MAAM,oCAAqCA,CAAG,CACvD,CAAC,CACH,CAEA,UAAkB,CACjB,OAAQ,KAAK,aAAa,OAAmB,OAC9C,CAEA,cAAcJ,EAA8C,CAC3D,YAAK,oBAAsBA,EACpB,IAAM,CACZ,KAAK,oBAAsB,IAC5B,CACD,CAEA,WAAoB,CACnB,OAAQ,KAAK,aAAa,QAAiC,IAC5D,CAEA,gBAA8B,CAC7B,OAAQ,KAAK,aAAa,aAA+B,QAC1D,CAEA,MAAM,mBAAmBM,EAAyC,CAEjE,OADe,MAAM,KAAK,IAAI,mBAAmB,CAAE,KAAAA,CAAK,CAAC,GAC3C,IACf,CAEA,oBAAoBN,EAAmD,CACtE,YAAK,0BAA4BA,EAC1B,IAAM,CACZ,KAAK,0BAA4B,IAClC,CACD,CAGA,aAA+B,CAC9B,OAAO,IACR,CAGA,kBAA+B,CAC9B,MAAO,IAAM,CAAC,CACf,CAGA,cAA8B,CAC7B,OAAO,IACR,CAGA,mBAAgC,CAC/B,MAAO,IAAM,CAAC,CACf,CAGA,yBAAgD,CAC/C,OAAO,IACR,CAGA,8BAA2C,CAC1C,MAAO,IAAM,CAAC,CACf,CAGA,gBAAuC,CACtC,OAAO,IACR,CAGA,qBAAkC,CACjC,MAAO,IAAM,CAAC,CACf,CACD","names":["App","PostMessageTransport","MCPAppsWidgetClient","params","result","callback","name","args","url","err","prompt","mode"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waniwani/sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "WaniWani SDK - MCP event tracking, widget framework, and tools",
5
5
  "type": "module",
6
6
  "exports": {
@@ -33,9 +33,9 @@
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@modelcontextprotocol/sdk": ">=1.0.0",
36
- "@modelcontextprotocol/ext-apps": ">=0.1.0",
37
- "zod": ">=3.0.0",
38
- "react": ">=18.0.0"
36
+ "@modelcontextprotocol/ext-apps": "^1.0.1",
37
+ "react": ">=18.0.0",
38
+ "zod": ">=3.0.0"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@modelcontextprotocol/sdk": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@biomejs/biome": "^2.3.13",
56
- "@modelcontextprotocol/ext-apps": "^0.1.0",
56
+ "@modelcontextprotocol/ext-apps": "1.0.1",
57
57
  "@modelcontextprotocol/sdk": "^1.0.0",
58
58
  "@types/node": "^22.10.0",
59
59
  "@types/react": "^19.0.0",
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{App as l,PostMessageTransport as s}from"@modelcontextprotocol/ext-apps";var n=class{app;toolResultCallback=null;themeChangeCallback=null;displayModeChangeCallback=null;hostContext;latestToolResult=null;constructor(){this.app=new l({name:"WaniWani Widget",version:"1.0.0"},{},{autoResize:!0}),this.app.ontoolresult=e=>{let t={content:e.content,structuredContent:e.structuredContent};this.latestToolResult=t,this.toolResultCallback?.(t)},this.app.onhostcontextchanged=e=>{this.hostContext={...this.hostContext,...e},e.theme&&this.themeChangeCallback?.(e.theme),e.displayMode&&this.displayModeChangeCallback?.(e.displayMode)}}async connect(){await this.app.connect(new s(window.parent)),this.hostContext=this.app.getHostContext()}getToolOutput(){return this.latestToolResult?.structuredContent?this.latestToolResult.structuredContent:null}onToolResult(e){return this.toolResultCallback=e,()=>{this.toolResultCallback=null}}async callTool(e,t){let o=await this.app.callServerTool({name:e,arguments:t});return{content:o.content,structuredContent:o.structuredContent}}openExternal(e){this.app.sendOpenLink({url:e}).catch(t=>{console.error("Failed to open link:",t)})}sendFollowUp(e){this.app.sendMessage({role:"user",content:[{type:"text",text:e}]}).catch(t=>{console.error("Failed to send follow-up message:",t)})}getTheme(){return this.hostContext?.theme??"light"}onThemeChange(e){return this.themeChangeCallback=e,()=>{this.themeChangeCallback=null}}getLocale(){return this.hostContext?.locale??"en"}getDisplayMode(){return this.hostContext?.displayMode??"inline"}async requestDisplayMode(e){return this.getDisplayMode()}onDisplayModeChange(e){return this.displayModeChangeCallback=e,()=>{this.displayModeChangeCallback=null}}getSafeArea(){return null}onSafeAreaChange(){return()=>{}}getMaxHeight(){return null}onMaxHeightChange(){return()=>{}}getToolResponseMetadata(){return null}onToolResponseMetadataChange(){return()=>{}}getWidgetState(){return null}onWidgetStateChange(){return()=>{}}};export{n as MCPAppsWidgetClient};
3
- //# sourceMappingURL=mcp-apps-client-BU7EN3Z2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/mcp/widgets/@utils/mcp-apps-client.ts"],"sourcesContent":["import type { McpUiHostContext } from \"@modelcontextprotocol/ext-apps\";\nimport { App, PostMessageTransport } from \"@modelcontextprotocol/ext-apps\";\nimport type {\n\tDisplayMode,\n\tSafeArea,\n\tTheme,\n\tUnknownObject,\n} from \"../../hooks/@types\";\nimport type {\n\tToolCallResult,\n\tToolResult,\n\tUnifiedWidgetClient,\n} from \"./widget-client\";\n\n/**\n * MCP Apps widget client implementation.\n * Uses the @modelcontextprotocol/ext-apps App class for communication.\n */\nexport class MCPAppsWidgetClient implements UnifiedWidgetClient {\n\tprivate app: App;\n\tprivate toolResultCallback: ((result: ToolResult) => void) | null = null;\n\tprivate themeChangeCallback: ((theme: Theme) => void) | null = null;\n\tprivate displayModeChangeCallback: ((mode: DisplayMode) => void) | null =\n\t\tnull;\n\tprivate hostContext: McpUiHostContext | undefined;\n\tprivate latestToolResult: ToolResult | null = null;\n\n\tconstructor() {\n\t\tthis.app = new App(\n\t\t\t{ name: \"WaniWani Widget\", version: \"1.0.0\" },\n\t\t\t{}, // capabilities\n\t\t\t{ autoResize: true },\n\t\t);\n\n\t\t// Set up notification handlers\n\t\tthis.app.ontoolresult = (params) => {\n\t\t\tconst result: ToolResult = {\n\t\t\t\tcontent: params.content,\n\t\t\t\tstructuredContent: params.structuredContent as\n\t\t\t\t\t| Record<string, unknown>\n\t\t\t\t\t| undefined,\n\t\t\t};\n\t\t\tthis.latestToolResult = result;\n\t\t\tthis.toolResultCallback?.(result);\n\t\t};\n\n\t\tthis.app.onhostcontextchanged = (params) => {\n\t\t\tthis.hostContext = { ...this.hostContext, ...params };\n\t\t\tif (params.theme) {\n\t\t\t\tthis.themeChangeCallback?.(params.theme as Theme);\n\t\t\t}\n\t\t\tif (params.displayMode) {\n\t\t\t\tthis.displayModeChangeCallback?.(params.displayMode as DisplayMode);\n\t\t\t}\n\t\t};\n\t}\n\n\tasync connect(): Promise<void> {\n\t\tawait this.app.connect(new PostMessageTransport(window.parent));\n\t\tthis.hostContext = this.app.getHostContext();\n\t}\n\n\tgetToolOutput<T = Record<string, unknown>>(): T | null {\n\t\t// In MCP Apps, tool output comes through ontoolresult notification\n\t\t// Return the latest cached result\n\t\tif (this.latestToolResult?.structuredContent) {\n\t\t\treturn this.latestToolResult.structuredContent as T;\n\t\t}\n\t\treturn null;\n\t}\n\n\tonToolResult(callback: (result: ToolResult) => void): () => void {\n\t\tthis.toolResultCallback = callback;\n\t\treturn () => {\n\t\t\tthis.toolResultCallback = null;\n\t\t};\n\t}\n\n\tasync callTool(\n\t\tname: string,\n\t\targs: Record<string, unknown>,\n\t): Promise<ToolCallResult> {\n\t\tconst result = await this.app.callServerTool({\n\t\t\tname,\n\t\t\targuments: args,\n\t\t});\n\t\treturn {\n\t\t\tcontent: result.content,\n\t\t\tstructuredContent: result.structuredContent as\n\t\t\t\t| Record<string, unknown>\n\t\t\t\t| undefined,\n\t\t};\n\t}\n\n\topenExternal(url: string): void {\n\t\tthis.app.sendOpenLink({ url }).catch((err: unknown) => {\n\t\t\tconsole.error(\"Failed to open link:\", err);\n\t\t});\n\t}\n\n\tsendFollowUp(prompt: string): void {\n\t\tthis.app\n\t\t\t.sendMessage({\n\t\t\t\trole: \"user\",\n\t\t\t\tcontent: [{ type: \"text\", text: prompt }],\n\t\t\t})\n\t\t\t.catch((err: unknown) => {\n\t\t\t\tconsole.error(\"Failed to send follow-up message:\", err);\n\t\t\t});\n\t}\n\n\tgetTheme(): Theme {\n\t\treturn (this.hostContext?.theme as Theme) ?? \"light\";\n\t}\n\n\tonThemeChange(callback: (theme: Theme) => void): () => void {\n\t\tthis.themeChangeCallback = callback;\n\t\treturn () => {\n\t\t\tthis.themeChangeCallback = null;\n\t\t};\n\t}\n\n\tgetLocale(): string {\n\t\treturn (this.hostContext?.locale as string | undefined) ?? \"en\";\n\t}\n\n\tgetDisplayMode(): DisplayMode {\n\t\treturn (this.hostContext?.displayMode as DisplayMode) ?? \"inline\";\n\t}\n\n\tasync requestDisplayMode(_mode: DisplayMode): Promise<DisplayMode> {\n\t\t// MCP Apps doesn't support display mode requests\n\t\treturn this.getDisplayMode();\n\t}\n\n\tonDisplayModeChange(callback: (mode: DisplayMode) => void): () => void {\n\t\tthis.displayModeChangeCallback = callback;\n\t\treturn () => {\n\t\t\tthis.displayModeChangeCallback = null;\n\t\t};\n\t}\n\n\t// OPENAI specific methods\n\tgetSafeArea(): SafeArea | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonSafeAreaChange(): () => void {\n\t\treturn () => {};\n\t}\n\n\t// OPENAI specific methods\n\tgetMaxHeight(): number | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonMaxHeightChange(): () => void {\n\t\treturn () => {};\n\t}\n\n\t// MCP Apps specific methods\n\tgetToolResponseMetadata(): UnknownObject | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonToolResponseMetadataChange(): () => void {\n\t\treturn () => {};\n\t}\n\n\t// MCP Apps specific methods\n\tgetWidgetState(): UnknownObject | null {\n\t\treturn null;\n\t}\n\n\t// MCP Apps specific methods\n\tonWidgetStateChange(): () => void {\n\t\treturn () => {};\n\t}\n}\n"],"mappings":";AACA,OAAS,OAAAA,EAAK,wBAAAC,MAA4B,iCAiBnC,IAAMC,EAAN,KAAyD,CACvD,IACA,mBAA4D,KAC5D,oBAAuD,KACvD,0BACP,KACO,YACA,iBAAsC,KAE9C,aAAc,CACb,KAAK,IAAM,IAAIF,EACd,CAAE,KAAM,kBAAmB,QAAS,OAAQ,EAC5C,CAAC,EACD,CAAE,WAAY,EAAK,CACpB,EAGA,KAAK,IAAI,aAAgBG,GAAW,CACnC,IAAMC,EAAqB,CAC1B,QAASD,EAAO,QAChB,kBAAmBA,EAAO,iBAG3B,EACA,KAAK,iBAAmBC,EACxB,KAAK,qBAAqBA,CAAM,CACjC,EAEA,KAAK,IAAI,qBAAwBD,GAAW,CAC3C,KAAK,YAAc,CAAE,GAAG,KAAK,YAAa,GAAGA,CAAO,EAChDA,EAAO,OACV,KAAK,sBAAsBA,EAAO,KAAc,EAE7CA,EAAO,aACV,KAAK,4BAA4BA,EAAO,WAA0B,CAEpE,CACD,CAEA,MAAM,SAAyB,CAC9B,MAAM,KAAK,IAAI,QAAQ,IAAIF,EAAqB,OAAO,MAAM,CAAC,EAC9D,KAAK,YAAc,KAAK,IAAI,eAAe,CAC5C,CAEA,eAAuD,CAGtD,OAAI,KAAK,kBAAkB,kBACnB,KAAK,iBAAiB,kBAEvB,IACR,CAEA,aAAaI,EAAoD,CAChE,YAAK,mBAAqBA,EACnB,IAAM,CACZ,KAAK,mBAAqB,IAC3B,CACD,CAEA,MAAM,SACLC,EACAC,EAC0B,CAC1B,IAAMH,EAAS,MAAM,KAAK,IAAI,eAAe,CAC5C,KAAAE,EACA,UAAWC,CACZ,CAAC,EACD,MAAO,CACN,QAASH,EAAO,QAChB,kBAAmBA,EAAO,iBAG3B,CACD,CAEA,aAAaI,EAAmB,CAC/B,KAAK,IAAI,aAAa,CAAE,IAAAA,CAAI,CAAC,EAAE,MAAOC,GAAiB,CACtD,QAAQ,MAAM,uBAAwBA,CAAG,CAC1C,CAAC,CACF,CAEA,aAAaC,EAAsB,CAClC,KAAK,IACH,YAAY,CACZ,KAAM,OACN,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAMA,CAAO,CAAC,CACzC,CAAC,EACA,MAAOD,GAAiB,CACxB,QAAQ,MAAM,oCAAqCA,CAAG,CACvD,CAAC,CACH,CAEA,UAAkB,CACjB,OAAQ,KAAK,aAAa,OAAmB,OAC9C,CAEA,cAAcJ,EAA8C,CAC3D,YAAK,oBAAsBA,EACpB,IAAM,CACZ,KAAK,oBAAsB,IAC5B,CACD,CAEA,WAAoB,CACnB,OAAQ,KAAK,aAAa,QAAiC,IAC5D,CAEA,gBAA8B,CAC7B,OAAQ,KAAK,aAAa,aAA+B,QAC1D,CAEA,MAAM,mBAAmBM,EAA0C,CAElE,OAAO,KAAK,eAAe,CAC5B,CAEA,oBAAoBN,EAAmD,CACtE,YAAK,0BAA4BA,EAC1B,IAAM,CACZ,KAAK,0BAA4B,IAClC,CACD,CAGA,aAA+B,CAC9B,OAAO,IACR,CAGA,kBAA+B,CAC9B,MAAO,IAAM,CAAC,CACf,CAGA,cAA8B,CAC7B,OAAO,IACR,CAGA,mBAAgC,CAC/B,MAAO,IAAM,CAAC,CACf,CAGA,yBAAgD,CAC/C,OAAO,IACR,CAGA,8BAA2C,CAC1C,MAAO,IAAM,CAAC,CACf,CAGA,gBAAuC,CACtC,OAAO,IACR,CAGA,qBAAkC,CACjC,MAAO,IAAM,CAAC,CACf,CACD","names":["App","PostMessageTransport","MCPAppsWidgetClient","params","result","callback","name","args","url","err","prompt","_mode"]}