@elabs-ai/components-ai 4.1.0 → 5.0.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/README.md +3 -3
- package/dist/{_audio-player-media-chrome-T3XVXWRZ.js → _audio-player-media-chrome.js} +1 -1
- package/dist/_code-block-theme.js +12 -0
- package/dist/_code-block-theme.js.map +1 -0
- package/dist/{_flow-boundary-SHNWLQG5.js → _flow-boundary.js} +1 -1
- package/dist/_flow-boundary.js.map +1 -0
- package/dist/_flow-lazy.js +8 -0
- package/dist/_flow-lazy.js.map +1 -0
- package/dist/_lazy-boundary-conformance.js +2 -0
- package/dist/_lazy-boundary-conformance.js.map +1 -0
- package/dist/_lazy-cjk.js +13 -0
- package/dist/_lazy-cjk.js.map +1 -0
- package/dist/_lazy-engine-boundary.js +9 -0
- package/dist/_lazy-engine-boundary.js.map +1 -0
- package/dist/_lazy-math.js +13 -0
- package/dist/_lazy-math.js.map +1 -0
- package/dist/_lazy-mermaid.js +12 -0
- package/dist/_lazy-mermaid.js.map +1 -0
- package/dist/_mermaid-error-panel.js +9 -0
- package/dist/_mermaid-error-panel.js.map +1 -0
- package/dist/{_persona-rive-JEG44YHX.js → _persona-rive.js} +19 -24
- package/dist/_persona-rive.js.map +1 -0
- package/dist/_streamdown-i18n.js +21 -0
- package/dist/_streamdown-i18n.js.map +1 -0
- package/dist/_streamdown-safety.js +10 -0
- package/dist/_streamdown-safety.js.map +1 -0
- package/dist/_theme-scope-store.js +13 -0
- package/dist/_theme-scope-store.js.map +1 -0
- package/dist/a2ui/a2ui-surface.js +17 -0
- package/dist/a2ui/a2ui-surface.js.map +1 -0
- package/dist/a2ui/core/catalog.generated.js +10 -0
- package/dist/a2ui/core/catalog.generated.js.map +1 -0
- package/dist/a2ui/core/complete-json.js +10 -0
- package/dist/a2ui/core/complete-json.js.map +1 -0
- package/dist/a2ui/core/index.js +37 -0
- package/dist/a2ui/core/index.js.map +1 -0
- package/dist/a2ui/core/schema.js +11 -0
- package/dist/a2ui/core/schema.js.map +1 -0
- package/dist/a2ui/core/spec.js +10 -0
- package/dist/a2ui/core/spec.js.map +1 -0
- package/dist/a2ui/core/validate.js +16 -0
- package/dist/a2ui/core/validate.js.map +1 -0
- package/dist/a2ui/index.js +54 -0
- package/dist/a2ui/index.js.map +1 -0
- package/dist/a2ui/ui-catalog.js +18 -0
- package/dist/a2ui/ui-catalog.js.map +1 -0
- package/dist/agent-event.js +10 -0
- package/dist/agent-event.js.map +1 -0
- package/dist/agent-timeline.js +11 -0
- package/dist/agent-timeline.js.map +1 -0
- package/dist/agent.js +25 -0
- package/dist/agent.js.map +1 -0
- package/dist/artifact.js +23 -0
- package/dist/artifact.js.map +1 -0
- package/dist/asset-preview.js +22 -0
- package/dist/asset-preview.js.map +1 -0
- package/dist/attachments.js +33 -0
- package/dist/attachments.js.map +1 -0
- package/dist/audio-player.js +30 -0
- package/dist/audio-player.js.map +1 -0
- package/dist/audio-visualizer.js +9 -0
- package/dist/audio-visualizer.js.map +1 -0
- package/dist/canvas.js +10 -0
- package/dist/canvas.js.map +1 -0
- package/dist/chain-of-thought.js +22 -0
- package/dist/chain-of-thought.js.map +1 -0
- package/dist/chat-greeting.js +8 -0
- package/dist/chat-greeting.js.map +1 -0
- package/dist/chat-shell.js +9 -0
- package/dist/chat-shell.js.map +1 -0
- package/dist/checkpoint.js +13 -0
- package/dist/checkpoint.js.map +1 -0
- package/dist/chunk-2XOIG5TG.js +72 -0
- package/dist/chunk-2XOIG5TG.js.map +1 -0
- package/dist/chunk-34CQ2VHM.js +172 -0
- package/dist/chunk-34CQ2VHM.js.map +1 -0
- package/dist/chunk-3TDHPXZZ.js +60 -0
- package/dist/chunk-3TDHPXZZ.js.map +1 -0
- package/dist/chunk-3XNPMDZY.js +478 -0
- package/dist/chunk-3XNPMDZY.js.map +1 -0
- package/dist/chunk-3YPT3V7L.js +56 -0
- package/dist/chunk-3YPT3V7L.js.map +1 -0
- package/dist/chunk-475UEU2Q.js +87 -0
- package/dist/chunk-475UEU2Q.js.map +1 -0
- package/dist/chunk-4CBTII2I.js +95 -0
- package/dist/chunk-4CBTII2I.js.map +1 -0
- package/dist/chunk-4XRNIZMG.js +22 -0
- package/dist/chunk-4XRNIZMG.js.map +1 -0
- package/dist/chunk-5NNWUKK5.js +2 -0
- package/dist/chunk-5NNWUKK5.js.map +1 -0
- package/dist/chunk-5UOMU27Z.js +164 -0
- package/dist/chunk-5UOMU27Z.js.map +1 -0
- package/dist/chunk-5VGYZ62I.js +264 -0
- package/dist/chunk-5VGYZ62I.js.map +1 -0
- package/dist/chunk-6IQPH2OS.js +21 -0
- package/dist/chunk-6IQPH2OS.js.map +1 -0
- package/dist/chunk-6PB2MXCI.js +482 -0
- package/dist/chunk-6PB2MXCI.js.map +1 -0
- package/dist/chunk-7FD5CZEU.js +215 -0
- package/dist/chunk-7FD5CZEU.js.map +1 -0
- package/dist/chunk-7RL6KZDF.js +266 -0
- package/dist/chunk-7RL6KZDF.js.map +1 -0
- package/dist/chunk-ADOYAGGK.js +482 -0
- package/dist/chunk-ADOYAGGK.js.map +1 -0
- package/dist/chunk-AXMNJMMH.js +984 -0
- package/dist/chunk-AXMNJMMH.js.map +1 -0
- package/dist/chunk-BA3AEMOU.js +21 -0
- package/dist/chunk-BA3AEMOU.js.map +1 -0
- package/dist/chunk-BBHFOYML.js +336 -0
- package/dist/chunk-BBHFOYML.js.map +1 -0
- package/dist/chunk-BHUVISIY.js +221 -0
- package/dist/chunk-BHUVISIY.js.map +1 -0
- package/dist/chunk-BM2LWERA.js +100 -0
- package/dist/chunk-BM2LWERA.js.map +1 -0
- package/dist/chunk-CMOYXNPJ.js +211 -0
- package/dist/chunk-CMOYXNPJ.js.map +1 -0
- package/dist/chunk-CZP3RHC4.js +74 -0
- package/dist/chunk-CZP3RHC4.js.map +1 -0
- package/dist/chunk-DDG5JHQT.js +112 -0
- package/dist/chunk-DDG5JHQT.js.map +1 -0
- package/dist/chunk-DJODXO7I.js +38 -0
- package/dist/chunk-DJODXO7I.js.map +1 -0
- package/dist/chunk-DWJDJLPU.js +192 -0
- package/dist/chunk-DWJDJLPU.js.map +1 -0
- package/dist/chunk-DZW6LM22.js +45 -0
- package/dist/chunk-DZW6LM22.js.map +1 -0
- package/dist/chunk-ELGCZLZF.js +305 -0
- package/dist/chunk-ELGCZLZF.js.map +1 -0
- package/dist/chunk-EV3U6ZZB.js +209 -0
- package/dist/chunk-EV3U6ZZB.js.map +1 -0
- package/dist/chunk-EY7LVUKQ.js +87 -0
- package/dist/chunk-EY7LVUKQ.js.map +1 -0
- package/dist/chunk-F4C74F7M.js +230 -0
- package/dist/chunk-F4C74F7M.js.map +1 -0
- package/dist/chunk-FERYDFZA.js +108 -0
- package/dist/chunk-FERYDFZA.js.map +1 -0
- package/dist/chunk-FUIYG2DS.js +166 -0
- package/dist/chunk-FUIYG2DS.js.map +1 -0
- package/dist/chunk-GKYZT3LA.js +136 -0
- package/dist/chunk-GKYZT3LA.js.map +1 -0
- package/dist/chunk-H42LRUQ4.js +102 -0
- package/dist/chunk-H42LRUQ4.js.map +1 -0
- package/dist/chunk-HVXM2G5F.js +222 -0
- package/dist/chunk-HVXM2G5F.js.map +1 -0
- package/dist/chunk-I4RDAGVY.js +53 -0
- package/dist/chunk-I4RDAGVY.js.map +1 -0
- package/dist/chunk-IQJG4IDX.js +208 -0
- package/dist/chunk-IQJG4IDX.js.map +1 -0
- package/dist/chunk-IX2PXG4Y.js +144 -0
- package/dist/chunk-IX2PXG4Y.js.map +1 -0
- package/dist/chunk-IXICSOOP.js +287 -0
- package/dist/chunk-IXICSOOP.js.map +1 -0
- package/dist/chunk-JY5HSN4D.js +84 -0
- package/dist/chunk-JY5HSN4D.js.map +1 -0
- package/dist/chunk-LMNSBOBG.js +19 -0
- package/dist/chunk-LMNSBOBG.js.map +1 -0
- package/dist/chunk-MBI7D6IL.js +42 -0
- package/dist/chunk-MBI7D6IL.js.map +1 -0
- package/dist/chunk-MLFMYCPH.js +192 -0
- package/dist/chunk-MLFMYCPH.js.map +1 -0
- package/dist/chunk-MOK66734.js +33 -0
- package/dist/chunk-MOK66734.js.map +1 -0
- package/dist/chunk-MXTAWPYM.js +196 -0
- package/dist/chunk-MXTAWPYM.js.map +1 -0
- package/dist/chunk-NCL2UZKI.js +96 -0
- package/dist/chunk-NCL2UZKI.js.map +1 -0
- package/dist/chunk-NET4YLRY.js +107 -0
- package/dist/chunk-NET4YLRY.js.map +1 -0
- package/dist/chunk-NIG67CFM.js +329 -0
- package/dist/chunk-NIG67CFM.js.map +1 -0
- package/dist/chunk-NMVNNO3L.js +10 -0
- package/dist/chunk-NMVNNO3L.js.map +1 -0
- package/dist/chunk-NP7VID4K.js +2 -0
- package/dist/chunk-NP7VID4K.js.map +1 -0
- package/dist/chunk-NPUCMAG2.js +382 -0
- package/dist/chunk-NPUCMAG2.js.map +1 -0
- package/dist/chunk-NSCLRHES.js +102 -0
- package/dist/chunk-NSCLRHES.js.map +1 -0
- package/dist/chunk-OEUXHVFW.js +86 -0
- package/dist/chunk-OEUXHVFW.js.map +1 -0
- package/dist/chunk-ONBHFIMZ.js +137 -0
- package/dist/chunk-ONBHFIMZ.js.map +1 -0
- package/dist/chunk-OPH2HHL2.js +228 -0
- package/dist/chunk-OPH2HHL2.js.map +1 -0
- package/dist/chunk-OQERHIQP.js +287 -0
- package/dist/chunk-OQERHIQP.js.map +1 -0
- package/dist/chunk-P6YJAZFG.js +103 -0
- package/dist/chunk-P6YJAZFG.js.map +1 -0
- package/dist/chunk-PG7ERDOD.js +65 -0
- package/dist/chunk-PG7ERDOD.js.map +1 -0
- package/dist/chunk-PIB5JBMA.js +90 -0
- package/dist/chunk-PIB5JBMA.js.map +1 -0
- package/dist/chunk-PQ5BPIWQ.js +22 -0
- package/dist/chunk-PQ5BPIWQ.js.map +1 -0
- package/dist/chunk-PQBF6ZIQ.js +55 -0
- package/dist/chunk-PQBF6ZIQ.js.map +1 -0
- package/dist/chunk-PTWCTSZL.js +173 -0
- package/dist/chunk-PTWCTSZL.js.map +1 -0
- package/dist/chunk-QJUNPVOS.js +101 -0
- package/dist/chunk-QJUNPVOS.js.map +1 -0
- package/dist/chunk-QUDZOTRV.js +43 -0
- package/dist/chunk-QUDZOTRV.js.map +1 -0
- package/dist/chunk-RB7G65JC.js +213 -0
- package/dist/chunk-RB7G65JC.js.map +1 -0
- package/dist/chunk-RPHAOR7P.js +45 -0
- package/dist/chunk-RPHAOR7P.js.map +1 -0
- package/dist/chunk-RTCSH2AN.js +331 -0
- package/dist/chunk-RTCSH2AN.js.map +1 -0
- package/dist/chunk-S3ISPW3A.js +28 -0
- package/dist/chunk-S3ISPW3A.js.map +1 -0
- package/dist/chunk-SEVN656N.js +36 -0
- package/dist/chunk-SEVN656N.js.map +1 -0
- package/dist/chunk-SKVG672B.js +64 -0
- package/dist/chunk-SKVG672B.js.map +1 -0
- package/dist/chunk-SPQIU7GA.js +236 -0
- package/dist/chunk-SPQIU7GA.js.map +1 -0
- package/dist/chunk-SSGJ6MEM.js +1076 -0
- package/dist/chunk-SSGJ6MEM.js.map +1 -0
- package/dist/chunk-SSKZ2AED.js +118 -0
- package/dist/chunk-SSKZ2AED.js.map +1 -0
- package/dist/chunk-T56JFGXI.js +561 -0
- package/dist/chunk-T56JFGXI.js.map +1 -0
- package/dist/chunk-TCB6O74A.js +137 -0
- package/dist/chunk-TCB6O74A.js.map +1 -0
- package/dist/chunk-TTEYPO6X.js +57 -0
- package/dist/chunk-TTEYPO6X.js.map +1 -0
- package/dist/chunk-TWPHAJNM.js +462 -0
- package/dist/chunk-TWPHAJNM.js.map +1 -0
- package/dist/chunk-TXJJLP4O.js +336 -0
- package/dist/chunk-TXJJLP4O.js.map +1 -0
- package/dist/chunk-TZ6TB7VM.js +245 -0
- package/dist/chunk-TZ6TB7VM.js.map +1 -0
- package/dist/chunk-UBLKJJ7K.js +278 -0
- package/dist/chunk-UBLKJJ7K.js.map +1 -0
- package/dist/chunk-UCJ6IUFS.js +52 -0
- package/dist/chunk-UCJ6IUFS.js.map +1 -0
- package/dist/chunk-UCKFJ3QF.js +197 -0
- package/dist/chunk-UCKFJ3QF.js.map +1 -0
- package/dist/chunk-UPXSLILN.js +20 -0
- package/dist/chunk-UPXSLILN.js.map +1 -0
- package/dist/chunk-V4DORGWJ.js +92 -0
- package/dist/chunk-V4DORGWJ.js.map +1 -0
- package/dist/chunk-V6E5DYZD.js +80 -0
- package/dist/chunk-V6E5DYZD.js.map +1 -0
- package/dist/chunk-VLLYKF3P.js +96 -0
- package/dist/chunk-VLLYKF3P.js.map +1 -0
- package/dist/chunk-VLNBTOH6.js +43 -0
- package/dist/chunk-VLNBTOH6.js.map +1 -0
- package/dist/chunk-WMDSMSPL.js +303 -0
- package/dist/chunk-WMDSMSPL.js.map +1 -0
- package/dist/chunk-WU5BLGTF.js +149 -0
- package/dist/chunk-WU5BLGTF.js.map +1 -0
- package/dist/chunk-WYTZVSGK.js +245 -0
- package/dist/chunk-WYTZVSGK.js.map +1 -0
- package/dist/chunk-X47QMM6K.js +187 -0
- package/dist/chunk-X47QMM6K.js.map +1 -0
- package/dist/chunk-XNBKO32Y.js +174 -0
- package/dist/chunk-XNBKO32Y.js.map +1 -0
- package/dist/chunk-YHUSW7D2.js +40 -0
- package/dist/chunk-YHUSW7D2.js.map +1 -0
- package/dist/chunk-YSKD7UXX.js +126 -0
- package/dist/chunk-YSKD7UXX.js.map +1 -0
- package/dist/chunk-YYRDGWOU.js +72 -0
- package/dist/chunk-YYRDGWOU.js.map +1 -0
- package/dist/chunk-ZIGZMWM7.js +19 -0
- package/dist/chunk-ZIGZMWM7.js.map +1 -0
- package/dist/chunk-ZKRTUKNP.js +40 -0
- package/dist/chunk-ZKRTUKNP.js.map +1 -0
- package/dist/code-block.js +38 -0
- package/dist/code-block.js.map +1 -0
- package/dist/commit.js +51 -0
- package/dist/commit.js.map +1 -0
- package/dist/composer.js +15 -0
- package/dist/composer.js.map +1 -0
- package/dist/confirmation.js +53 -0
- package/dist/confirmation.js.map +1 -0
- package/dist/connection.js +8 -0
- package/dist/connection.js.map +1 -0
- package/dist/context-panel.js +25 -0
- package/dist/context-panel.js.map +1 -0
- package/dist/controls.js +10 -0
- package/dist/controls.js.map +1 -0
- package/dist/conversation.js +19 -0
- package/dist/conversation.js.map +1 -0
- package/dist/diff-view.js +15 -0
- package/dist/diff-view.js.map +1 -0
- package/dist/edge.js +10 -0
- package/dist/edge.js.map +1 -0
- package/dist/environment-variables.js +29 -0
- package/dist/environment-variables.js.map +1 -0
- package/dist/file-tree.js +23 -0
- package/dist/file-tree.js.map +1 -0
- package/dist/gallery.js +9 -0
- package/dist/gallery.js.map +1 -0
- package/dist/grouped-parts.js +21 -0
- package/dist/grouped-parts.js.map +1 -0
- package/dist/image.js +9 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +403 -108
- package/dist/index.js +671 -13205
- package/dist/index.js.map +1 -1
- package/dist/inline-citation.js +39 -0
- package/dist/inline-citation.js.map +1 -0
- package/dist/jsx-preview.js +17 -0
- package/dist/jsx-preview.js.map +1 -0
- package/dist/markdown-view.js +17 -0
- package/dist/markdown-view.js.map +1 -0
- package/dist/message-compare.js +12 -0
- package/dist/message-compare.js.map +1 -0
- package/dist/message-edit.js +19 -0
- package/dist/message-edit.js.map +1 -0
- package/dist/message-feedback.js +11 -0
- package/dist/message-feedback.js.map +1 -0
- package/dist/message-form-spec.js +38 -0
- package/dist/message-form-spec.js.map +1 -0
- package/dist/message-form.js +26 -0
- package/dist/message-form.js.map +1 -0
- package/dist/message-table-spec.js +26 -0
- package/dist/message-table-spec.js.map +1 -0
- package/dist/message-table.js +12 -0
- package/dist/message-table.js.map +1 -0
- package/dist/message.js +51 -0
- package/dist/message.js.map +1 -0
- package/dist/mic-selector.js +27 -0
- package/dist/mic-selector.js.map +1 -0
- package/dist/model-provider-logo.js +13 -0
- package/dist/model-provider-logo.js.map +1 -0
- package/dist/motion-config.js +9 -0
- package/dist/motion-config.js.map +1 -0
- package/dist/node.js +22 -0
- package/dist/node.js.map +1 -0
- package/dist/open-in-chat.js +31 -0
- package/dist/open-in-chat.js.map +1 -0
- package/dist/package-info.js +25 -0
- package/dist/package-info.js.map +1 -0
- package/dist/panel.js +10 -0
- package/dist/panel.js.map +1 -0
- package/dist/part-groups.js +18 -0
- package/dist/part-groups.js.map +1 -0
- package/dist/permission-mode-select.js +9 -0
- package/dist/permission-mode-select.js.map +1 -0
- package/dist/persona-sources.js +8 -0
- package/dist/persona-sources.js.map +1 -0
- package/dist/persona.js +14 -0
- package/dist/persona.js.map +1 -0
- package/dist/plan.js +32 -0
- package/dist/plan.js.map +1 -0
- package/dist/prompt-input-effort.js +9 -0
- package/dist/prompt-input-effort.js.map +1 -0
- package/dist/prompt-input-mode.js +10 -0
- package/dist/prompt-input-mode.js.map +1 -0
- package/dist/prompt-input-slash.js +12 -0
- package/dist/prompt-input-slash.js.map +1 -0
- package/dist/prompt-input.js +89 -0
- package/dist/prompt-input.js.map +1 -0
- package/dist/queue.js +37 -0
- package/dist/queue.js.map +1 -0
- package/dist/reasoning.js +23 -0
- package/dist/reasoning.js.map +1 -0
- package/dist/sandbox.js +28 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/schema-display.js +33 -0
- package/dist/schema-display.js.map +1 -0
- package/dist/selection-toolbar.js +11 -0
- package/dist/selection-toolbar.js.map +1 -0
- package/dist/session-header.js +9 -0
- package/dist/session-header.js.map +1 -0
- package/dist/session-status-bar.js +9 -0
- package/dist/session-status-bar.js.map +1 -0
- package/dist/shimmer.js +9 -0
- package/dist/shimmer.js.map +1 -0
- package/dist/snippet.js +17 -0
- package/dist/snippet.js.map +1 -0
- package/dist/sources.js +17 -0
- package/dist/sources.js.map +1 -0
- package/dist/speech-input.js +9 -0
- package/dist/speech-input.js.map +1 -0
- package/dist/stack-trace.js +27 -0
- package/dist/stack-trace.js.map +1 -0
- package/dist/suggestion.js +16 -0
- package/dist/suggestion.js.map +1 -0
- package/dist/task.js +18 -0
- package/dist/task.js.map +1 -0
- package/dist/test-results.js +43 -0
- package/dist/test-results.js.map +1 -0
- package/dist/token-usage.js +27 -0
- package/dist/token-usage.js.map +1 -0
- package/dist/tool-result-card.js +9 -0
- package/dist/tool-result-card.js.map +1 -0
- package/dist/tool.js +27 -0
- package/dist/tool.js.map +1 -0
- package/dist/toolbar.js +10 -0
- package/dist/toolbar.js.map +1 -0
- package/dist/transcription.js +11 -0
- package/dist/transcription.js.map +1 -0
- package/dist/turn-status.js +9 -0
- package/dist/turn-status.js.map +1 -0
- package/dist/use-audio-level.js +9 -0
- package/dist/use-audio-level.js.map +1 -0
- package/dist/voice-selector.js +47 -0
- package/dist/voice-selector.js.map +1 -0
- package/dist/web-preview.js +19 -0
- package/dist/web-preview.js.map +1 -0
- package/package.json +12 -10
- package/schemas/a2ui-surface.v1.schema.json +5425 -0
- package/src/__contract__/audio-visualizer.contract.test.tsx +49 -0
- package/src/__contract__/chat-shell.contract.test.tsx +49 -0
- package/src/__contract__/grouped-parts.contract.test.tsx +49 -0
- package/src/__contract__/image.contract.test.tsx +49 -0
- package/src/__contract__/markdown-view.contract.test.tsx +49 -0
- package/src/__contract__/message-feedback.contract.test.tsx +49 -0
- package/src/__contract__/message-form.contract.test.tsx +49 -0
- package/src/__contract__/message-table.contract.test.tsx +49 -0
- package/src/__contract__/model-provider-logo.contract.test.tsx +49 -0
- package/src/__contract__/persona.contract.test.tsx +49 -0
- package/src/__contract__/prompt-input-effort.contract.test.tsx +49 -0
- package/src/__contract__/prompt-input-mode.contract.test.tsx +49 -0
- package/src/_chat-shell-rail.tsx +4 -2
- package/src/_flow-boundary.tsx +2 -2
- package/src/_lazy-cjk.test.ts +43 -0
- package/src/_lazy-cjk.ts +73 -0
- package/src/_lazy-math.test.ts +63 -0
- package/src/_lazy-math.ts +90 -0
- package/src/_persona-rive.tsx +27 -41
- package/src/_streamdown-i18n.ts +73 -21
- package/src/_streamdown-safety.ts +2 -2
- package/src/_theme-scope-store.test.ts +83 -0
- package/src/_theme-scope-store.ts +103 -0
- package/src/a2ui/a2ui-surface.stories.tsx +662 -0
- package/src/a2ui/a2ui-surface.test.tsx +201 -0
- package/src/a2ui/a2ui-surface.tsx +354 -0
- package/src/a2ui/catalog.source.json +772 -0
- package/src/a2ui/core/a2ui-core.test.ts +178 -0
- package/src/a2ui/core/catalog.generated.ts +1006 -0
- package/src/a2ui/core/complete-json.ts +81 -0
- package/src/a2ui/core/index.ts +10 -0
- package/src/a2ui/core/schema.ts +111 -0
- package/src/a2ui/core/spec.ts +148 -0
- package/src/a2ui/core/validate.ts +266 -0
- package/src/a2ui/index.ts +7 -0
- package/src/a2ui/ui-catalog.tsx +225 -0
- package/src/a2ui/wave1-chart-spec.test.ts +87 -0
- package/src/a2ui/wave2-chart-spec.test.ts +108 -0
- package/src/agent-event.tsx +1 -1
- package/src/agent.tsx +18 -13
- package/src/agentic-workspace.stories.tsx +6 -45
- package/src/artifact.tsx +2 -2
- package/src/asset-preview.test.tsx +40 -0
- package/src/asset-preview.tsx +83 -12
- package/src/attachments.tsx +7 -4
- package/src/chat-shell.test.tsx +40 -10
- package/src/chat-shell.tsx +90 -44
- package/src/chat.stories.tsx +47 -42
- package/src/code-block.test.tsx +100 -1
- package/src/code-block.tsx +166 -103
- package/src/commit.tsx +30 -41
- package/src/composer.stories.tsx +4 -5
- package/src/composer.test.tsx +45 -0
- package/src/composer.tsx +104 -21
- package/src/confirmation.tsx +1 -1
- package/src/context-panel.stories.tsx +1 -1
- package/src/context-panel.tsx +2 -2
- package/src/conversation.stories.tsx +24 -0
- package/src/conversation.test.tsx +69 -0
- package/src/conversation.tsx +47 -8
- package/src/diff-view.stories.tsx +79 -0
- package/src/diff-view.test.tsx +52 -2
- package/src/diff-view.tsx +92 -36
- package/src/environment-variables.tsx +20 -37
- package/src/file-tree.test.tsx +21 -0
- package/src/file-tree.tsx +33 -16
- package/src/gallery.stories.tsx +42 -0
- package/src/gallery.tsx +2 -2
- package/src/grouped-parts.stories.tsx +23 -0
- package/src/grouped-parts.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/inline-citation.tsx +5 -5
- package/src/jsx-preview.tsx +151 -43
- package/src/markdown-view.test.tsx +7 -3
- package/src/markdown-view.tsx +8 -1
- package/src/message-compare.stories.tsx +40 -0
- package/src/message-compare.tsx +2 -1
- package/src/message-form.stories.tsx +36 -3
- package/src/message-form.test.tsx +8 -2
- package/src/message-form.tsx +16 -8
- package/src/message-table.stories.tsx +26 -2
- package/src/message-table.test.tsx +7 -0
- package/src/message-table.tsx +9 -5
- package/src/message.test.tsx +73 -3
- package/src/message.tsx +36 -12
- package/src/model-provider-logo.test.tsx +57 -3
- package/src/model-provider-logo.tsx +45 -11
- package/src/open-in-chat.tsx +50 -29
- package/src/package-info.tsx +23 -20
- package/src/prompt-input-slash.stories.tsx +1 -1
- package/src/prompt-input.test.tsx +67 -1
- package/src/prompt-input.tsx +42 -4
- package/src/queue.tsx +4 -4
- package/src/reasoning.stories.tsx +27 -0
- package/src/reasoning.tsx +17 -6
- package/src/sandbox.tsx +3 -3
- package/src/schema-display.test.tsx +56 -0
- package/src/schema-display.tsx +68 -37
- package/src/session-header.stories.tsx +35 -1
- package/src/session-header.tsx +1 -1
- package/src/snippet.test.tsx +6 -2
- package/src/snippet.tsx +14 -34
- package/src/sources.stories.tsx +30 -0
- package/src/sources.tsx +4 -1
- package/src/speech-input.test.tsx +109 -0
- package/src/speech-input.tsx +31 -3
- package/src/stack-trace.tsx +20 -36
- package/src/streamdown-i18n.test.tsx +23 -0
- package/src/templates-ai-assistant.stories.tsx +151 -87
- package/src/test-results.tsx +47 -27
- package/src/token-usage.tsx +6 -6
- package/src/tool.stories.tsx +39 -0
- package/src/tool.test.tsx +65 -0
- package/src/tool.tsx +61 -25
- package/src/toolbar.tsx +0 -10
- package/src/transcription.tsx +1 -1
- package/src/voice-selector.tsx +5 -5
- package/src/web-preview.test.tsx +51 -1
- package/src/web-preview.tsx +39 -8
- package/dist/_flow-boundary-SHNWLQG5.js.map +0 -1
- package/dist/_persona-rive-JEG44YHX.js.map +0 -1
- /package/dist/{_audio-player-media-chrome-T3XVXWRZ.js.map → _audio-player-media-chrome.js.map} +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Shimmer
|
|
4
|
+
} from "./chunk-3YPT3V7L.js";
|
|
5
|
+
|
|
6
|
+
// src/suggestion.tsx
|
|
7
|
+
import { Button } from "@elabs-ai/components-ui";
|
|
8
|
+
import { ScrollArea, ScrollBar } from "@elabs-ai/components-ui";
|
|
9
|
+
import { cn } from "@elabs-ai/components-ui/lib/cn";
|
|
10
|
+
import { useCallback } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var Suggestions = ({ className, children, ...props }) => /* @__PURE__ */ jsxs(ScrollArea, { className: "w-full overflow-x-auto whitespace-nowrap", ...props, children: [
|
|
13
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex w-max flex-nowrap items-center gap-2", className), children }),
|
|
14
|
+
/* @__PURE__ */ jsx(ScrollBar, { className: "hidden", orientation: "horizontal" })
|
|
15
|
+
] });
|
|
16
|
+
var Suggestion = ({
|
|
17
|
+
suggestion,
|
|
18
|
+
onClick,
|
|
19
|
+
className,
|
|
20
|
+
// The soft tinted pill (#194, research 02 §3a BTN-2 / 08 §C.1): `secondary`
|
|
21
|
+
// = borderless `bg-secondary` fill; the pill shape comes from `rounded-full`
|
|
22
|
+
// below. The harsh `outline` (strong `--input` boundary) is for form-adjacent
|
|
23
|
+
// controls, not chips.
|
|
24
|
+
variant = "secondary",
|
|
25
|
+
size = "sm",
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}) => {
|
|
29
|
+
const handleClick = useCallback(() => {
|
|
30
|
+
onClick?.(suggestion);
|
|
31
|
+
}, [onClick, suggestion]);
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
Button,
|
|
34
|
+
{
|
|
35
|
+
className: cn("cursor-pointer rounded-full px-4", className),
|
|
36
|
+
onClick: handleClick,
|
|
37
|
+
size,
|
|
38
|
+
type: "button",
|
|
39
|
+
variant,
|
|
40
|
+
...props,
|
|
41
|
+
children: children || suggestion
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
var SuggestionLoading = ({
|
|
46
|
+
label = "Thinking\u2026",
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}) => /* @__PURE__ */ jsx(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
role: "status",
|
|
53
|
+
"aria-live": "polite",
|
|
54
|
+
className: cn(
|
|
55
|
+
"inline-flex h-8 shrink-0 items-center rounded-full bg-secondary px-4 text-body",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
...props,
|
|
59
|
+
children: /* @__PURE__ */ jsx(Shimmer, { as: "span", className: "text-secondary-foreground", children: label })
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
var StreamingSuggestions = ({
|
|
63
|
+
suggestions,
|
|
64
|
+
loading = false,
|
|
65
|
+
onSuggestionClick,
|
|
66
|
+
loadingLabel,
|
|
67
|
+
...props
|
|
68
|
+
}) => /* @__PURE__ */ jsxs(Suggestions, { ...props, children: [
|
|
69
|
+
suggestions.map((s) => /* @__PURE__ */ jsx(
|
|
70
|
+
Suggestion,
|
|
71
|
+
{
|
|
72
|
+
suggestion: s,
|
|
73
|
+
onClick: onSuggestionClick,
|
|
74
|
+
className: "animate-in fade-in-0 slide-in-from-bottom-1 duration-fast ease-entrance motion-reduce:animate-none"
|
|
75
|
+
},
|
|
76
|
+
s
|
|
77
|
+
)),
|
|
78
|
+
loading && /* @__PURE__ */ jsx(SuggestionLoading, { label: loadingLabel })
|
|
79
|
+
] });
|
|
80
|
+
|
|
81
|
+
export {
|
|
82
|
+
Suggestions,
|
|
83
|
+
Suggestion,
|
|
84
|
+
SuggestionLoading,
|
|
85
|
+
StreamingSuggestions
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=chunk-475UEU2Q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/suggestion.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@elabs-ai/components-ui\";\nimport { ScrollArea, ScrollBar } from \"@elabs-ai/components-ui\";\nimport { cn } from \"@elabs-ai/components-ui/lib/cn\";\nimport type { ComponentProps, HTMLAttributes } from \"react\";\nimport { useCallback } from \"react\";\n\nimport { Shimmer } from \"./shimmer\";\n\nexport type SuggestionsProps = ComponentProps<typeof ScrollArea>;\n\nexport const Suggestions = ({ className, children, ...props }: SuggestionsProps) => (\n <ScrollArea className=\"w-full overflow-x-auto whitespace-nowrap\" {...props}>\n <div className={cn(\"flex w-max flex-nowrap items-center gap-2\", className)}>{children}</div>\n <ScrollBar className=\"hidden\" orientation=\"horizontal\" />\n </ScrollArea>\n);\n\nexport type SuggestionProps = Omit<ComponentProps<typeof Button>, \"onClick\"> & {\n suggestion: string;\n onClick?: (suggestion: string) => void;\n};\n\nexport const Suggestion = ({\n suggestion,\n onClick,\n className,\n // The soft tinted pill (#194, research 02 §3a BTN-2 / 08 §C.1): `secondary`\n // = borderless `bg-secondary` fill; the pill shape comes from `rounded-full`\n // below. The harsh `outline` (strong `--input` boundary) is for form-adjacent\n // controls, not chips.\n variant = \"secondary\",\n size = \"sm\",\n children,\n ...props\n}: SuggestionProps) => {\n const handleClick = useCallback(() => {\n onClick?.(suggestion);\n }, [onClick, suggestion]);\n\n return (\n <Button\n className={cn(\"cursor-pointer rounded-full px-4\", className)}\n onClick={handleClick}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {children || suggestion}\n </Button>\n );\n};\n\nexport type SuggestionLoadingProps = HTMLAttributes<HTMLDivElement> & {\n /** Shimmering label shown while the suggestion set is still generating. */\n label?: string;\n};\n\n/**\n * A non-interactive trailing chip that shimmers while suggestions stream in.\n * Shaped like a `Suggestion` pill; composes `Shimmer` (motion-reduce aware) and\n * announces via `role=\"status\"`. Render it after the chips while loading.\n */\nexport const SuggestionLoading = ({\n label = \"Thinking…\",\n className,\n ...props\n}: SuggestionLoadingProps) => (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={cn(\n \"inline-flex h-8 shrink-0 items-center rounded-full bg-secondary px-4 text-body\",\n className,\n )}\n {...props}\n >\n <Shimmer as=\"span\" className=\"text-secondary-foreground\">\n {label}\n </Shimmer>\n </div>\n);\n\nexport type StreamingSuggestionsProps = Omit<SuggestionsProps, \"children\"> & {\n /** The suggestions to render. As this array grows, new chips appear in place. */\n suggestions: string[];\n /** While true, a shimmering trailing chip is shown until the set settles. */\n loading?: boolean;\n /** Click handler for a suggestion chip. */\n onSuggestionClick?: (suggestion: string) => void;\n /** Label for the trailing loading chip. @default \"Thinking…\" */\n loadingLabel?: string;\n};\n\n/**\n * Suggestions that appear progressively while a generator streams. Each chip\n * fades in on mount (existing chips don't re-animate — keys are the suggestion\n * text); a shimmering trailing chip shows until `loading` flips false.\n */\nexport const StreamingSuggestions = ({\n suggestions,\n loading = false,\n onSuggestionClick,\n loadingLabel,\n ...props\n}: StreamingSuggestionsProps) => (\n <Suggestions {...props}>\n {suggestions.map((s) => (\n <Suggestion\n key={s}\n suggestion={s}\n onClick={onSuggestionClick}\n className=\"animate-in fade-in-0 slide-in-from-bottom-1 duration-fast ease-entrance motion-reduce:animate-none\"\n />\n ))}\n {loading && <SuggestionLoading label={loadingLabel} />}\n </Suggestions>\n);\n"],"mappings":";;;;;;AAEA,SAAS,cAAc;AACvB,SAAS,YAAY,iBAAiB;AACtC,SAAS,UAAU;AAEnB,SAAS,mBAAmB;AAO1B,SACE,KADF;AADK,IAAM,cAAc,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,MAC1D,qBAAC,cAAW,WAAU,4CAA4C,GAAG,OACnE;AAAA,sBAAC,SAAI,WAAW,GAAG,6CAA6C,SAAS,GAAI,UAAS;AAAA,EACtF,oBAAC,aAAU,WAAU,UAAS,aAAY,cAAa;AAAA,GACzD;AAQK,IAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,MAAuB;AACrB,QAAM,cAAc,YAAY,MAAM;AACpC,cAAU,UAAU;AAAA,EACtB,GAAG,CAAC,SAAS,UAAU,CAAC;AAExB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,oCAAoC,SAAS;AAAA,MAC3D,SAAS;AAAA,MACT;AAAA,MACA,MAAK;AAAA,MACL;AAAA,MACC,GAAG;AAAA,MAEH,sBAAY;AAAA;AAAA,EACf;AAEJ;AAYO,IAAM,oBAAoB,CAAC;AAAA,EAChC,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,MAAK;AAAA,IACL,aAAU;AAAA,IACV,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ,8BAAC,WAAQ,IAAG,QAAO,WAAU,6BAC1B,iBACH;AAAA;AACF;AAmBK,IAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,qBAAC,eAAa,GAAG,OACd;AAAA,cAAY,IAAI,CAAC,MAChB;AAAA,IAAC;AAAA;AAAA,MAEC,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,WAAU;AAAA;AAAA,IAHL;AAAA,EAIP,CACD;AAAA,EACA,WAAW,oBAAC,qBAAkB,OAAO,cAAc;AAAA,GACtD;","names":[]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/chat-shell.tsx
|
|
4
|
+
import { useLayoutEffect, useRef } from "react";
|
|
5
|
+
import { cn } from "@elabs-ai/components-ui/lib/cn";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function ChatShell({
|
|
8
|
+
children,
|
|
9
|
+
composer,
|
|
10
|
+
header,
|
|
11
|
+
aside,
|
|
12
|
+
variant = "card",
|
|
13
|
+
className
|
|
14
|
+
}) {
|
|
15
|
+
const bare = variant === "bare";
|
|
16
|
+
const rootRef = useRef(null);
|
|
17
|
+
const composerRef = useRef(null);
|
|
18
|
+
const hasComposer = composer != null;
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
const root = rootRef.current;
|
|
21
|
+
const node = composerRef.current;
|
|
22
|
+
if (!root) return;
|
|
23
|
+
if (!node) {
|
|
24
|
+
root.style.removeProperty("--chat-composer-inset");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const sync = () => root.style.setProperty("--chat-composer-inset", `${node.getBoundingClientRect().height}px`);
|
|
28
|
+
sync();
|
|
29
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
30
|
+
const observer = new ResizeObserver(sync);
|
|
31
|
+
observer.observe(node);
|
|
32
|
+
return () => observer.disconnect();
|
|
33
|
+
}, [hasComposer]);
|
|
34
|
+
return /* @__PURE__ */ jsxs(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
ref: rootRef,
|
|
38
|
+
"data-slot": "chat-shell",
|
|
39
|
+
"data-variant": variant,
|
|
40
|
+
className: cn(
|
|
41
|
+
// Reading columns: the transcript (`ConversationContent`) reads a
|
|
42
|
+
// little wider than the composer beneath it. Override per app, e.g.
|
|
43
|
+
// `className="[--chat-column:var(--container-5xl)]"`.
|
|
44
|
+
"flex h-full min-h-0 w-full overflow-hidden bg-background [--chat-column:var(--container-4xl)] [--chat-composer-column:var(--container-3xl)]",
|
|
45
|
+
bare ? null : "rounded-xl border",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
50
|
+
header ? /* @__PURE__ */ jsx("div", { className: cn("flex h-header shrink-0 items-center px-4", bare ? null : "border-b"), children: header }) : null,
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 flex-1 flex-col", children: [
|
|
52
|
+
children,
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
"aria-hidden": true,
|
|
57
|
+
className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-8 bg-gradient-to-b from-background to-transparent"
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
"aria-hidden": true,
|
|
64
|
+
"data-slot": "chat-shell-scrim",
|
|
65
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-background from-50% to-transparent",
|
|
66
|
+
style: { height: "calc(var(--chat-composer-inset, 0px) + 3rem)" }
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
composer ? (
|
|
70
|
+
// The float layer passes pointer events through, so the
|
|
71
|
+
// transcript's scrollbar and the gutters beside the composer stay
|
|
72
|
+
// live; only the composer itself takes input. DOM order still puts
|
|
73
|
+
// it after the transcript (tab order follows reading order).
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
ref: composerRef,
|
|
78
|
+
"data-slot": "chat-shell-composer",
|
|
79
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 z-20 px-4 pb-4",
|
|
80
|
+
children: /* @__PURE__ */ jsx("div", { className: "pointer-events-auto mx-auto w-full max-w-(--chat-composer-column)", children: composer })
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
) : null
|
|
84
|
+
] })
|
|
85
|
+
] }),
|
|
86
|
+
aside ? /* @__PURE__ */ jsx("div", { className: "hidden w-80 shrink-0 border-s lg:block", children: aside }) : null
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
ChatShell
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=chunk-4CBTII2I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/chat-shell.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { useLayoutEffect, useRef } from \"react\";\nimport { cn } from \"@elabs-ai/components-ui/lib/cn\";\n\nexport interface ChatShellProps {\n /** Scrollable transcript — typically a <Conversation>. */\n children: ReactNode;\n /**\n * Floating composer — typically a <Composer> (the standard chat input). It\n * floats, padded, over the bottom of the transcript, centred at\n * `--chat-composer-column` (default `--container-3xl`) under a transcript\n * column of `--chat-column` (default `--container-4xl`, read by\n * `ConversationContent`); turns scroll up behind it and fade out.\n */\n composer?: ReactNode;\n /** Optional header row (title, model picker, actions). */\n header?: ReactNode;\n /** Optional right-side context rail (sources, files, memory). */\n aside?: ReactNode;\n /**\n * Frame treatment (the transcript/composer layout is the same in both):\n * - `\"card\"` (default) — a self-contained rounded, bordered chat card with a\n * divider under the header. Use when the shell sits on a page among other\n * content and needs its own frame.\n * - `\"bare\"` — an immersive pane that fills its container with NO frame and\n * no header divider. Use when the shell already lives inside a bounded\n * region (an AppShell `SidebarInset`, a full-page workspace) so it doesn't\n * draw a redundant second frame.\n */\n variant?: \"card\" | \"bare\";\n className?: string;\n}\n\n/**\n * Layout shell for an AI chat built from the AI Elements: a header, a\n * full-height scrollable transcript (give it a <Conversation>, which is\n * `flex-1`), a composer floating over the transcript's bottom edge (a\n * <Composer>, the standard chat input), and an optional context rail. Fills\n * its parent's height.\n *\n * Two frames (`variant`): a framed `\"card\"` for in-page use, and a frameless\n * `\"bare\"` immersive pane for when the shell already sits inside a bounded\n * region and a second frame would just read as boxy.\n */\nexport function ChatShell({\n children,\n composer,\n header,\n aside,\n variant = \"card\",\n className,\n}: ChatShellProps) {\n const bare = variant === \"bare\";\n const rootRef = useRef<HTMLDivElement>(null);\n const composerRef = useRef<HTMLDivElement>(null);\n const hasComposer = composer != null;\n\n // The composer floats OVER the transcript, so the transcript has to\n // know how tall it is — `ConversationContent` pads its bottom by\n // `--chat-composer-inset` (so the last turn scrolls clear of the composer)\n // and `ConversationScrollButton` sits just above it. Written straight onto\n // the root's style: no React state, no re-render per resize.\n useLayoutEffect(() => {\n const root = rootRef.current;\n const node = composerRef.current;\n if (!root) return;\n if (!node) {\n root.style.removeProperty(\"--chat-composer-inset\");\n return;\n }\n const sync = () =>\n root.style.setProperty(\"--chat-composer-inset\", `${node.getBoundingClientRect().height}px`);\n sync();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(sync);\n observer.observe(node);\n return () => observer.disconnect();\n }, [hasComposer]);\n\n return (\n <div\n ref={rootRef}\n data-slot=\"chat-shell\"\n data-variant={variant}\n className={cn(\n // Reading columns: the transcript (`ConversationContent`) reads a\n // little wider than the composer beneath it. Override per app, e.g.\n // `className=\"[--chat-column:var(--container-5xl)]\"`.\n \"flex h-full min-h-0 w-full overflow-hidden bg-background [--chat-column:var(--container-4xl)] [--chat-composer-column:var(--container-3xl)]\",\n bare ? null : \"rounded-xl border\",\n className,\n )}\n >\n <div className=\"flex min-h-0 min-w-0 flex-1 flex-col\">\n {header ? (\n <div className={cn(\"flex h-header shrink-0 items-center px-4\", bare ? null : \"border-b\")}>\n {header}\n </div>\n ) : null}\n\n {/* The transcript runs the FULL height of the pane and the composer\n floats over its bottom edge, so turns scroll up behind the composer\n and dissolve under the top edge instead of stopping at a hard bar.\n The scrims are token-driven (`from-background`) so they fade to the\n shell's own ground in every theme, and inert (`pointer-events-none`\n + `aria-hidden`) so they never block scroll, steal a tap, or get\n announced. */}\n <div className=\"relative flex min-h-0 flex-1 flex-col\">\n {children}\n <div\n aria-hidden\n className=\"pointer-events-none absolute inset-x-0 top-0 z-10 h-8 bg-gradient-to-b from-background to-transparent\"\n />\n <div\n aria-hidden\n data-slot=\"chat-shell-scrim\"\n // Solid under the composer, fading out a little above it.\n className=\"pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-background from-50% to-transparent\"\n style={{ height: \"calc(var(--chat-composer-inset, 0px) + 3rem)\" }}\n />\n {composer ? (\n // The float layer passes pointer events through, so the\n // transcript's scrollbar and the gutters beside the composer stay\n // live; only the composer itself takes input. DOM order still puts\n // it after the transcript (tab order follows reading order).\n <div\n ref={composerRef}\n data-slot=\"chat-shell-composer\"\n className=\"pointer-events-none absolute inset-x-0 bottom-0 z-20 px-4 pb-4\"\n >\n <div className=\"pointer-events-auto mx-auto w-full max-w-(--chat-composer-column)\">\n {composer}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n {aside ? <div className=\"hidden w-80 shrink-0 border-s lg:block\">{aside}</div> : null}\n </div>\n );\n}\n"],"mappings":";;;AAGA,SAAS,iBAAiB,cAAc;AACxC,SAAS,UAAU;AA6FT,cAYF,YAZE;AAnDH,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AACF,GAAmB;AACjB,QAAM,OAAO,YAAY;AACzB,QAAM,UAAU,OAAuB,IAAI;AAC3C,QAAM,cAAc,OAAuB,IAAI;AAC/C,QAAM,cAAc,YAAY;AAOhC,kBAAgB,MAAM;AACpB,UAAM,OAAO,QAAQ;AACrB,UAAM,OAAO,YAAY;AACzB,QAAI,CAAC,KAAM;AACX,QAAI,CAAC,MAAM;AACT,WAAK,MAAM,eAAe,uBAAuB;AACjD;AAAA,IACF;AACA,UAAM,OAAO,MACX,KAAK,MAAM,YAAY,yBAAyB,GAAG,KAAK,sBAAsB,EAAE,MAAM,IAAI;AAC5F,SAAK;AACL,QAAI,OAAO,mBAAmB,YAAa;AAC3C,UAAM,WAAW,IAAI,eAAe,IAAI;AACxC,aAAS,QAAQ,IAAI;AACrB,WAAO,MAAM,SAAS,WAAW;AAAA,EACnC,GAAG,CAAC,WAAW,CAAC;AAEhB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,aAAU;AAAA,MACV,gBAAc;AAAA,MACd,WAAW;AAAA;AAAA;AAAA;AAAA,QAIT;AAAA,QACA,OAAO,OAAO;AAAA,QACd;AAAA,MACF;AAAA,MAEA;AAAA,6BAAC,SAAI,WAAU,wCACZ;AAAA,mBACC,oBAAC,SAAI,WAAW,GAAG,4CAA4C,OAAO,OAAO,UAAU,GACpF,kBACH,IACE;AAAA,UASJ,qBAAC,SAAI,WAAU,yCACZ;AAAA;AAAA,YACD;AAAA,cAAC;AAAA;AAAA,gBACC,eAAW;AAAA,gBACX,WAAU;AAAA;AAAA,YACZ;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,eAAW;AAAA,gBACX,aAAU;AAAA,gBAEV,WAAU;AAAA,gBACV,OAAO,EAAE,QAAQ,+CAA+C;AAAA;AAAA,YAClE;AAAA,YACC;AAAA;AAAA;AAAA;AAAA;AAAA,cAKC;AAAA,gBAAC;AAAA;AAAA,kBACC,KAAK;AAAA,kBACL,aAAU;AAAA,kBACV,WAAU;AAAA,kBAEV,8BAAC,SAAI,WAAU,qEACZ,oBACH;AAAA;AAAA,cACF;AAAA,gBACE;AAAA,aACN;AAAA,WACF;AAAA,QACC,QAAQ,oBAAC,SAAI,WAAU,0CAA0C,iBAAM,IAAS;AAAA;AAAA;AAAA,EACnF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/a2ui/core/spec.ts
|
|
4
|
+
var A2UI_VERSION = "1";
|
|
5
|
+
var A2UI_COMMON_PROPS = {
|
|
6
|
+
id: { type: "string" },
|
|
7
|
+
title: { type: "string" },
|
|
8
|
+
role: { type: "string" },
|
|
9
|
+
hidden: { type: "boolean" },
|
|
10
|
+
lang: { type: "string" },
|
|
11
|
+
dir: { type: "string", enum: ["ltr", "rtl", "auto"] },
|
|
12
|
+
"aria-label": { type: "string" },
|
|
13
|
+
"aria-labelledby": { type: "string" },
|
|
14
|
+
"aria-describedby": { type: "string" },
|
|
15
|
+
"aria-hidden": { type: "boolean" }
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
A2UI_VERSION,
|
|
20
|
+
A2UI_COMMON_PROPS
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-4XRNIZMG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/a2ui/core/spec.ts"],"sourcesContent":["/**\n * spec.ts — the A2UI surface protocol (D2, the generative-UI path: \"the agent\n * describes a screen as DATA, validated against a catalog\").\n *\n * An `A2uiSurface` is plain JSON an agent emits — a tree of catalog nodes. It is\n * NOT JSX (that is `JSXPreview`, the escape hatch) and it carries no code: every\n * `type` must exist in the catalog, every prop is checked against that type's\n * schema, and interaction is a named `on` binding the HOST app resolves\n * (`onAction`). brand-ui renders the tree; the app owns the model call and what\n * an action means (D5).\n *\n * Engine-free on purpose (no React import): `validateA2uiSurface` runs in the\n * browser, in Node, and — bundled by `pnpm gen` — inside the dependency-free\n * `brand-ui a2ui` CLI, so the CLI and `@elabs-ai/components-ai` can never\n * disagree about what a valid surface is.\n */\n\n/** Protocol version this module understands (`\"a2ui\": \"1\"` on the root). */\nexport const A2UI_VERSION = \"1\";\n\n/**\n * A JSON value an agent may place in a prop. The `object` arm is there for\n * authoring: an app hands typed records (an interface for a KPI, a chart row) to\n * a spec literal without an index-signature cast; the runtime validator, not the\n * type, is what decides whether a value is acceptable.\n */\nexport type A2uiJson =\n | string\n | number\n | boolean\n | null\n | undefined\n | readonly A2uiJson[]\n | { readonly [key: string]: A2uiJson }\n | object;\n\n/**\n * A node's prop value: a JSON value, or — for props the catalog types as `node`\n * (`title`, `description`, `actions`, …) — a nested node or list of nodes.\n */\nexport type A2uiPropValue = A2uiJson | A2uiNode | A2uiNode[];\n\n/** What a bound event sends to the host: a NAME (the app's verb) and a payload. */\nexport interface A2uiAction {\n /** The host-side verb, e.g. `\"approve\"`, `\"open-order\"`. Never a code string. */\n name: string;\n /** Free JSON the agent attaches (an id, a row, a form draft). */\n payload?: A2uiJson;\n}\n\n/** An element node. Text nodes are plain strings inside `children`. */\nexport interface A2uiElement {\n /** A catalog type — `\"Card\"`, `\"Button\"`, `\"Stack\"`, … Unknown types are errors. */\n type: string;\n /** Optional stable id (→ `data-a2ui-id`), useful for the host to address a node. */\n id?: string;\n /** Props checked against the catalog entry's schema. */\n props?: Record<string, A2uiPropValue>;\n /** Child nodes — only for catalog types that accept children. */\n children?: A2uiNode[];\n /**\n * Event bindings by the catalog's event vocabulary (`click`, `change`, …) →\n * the action the host receives. The renderer wires the React handler.\n */\n on?: Record<string, A2uiAction>;\n}\n\nexport type A2uiNode = string | A2uiElement;\n\n/** The document an agent emits (the whole tool-call result / message part). */\nexport interface A2uiSurfaceSpec {\n /** Protocol version — currently always `\"1\"`. */\n a2ui: string;\n /** Optional accessible name for the surface region. */\n title?: string;\n /** The root node — usually a `Stack`, `Grid` or `Card`. */\n root: A2uiNode;\n}\n\n/** The value shape of one prop in a catalog entry. */\nexport type A2uiPropType = \"string\" | \"number\" | \"boolean\" | \"node\" | \"array\" | \"object\" | \"any\";\n\nexport interface A2uiPropSchema {\n type: A2uiPropType;\n /** Closed set of allowed values (strings or numbers); `type` is then informational. */\n enum?: (string | number)[];\n required?: boolean;\n default?: A2uiJson;\n description?: string;\n}\n\n/** One catalog type — what an agent may emit for it. */\nexport interface A2uiCatalogTypeSchema {\n /** Drawn by the renderer itself (`Stack`, `Grid`), not a library component. */\n builtin?: boolean;\n /** May carry `children`. */\n children: boolean;\n /** One line for the agent (rendered by `brand-ui a2ui catalog`). */\n summary?: string;\n /** Prop name → schema. Anything not listed (and not in `A2UI_COMMON_PROPS`) is an error. */\n props: Record<string, A2uiPropSchema>;\n /** Event vocabulary → React handler prop (`click` → `onClick`). */\n events: Record<string, string>;\n /** Where the component comes from (`@elabs-ai/components-ui`) or `\"builtin\"`. */\n source: string;\n}\n\nexport type A2uiCatalogSchema = Record<string, A2uiCatalogTypeSchema>;\n\n/**\n * Props every non-builtin element accepts on top of its own schema: the DOM\n * attributes that are safe for an agent to set. Deliberately NO `className` or\n * `style` — a surface inherits the app's theme and tokens; it never restyles.\n */\nexport const A2UI_COMMON_PROPS: Record<string, A2uiPropSchema> = {\n id: { type: \"string\" },\n title: { type: \"string\" },\n role: { type: \"string\" },\n hidden: { type: \"boolean\" },\n lang: { type: \"string\" },\n dir: { type: \"string\", enum: [\"ltr\", \"rtl\", \"auto\"] },\n \"aria-label\": { type: \"string\" },\n \"aria-labelledby\": { type: \"string\" },\n \"aria-describedby\": { type: \"string\" },\n \"aria-hidden\": { type: \"boolean\" },\n};\n\n/** Machine-readable problem codes from `validateA2uiSurface`. */\nexport type A2uiErrorCode =\n | \"invalid-root\"\n | \"unsupported-version\"\n | \"invalid-node\"\n | \"unknown-type\"\n | \"unknown-prop\"\n | \"missing-prop\"\n | \"invalid-value\"\n | \"children-not-allowed\"\n | \"unknown-event\"\n | \"invalid-action\";\n\nexport interface A2uiError {\n /** JSON-pointer-ish path: `root.children[2].props.variant`. */\n path: string;\n /** The path of the NODE that owns the problem (`root.children[2]`) — what a streaming renderer prunes. */\n node: string;\n code: A2uiErrorCode;\n message: string;\n}\n"],"mappings":";;;AAkBO,IAAM,eAAe;AAgGrB,IAAM,oBAAoD;AAAA,EAC/D,IAAI,EAAE,MAAM,SAAS;AAAA,EACrB,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,QAAQ,EAAE,MAAM,UAAU;AAAA,EAC1B,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,KAAK,EAAE,MAAM,UAAU,MAAM,CAAC,OAAO,OAAO,MAAM,EAAE;AAAA,EACpD,cAAc,EAAE,MAAM,SAAS;AAAA,EAC/B,mBAAmB,EAAE,MAAM,SAAS;AAAA,EACpC,oBAAoB,EAAE,MAAM,SAAS;AAAA,EACrC,eAAe,EAAE,MAAM,UAAU;AACnC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/session-header.tsx
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { Folder, Sparkles } from "lucide-react";
|
|
6
|
+
import { BrandLogo } from "@elabs-ai/components-icons";
|
|
7
|
+
import {
|
|
8
|
+
Button,
|
|
9
|
+
cn,
|
|
10
|
+
Heading,
|
|
11
|
+
Kbd,
|
|
12
|
+
useLocale
|
|
13
|
+
} from "@elabs-ai/components-ui";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var SessionHeader = forwardRef(function SessionHeader2({
|
|
16
|
+
title,
|
|
17
|
+
model,
|
|
18
|
+
workspace,
|
|
19
|
+
version,
|
|
20
|
+
capabilities,
|
|
21
|
+
whatsNew,
|
|
22
|
+
quickActions,
|
|
23
|
+
level = 2,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}, ref) {
|
|
27
|
+
const { t } = useLocale();
|
|
28
|
+
const hasMeta = model != null || version != null;
|
|
29
|
+
const hasIdentity = title != null || hasMeta || workspace != null;
|
|
30
|
+
const hasCapabilities = (capabilities?.length ?? 0) > 0;
|
|
31
|
+
const hasWhatsNew = (whatsNew?.length ?? 0) > 0;
|
|
32
|
+
const hasQuickActions = (quickActions?.length ?? 0) > 0;
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
ref,
|
|
37
|
+
"data-slot": "session-header",
|
|
38
|
+
className: cn(
|
|
39
|
+
"min-w-0 rounded-xl border bg-card p-5 text-card-foreground shadow-xs",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
...props,
|
|
43
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-4", children: [
|
|
44
|
+
hasIdentity ? /* @__PURE__ */ jsxs("div", { "data-slot": "session-header-identity", className: "flex min-w-0 flex-col gap-1", children: [
|
|
45
|
+
title != null ? /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "shrink-0", children: /* @__PURE__ */ jsx(BrandLogo, { variant: "mark", height: 24, title }) }),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
Heading,
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "session-header-title",
|
|
51
|
+
level,
|
|
52
|
+
size: "subtitle",
|
|
53
|
+
className: "min-w-0 truncate",
|
|
54
|
+
children: title
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }) : null,
|
|
58
|
+
hasMeta ? /* @__PURE__ */ jsxs(
|
|
59
|
+
"p",
|
|
60
|
+
{
|
|
61
|
+
"data-slot": "session-header-meta",
|
|
62
|
+
className: "min-w-0 truncate text-meta text-muted-foreground",
|
|
63
|
+
children: [
|
|
64
|
+
model,
|
|
65
|
+
model != null && version != null ? " \xB7 " : null,
|
|
66
|
+
version
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
) : null,
|
|
70
|
+
workspace != null ? /* @__PURE__ */ jsxs(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
"data-slot": "session-header-workspace",
|
|
74
|
+
className: "flex min-w-0 items-center gap-1.5 text-body text-muted-foreground",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Folder, { "aria-hidden": "true", className: "size-3.5 shrink-0" }),
|
|
77
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: workspace })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) : null
|
|
81
|
+
] }) : null,
|
|
82
|
+
hasCapabilities ? /* @__PURE__ */ jsxs("div", { "data-slot": "session-header-capabilities", className: "flex min-w-0 flex-col gap-2", children: [
|
|
83
|
+
/* @__PURE__ */ jsx("p", { className: "text-meta font-medium text-muted-foreground", children: t("ai.sessionHeader.capabilities") }),
|
|
84
|
+
/* @__PURE__ */ jsx("ul", { className: "flex min-w-0 flex-col gap-2", children: capabilities?.map((capability) => /* @__PURE__ */ jsxs(
|
|
85
|
+
"li",
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "session-header-capability",
|
|
88
|
+
className: "flex min-w-0 items-start gap-2",
|
|
89
|
+
children: [
|
|
90
|
+
capability.icon != null ? /* @__PURE__ */ jsx(
|
|
91
|
+
"span",
|
|
92
|
+
{
|
|
93
|
+
"aria-hidden": "true",
|
|
94
|
+
className: "mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-4",
|
|
95
|
+
children: capability.icon
|
|
96
|
+
}
|
|
97
|
+
) : null,
|
|
98
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
99
|
+
/* @__PURE__ */ jsx("p", { className: "min-w-0 truncate text-body text-foreground", children: capability.label }),
|
|
100
|
+
capability.description != null ? /* @__PURE__ */ jsx("p", { className: "min-w-0 truncate text-meta text-muted-foreground", children: capability.description }) : null
|
|
101
|
+
] })
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
capability.label
|
|
105
|
+
)) })
|
|
106
|
+
] }) : null,
|
|
107
|
+
hasWhatsNew ? /* @__PURE__ */ jsxs("div", { "data-slot": "session-header-whats-new", className: "flex min-w-0 flex-col gap-2", children: [
|
|
108
|
+
/* @__PURE__ */ jsxs("p", { className: "flex items-center gap-1.5 text-meta font-medium text-muted-foreground", children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Sparkles, { "aria-hidden": "true", className: "size-3.5 shrink-0" }),
|
|
110
|
+
t("ai.sessionHeader.whatsNew")
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsx("ul", { className: "flex min-w-0 flex-col gap-1", children: whatsNew?.map((item) => /* @__PURE__ */ jsx(
|
|
113
|
+
"li",
|
|
114
|
+
{
|
|
115
|
+
"data-slot": "session-header-whats-new-item",
|
|
116
|
+
className: "min-w-0 truncate text-body",
|
|
117
|
+
children: item.href != null ? /* @__PURE__ */ jsx(
|
|
118
|
+
"a",
|
|
119
|
+
{
|
|
120
|
+
href: item.href,
|
|
121
|
+
className: "text-link underline-offset-4 hover:underline focus-ring",
|
|
122
|
+
children: item.label
|
|
123
|
+
}
|
|
124
|
+
) : /* @__PURE__ */ jsx("span", { className: "text-foreground", children: item.label })
|
|
125
|
+
},
|
|
126
|
+
item.label
|
|
127
|
+
)) })
|
|
128
|
+
] }) : null,
|
|
129
|
+
hasQuickActions ? /* @__PURE__ */ jsx(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
"data-slot": "session-header-quick-actions",
|
|
133
|
+
role: "group",
|
|
134
|
+
"aria-label": t("ai.sessionHeader.quickActions"),
|
|
135
|
+
className: "flex min-w-0 flex-wrap gap-2",
|
|
136
|
+
children: quickActions?.map((action) => /* @__PURE__ */ jsxs(
|
|
137
|
+
Button,
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
"data-slot": "session-header-quick-action",
|
|
141
|
+
variant: "outline",
|
|
142
|
+
size: "sm",
|
|
143
|
+
onClick: action.onSelect,
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx("span", { children: action.label }),
|
|
146
|
+
action.keyHint != null ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
147
|
+
" ",
|
|
148
|
+
/* @__PURE__ */ jsx(Kbd, { children: action.keyHint })
|
|
149
|
+
] }) : null
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
action.label
|
|
153
|
+
))
|
|
154
|
+
}
|
|
155
|
+
) : null
|
|
156
|
+
] })
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export {
|
|
162
|
+
SessionHeader
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=chunk-5UOMU27Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/session-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { forwardRef } from \"react\";\nimport { Folder, Sparkles } from \"lucide-react\";\nimport { BrandLogo } from \"@elabs-ai/components-icons\";\nimport {\n Button,\n cn,\n Heading,\n Kbd,\n useLocale,\n type HeadingLevel,\n type SessionCapability,\n type SessionQuickAction,\n type SessionWhatsNewItem,\n} from \"@elabs-ai/components-ui\";\n\n// `SessionCapability`, `SessionWhatsNewItem` and `SessionQuickAction` moved\n// to `@elabs-ai/components-ui` (`lib/session-launch.ts`) — the terminal CLI\n// look-alike family's own session header (issue #117) reuses the same\n// vocabulary shape, and `@elabs-ai/components-ai`/\n// `@elabs-ai/components-terminal` are layer-2 DAG siblings that may not\n// import each other (T0; see\n// docs/decisions/2026-09-01-brainless-adoption-architecture.md § 4). Imported\n// above; NOT re-exported from here — a consumer imports these from\n// `@elabs-ai/components-ui`.\n\nexport interface SessionHeaderProps extends ComponentProps<\"div\"> {\n /**\n * Session/agent name, e.g. \"Codex\". Anchors the card — every other section\n * is independently optional and renders nothing when omitted.\n */\n title?: string;\n /** Active model, e.g. \"gpt-5.1-codex\". */\n model?: string;\n /** Working directory / project path. Truncates instead of overflowing. */\n workspace?: string;\n /** Build/version string, e.g. \"v2.4.0\". */\n version?: string;\n /** What this session can reach. */\n capabilities?: SessionCapability[];\n /** Recent changes, shown as a short list. */\n whatsNew?: SessionWhatsNewItem[];\n /** Shortcut actions, rendered as real buttons with optional shortcut hints. */\n quickActions?: SessionQuickAction[];\n /**\n * Semantic heading level for `title`. Default `2` (a session header\n * typically sits above a `ChatGreeting`'s level-1 headline, or inside a\n * page that already owns its own `<h1>`).\n */\n level?: HeadingLevel;\n}\n\n/**\n * SessionHeader — the launch card for an empty agent session: model,\n * workspace, version, capabilities, what's new, and quick actions with\n * shortcut hints. Pair it above `ChatGreeting` (or inside `ChatShell`'s\n * `header` slot) for the standard first-run agent session state.\n *\n * Distinct from `ChatGreeting`, which is the centered display-scale greeting\n * for a general assistant chat — `SessionHeader` answers different questions\n * (what workspace am I in, what model, what can this thing reach, what\n * changed) that a greeting has no home for.\n *\n * **Every section is independently optional.** With only `title` supplied,\n * the card renders the identity row alone — no empty section scaffolding,\n * no stray separators.\n */\nexport const SessionHeader = forwardRef<HTMLDivElement, SessionHeaderProps>(function SessionHeader(\n {\n title,\n model,\n workspace,\n version,\n capabilities,\n whatsNew,\n quickActions,\n level = 2,\n className,\n ...props\n },\n ref,\n) {\n const { t } = useLocale();\n const hasMeta = model != null || version != null;\n const hasIdentity = title != null || hasMeta || workspace != null;\n const hasCapabilities = (capabilities?.length ?? 0) > 0;\n const hasWhatsNew = (whatsNew?.length ?? 0) > 0;\n const hasQuickActions = (quickActions?.length ?? 0) > 0;\n\n return (\n <div\n ref={ref}\n data-slot=\"session-header\"\n className={cn(\n \"min-w-0 rounded-xl border bg-card p-5 text-card-foreground shadow-xs\",\n className,\n )}\n {...props}\n >\n <div className=\"flex min-w-0 flex-col gap-4\">\n {hasIdentity ? (\n <div data-slot=\"session-header-identity\" className=\"flex min-w-0 flex-col gap-1\">\n {title != null ? (\n <div className=\"flex min-w-0 items-center gap-2\">\n {/* Decorative — the visible Heading already carries the\n accessible name, so the mark is hidden from AT rather than\n announced a second time via BrandLogo's own `role=\"img\"`. */}\n <span aria-hidden=\"true\" className=\"shrink-0\">\n <BrandLogo variant=\"mark\" height={24} title={title} />\n </span>\n <Heading\n data-slot=\"session-header-title\"\n level={level}\n size=\"subtitle\"\n className=\"min-w-0 truncate\"\n >\n {title}\n </Heading>\n </div>\n ) : null}\n\n {hasMeta ? (\n <p\n data-slot=\"session-header-meta\"\n className=\"min-w-0 truncate text-meta text-muted-foreground\"\n >\n {model}\n {model != null && version != null ? \" · \" : null}\n {version}\n </p>\n ) : null}\n\n {workspace != null ? (\n <div\n data-slot=\"session-header-workspace\"\n className=\"flex min-w-0 items-center gap-1.5 text-body text-muted-foreground\"\n >\n <Folder aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n <span className=\"min-w-0 flex-1 truncate\">{workspace}</span>\n </div>\n ) : null}\n </div>\n ) : null}\n\n {hasCapabilities ? (\n <div data-slot=\"session-header-capabilities\" className=\"flex min-w-0 flex-col gap-2\">\n <p className=\"text-meta font-medium text-muted-foreground\">\n {t(\"ai.sessionHeader.capabilities\")}\n </p>\n <ul className=\"flex min-w-0 flex-col gap-2\">\n {capabilities?.map((capability) => (\n <li\n key={capability.label}\n data-slot=\"session-header-capability\"\n className=\"flex min-w-0 items-start gap-2\"\n >\n {capability.icon != null ? (\n <span\n aria-hidden=\"true\"\n className=\"mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-4\"\n >\n {capability.icon}\n </span>\n ) : null}\n <div className=\"min-w-0\">\n <p className=\"min-w-0 truncate text-body text-foreground\">{capability.label}</p>\n {capability.description != null ? (\n <p className=\"min-w-0 truncate text-meta text-muted-foreground\">\n {capability.description}\n </p>\n ) : null}\n </div>\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n\n {hasWhatsNew ? (\n <div data-slot=\"session-header-whats-new\" className=\"flex min-w-0 flex-col gap-2\">\n <p className=\"flex items-center gap-1.5 text-meta font-medium text-muted-foreground\">\n <Sparkles aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n {t(\"ai.sessionHeader.whatsNew\")}\n </p>\n <ul className=\"flex min-w-0 flex-col gap-1\">\n {whatsNew?.map((item) => (\n <li\n key={item.label}\n data-slot=\"session-header-whats-new-item\"\n className=\"min-w-0 truncate text-body\"\n >\n {item.href != null ? (\n <a\n href={item.href}\n className=\"text-link underline-offset-4 hover:underline focus-ring\"\n >\n {item.label}\n </a>\n ) : (\n <span className=\"text-foreground\">{item.label}</span>\n )}\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n\n {hasQuickActions ? (\n <div\n data-slot=\"session-header-quick-actions\"\n role=\"group\"\n aria-label={t(\"ai.sessionHeader.quickActions\")}\n className=\"flex min-w-0 flex-wrap gap-2\"\n >\n {quickActions?.map((action) => (\n <Button\n key={action.label}\n type=\"button\"\n data-slot=\"session-header-quick-action\"\n variant=\"outline\"\n size=\"sm\"\n onClick={action.onSelect}\n >\n <span>{action.label}</span>\n {/* An explicit space text node (not just flex `gap-2`) keeps\n \"New chat\"/\"⌘N\" apart in the button's computed accessible\n name, not only its visual layout. */}\n {action.keyHint != null ? (\n <>\n {\" \"}\n <Kbd>{action.keyHint}</Kbd>\n </>\n ) : null}\n </Button>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n );\n});\n"],"mappings":"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","names":["SessionHeader"]}
|