@waniwani/sdk 0.11.3 → 0.11.6
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/chat/embed.js +64 -64
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/express-js/index.d.ts +1 -7
- package/dist/chat/index.d.ts +12 -0
- package/dist/chat/index.js +7 -7
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/next-js/index.d.ts +1 -7
- package/dist/chat/styles.css +1 -1
- package/dist/index.d.ts +1 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -7
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/react.js +1 -1
- package/dist/mcp/react.js.map +1 -1
- package/package.json +2 -1
package/dist/mcp/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as re}from"../chunk-DGSC74SV.js";import{b as L,c as ie}from"../chunk-5OQXAEHG.js";import{Fragment as Ye,jsx as U,jsxs as $e}from"react/jsx-runtime";function ze(){let e=window.innerBaseUrl,t=window.__wwPassthroughOrigins??[],n=document.documentElement;new MutationObserver(p=>{p.forEach(m=>{if(m.type==="attributes"&&m.target===n){let u=m.attributeName;u&&u!=="suppresshydrationwarning"&&u!=="lang"&&u!=="class"&&u!=="style"&&n.removeAttribute(u)}})}).observe(n,{attributes:!0,attributeOldValue:!0});let r=history.replaceState.bind(history);history.replaceState=(p,m,u)=>{try{let i=new URL(String(u??""),window.location.href);r(null,m,i.pathname+i.search+i.hash)}catch{}};let c=history.pushState.bind(history);history.pushState=(p,m,u)=>{try{let i=new URL(String(u??""),window.location.href);c(null,m,i.pathname+i.search+i.hash)}catch{}};let h=new URL(e).origin,x=window.self!==window.top;if(window.addEventListener("click",p=>{let m=p?.target?.closest("a");if(!m||!m.href)return;let u=new URL(m.href,window.location.href);if(u.origin!==window.location.origin&&u.origin!==h)try{window.openai&&(window.openai?.openExternal({href:m.href}),p.preventDefault())}catch{console.warn("openExternal failed, likely not in OpenAI client")}},!0),x&&window.location.origin!==h){let p=window.fetch;window.fetch=((o,d)=>{let g=typeof o=="string"&&!/^[a-z][a-z0-9+.-]*:/i.test(o)&&!o.startsWith("//"),l;if(typeof o=="string"||o instanceof URL?l=new URL(o,window.location.href):l=new URL(o.url,window.location.href),l.origin===h)return typeof o=="string"||o instanceof URL?o=l.toString():o=new Request(l.toString(),o),p.call(window,o,{...d,mode:"cors"});if(t.indexOf(l.origin)!==-1)return p.call(window,o,d);if(g&&l.origin===window.location.origin){let y=new URL(e);return y.pathname=l.pathname,y.search=l.search,y.hash=l.hash,l=y,o=l.toString(),p.call(window,o,{...d,mode:"cors"})}return p.call(window,o,d)});let m=h.replace(/^http/,"ws"),u=window.WebSocket,i=
|
|
2
|
+
import{a as re}from"../chunk-DGSC74SV.js";import{b as L,c as ie}from"../chunk-5OQXAEHG.js";import{Fragment as Ye,jsx as U,jsxs as $e}from"react/jsx-runtime";function ze(){let e=window.innerBaseUrl,t=window.__wwPassthroughOrigins??[],n=document.documentElement;new MutationObserver(p=>{p.forEach(m=>{if(m.type==="attributes"&&m.target===n){let u=m.attributeName;u&&u!=="suppresshydrationwarning"&&u!=="lang"&&u!=="class"&&u!=="style"&&n.removeAttribute(u)}})}).observe(n,{attributes:!0,attributeOldValue:!0});let r=history.replaceState.bind(history);history.replaceState=(p,m,u)=>{try{let i=new URL(String(u??""),window.location.href);r(null,m,i.pathname+i.search+i.hash)}catch{}};let c=history.pushState.bind(history);history.pushState=(p,m,u)=>{try{let i=new URL(String(u??""),window.location.href);c(null,m,i.pathname+i.search+i.hash)}catch{}};let h=new URL(e).origin,x=window.self!==window.top;if(window.addEventListener("click",p=>{let m=p?.target?.closest("a");if(!m||!m.href)return;let u=new URL(m.href,window.location.href);if(u.origin!==window.location.origin&&u.origin!==h)try{window.openai&&(window.openai?.openExternal({href:m.href}),p.preventDefault())}catch{console.warn("openExternal failed, likely not in OpenAI client")}},!0),x&&window.location.origin!==h){let p=window.fetch;window.fetch=((o,d)=>{let g=typeof o=="string"&&!/^[a-z][a-z0-9+.-]*:/i.test(o)&&!o.startsWith("//"),l;if(typeof o=="string"||o instanceof URL?l=new URL(o,window.location.href):l=new URL(o.url,window.location.href),l.origin===h)return typeof o=="string"||o instanceof URL?o=l.toString():o=new Request(l.toString(),o),p.call(window,o,{...d,mode:"cors"});if(t.indexOf(l.origin)!==-1)return p.call(window,o,d);if(g&&l.origin===window.location.origin){let y=new URL(e);return y.pathname=l.pathname,y.search=l.search,y.hash=l.hash,l=y,o=l.toString(),p.call(window,o,{...d,mode:"cors"})}return p.call(window,o,d)});let m=h.replace(/^http/,"ws"),u=window.WebSocket,i=((o,d)=>{let g=new URL(String(o),window.location.href);if(g.origin===window.location.origin||g.origin===window.location.origin.replace(/^http/,"ws")){let l=new URL(m);return l.pathname=g.pathname,l.search=g.search,l.hash=g.hash,new u(l.toString(),d)}return new u(o,d)});i.prototype=u.prototype,Object.assign(i,{CONNECTING:u.CONNECTING,OPEN:u.OPEN,CLOSING:u.CLOSING,CLOSED:u.CLOSED}),window.WebSocket=i}}var Ge=`(${ze.toString()})()`;function Ve({baseUrl:e,passthroughOrigins:t}){return $e(Ye,{children:[U("base",{href:e}),U("script",{children:`window.innerBaseUrl = ${JSON.stringify(e)}`}),U("script",{children:`window.__wwPassthroughOrigins = ${JSON.stringify(t??[])}`}),U("script",{children:'window.__isChatGptApp = typeof window.openai !== "undefined";'}),U("script",{children:Ge})]})}import{useCallback as T,useEffect as N,useRef as q,useState as C}from"react";var se={theme:"dark",userAgent:{device:{type:"desktop"},capabilities:{hover:!0,touch:!1}},locale:"en",maxHeight:800,displayMode:"inline",safeArea:{insets:{top:0,bottom:0,left:0,right:0}},toolInput:{},toolOutput:null,toolResponseMetadata:null,widgetState:null},D={...se};function F(e){typeof window>"u"||window.openai||(D={...se,toolOutput:e??null},window.openai={...D,requestDisplayMode:async({mode:t})=>(R("displayMode",t),{mode:t}),callTool:async(t,n)=>(console.log(`[DevMode] callTool: ${t}`,n),{result:JSON.stringify({mock:!0,tool:t,args:n})}),sendFollowUpMessage:async({prompt:t})=>{console.log(`[DevMode] sendFollowUpMessage: ${t}`)},openExternal:({href:t})=>{console.log(`[DevMode] openExternal: ${t}`),window.open(t,"_blank")},setWidgetState:async t=>{R("widgetState",t)}},window.dispatchEvent(new L({globals:D})))}function R(e,t){typeof window>"u"||!window.openai||(D[e]=t,window.openai[e]=t,window.dispatchEvent(new L({globals:{[e]:t}})))}function z(){return{...D}}function P(e){R("toolOutput",e)}function H(e){R("displayMode",e)}function B(e){R("theme",e)}import{Fragment as Z,jsx as a,jsxs as v}from"react/jsx-runtime";var G=150;function ae({className:e}){return v("svg",{className:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Dev Controls",children:[a("rect",{x:"4",y:"4",width:"10",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),a("rect",{x:"10",y:"10",width:"10",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.15"})]})}function Xe({className:e}){return a("svg",{"aria-hidden":"true",className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a("path",{d:"M18 6L6 18M6 6l12 12"})})}function Je({className:e}){return a("svg",{"aria-hidden":"true",className:e,viewBox:"0 0 16 16",fill:"none",children:a("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5",stroke:"currentColor",strokeWidth:"1.25"})})}function qe({className:e}){return v("svg",{"aria-hidden":"true",className:e,viewBox:"0 0 16 16",fill:"none",children:[a("rect",{x:"1.5",y:"3",width:"13",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.25"}),a("rect",{x:"8.5",y:"7",width:"5",height:"4",rx:"0.75",fill:"currentColor"})]})}function Ze({className:e}){return a("svg",{"aria-hidden":"true",className:e,viewBox:"0 0 16 16",fill:"none",children:a("path",{d:"M2 5.5V3.5C2 2.95 2.45 2.5 3 2.5H5.5M10.5 2.5H13C13.55 2.5 14 2.95 14 3.5V5.5M14 10.5V12.5C14 13.05 13.55 13.5 13 13.5H10.5M5.5 13.5H3C2.45 13.5 2 13.05 2 12.5V10.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Qe({className:e}){return v("svg",{"aria-hidden":"true",className:e,viewBox:"0 0 16 16",fill:"none",children:[a("circle",{cx:"8",cy:"8",r:"2.5",stroke:"currentColor",strokeWidth:"1.25"}),a("path",{d:"M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M4.11 4.11l1.06 1.06M10.83 10.83l1.06 1.06M4.11 11.89l1.06-1.06M10.83 5.17l1.06-1.06",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function et({className:e}){return a("svg",{"aria-hidden":"true",className:e,viewBox:"0 0 16 16",fill:"none",children:a("path",{d:"M13.5 9.5a5.5 5.5 0 01-7-7 5.5 5.5 0 107 7z",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function tt({className:e}){return v("svg",{"aria-hidden":"true",className:e,viewBox:"0 0 16 16",fill:"none",children:[a("path",{d:"M2.5 8a5.5 5.5 0 019.37-3.9M13.5 8a5.5 5.5 0 01-9.37 3.9",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),a("path",{d:"M12.5 2v3h-3M3.5 14v-3h3",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}var nt=`
|
|
3
3
|
@keyframes devPanelSlideIn {
|
|
4
4
|
0% {
|
|
5
5
|
opacity: 0;
|