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