@aceshooting/lyra-ui 30.1.0 → 30.3.0
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/CHANGELOG.md +92 -0
- package/dist/ai/adapters/a2ui.d.ts +10 -4
- package/dist/ai/adapters/a2ui.js +1 -1
- package/dist/ai/adapters/ag-ui.d.ts +17 -4
- package/dist/ai/adapters/ag-ui.js +1 -1
- package/dist/ai/adapters/ai-sdk.js +1 -1
- package/dist/ai/runtime.js +1 -1
- package/dist/components/agent-tools/mcp-app/mcp-app-protocol.d.ts +15 -0
- package/dist/components/agent-tools/mcp-app/mcp-app-protocol.js +36 -0
- package/dist/components/agent-tools/mcp-app/mcp-app.class.d.ts +31 -4
- package/dist/components/agent-tools/mcp-app/mcp-app.class.js +4 -4
- package/dist/components/agent-tools/span-waterfall/span-waterfall.class.js +1 -1
- package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
- package/dist/components/agent-tools/trace-tree/trace-tree.class.js +2 -2
- package/dist/components/charts/chart/chart-prepared-data.d.ts +3 -1
- package/dist/components/charts/chart/chart-prepared-data.js +1 -1
- package/dist/components/charts/chart/chart.class.js +2 -2
- package/dist/components/charts/chart/lite-chart.class.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +2 -2
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +13 -4
- package/dist/components/conversation/message-parts/message-parts.class.js +12 -10
- package/dist/components/conversation/message-parts/message-parts.d.ts +1 -1
- package/dist/components/conversation/message-parts/message-parts.js +1 -1
- package/dist/components/forms/checkbox/checkbox.class.d.ts +1 -1
- package/dist/components/forms/checkbox/checkbox.class.js +2 -2
- package/dist/components/forms/combobox/option.class.d.ts +1 -1
- package/dist/components/forms/combobox/option.class.js +2 -2
- package/dist/components/forms/radio/radio.class.d.ts +1 -1
- package/dist/components/forms/radio/radio.class.js +1 -1
- package/dist/components/forms/select/select.class.js +1 -1
- package/dist/components/forms/switch/switch.class.d.ts +1 -1
- package/dist/components/forms/switch/switch.class.js +1 -1
- package/dist/components/media/file-input/file-input.styles.js +1 -1
- package/dist/components/media/map/map-anchor-controller.js +1 -1
- package/dist/components/media/map/map-control-chrome.js +1 -0
- package/dist/components/media/map/map-control-options.d.ts +6 -2
- package/dist/components/media/map/map-control-options.js +1 -1
- package/dist/components/media/map/map-controls-lifecycle.js +1 -1
- package/dist/components/media/map/map-controls-readiness.js +1 -0
- package/dist/components/media/map/map.class.d.ts +39 -2
- package/dist/components/media/map/map.class.js +13 -7
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/components/viewers/model-viewer/model-viewer-loader.js +1 -1
- package/dist/components/viewers/model-viewer/model-viewer.class.js +1 -1
- package/dist/components/viewers/pptx-viewer/pptx-viewer.class.d.ts +11 -11
- package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +1 -1
- package/dist/events.d.ts +10 -1
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/accessible-text-controller.js +1 -1
- package/dist/internal/anchored-overlay-runtime.js +1 -1
- package/dist/internal/default-label-forwarding.js +1 -0
- package/dist/internal/hierarchy-summary-source.js +1 -0
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/positioner.d.ts +8 -0
- package/dist/internal/positioner.js +1 -1
- package/dist/internal/scoped-definitions.generated.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/llms/components/lr-file-input.md +5 -0
- package/llms/components/lr-map.md +87 -14
- package/llms/components/lr-mcp-app.md +94 -4
- package/llms/components/lr-message-parts.md +18 -0
- package/llms/components/lr-pptx-viewer.md +9 -5
- package/llms/components/lr-select.md +3 -2
- package/llms/index.md +1 -1
- package/llms/peers.md +1 -1
- package/llms/shared/ai-and-peers.md +77 -3
- package/llms/shared/events-and-types.md +25 -1
- package/llms/shared/localization-and-rtl.md +29 -0
- package/llms/shared.md +131 -4
- package/locales.json +1 -1
- package/package.json +12 -8
- package/registrations.json +1 -1
- package/skills/compose-lyra-interfaces/SKILL.md +5 -3
- package/skills/compose-lyra-interfaces/references/composition-patterns.md +8 -1
- package/skills/lyra-ui/SKILL.md +16 -8
- package/skills/lyra-ui/lyra-gen.md +86 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [media](https://github.com/aceshooting/lyra-ui/blob/main/packages/lyra-ui/llms/media.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** `@aceshooting/lyra-map`, `dompurify`, `maplibre-gl` — see `llms/peers.md`
|
|
12
|
-
- **Themeable via**
|
|
12
|
+
- **Themeable via** 78 parts, 10 custom properties — see this component's own `@csspart`/`@cssprop` list below
|
|
13
13
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
14
14
|
|
|
15
15
|
---
|
|
@@ -63,12 +63,22 @@ style, await `whenIdle()` for the current resource and rendering work. Observe
|
|
|
63
63
|
rejection when replacing styles or disconnecting; a returned `true` from a synchronous command
|
|
64
64
|
means admission, not asynchronous completion.
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
`whenControlsReady(): Promise<void>` waits for native control installation and public chrome hooks,
|
|
67
|
+
including default attribution. Await it after `whenStyleReady()` when measuring or styling installed
|
|
68
|
+
controls. Explicitly disabling all controls resolves after map construction. On a connected deferred
|
|
69
|
+
map, it waits for initialization rather than activating the map. Replacing `controls` or disconnecting
|
|
70
|
+
rejects the pending barrier with `AbortError`; initialization, invalid configuration or control
|
|
71
|
+
loading failure rejects with `MapReadinessError`. A style-only change preserves the controls
|
|
72
|
+
barrier. A completed promise describes its captured configuration; call again after assigning
|
|
73
|
+
`controls`.
|
|
74
|
+
|
|
75
|
+
URL `mapStyle` replacements and new objects on the modular peer use `setStyle(style, { diff: false })`.
|
|
76
|
+
Readiness waits for the replacement's committed `style.load` before capturing its catalog and
|
|
77
|
+
restoring owned layers, images and style overrides. Superseding an unfinished replacement also
|
|
78
|
+
rebuilds the style. This trades style diffs for reliable completion, including unchanged URL
|
|
79
|
+
responses and structurally equal new modular objects. Reassigning the exact same object is a no-op.
|
|
80
|
+
Loaded native MapLibre styles retain synchronous inline diffs. The live peer determines behavior;
|
|
81
|
+
`engine` changes apply after reconnect. Map and camera identity are preserved.
|
|
72
82
|
|
|
73
83
|
**On-demand runtimes:** optional `lr-map` features load their code on first use, so a bundler that
|
|
74
84
|
splits chunks keeps them out of the initial bundle. Drawing and vertex editing load when `drawMode`
|
|
@@ -1037,12 +1047,16 @@ intensity?: LyraMapHeatmapZoomValue; opacity?: number }`, where `LyraMapHeatmapZ
|
|
|
1037
1047
|
LyraMapNavigationControlOptions; scale?: boolean | LyraMapScaleControlOptions;
|
|
1038
1048
|
geolocate?: boolean | LyraMapGeolocateControlOptions;
|
|
1039
1049
|
attribution?: boolean | LyraMapAttributionControlOptions }`, with
|
|
1040
|
-
`LyraMapNavigationControlOptions { position?: LyraMapControlPosition }`,
|
|
1041
|
-
`LyraMapScaleControlOptions { position?: LyraMapControlPosition; unit?: LyraMapScaleUnit }`,
|
|
1050
|
+
`LyraMapNavigationControlOptions { position?: LyraMapControlPosition; order?: number }`,
|
|
1051
|
+
`LyraMapScaleControlOptions { position?: LyraMapControlPosition; order?: number; unit?: LyraMapScaleUnit }`,
|
|
1042
1052
|
`LyraMapControlPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'` and
|
|
1043
1053
|
`LyraMapScaleUnit = 'metric' | 'imperial'`. The element adds the engine's standard controls once
|
|
1044
1054
|
the map exists, moves one whose corner changes, replaces one whose other options change and removes one that
|
|
1045
1055
|
is dropped, so an application no longer imports control classes and calls `map.addControl()`.
|
|
1056
|
+
All four control option objects accept finite `order` numbers, defaulting to `0`. Within each
|
|
1057
|
+
corner, ascending order controls both visual and keyboard order; ties retain the existing
|
|
1058
|
+
navigation, scale, geolocate, attribution sequence. Changing only order moves existing controls
|
|
1059
|
+
without reconstructing them. Invalid order values produce localized configuration feedback.
|
|
1046
1060
|
`true` takes the defaults (navigation `'top-right'`, scale `'bottom-left'` and `'metric'`); an
|
|
1047
1061
|
unknown navigation/scale position or unit falls back to its default. Malformed geolocate or
|
|
1048
1062
|
attribution options are rejected with localized feedback. The control code comes from the selected
|
|
@@ -1063,7 +1077,7 @@ intensity?: LyraMapHeatmapZoomValue; opacity?: number }`, where `LyraMapHeatmapZ
|
|
|
1063
1077
|
mapElement.controls = {
|
|
1064
1078
|
navigation: { position: 'bottom-left' },
|
|
1065
1079
|
scale: { position: 'bottom-left' },
|
|
1066
|
-
geolocate: { position: 'bottom-left' },
|
|
1080
|
+
geolocate: { position: 'bottom-left', order: -1 },
|
|
1067
1081
|
attribution: { position: 'bottom-left', customAttribution: [
|
|
1068
1082
|
'Survey team', { label: 'Data contributors', url: 'https://example.com/credits' }
|
|
1069
1083
|
] }
|
|
@@ -1417,11 +1431,20 @@ which only reaches rows projected from `legend`.
|
|
|
1417
1431
|
`legend-hi`, `legend-ticks`, `legend-tick`, `legend-derived`, `legend-limit`, `anchor`,
|
|
1418
1432
|
`anchor-close`, `marker`, `popup`, `popup-content`, `popup-close-button`, `attribution`,
|
|
1419
1433
|
`attribution-toggle`, `attribution-content`, `navigation`, `zoom-in`, `zoom-out`, `compass`, `scale`,
|
|
1420
|
-
`geolocate`, `geolocate-control`,
|
|
1434
|
+
`geolocate`, `geolocate-control`, `controls`, `controls-top`, `controls-bottom`, `controls-top-left`, `controls-top-right`,
|
|
1435
|
+
`controls-bottom-left`, `controls-bottom-right`, `zoom-in-icon`, `zoom-out-icon`, `compass-icon`,
|
|
1436
|
+
`geolocate-icon`, `geolocate-waiting`, `geolocate-active`, `geolocate-background`, `geolocate-error`,
|
|
1437
|
+
`attribution-link`, `attribution-expanded`, `controls-attribution-expanded`,
|
|
1421
1438
|
`configuration-error`, `error`.
|
|
1422
|
-
Before native construction, `initialization-placeholder` is the stable surface
|
|
1423
|
-
`initialization-
|
|
1424
|
-
`
|
|
1439
|
+
Before native construction, `initialization-placeholder` is the stable surface and
|
|
1440
|
+
`initialization-skeleton` is its decorative skeleton. `initialization-controls` also exposes `controls`;
|
|
1441
|
+
its rows expose `controls-top` and `controls-bottom`, and each `initialization-corner` also exposes its
|
|
1442
|
+
matching corner token. `initialization-control` outlines explicitly requested controls, with
|
|
1443
|
+
`initialization-navigation`, `initialization-scale`, `initialization-geolocate` or
|
|
1444
|
+
`initialization-attribution` identifying the kind. Placeholder corners and order follow those options;
|
|
1445
|
+
implicit default attribution has no placeholder. For `initialization="interaction"`,
|
|
1446
|
+
`initialization-activate` starts the map and `initialization-activate-label` styles its visible label.
|
|
1447
|
+
Hiding that label retains the button's localized accessible name. Pick mode renders `pick-controls` with
|
|
1425
1448
|
`pick-center` and `pick-cancel`; draw mode renders `drawing-controls` with `drawing-add`,
|
|
1426
1449
|
`drawing-undo`, `drawing-complete`, `drawing-cancel` and the `drawing-status` vertex count (plus
|
|
1427
1450
|
`drawing-summary` with `drawingMeasurements`), vertex editing renders `drawing-handles` containing
|
|
@@ -1458,6 +1481,55 @@ lr-map::part(attribution-content) {
|
|
|
1458
1481
|
|
|
1459
1482
|
Choose panel bounds that fit the map's allocation and keep required provider credits reachable.
|
|
1460
1483
|
|
|
1484
|
+
`controls` targets the native control container; `controls-top` and `controls-bottom` are independent
|
|
1485
|
+
row grids. `controls-top-left`, `controls-top-right`,
|
|
1486
|
+
`controls-bottom-left` and `controls-bottom-right` target its corners. Their names match the control
|
|
1487
|
+
position vocabulary; positioning follows the inherited text direction. Use these parts for corner
|
|
1488
|
+
insets, gaps and responsive layouts. Icon parts target the native spans: styling `compass-icon`
|
|
1489
|
+
preserves the engine's bearing rotation. Geolocation button state adds `geolocate-waiting`,
|
|
1490
|
+
`geolocate-active`, `geolocate-background` or `geolocate-error` tokens as applicable.
|
|
1491
|
+
`attribution-link` reaches each credit link. While credits are expanded, `attribution-expanded`
|
|
1492
|
+
is added to the attribution wrapper, toggle and content, allowing each surface to be styled directly.
|
|
1493
|
+
|
|
1494
|
+
`--lr-map-scale-bar-display` defaults to `block`; set it to `none` to hide the ruler while retaining
|
|
1495
|
+
the distance text. For example:
|
|
1496
|
+
|
|
1497
|
+
```css
|
|
1498
|
+
lr-map { --lr-map-scale-bar-display: none; }
|
|
1499
|
+
lr-map::part(controls-bottom-right) { gap: var(--lr-space-s); }
|
|
1500
|
+
lr-map::part(compass-icon) { color: var(--lr-color-brand); }
|
|
1501
|
+
lr-map::part(attribution-link) { padding-inline: var(--lr-space-xs); }
|
|
1502
|
+
lr-map::part(attribution-toggle) { background: transparent; }
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
Corner spacing also includes each control's margin; reset those public wrapper margins when
|
|
1506
|
+
replacing them with a corner gap. Keep required credits visible and controls within the map.
|
|
1507
|
+
|
|
1508
|
+
When any attribution in the container is expanded, `controls-attribution-expanded` is added to
|
|
1509
|
+
that container, both rows and all four corners. Compound part selectors can therefore reflow the
|
|
1510
|
+
corners without observing shadow DOM. This bounded example stacks the two bottom corners on narrow
|
|
1511
|
+
viewports; choose the breakpoint and footer reservation for the application:
|
|
1512
|
+
|
|
1513
|
+
```css
|
|
1514
|
+
@media (max-width: 40rem) {
|
|
1515
|
+
lr-map::part(controls controls-attribution-expanded) {
|
|
1516
|
+
display: flex;
|
|
1517
|
+
flex-direction: column;
|
|
1518
|
+
justify-content: flex-end;
|
|
1519
|
+
gap: var(--lr-space-s);
|
|
1520
|
+
}
|
|
1521
|
+
lr-map::part(controls-top controls-attribution-expanded),
|
|
1522
|
+
lr-map::part(controls-bottom controls-attribution-expanded) { display: contents; }
|
|
1523
|
+
lr-map::part(controls-bottom-left controls-attribution-expanded),
|
|
1524
|
+
lr-map::part(controls-bottom-right controls-attribution-expanded) { position: static; }
|
|
1525
|
+
lr-map::part(controls-bottom-left controls-attribution-expanded) { align-self: flex-start; }
|
|
1526
|
+
lr-map::part(controls-bottom-right controls-attribution-expanded) { align-self: flex-end; }
|
|
1527
|
+
}
|
|
1528
|
+
```
|
|
1529
|
+
|
|
1530
|
+
Map content is clipped to its allocation. The host application owns stacking relative to page
|
|
1531
|
+
siblings and the stacking contexts established by its ancestors.
|
|
1532
|
+
|
|
1461
1533
|
`legend` is a localized `role="group"` containing a real list associated to the map canvas with
|
|
1462
1534
|
`aria-describedby`; each entry is a `listitem`, decorative swatches are inert/accessibility-hidden,
|
|
1463
1535
|
and the overlay is bounded to the map allocation with scrolling and long-label wrapping.
|
|
@@ -1620,6 +1692,7 @@ mapEl.overlays = {
|
|
|
1620
1692
|
};
|
|
1621
1693
|
document.body.append(mapEl);
|
|
1622
1694
|
await mapEl.whenStyleReady();
|
|
1695
|
+
await mapEl.whenControlsReady();
|
|
1623
1696
|
|
|
1624
1697
|
async function replaceBasemap(style: LyraMapStyleSpecification): Promise<void> {
|
|
1625
1698
|
mapEl.mapStyle = style;
|
|
@@ -21,7 +21,94 @@ with a trusted CSP meta placed before every caller-controlled HTML token; commen
|
|
|
21
21
|
head decoys therefore cannot bypass the policy. Remote documents accept only relative or HTTP(S)
|
|
22
22
|
URLs and use a fixed `no-referrer` policy; active-document `data:` and `blob:` URLs are rejected.
|
|
23
23
|
The frame can only request tool calls, messages, navigation, logs, and clamped resizing through
|
|
24
|
-
typed events.
|
|
24
|
+
typed events. Browser API permissions are denied unless explicitly enabled in `resource.permissions`.
|
|
25
|
+
|
|
26
|
+
The default `protocol="legacy"` uses Lyra's existing nonce/port envelope. Set
|
|
27
|
+
`protocol="mcp-apps"` for the supported JSON-RPC host subset of the
|
|
28
|
+
[MCP Apps 2026-01-26 protocol](https://github.com/modelcontextprotocol/ext-apps/blob/v2.0.3/specification/2026-01-26/apps.mdx).
|
|
29
|
+
The wire contract is pinned against the public `@modelcontextprotocol/ext-apps` 2.0.3 types.
|
|
30
|
+
An SDK-built interoperability fixture exercises initialization, tools, resources, context, text messages,
|
|
31
|
+
links, inline display fallback, cancellation, error responses and teardown with `App` from the pinned
|
|
32
|
+
SDK. This is a bounded host implementation, not a claim of full MCP Apps conformance: server
|
|
33
|
+
connections and discovery execution belong to the embedding application; sampling, downloads,
|
|
34
|
+
fullscreen/PiP presentation and host calls into app-exposed tools are unsupported. Unsupported
|
|
35
|
+
optional host capabilities are omitted from the initialization result, even if untyped input offers
|
|
36
|
+
them; their incoming requests fail with method-not-found and do not dispatch host work. App-exposed
|
|
37
|
+
tools use the separate app capability direction: advertising them does not grant server-tool access,
|
|
38
|
+
and this host does not discover or invoke them.
|
|
39
|
+
|
|
40
|
+
**Official protocol mode:**
|
|
41
|
+
|
|
42
|
+
- `hostCapabilities: McpAppHostCapabilities = {}` (attribute: false) is a clone-owned grant snapshot.
|
|
43
|
+
Supported grants are `serverTools: {}`, `serverResources: {}`, `openLinks: {}`, `logging: {}`,
|
|
44
|
+
`message: { text: {} }`, and
|
|
45
|
+
`updateModelContext: { text?: {}, structuredContent?: {} }`. Unadvertised methods return JSON-RPC
|
|
46
|
+
method-not-found. Changing capabilities or protocol remounts the app and cancels pending work.
|
|
47
|
+
- The app sends `ui/initialize`; the host returns the pinned revision, host identity, supported
|
|
48
|
+
capabilities, locale and inline display context. The app's `ui/notifications/initialized`
|
|
49
|
+
notification emits `lr-mcp-initialized` with `{ uri, frameGeneration }`. Host notifications are
|
|
50
|
+
rejected before that point; `lr-mcp-ready` alone only reports frame load.
|
|
51
|
+
- `lr-mcp-request` carries `{ requestId, requestToken, method, params, frameGeneration, signal }` for `tools/call`,
|
|
52
|
+
`tools/list`, `resources/list`, `resources/templates/list`, `resources/read`, `ui/message`,
|
|
53
|
+
`ui/open-link`, and `ui/update-model-context`. IDs retain their string
|
|
54
|
+
or numeric type, including `0`. The host authorizes and executes each request. Links must be
|
|
55
|
+
absolute HTTP(S) or mailto; message content supports text blocks only. Resource methods delegate
|
|
56
|
+
authorization and actual server reads to the host listener; they never fetch on their own.
|
|
57
|
+
- `ui/request-display-mode` accepts the standard mode vocabulary and returns `{ mode: "inline" }`,
|
|
58
|
+
the only display mode advertised by this host, including when the app requests fullscreen or PiP.
|
|
59
|
+
- `postMcpResponse(requestId, options): boolean` requires `{ frameGeneration, requestToken, result }` or
|
|
60
|
+
`{ frameGeneration, requestToken, error: { code, message, data? } }`. Results are objects. Unknown, duplicate,
|
|
61
|
+
cancelled, timed-out and stale replies return `false`. Each event has a fresh opaque `requestToken`;
|
|
62
|
+
return it unchanged so a late reply cannot answer a newer request that reuses the same wire ID.
|
|
63
|
+
No external action is automatic.
|
|
64
|
+
- `postMcpNotification(method, params, frameGeneration): boolean` supports
|
|
65
|
+
`ui/notifications/tool-input`, `tool-input-partial`, `tool-result`, `tool-cancelled` and
|
|
66
|
+
`host-context-changed` under that same prefix. Keep the initialized event's generation for
|
|
67
|
+
asynchronous deliveries. `postHostContext()` sends a context-changed notification in this mode.
|
|
68
|
+
- `teardownApp(): Promise<boolean>` sends `ui/resource-teardown` and waits at most one second for
|
|
69
|
+
acknowledgement. Await it before removing the resource when graceful cleanup is needed. The
|
|
70
|
+
session closes regardless of acknowledgement. Abrupt removal closes immediately.
|
|
71
|
+
- Each pending request has a 30-second deadline; cancellation, timeout and teardown abort its
|
|
72
|
+
`signal`. There are at most 64 pending requests; messages are bounded to 10,000 values, 32 nesting
|
|
73
|
+
levels and 1,048,576 UTF-16 code units across keys and strings. This bounds processing and retained requests, not the
|
|
74
|
+
browser's initial structured-clone allocation. Optional undefined object members are omitted
|
|
75
|
+
during bounded JSON normalization; sparse/undefined arrays, cyclic values and accessors are rejected.
|
|
76
|
+
|
|
77
|
+
In official mode, inline resources can load external JavaScript and stylesheets only from the
|
|
78
|
+
HTTP(S) origins explicitly granted in `resource.csp.resourceDomains`. The embedding host must vet
|
|
79
|
+
those origins before assigning the resource; server-provided metadata is not itself authorization.
|
|
80
|
+
Empty, malformed and unmatched origins do not enable external assets. This adds no evaluation,
|
|
81
|
+
blob-script or wildcard allowances. Legacy mode keeps script and stylesheet execution inline-only,
|
|
82
|
+
even when its resource domains permit images, fonts or media. Remote `src` resources still follow
|
|
83
|
+
the remote server's own CSP rather than receiving an injected policy.
|
|
84
|
+
|
|
85
|
+
The official app runs in an inner opaque-origin iframe within a trusted outer sandbox proxy.
|
|
86
|
+
The trusted proxy enforces an ancestor CSP: inline app navigation is limited to the explicitly
|
|
87
|
+
approved `frameDomains` (none by default), including redirects. For remote `src`, the ancestor
|
|
88
|
+
permits only its initial HTTP(S) origin. This blocks unapproved destinations before a network
|
|
89
|
+
request is sent; the inner document cannot remove or relax the ancestor policy. Inline srcdoc
|
|
90
|
+
frames inherit the approved policy, including any approved nested-frame origins.
|
|
91
|
+
The app uses standard parent-window JSON-RPC messages; the proxy checks the app window and opaque
|
|
92
|
+
origin and relays through the host's document-bound message port. Loaded inner-frame navigation
|
|
93
|
+
closes that relay and remounts the sandbox. Treat all app documents and navigations as untrusted;
|
|
94
|
+
window transport does not authenticate a document during the interval before a permitted navigation
|
|
95
|
+
loads. The origin allowlist constrains that interval but does not prove document identity. Do not deliver credentials or secrets as host context or tool data.
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
element.protocol = "mcp-apps";
|
|
99
|
+
element.hostCapabilities = { serverTools: {} };
|
|
100
|
+
element.addEventListener("lr-mcp-request", async event => {
|
|
101
|
+
const { requestId, requestToken, method, params, frameGeneration, signal } = event.detail;
|
|
102
|
+
if (method !== "tools/call") {
|
|
103
|
+
element.postMcpResponse(requestId, {
|
|
104
|
+
frameGeneration, requestToken, error: { code: -32601, message: "Unsupported method" }
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const result = await callAuthorizedTool(params, { signal });
|
|
109
|
+
element.postMcpResponse(requestId, { frameGeneration, requestToken, result });
|
|
110
|
+
});
|
|
111
|
+
```
|
|
25
112
|
|
|
26
113
|
**Properties:**
|
|
27
114
|
|
|
@@ -51,15 +138,18 @@ typed events. Capabilities are denied unless explicitly enabled in `resource.per
|
|
|
51
138
|
request with exactly one of `{ frameGeneration, result }` or `{ frameGeneration, error }`. Missing,
|
|
52
139
|
stale, or ambiguous correlation fails closed. Both methods are no-ops before a frame exists.
|
|
53
140
|
|
|
54
|
-
|
|
141
|
+
In legacy mode, the initial `host-context` message includes a document-bound nonce and transfers a `MessagePort` to
|
|
55
142
|
the executable document; that port is the only channel (window messages are ignored). A same-frame
|
|
56
143
|
navigation closes the port, invalidates the nonce and generation, and mounts a fresh sandbox before
|
|
57
144
|
host data can be delivered.
|
|
58
145
|
|
|
59
146
|
**Exported types:** `McpAppResource`, `McpAppCsp`, `McpAppPermissions`,
|
|
60
|
-
`McpAppToolCallDetail`, `McpAppToolResultOptions`,
|
|
147
|
+
`McpAppToolCallDetail`, `McpAppToolResultOptions`, `McpAppProtocol`, `McpAppHostCapabilities`,
|
|
148
|
+
`McpAppRequestId`, `McpAppRequestMethod`, `McpAppRequestDetail`, `McpAppResponseOptions`,
|
|
149
|
+
`McpAppNotificationMethod`, and `LyraMcpAppEventMap`.
|
|
61
150
|
|
|
62
|
-
**Events:** `lr-mcp-ready` (`{ uri }`), `lr-mcp-
|
|
151
|
+
**Events:** `lr-mcp-ready` (`{ uri }`), `lr-mcp-initialized` (`{ uri, frameGeneration }`),
|
|
152
|
+
`lr-mcp-request` (`{ requestId, requestToken, method, params, frameGeneration, signal }`), `lr-mcp-tool-call`
|
|
63
153
|
(`{ requestId?, name, args, frameGeneration }`), `lr-mcp-send-message` (`{ message }`),
|
|
64
154
|
`lr-mcp-open-link` (`{ href }`, an absolute http(s) or mailto URL), `lr-mcp-log`
|
|
65
155
|
(`{ level, value }`), and `lr-mcp-resize` (`{ height }`). These are host-authorized requests; the
|
|
@@ -22,6 +22,11 @@ Built-in text and reasoning Markdown receives each part's `state === 'streaming'
|
|
|
22
22
|
accumulated plain text without parsing or highlighting by default. The `streaming-render` property
|
|
23
23
|
can opt those parts into progressive Markdown. Replacing that same-id part with `state: 'complete'`
|
|
24
24
|
parses and renders the final content.
|
|
25
|
+
Built-in reasoning, tool, citation, attachment, JSON, widget and retry-button renderers register
|
|
26
|
+
on first use. A localized loading placeholder is visible while the import is pending; a failed
|
|
27
|
+
import shows a localized error and emits `lr-render-error`. Text-only messages do not load those
|
|
28
|
+
renderer implementations. Audio uses the browser's native audio element. A custom `renderPart`
|
|
29
|
+
that replaces a part does not load that part's built-in renderer.
|
|
25
30
|
Citation badge ranks are precomputed in one linear pass per render, rather than rescanning and
|
|
26
31
|
allocating every preceding part for each citation in a citation-heavy or growing message.
|
|
27
32
|
|
|
@@ -58,6 +63,19 @@ default — every instance carries `tool-display="chip"` until set, like `conten
|
|
|
58
63
|
`renderPart` is called exactly once per rendered part, in order, in both tool displays, and its
|
|
59
64
|
output is the host's own: it is never masked by `redactedFields`.
|
|
60
65
|
|
|
66
|
+
`widgetRegistry: LyraWidgetTypeRegistry = DEFAULT_WIDGET_TYPE_REGISTRY` (property only) forwards
|
|
67
|
+
an immutable registry created by `createWidgetTypeRegistry()` to every built-in widget part.
|
|
68
|
+
`widgetBindingState?: unknown` (property only) forwards explicit controlled state; `null` is a real
|
|
69
|
+
value. This state takes a bounded, clone-owned snapshot on assignment. Handle
|
|
70
|
+
`lr-widget-state-change` and reassign the next state yourself. Parts share this state, so their
|
|
71
|
+
JSON Pointer bindings must refer to the intended host-owned paths. Registry entries only describe
|
|
72
|
+
allowed types: applications must still register custom mapped components using granular imports.
|
|
73
|
+
Widget documents are cached by the unique part id and their bounded snapshot content. Unrelated
|
|
74
|
+
text writes preserve the existing widget document, while a changed widget root invalidates it.
|
|
75
|
+
Removing a part, windowing it out, or disconnecting releases its cached document. This cache does
|
|
76
|
+
not change widget-v2 validation, identity rejection, or controlled-state ownership.
|
|
77
|
+
|
|
78
|
+
|
|
61
79
|
Unsupported direct or `content-mode` attribute values normalize and reflect as `markdown`;
|
|
62
80
|
unsupported `tool-display` values normalize and reflect as `chip`.
|
|
63
81
|
|
|
@@ -103,11 +103,15 @@ wants that deferred too can instead import
|
|
|
103
103
|
same registration lazily and exports `PPTX_VIEWER_TAG` (`'lr-pptx-viewer'`) as a stable reference to
|
|
104
104
|
the tag it eventually registers.
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
`documentPreviewResourceTooLarge` message
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
Before the renderer opens an archive, remote resources are capped at 25 MB and measured ZIP
|
|
107
|
+
expansion at 256 MB. Exceeding either replaces the presentation with the localized
|
|
108
|
+
`documentPreviewResourceTooLarge` message. The optional peer must expose complete recommended
|
|
109
|
+
ZIP limits within Lyra's safety ceilings; missing, malformed, or more-permissive limits make it
|
|
110
|
+
unavailable and the viewer fails closed.
|
|
111
|
+
|
|
112
|
+
Initial rendering, slide navigation, and thumbnails block presentation-linked external images,
|
|
113
|
+
background and shape/text picture fills, audio, video, and posters. Embedded package media remains
|
|
114
|
+
available; linked media is omitted or replaced by a placeholder. Click-driven hyperlinks are unchanged.
|
|
111
115
|
|
|
112
116
|
The peer instance is immediately wrapped in a validated `PptxViewerAdapter`; the component observes
|
|
113
117
|
only readonly slide metadata, complete-model search/navigation/highlight/thumbnail capabilities and
|
|
@@ -545,8 +545,9 @@ purposes.
|
|
|
545
545
|
`defaultSelected`/attribute changes update that reset baseline without clobbering a dirty live
|
|
546
546
|
selection; user picks and direct `option.selected` writes remain live-only and never rewrite the
|
|
547
547
|
attribute/default.
|
|
548
|
-
- `aria-required` on the trigger reflects `required` immediately; `aria-invalid`
|
|
549
|
-
|
|
548
|
+
- `aria-required` on the trigger reflects `required` immediately; `aria-invalid` and `data-invalid`
|
|
549
|
+
reveal a constraint error after blur, `reportValidity()` or a native submission attempt.
|
|
550
|
+
A silent `checkValidity()` leaves a pristine control unchanged; `form.reset()` restores that state.
|
|
550
551
|
Blurring the trigger (Tab away) closes an open listbox, the same as a native `<select>`'s popup,
|
|
551
552
|
without restoring focus and undoing the browser's native Tab/Shift+Tab destination.
|
|
552
553
|
- The trigger's accessible name now checks a host-level `aria-label` attribute first, before falling
|
package/llms/index.md
CHANGED
|
@@ -241,7 +241,7 @@ Optional peers: `llms/peers.md`. Safe `wa-*`/`sl-*` migration: `llms/migration.m
|
|
|
241
241
|
- `lr-calendar-viewer` · lr-calendar-viewer.js · `stable` since `4.0.0` — Parses `.ics` calendars with the optional `ical.js` peer and renders each VEVENT as plain text, preserving summaries, DATE/DATE-TIME...
|
|
242
242
|
- `lr-archive-viewer` · lr-archive-viewer.js · `stable` since `4.0.0` — Lists names and declared uncompressed sizes in a ZIP archive without rendering entry contents or loading an archive parser.
|
|
243
243
|
- `lr-ebook-viewer` · lr-ebook-viewer.js · `stable` since `4.0.0` — Renders an EPUB with the optional `epubjs` peer.
|
|
244
|
-
- `lr-pptx-viewer` · lr-pptx-viewer.js · `stable` since `4.0.0` — Best-effort client-side PPTX viewer
|
|
244
|
+
- `lr-pptx-viewer` · lr-pptx-viewer.js · `stable` since `4.0.0` — Best-effort client-side PPTX viewer with optional `@aiden0z/pptx-renderer`.
|
|
245
245
|
- `lr-svg-viewer` · lr-svg-viewer.js · `stable` since `4.0.0` — Fetches and safely renders an inline SVG document.
|
|
246
246
|
- `lr-html-viewer` · lr-html-viewer.js · `stable` since `4.0.0` — Fetches and safely renders an inline HTML document.
|
|
247
247
|
- `lr-dataset-viewer` · lr-dataset-viewer.js · `stable` since `4.0.0` — Fetches delimited text and renders a virtualized, accessible data table: a `role="table"` container with a sticky `role="row"` header...
|
package/llms/peers.md
CHANGED
|
@@ -40,7 +40,7 @@ for the page.
|
|
|
40
40
|
| `@aceshooting/lyra-3d` | `^1.0.0` | `lr-chart-3d`, `lr-embedding-explorer`, `lr-graph`, `lr-image-viewer`, `lr-knowledge-graph-explorer`, `lr-model-viewer`, `lr-video` |
|
|
41
41
|
| `@aceshooting/lyra-flags` | `^2.3.1` | _(loaded by a shared internal module)_ |
|
|
42
42
|
| `@aceshooting/lyra-map` | `^1.3.0` | `lr-geojson-viewer`, `lr-map` |
|
|
43
|
-
| `@aceshooting/lyra-translations` | `^30.
|
|
43
|
+
| `@aceshooting/lyra-translations` | `^30.3.0` | _(not referenced by any component)_ |
|
|
44
44
|
| `@aiden0z/pptx-renderer` | `^1.4.0` | `lr-pptx-viewer` |
|
|
45
45
|
| `@sgratzl/chartjs-chart-boxplot` | `^4.0.0` | `lr-box-plot` |
|
|
46
46
|
| `chart.js` | `^4.0.1` | `lr-bar-chart`, `lr-box-plot`, `lr-bubble-chart`, `lr-chart`, `lr-doughnut-chart`, `lr-histogram`, `lr-line-chart`, `lr-pie-chart`, `lr-polar-area-chart`, `lr-radar-chart`, `lr-scatter-chart` |
|
|
@@ -29,9 +29,12 @@ import {
|
|
|
29
29
|
and strictly increasing `sequence`. A newer generation atomically retires the previous run, while
|
|
30
30
|
an older or replayed cursor is ignored. JSON Patch input is structurally validated and rejects
|
|
31
31
|
prototype-mutating paths.
|
|
32
|
-
- **
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
- **Structural adapters** — `adaptAiSdkMessage()` maps structural provider messages and
|
|
33
|
+
`AgUiStreamAdapter` maps events onto the neutral runtime without pulling vendor SDKs into the
|
|
34
|
+
package. Feed AG-UI events through `new AgUiStreamAdapter().push(event)`; the constructor accepts
|
|
35
|
+
`(limits?: Partial<AgUiAdapterLimits>, options?: AgUiAdapterOptions)`.
|
|
36
|
+
`adaptA2UiSurface()` is a limited A2UI-like graph helper, described below; it does not implement
|
|
37
|
+
the native A2UI protocol or its surface lifecycle.
|
|
35
38
|
Adapter inputs are treated as untrusted data, recursively snapshotted, and rejected without
|
|
36
39
|
throwing when malformed, non-serializable, or over their configured budgets.
|
|
37
40
|
`adaptAiSdkMessage()` maps AI SDK tool states structurally: `output-error` → `error`,
|
|
@@ -71,6 +74,77 @@ import {
|
|
|
71
74
|
These structural, provider-agnostic types correspond to the component inputs above; map a vendor
|
|
72
75
|
payload onto them at the edge.
|
|
73
76
|
|
|
77
|
+
### AG-UI reasoning, activity, and custom events
|
|
78
|
+
|
|
79
|
+
`AgUiLikeEvent` is the structural input shape; `push()` also accepts unknown input for guarded
|
|
80
|
+
admission. Visible `REASONING_MESSAGE_*` events become reasoning parts. `ACTIVITY_SNAPSHOT`
|
|
81
|
+
uses `messageId`, `activityType`, object `content`, and optional `replace`; `replace: false`
|
|
82
|
+
keeps an existing message. `ACTIVITY_DELTA` uses `patch` against a prior snapshot with the same
|
|
83
|
+
`messageId` and `activityType`. Activity content becomes a named data part and remains subject to
|
|
84
|
+
the adapter's snapshot and buffered-content budgets.
|
|
85
|
+
|
|
86
|
+
`CUSTOM` requires `name` and `value` plus explicit host routing. Set
|
|
87
|
+
`AgUiAdapterOptions.customEventTarget` to receive an `AgUiCustomEvent { name, value }` and return
|
|
88
|
+
an `AgUiCustomEventTarget { messageId, partId }`, or `null` to ignore it. Repeated targets replace
|
|
89
|
+
their data part. The callback owns those identities; the application registers named data renderers
|
|
90
|
+
and controls which event names it accepts. An omitted callback ignores custom events. Named data values remain data,
|
|
91
|
+
including values that resemble widgets or actions.
|
|
92
|
+
|
|
93
|
+
`AgUiAdapterLimits.maxBufferedMessages` bounds retained message identities, including activity
|
|
94
|
+
patch baselines; its default is 512. `maxBufferedTools`, `maxToolArgumentBytes`,
|
|
95
|
+
`maxTextDeltaCharacters`, and the inherited provider snapshot limits remain independently bounded.
|
|
96
|
+
Run boundaries and `reset()` clear retained buffers. Compact chunks require upstream expansion;
|
|
97
|
+
phase, encrypted, raw, step, subagent, deprecated thinking, and unknown events are ignored.
|
|
98
|
+
See the [AG-UI adapter guide](https://github.com/aceshooting/lyra-ui/blob/main/docs/ag-ui-adapter.md)
|
|
99
|
+
for event mappings, routing examples, error behavior, and the supported subset.
|
|
100
|
+
|
|
101
|
+
### Limited A2UI-like graph helper
|
|
102
|
+
|
|
103
|
+
`adaptA2UiSurface(surface, typeMap, limits?)` accepts one structural graph:
|
|
104
|
+
`{ rootId, components: [{ id, type, props?, text?, children?: string[], action?: { id, payload? } }], data? }`.
|
|
105
|
+
The host-owned `typeMap` maps those type names to allowlisted widget types. Unsupported native
|
|
106
|
+
A2UI lifecycle messages are not accepted as graphs; the helper does not maintain surfaces,
|
|
107
|
+
process native data-model updates, or provide native A2UI catalog compatibility.
|
|
108
|
+
|
|
109
|
+
The result is `A2UiAdapterResult | null`: a widget-compatible `{ version: '2', root }` plus
|
|
110
|
+
`bindingState` when `surface.data` is present. Assign `bindingState` separately; the widget-v2
|
|
111
|
+
document itself never supplies controlled state. Explicit `data: null` remains `bindingState: null`.
|
|
112
|
+
The original `state` field remains an equal compatibility alias in the helper result; renderers
|
|
113
|
+
do not read it. Input, props, action payloads and state are detached under the adapter budgets.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { adaptA2UiSurface } from "@aceshooting/lyra-ui/ai";
|
|
117
|
+
import "@aceshooting/lyra-ui/components/lr-message-parts.js";
|
|
118
|
+
import "@aceshooting/lyra-ui/components/lr-input.js";
|
|
119
|
+
import { createWidgetTypeRegistry } from "@aceshooting/lyra-ui/components/lr-widget-renderer.js";
|
|
120
|
+
|
|
121
|
+
const registry = createWidgetTypeRegistry([["field", {
|
|
122
|
+
tag: "lr-input", interaction: "control", props: { label: "string", value: "string" },
|
|
123
|
+
bindings: { value: { event: "lr-input" } },
|
|
124
|
+
}]]);
|
|
125
|
+
const adapted = adaptA2UiSurface({
|
|
126
|
+
rootId: "name-field",
|
|
127
|
+
components: [{ id: "name-field", type: "Field", props: {
|
|
128
|
+
label: "Name", value: { $bind: "/name" },
|
|
129
|
+
} }],
|
|
130
|
+
data: { name: "Ada" },
|
|
131
|
+
}, { Field: "field" });
|
|
132
|
+
const message = document.querySelector("lr-message-parts")!;
|
|
133
|
+
if (adapted) {
|
|
134
|
+
message.widgetRegistry = registry;
|
|
135
|
+
message.widgetBindingState = adapted.bindingState;
|
|
136
|
+
message.parts = [{ id: "name-form", type: "data", widget: adapted.root }];
|
|
137
|
+
}
|
|
138
|
+
message.addEventListener("lr-widget-state-change", (event) => {
|
|
139
|
+
if (event.detail.path === "/name") message.widgetBindingState = { name: event.detail.value };
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
For host-specific content, keep using `renderPart(part, index)`: return `undefined` to delegate
|
|
144
|
+
one part, or return a template to replace it and own its interaction. No extra part registry is
|
|
145
|
+
required. Widget type registries control the existing widget renderer's allowed component types,
|
|
146
|
+
separately from the message-part rendering hook.
|
|
147
|
+
|
|
74
148
|
### Interrupting and resuming a streamed run
|
|
75
149
|
|
|
76
150
|
`stream-interrupt` and `stream-resume` are reducer events for the host-owned transport lifecycle;
|
|
@@ -614,11 +614,18 @@ These named interfaces and helper signatures are available to typed integrations
|
|
|
614
614
|
components: A2UiLikeComponent[];
|
|
615
615
|
data?: unknown;
|
|
616
616
|
}`
|
|
617
|
-
`
|
|
617
|
+
`A2UiAdapterResult {
|
|
618
|
+
readonly version: '2';
|
|
619
|
+
readonly root: LyraWidgetNode;
|
|
620
|
+
readonly bindingState?: unknown;
|
|
621
|
+
readonly state?: unknown;
|
|
622
|
+
}`
|
|
623
|
+
`adaptA2UiSurface(surface: unknown, typeMap: unknown, limits: Partial<A2UiAdapterLimits> = {}): A2UiAdapterResult | null`
|
|
618
624
|
|
|
619
625
|
- **`ai-adapters-ag-ui-contracts`** — AI adapter and runtime contracts.
|
|
620
626
|
`AgUiAdapterLimits {
|
|
621
627
|
maxBufferedTools: number;
|
|
628
|
+
maxBufferedMessages: number;
|
|
622
629
|
maxToolArgumentBytes: number;
|
|
623
630
|
maxTextDeltaCharacters: number;
|
|
624
631
|
maxDepth: number;
|
|
@@ -640,6 +647,23 @@ These named interfaces and helper signatures are available to typed integrations
|
|
|
640
647
|
code?: string;
|
|
641
648
|
snapshot?: unknown;
|
|
642
649
|
messages?: unknown[];
|
|
650
|
+
name?: string;
|
|
651
|
+
value?: unknown;
|
|
652
|
+
activityType?: string;
|
|
653
|
+
content?: unknown;
|
|
654
|
+
replace?: boolean;
|
|
655
|
+
patch?: unknown[];
|
|
656
|
+
}`
|
|
657
|
+
`AgUiCustomEvent {
|
|
658
|
+
name: string;
|
|
659
|
+
value: unknown;
|
|
660
|
+
}`
|
|
661
|
+
`AgUiCustomEventTarget {
|
|
662
|
+
messageId: string;
|
|
663
|
+
partId: string;
|
|
664
|
+
}`
|
|
665
|
+
`AgUiAdapterOptions {
|
|
666
|
+
customEventTarget?: (event: AgUiCustomEvent) => AgUiCustomEventTarget | null;
|
|
643
667
|
}`
|
|
644
668
|
|
|
645
669
|
- **`ai-adapters-ai-sdk-contracts`** — AI adapter and runtime contracts.
|
|
@@ -313,6 +313,35 @@ Pluralized messages use one object-valued entry keyed by CLDR categories. A cata
|
|
|
313
313
|
singular and `<key>Plural` entries should fold them into `{ one: …, other: … }` under the singular
|
|
314
314
|
key's name; the plural key is not read.
|
|
315
315
|
|
|
316
|
+
### Generated views and embedded apps
|
|
317
|
+
|
|
318
|
+
`@aceshooting/lyra-gen` uses the same locale registry and inherited `lang`/`locale` as Lyra UI.
|
|
319
|
+
The seven `genView*` renderer messages ship in each locale's `conversation` slice, including
|
|
320
|
+
empty, invalid, loading, load-failure, field-value, unavailable-action and confirmation messages.
|
|
321
|
+
Import the full matching `@aceshooting/lyra-translations/<locale>.js` catalog, or the
|
|
322
|
+
`<locale>/conversation.js` slice plus the families and `shared.js` used by generated child controls.
|
|
323
|
+
The translations package matches the **Lyra UI** version; Gen is versioned independently.
|
|
324
|
+
|
|
325
|
+
```ts
|
|
326
|
+
import '@aceshooting/lyra-translations/fr/conversation.js';
|
|
327
|
+
import '@aceshooting/lyra-translations/fr/forms.js';
|
|
328
|
+
import '@aceshooting/lyra-translations/fr/shared.js';
|
|
329
|
+
import '@aceshooting/lyra-gen/gen-view.js';
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The renderer keeps its own small English defaults and does not load the complete English catalog.
|
|
333
|
+
Its `.strings` overrides affect its own messages; registered locale messages also reach nested
|
|
334
|
+
controls. Changing the inherited locale or registering a catalog after mounting refreshes the
|
|
335
|
+
renderer. Caller labels and model-generated prose remain caller content: the host chooses their
|
|
336
|
+
language separately. Numeric/date formatting follows the host locale without changing stored
|
|
337
|
+
JSON numbers or ISO dates. Host-created chat stream messages still require the host's localized
|
|
338
|
+
`strings` configuration.
|
|
339
|
+
|
|
340
|
+
A loaded `lr-mcp-app` publishes changed locale/direction context without reloading its frame.
|
|
341
|
+
Official MCP Apps sessions retain context updates during initialization and deliver the latest
|
|
342
|
+
context when the app becomes ready. Resource content remains responsible for rendering its own
|
|
343
|
+
translations and direction; the iframe does not inherit the parent document's CSS or `dir`.
|
|
344
|
+
|
|
316
345
|
## RTL and direction
|
|
317
346
|
|
|
318
347
|
Direction is inherited from the platform `dir` cascade; locale/`lang` selection does not change it,
|