()
| 1762 | * any capabilities exist. |
| 1763 | */ |
| 1764 | const appsSupported = (): boolean => { |
| 1765 | const live = server.server.getClientCapabilities(); |
| 1766 | if (!live) return appsEnabled; |
| 1767 | const uiCapability = getUiCapability( |
| 1768 | live as ClientCapabilities & { extensions?: Record<string, unknown> }, |
| 1769 | ); |
| 1770 | const supported = Boolean(uiCapability?.mimeTypes?.includes(RESOURCE_MIME_TYPE)); |
| 1771 | // Reconcile the tools too: a restore that re-established capabilities |
| 1772 | // without firing `oninitialized` would otherwise render inline while |
| 1773 | // `execute-action` — the tool that rendered app calls back into — stayed |
| 1774 | // hidden, leaving the widget unable to do anything. |
| 1775 | if (supported !== appsEnabled) applyAppsEnabled(supported); |
| 1776 | return supported; |
| 1777 | }; |
| 1778 | |
| 1779 | const deliverArtifact = (input: { |
| 1780 | readonly code: string; |
no test coverage detected