+
    Q(i                        R t ^ RIHt ^ RIHtHt ^ RIHtHt Rt	Rt
 ! R R]4      t ! R R	]4      t ! R
 R]4      tR R ltR R ltR# )u  MCP Apps support — extension negotiation and typed UI metadata models.

Provides constants and Pydantic models for the MCP Apps extension
(io.modelcontextprotocol/ui), enabling tools and resources to carry
UI metadata for clients that support interactive app rendering.
)annotations)AnyLiteral)	BaseModelFieldzio.modelcontextprotocol/uiztext/html;profile=mcp-appc                      ] tR t^t$ Rt]! RRRR7      tR]R&   ]! RRR	R7      tR]R
&   ]! RRRR7      t	R]R&   ]! RRRR7      t
R]R&   RRRR/tRtR# )ResourceCSPzContent Security Policy for MCP App resources.

Declares which external origins the app is allowed to connect to or
load resources from.  Hosts use these declarations to build the
``Content-Security-Policy`` header for the sandboxed iframe.
NconnectDomainsz5Origins allowed for fetch/XHR/WebSocket (connect-src)defaultaliasdescriptionzlist[str] | Noneconnect_domainsresourceDomainszDOrigins allowed for scripts, images, styles, fonts (script-src etc.)resource_domainsframeDomainsz.Origins allowed for nested iframes (frame-src)frame_domainsbaseUriDomainsz-Allowed base URIs for the document (base-uri)base_uri_domainspopulate_by_nameTextraallow )__name__
__module____qualname____firstlineno____doc__r   r   __annotations__r   r   r   model_config__static_attributes__r       Y/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/fastmcp/server/apps.pyr   r      s     ).K)O% 
 */Z*& 
 ',D'M# 
 */C*&  'gw?Lr!   r   c                      ] tR t^2t$ Rt]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! RR	R7      t	R]R
&   ]! RRRR7      t
R]R&   RRRR/tRtR# )ResourcePermissionsa  Iframe sandbox permissions for MCP App resources.

Each field, when set (typically to ``{}``), requests that the host
grant the corresponding Permission Policy feature to the sandboxed
iframe.  Hosts MAY honour these; apps should use JS feature detection
as a fallback.
NzRequest camera accessr   r   zdict[str, Any] | NonecamerazRequest microphone access
microphonezRequest geolocation accessgeolocationclipboardWritezRequest clipboard-write accessr
   clipboard_writer   Tr   r   r   )r   r   r   r   r   r   r&   r   r'   r(   r*   r   r    r   r!   r"   r$   r$   2   s     %*"9%F!  )."=)J%  */">*K&  .34.O*  'gw?Lr!   r$   c                      ] tR t^Mt$ Rt]! RRRR7      tR]R&   ]! RRR	7      tR
]R&   ]! RRR	7      t	R]R&   ]! RRR	7      t
R]R&   ]! RRR	7      tR]R&   ]! RRRR7      tR]R&   RRRR/tRtR# )	AppConfiga  Configuration for MCP App tools and resources.

Controls how a tool or resource participates in the MCP Apps extension.
On tools, ``resource_uri`` and ``visibility`` specify which UI resource
to render and where the tool appears.  On resources, those fields must
be left unset (the resource itself is the UI).

All fields use ``exclude_none`` serialization so only explicitly-set
values appear on the wire.  Aliases match the MCP Apps wire format
(camelCase).
NresourceUriz<URI of the UI resource (typically ui:// scheme). Tools only.r
   
str | Noneresource_uriz@Where this tool is visible: 'app', 'model', or both. Tools only.r%   z$list[Literal['app', 'model']] | None
visibilityz*Content Security Policy for the app iframezResourceCSP | NonecspzIframe sandbox permissionszResourcePermissions | NonepermissionszDomain for the iframedomainprefersBorderz'Whether the UI prefers a visible borderzbool | Noneprefers_borderr   Tr   r   r   )r   r   r   r   r   r   r/   r   r0   r1   r2   r3   r5   r   r    r   r!   r"   r,   r,   M   s    
  %R L* 
 8=V8J4  $"NC	  /4">/K+  t9PQFJQ"'=#NK  'gw?Lr!   r,   c                    V ^8  d   QhRRRR/# )   appzAppConfig | dict[str, Any]returnzdict[str, Any]r   )formats   "r"   __annotate__r;   s   s      !;  r!   c                X    \        V \        4      '       d   V P                  RRR7      # V # )zHConvert an AppConfig or dict to the wire-format dict for ``meta["ui"]``.T)by_aliasexclude_none)
isinstancer,   
model_dump)r8   s   &r"   app_config_to_meta_dictrA   s   s'    #y!!~~t$~??Jr!   c               $    V ^8  d   QhRRRRRR/# )r7   uristrexplicit_mime_typer.   r9   r   )r:   s   "r"   r;   r;   z   s!      c z j r!   c                h    Ve   V# V P                  4       P                  R4      '       d   \        # R# )a  Return the appropriate MIME type for a resource URI.

For ``ui://`` scheme resources, defaults to ``UI_MIME_TYPE`` when no
explicit MIME type is provided. This ensures UI resources are correctly
identified regardless of how they're registered (via FastMCP.resource,
the standalone @resource decorator, or resource templates).

Args:
    uri: The resource URI string
    explicit_mime_type: The MIME type explicitly provided by the user

Returns:
    The resolved MIME type (explicit value, UI default, or None)
Nzui://)lower
startswithUI_MIME_TYPE)rC   rE   s   &&r"   resolve_ui_mime_typerJ   z   s0     %!!
yy{g&&r!   N)r   
__future__r   typingr   r   pydanticr   r   UI_EXTENSION_IDrI   r   r$   r,   rA   rJ   r   r!   r"   <module>rO      sU    #  %.*@) @@@) @6#@	 #@Lr!   