()
| 2320 | * any capabilities exist. |
| 2321 | */ |
| 2322 | const appsSupported = (): boolean => { |
| 2323 | const live = server.server.getClientCapabilities(); |
| 2324 | if (!live) return appsEnabled; |
| 2325 | const uiCapability = getUiCapability( |
| 2326 | live as ClientCapabilities & { extensions?: Record<string, unknown> }, |
| 2327 | ); |
| 2328 | const supported = Boolean(uiCapability?.mimeTypes?.includes(RESOURCE_MIME_TYPE)); |
| 2329 | // Reconcile the tools too: a restore that re-established capabilities |
| 2330 | // without firing `oninitialized` would otherwise render inline while |
| 2331 | // `execute-action` — the tool that rendered app calls back into — stayed |
| 2332 | // hidden, leaving the widget unable to do anything. |
| 2333 | if (supported !== appsEnabled) applyAppsEnabled(supported); |
| 2334 | return supported; |
| 2335 | }; |
| 2336 | |
| 2337 | const deliverArtifact = (input: { |
| 2338 | readonly code: string; |
no test coverage detected