@tuteliq/mcp 3.3.3 → 3.3.4
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-ui/action-plan.html
CHANGED
|
@@ -158,7 +158,7 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
158
158
|
- omitted: host decides border`)});_.object({method:_.literal("ui/request-display-mode"),params:_.object({mode:So.describe("The display mode being requested.")})});var IT=_.object({mode:So.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),xT=_.union([_.literal("model"),_.literal("app")]).describe("Tool visibility scope - who can access the tool.");_.object({resourceUri:_.string().optional(),visibility:_.array(xT).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
159
159
|
- "model": Tool visible to and callable by the agent
|
|
160
160
|
- "app": Tool callable by the app from this server only`)});_.object({mimeTypes:_.array(_.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});_.object({method:_.literal("ui/download-file"),params:_.object({contents:_.array(_.union([ty,ny])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});_.object({method:_.literal("ui/message"),params:_.object({role:_.literal("user").describe('Message role, currently only "user" is supported.'),content:_.array(No).describe("Message content blocks (text, image, etc.).")})});_.object({method:_.literal("ui/notifications/sandbox-resource-ready"),params:_.object({html:_.string().describe("HTML content to load into the inner iframe."),sandbox:_.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:pp.optional().describe("CSP configuration from resource metadata."),permissions:mp.optional().describe("Sandbox permissions from resource metadata.")})});var zT=_.object({method:_.literal("ui/notifications/tool-result"),params:Mu.describe("Standard MCP tool execution result.")}),HS=_.object({toolInfo:_.object({id:Io.optional().describe("JSON-RPC id of the tools/call request."),tool:hd.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:dT.optional().describe("Current color theme preference."),styles:kT.optional().describe("Style configuration for theming the app."),displayMode:So.optional().describe("How the UI is currently displayed."),availableDisplayModes:_.array(So).optional().describe("Display modes the host supports."),containerDimensions:_.union([_.object({height:_.number().describe("Fixed container height in pixels.")}),_.object({maxHeight:_.union([_.number(),_.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(_.union([_.object({width:_.number().describe("Fixed container width in pixels.")}),_.object({maxWidth:_.union([_.number(),_.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
161
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:_.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:_.string().optional().describe("User's timezone in IANA format."),userAgent:_.string().optional().describe("Host application identifier."),platform:_.union([_.literal("web"),_.literal("desktop"),_.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:_.object({touch:_.boolean().optional().describe("Whether the device supports touch input."),hover:_.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:_.object({top:_.number().describe("Top safe area inset in pixels."),right:_.number().describe("Right safe area inset in pixels."),bottom:_.number().describe("Bottom safe area inset in pixels."),left:_.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),ET=_.object({method:_.literal("ui/notifications/host-context-changed"),params:HS.describe("Partial context update containing only changed fields.")});_.object({method:_.literal("ui/update-model-context"),params:_.object({content:_.array(No).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:_.record(_.string(),_.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});_.object({method:_.literal("ui/initialize"),params:_.object({appInfo:Au.describe("App identification (name and version)."),appCapabilities:bT.describe("Features and capabilities this app provides."),protocolVersion:_.string().describe("Protocol version this app supports.")})});var PT=_.object({protocolVersion:_.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Au.describe("Host application identification and version."),hostCapabilities:ST.describe("Features and capabilities provided by the host."),hostContext:HS.describe("Rich context about the host environment.")}).passthrough();class OT extends NE{constructor(i,a={},n={autoResize:!0}){super(n);kt(this,"_appInfo");kt(this,"_capabilities");kt(this,"options");kt(this,"_hostCapabilities");kt(this,"_hostInfo");kt(this,"_hostContext");kt(this,"sendOpenLink",this.openLink);this._appInfo=i,this._capabilities=a,this.options=n,this.setRequestHandler(Lu,u=>(console.log("Received ping:",u.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(i){this.setNotificationHandler(gT,a=>i(a.params))}set ontoolinputpartial(i){this.setNotificationHandler(yT,a=>i(a.params))}set ontoolresult(i){this.setNotificationHandler(zT,a=>i(a.params))}set ontoolcancelled(i){this.setNotificationHandler(_T,a=>i(a.params))}set onhostcontextchanged(i){this.setNotificationHandler(ET,a=>{this._hostContext={...this._hostContext,...a.params},i(a.params)})}set onteardown(i){this.setRequestHandler(wT,(a,n)=>i(a.params,n))}set oncalltool(i){this.setRequestHandler(iy,(a,n)=>i(a.params,n))}set onlisttools(i){this.setRequestHandler(ry,(a,n)=>i(a.params,n))}assertCapabilityForMethod(i){}assertRequestHandlerCapability(i){switch(i){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${i})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${i} registered`)}}assertNotificationCapability(i){}assertTaskCapability(i){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(i){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(i,a){if(typeof i=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${i}"). Did you mean: callServerTool({ name: "${i}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:i},Mu,a)}sendMessage(i,a){return this.request({method:"ui/message",params:i},hT,a)}sendLog(i){return this.notification({method:"notifications/message",params:i})}updateModelContext(i,a){return this.request({method:"ui/update-model-context",params:i},td,a)}openLink(i,a){return this.request({method:"ui/open-link",params:i},mT,a)}downloadFile(i,a){return this.request({method:"ui/download-file",params:i},vT,a)}requestDisplayMode(i,a){return this.request({method:"ui/request-display-mode",params:i},IT,a)}sendSizeChanged(i){return this.notification({method:"ui/notifications/size-changed",params:i})}setupSizeChangedNotifications(){let i=!1,a=0,n=0,u=()=>{i||(i=!0,requestAnimationFrame(()=>{i=!1;let f=document.documentElement,m=f.style.width,v=f.style.height;f.style.width="fit-content",f.style.height="fit-content";let g=f.getBoundingClientRect();f.style.width=m,f.style.height=v;let y=window.innerWidth-f.clientWidth,k=Math.ceil(g.width+y),P=Math.ceil(g.height);(k!==a||P!==n)&&(a=k,n=P,this.sendSizeChanged({width:k,height:P}))}))};u();let l=new ResizeObserver(u);return l.observe(document.documentElement),l.observe(document.body),()=>l.disconnect()}async connect(i=new ay(window.parent,window.parent),a){var n;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(i);try{let u=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:jE}},PT,a);if(u===void 0)throw Error(`Server sent invalid initialize result: ${u}`);this._hostCapabilities=u.hostCapabilities,this._hostInfo=u.hostInfo,this._hostContext=u.hostContext,await this.notification({method:"ui/notifications/initialized"}),(n=this.options)!=null&&n.autoResize&&this.setupSizeChangedNotifications()}catch(u){throw this.close(),u}}}function NT({appInfo:e,capabilities:t,onAppCreated:i}){let[a,n]=rr.useState(null),[u,l]=rr.useState(!1),[f,m]=rr.useState(null);return rr.useEffect(()=>{let v=!0;async function g(){try{let y=new ay(window.parent,window.parent),k=new OT(e,t);i==null||i(k),await k.connect(y),v&&(n(k),l(!0),m(null))}catch(y){v&&(n(null),l(!1),m(y instanceof Error?y:Error("Failed to connect")))}}return g(),()=>{v=!1}},[]),{app:a,isConnected:u,error:f}}function TT(){const[e,t]=rr.useState(null),[i,a]=rr.useState(!0),n=rr.useCallback(v=>{v.ontoolresult=g=>{g.structuredContent&&t(g.structuredContent),a(!1)}},[]),{app:u,isConnected:l,error:f}=NT({appInfo:{name:"Tuteliq",version:"3.0.0"},capabilities:{},onAppCreated:n}),m=rr.useCallback(async(v,g={})=>u?u.callServerTool({name:v,arguments:g}):null,[u]);return{data:e,loading:i,error:f,isConnected:l,callTool:m}}const it={brand:{primary:"#6366F1",primaryLight:"#818CF8",primaryDark:"#4F46E5"},bg:{primary:"#FFFFFF",secondary:"#F8FAFC",tertiary:"#F1F5F9"},text:{primary:"#0F172A",secondary:"#475569",muted:"#94A3B8"},border:"#E2E8F0"},vp='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',jT=`
|
|
161
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:_.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:_.string().optional().describe("User's timezone in IANA format."),userAgent:_.string().optional().describe("Host application identifier."),platform:_.union([_.literal("web"),_.literal("desktop"),_.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:_.object({touch:_.boolean().optional().describe("Whether the device supports touch input."),hover:_.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:_.object({top:_.number().describe("Top safe area inset in pixels."),right:_.number().describe("Right safe area inset in pixels."),bottom:_.number().describe("Bottom safe area inset in pixels."),left:_.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),ET=_.object({method:_.literal("ui/notifications/host-context-changed"),params:HS.describe("Partial context update containing only changed fields.")});_.object({method:_.literal("ui/update-model-context"),params:_.object({content:_.array(No).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:_.record(_.string(),_.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});_.object({method:_.literal("ui/initialize"),params:_.object({appInfo:Au.describe("App identification (name and version)."),appCapabilities:bT.describe("Features and capabilities this app provides."),protocolVersion:_.string().describe("Protocol version this app supports.")})});var PT=_.object({protocolVersion:_.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Au.describe("Host application identification and version."),hostCapabilities:ST.describe("Features and capabilities provided by the host."),hostContext:HS.describe("Rich context about the host environment.")}).passthrough();class OT extends NE{constructor(i,a={},n={autoResize:!0}){super(n);kt(this,"_appInfo");kt(this,"_capabilities");kt(this,"options");kt(this,"_hostCapabilities");kt(this,"_hostInfo");kt(this,"_hostContext");kt(this,"sendOpenLink",this.openLink);this._appInfo=i,this._capabilities=a,this.options=n,this.setRequestHandler(Lu,u=>(console.log("Received ping:",u.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(i){this.setNotificationHandler(gT,a=>i(a.params))}set ontoolinputpartial(i){this.setNotificationHandler(yT,a=>i(a.params))}set ontoolresult(i){this.setNotificationHandler(zT,a=>i(a.params))}set ontoolcancelled(i){this.setNotificationHandler(_T,a=>i(a.params))}set onhostcontextchanged(i){this.setNotificationHandler(ET,a=>{this._hostContext={...this._hostContext,...a.params},i(a.params)})}set onteardown(i){this.setRequestHandler(wT,(a,n)=>i(a.params,n))}set oncalltool(i){this.setRequestHandler(iy,(a,n)=>i(a.params,n))}set onlisttools(i){this.setRequestHandler(ry,(a,n)=>i(a.params,n))}assertCapabilityForMethod(i){}assertRequestHandlerCapability(i){switch(i){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${i})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${i} registered`)}}assertNotificationCapability(i){}assertTaskCapability(i){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(i){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(i,a){if(typeof i=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${i}"). Did you mean: callServerTool({ name: "${i}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:i},Mu,a)}sendMessage(i,a){return this.request({method:"ui/message",params:i},hT,a)}sendLog(i){return this.notification({method:"notifications/message",params:i})}updateModelContext(i,a){return this.request({method:"ui/update-model-context",params:i},td,a)}openLink(i,a){return this.request({method:"ui/open-link",params:i},mT,a)}downloadFile(i,a){return this.request({method:"ui/download-file",params:i},vT,a)}requestDisplayMode(i,a){return this.request({method:"ui/request-display-mode",params:i},IT,a)}sendSizeChanged(i){return this.notification({method:"ui/notifications/size-changed",params:i})}setupSizeChangedNotifications(){let i=!1,a=0,n=0,u=()=>{i||(i=!0,requestAnimationFrame(()=>{i=!1;let f=document.documentElement,m=f.style.width,v=f.style.height;f.style.width="fit-content",f.style.height="fit-content";let g=f.getBoundingClientRect();f.style.width=m,f.style.height=v;let y=window.innerWidth-f.clientWidth,k=Math.ceil(g.width+y),P=Math.ceil(g.height);(k!==a||P!==n)&&(a=k,n=P,this.sendSizeChanged({width:k,height:P}))}))};u();let l=new ResizeObserver(u);return l.observe(document.documentElement),l.observe(document.body),()=>l.disconnect()}async connect(i=new ay(window.parent,window.parent),a){var n;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(i);try{let u=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:jE}},PT,a);if(u===void 0)throw Error(`Server sent invalid initialize result: ${u}`);this._hostCapabilities=u.hostCapabilities,this._hostInfo=u.hostInfo,this._hostContext=u.hostContext,await this.notification({method:"ui/notifications/initialized"}),(n=this.options)!=null&&n.autoResize&&this.setupSizeChangedNotifications()}catch(u){throw this.close(),u}}}function NT({appInfo:e,capabilities:t,onAppCreated:i}){let[a,n]=rr.useState(null),[u,l]=rr.useState(!1),[f,m]=rr.useState(null);return rr.useEffect(()=>{let v=!0;async function g(){try{let y=new ay(window.parent,window.parent),k=new OT(e,t);i==null||i(k),await k.connect(y),v&&(n(k),l(!0),m(null))}catch(y){v&&(n(null),l(!1),m(y instanceof Error?y:Error("Failed to connect")))}}return g(),()=>{v=!1}},[]),{app:a,isConnected:u,error:f}}function TT(){const[e,t]=rr.useState(null),[i,a]=rr.useState(!0),n=rr.useCallback(v=>{v.ontoolresult=g=>{g.structuredContent&&t(g.structuredContent),a(!1)}},[]),{app:u,isConnected:l,error:f}=NT({appInfo:{name:"Tuteliq",version:"3.0.0"},capabilities:{},onAppCreated:n}),m=rr.useCallback(async(v,g={})=>u?u.callServerTool({name:v,arguments:g}):null,[u]);return{data:e,loading:i,error:f,isConnected:l,callTool:m,app:u}}const it={brand:{primary:"#6366F1",primaryLight:"#818CF8",primaryDark:"#4F46E5"},bg:{primary:"#FFFFFF",secondary:"#F8FAFC",tertiary:"#F1F5F9"},text:{primary:"#0F172A",secondary:"#475569",muted:"#94A3B8"},border:"#E2E8F0"},vp='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',jT=`
|
|
162
162
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
163
163
|
body {
|
|
164
164
|
font-family: ${vp};
|