@adia-ai/web-components 0.0.1
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 +195 -0
- package/a2ui/dockables/action.js +152 -0
- package/a2ui/dockables/base.js +30 -0
- package/a2ui/dockables/controller.js +97 -0
- package/a2ui/dockables/data-source.js +103 -0
- package/a2ui/dockables/index.js +6 -0
- package/a2ui/dockables/lifecycle.js +84 -0
- package/a2ui/dockables/provider.js +59 -0
- package/a2ui/index.js +19 -0
- package/a2ui/manifest-runtime.js +226 -0
- package/a2ui/registry.js +200 -0
- package/a2ui/renderer.js +361 -0
- package/a2ui/root.js +152 -0
- package/a2ui/stream.js +243 -0
- package/a2ui/surface-manifest.js +294 -0
- package/a2ui/surface.js +222 -0
- package/a2ui/wire-factory.js +134 -0
- package/a2ui/wiring-engine.js +209 -0
- package/a2ui/wiring-registry.js +342 -0
- package/components/accordion/accordion.a2ui.json +129 -0
- package/components/accordion/accordion.css +133 -0
- package/components/accordion/accordion.js +125 -0
- package/components/accordion/accordion.yaml +527 -0
- package/components/action-list/action-list.a2ui.json +64 -0
- package/components/action-list/action-list.css +115 -0
- package/components/action-list/action-list.js +149 -0
- package/components/action-list/action-list.yaml +56 -0
- package/components/agent-artifact/agent-artifact.a2ui.json +99 -0
- package/components/agent-artifact/agent-artifact.css +94 -0
- package/components/agent-artifact/agent-artifact.js +169 -0
- package/components/agent-artifact/agent-artifact.yaml +71 -0
- package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +91 -0
- package/components/agent-feedback-bar/agent-feedback-bar.css +33 -0
- package/components/agent-feedback-bar/agent-feedback-bar.js +152 -0
- package/components/agent-feedback-bar/agent-feedback-bar.yaml +65 -0
- package/components/agent-questions/agent-questions.a2ui.json +89 -0
- package/components/agent-questions/agent-questions.css +146 -0
- package/components/agent-questions/agent-questions.js +189 -0
- package/components/agent-questions/agent-questions.yaml +63 -0
- package/components/agent-reasoning/agent-reasoning.a2ui.json +100 -0
- package/components/agent-reasoning/agent-reasoning.css +273 -0
- package/components/agent-reasoning/agent-reasoning.js +469 -0
- package/components/agent-reasoning/agent-reasoning.yaml +70 -0
- package/components/agent-suggestions/agent-suggestions.a2ui.json +87 -0
- package/components/agent-suggestions/agent-suggestions.css +18 -0
- package/components/agent-suggestions/agent-suggestions.js +87 -0
- package/components/agent-suggestions/agent-suggestions.yaml +59 -0
- package/components/agent-trace/agent-trace.a2ui.json +78 -0
- package/components/agent-trace/agent-trace.css +275 -0
- package/components/agent-trace/agent-trace.js +216 -0
- package/components/agent-trace/agent-trace.yaml +53 -0
- package/components/alert/alert.a2ui.json +211 -0
- package/components/alert/alert.css +88 -0
- package/components/alert/alert.js +96 -0
- package/components/alert/alert.yaml +205 -0
- package/components/avatar/avatar.a2ui.json +215 -0
- package/components/avatar/avatar.css +159 -0
- package/components/avatar/avatar.js +157 -0
- package/components/avatar/avatar.yaml +559 -0
- package/components/badge/badge.a2ui.json +169 -0
- package/components/badge/badge.css +78 -0
- package/components/badge/badge.js +53 -0
- package/components/badge/badge.yaml +612 -0
- package/components/block/block.a2ui.json +135 -0
- package/components/block/block.css +29 -0
- package/components/block/block.js +23 -0
- package/components/block/block.yaml +115 -0
- package/components/breadcrumb/breadcrumb.a2ui.json +86 -0
- package/components/breadcrumb/breadcrumb.css +78 -0
- package/components/breadcrumb/breadcrumb.js +44 -0
- package/components/breadcrumb/breadcrumb.yaml +84 -0
- package/components/button/button.a2ui.json +172 -0
- package/components/button/button.css +168 -0
- package/components/button/button.js +60 -0
- package/components/button/button.yaml +120 -0
- package/components/calendar-picker/calendar-picker.a2ui.json +139 -0
- package/components/calendar-picker/calendar-picker.css +321 -0
- package/components/calendar-picker/calendar-picker.js +324 -0
- package/components/calendar-picker/calendar-picker.yaml +243 -0
- package/components/canvas/canvas.a2ui.json +75 -0
- package/components/canvas/canvas.css +52 -0
- package/components/canvas/canvas.js +179 -0
- package/components/canvas/canvas.yaml +62 -0
- package/components/card/card.a2ui.json +276 -0
- package/components/card/card.css +362 -0
- package/components/card/card.js +58 -0
- package/components/card/card.yaml +527 -0
- package/components/chart/chart.a2ui.json +298 -0
- package/components/chart/chart.css +512 -0
- package/components/chart/chart.js +1075 -0
- package/components/chart/chart.yaml +540 -0
- package/components/chat/chat-input.css +141 -0
- package/components/chat/chat-input.js +242 -0
- package/components/chat/chat.a2ui.json +181 -0
- package/components/chat/chat.css +193 -0
- package/components/chat/chat.js +155 -0
- package/components/chat/chat.yaml +230 -0
- package/components/check/check.a2ui.json +134 -0
- package/components/check/check.css +126 -0
- package/components/check/check.js +58 -0
- package/components/check/check.yaml +109 -0
- package/components/code/code.a2ui.json +153 -0
- package/components/code/code.css +133 -0
- package/components/code/code.js +114 -0
- package/components/code/code.yaml +163 -0
- package/components/col/col.a2ui.json +104 -0
- package/components/col/col.css +36 -0
- package/components/col/col.js +19 -0
- package/components/col/col.yaml +364 -0
- package/components/color-picker/color-picker.a2ui.json +100 -0
- package/components/color-picker/color-picker.css +182 -0
- package/components/color-picker/color-picker.js +537 -0
- package/components/color-picker/color-picker.yaml +105 -0
- package/components/command/command.a2ui.json +221 -0
- package/components/command/command.css +251 -0
- package/components/command/command.js +284 -0
- package/components/command/command.yaml +186 -0
- package/components/description-list/description-list.a2ui.json +89 -0
- package/components/description-list/description-list.css +70 -0
- package/components/description-list/description-list.js +75 -0
- package/components/description-list/description-list.yaml +59 -0
- package/components/divider/divider.a2ui.json +126 -0
- package/components/divider/divider.css +102 -0
- package/components/divider/divider.js +47 -0
- package/components/divider/divider.yaml +366 -0
- package/components/drawer/drawer.a2ui.json +199 -0
- package/components/drawer/drawer.css +342 -0
- package/components/drawer/drawer.js +263 -0
- package/components/drawer/drawer.yaml +366 -0
- package/components/embed/embed.a2ui.json +150 -0
- package/components/embed/embed.css +28 -0
- package/components/embed/embed.js +63 -0
- package/components/embed/embed.yaml +224 -0
- package/components/empty-state/empty-state.a2ui.json +133 -0
- package/components/empty-state/empty-state.css +58 -0
- package/components/empty-state/empty-state.js +87 -0
- package/components/empty-state/empty-state.yaml +314 -0
- package/components/footer/footer.a2ui.json +79 -0
- package/components/footer/footer.yaml +239 -0
- package/components/grid/grid.a2ui.json +171 -0
- package/components/grid/grid.css +37 -0
- package/components/grid/grid.js +21 -0
- package/components/grid/grid.yaml +577 -0
- package/components/header/header.a2ui.json +76 -0
- package/components/header/header.yaml +336 -0
- package/components/heatmap/heatmap.a2ui.json +150 -0
- package/components/heatmap/heatmap.css +146 -0
- package/components/heatmap/heatmap.js +246 -0
- package/components/heatmap/heatmap.yaml +131 -0
- package/components/icon/icon.a2ui.json +79 -0
- package/components/icon/icon.css +20 -0
- package/components/icon/icon.js +26 -0
- package/components/icon/icon.yaml +233 -0
- package/components/image/image.a2ui.json +261 -0
- package/components/image/image.css +76 -0
- package/components/image/image.js +102 -0
- package/components/image/image.yaml +477 -0
- package/components/index.js +85 -0
- package/components/input/input.a2ui.json +284 -0
- package/components/input/input.css +162 -0
- package/components/input/input.js +148 -0
- package/components/input/input.yaml +496 -0
- package/components/inspector/inspector.a2ui.json +67 -0
- package/components/inspector/inspector.css +31 -0
- package/components/inspector/inspector.js +133 -0
- package/components/inspector/inspector.yaml +58 -0
- package/components/kbd/kbd.a2ui.json +96 -0
- package/components/kbd/kbd.css +62 -0
- package/components/kbd/kbd.js +24 -0
- package/components/kbd/kbd.yaml +213 -0
- package/components/list/list.a2ui.json +145 -0
- package/components/list/list.css +103 -0
- package/components/list/list.js +236 -0
- package/components/list/list.yaml +122 -0
- package/components/menu/menu.a2ui.json +146 -0
- package/components/menu/menu.css +146 -0
- package/components/menu/menu.js +296 -0
- package/components/menu/menu.yaml +123 -0
- package/components/modal/modal.a2ui.json +136 -0
- package/components/modal/modal.css +153 -0
- package/components/modal/modal.js +181 -0
- package/components/modal/modal.yaml +114 -0
- package/components/noodles/noodles.a2ui.json +145 -0
- package/components/noodles/noodles.css +118 -0
- package/components/noodles/noodles.js +470 -0
- package/components/noodles/noodles.yaml +123 -0
- package/components/otp-input/otp-input.a2ui.json +104 -0
- package/components/otp-input/otp-input.css +78 -0
- package/components/otp-input/otp-input.js +170 -0
- package/components/otp-input/otp-input.yaml +218 -0
- package/components/pagination/pagination.a2ui.json +122 -0
- package/components/pagination/pagination.css +162 -0
- package/components/pagination/pagination.js +185 -0
- package/components/pagination/pagination.yaml +165 -0
- package/components/pane/pane.a2ui.json +94 -0
- package/components/pane/pane.css +166 -0
- package/components/pane/pane.js +140 -0
- package/components/pane/pane.yaml +197 -0
- package/components/pipeline-status/pipeline-status.a2ui.json +90 -0
- package/components/pipeline-status/pipeline-status.css +162 -0
- package/components/pipeline-status/pipeline-status.js +176 -0
- package/components/pipeline-status/pipeline-status.yaml +99 -0
- package/components/popover/popover.a2ui.json +181 -0
- package/components/popover/popover.css +57 -0
- package/components/popover/popover.js +170 -0
- package/components/popover/popover.yaml +257 -0
- package/components/progress/progress.a2ui.json +199 -0
- package/components/progress/progress.css +88 -0
- package/components/progress/progress.js +64 -0
- package/components/progress/progress.yaml +342 -0
- package/components/progress-row/progress-row.a2ui.json +100 -0
- package/components/progress-row/progress-row.css +57 -0
- package/components/progress-row/progress-row.js +92 -0
- package/components/progress-row/progress-row.yaml +87 -0
- package/components/radio/radio.a2ui.json +232 -0
- package/components/radio/radio.css +102 -0
- package/components/radio/radio.js +73 -0
- package/components/radio/radio.yaml +248 -0
- package/components/range/range.a2ui.json +151 -0
- package/components/range/range.css +148 -0
- package/components/range/range.js +177 -0
- package/components/range/range.yaml +188 -0
- package/components/rating/rating.a2ui.json +105 -0
- package/components/rating/rating.css +92 -0
- package/components/rating/rating.js +138 -0
- package/components/rating/rating.yaml +74 -0
- package/components/richtext/richtext.a2ui.json +82 -0
- package/components/richtext/richtext.css +225 -0
- package/components/richtext/richtext.js +74 -0
- package/components/richtext/richtext.yaml +89 -0
- package/components/row/row.a2ui.json +102 -0
- package/components/row/row.css +51 -0
- package/components/row/row.js +39 -0
- package/components/row/row.yaml +358 -0
- package/components/search/search.a2ui.json +186 -0
- package/components/search/search.css +28 -0
- package/components/search/search.js +124 -0
- package/components/search/search.yaml +154 -0
- package/components/section/section.a2ui.json +78 -0
- package/components/section/section.yaml +338 -0
- package/components/segment/segment.a2ui.json +100 -0
- package/components/segment/segment.css +81 -0
- package/components/segment/segment.js +32 -0
- package/components/segment/segment.yaml +216 -0
- package/components/segmented/segmented.a2ui.json +106 -0
- package/components/segmented/segmented.css +67 -0
- package/components/segmented/segmented.js +149 -0
- package/components/segmented/segmented.yaml +91 -0
- package/components/select/select.a2ui.json +203 -0
- package/components/select/select.css +277 -0
- package/components/select/select.js +388 -0
- package/components/select/select.yaml +375 -0
- package/components/skeleton/skeleton.a2ui.json +120 -0
- package/components/skeleton/skeleton.css +47 -0
- package/components/skeleton/skeleton.js +43 -0
- package/components/skeleton/skeleton.yaml +153 -0
- package/components/slider/slider.a2ui.json +162 -0
- package/components/slider/slider.css +137 -0
- package/components/slider/slider.js +162 -0
- package/components/slider/slider.yaml +299 -0
- package/components/stack/stack.a2ui.json +62 -0
- package/components/stack/stack.css +28 -0
- package/components/stack/stack.js +18 -0
- package/components/stack/stack.yaml +54 -0
- package/components/stat/stat.a2ui.json +246 -0
- package/components/stat/stat.css +101 -0
- package/components/stat/stat.js +91 -0
- package/components/stat/stat.yaml +206 -0
- package/components/stepper/stepper.a2ui.json +77 -0
- package/components/stepper/stepper.css +243 -0
- package/components/stepper/stepper.js +118 -0
- package/components/stepper/stepper.yaml +73 -0
- package/components/stream/stream.a2ui.json +98 -0
- package/components/stream/stream.css +37 -0
- package/components/stream/stream.js +99 -0
- package/components/stream/stream.yaml +87 -0
- package/components/swiper/swiper.a2ui.json +140 -0
- package/components/swiper/swiper.css +267 -0
- package/components/swiper/swiper.js +285 -0
- package/components/swiper/swiper.yaml +268 -0
- package/components/switch/switch.a2ui.json +134 -0
- package/components/switch/switch.css +104 -0
- package/components/switch/switch.js +53 -0
- package/components/switch/switch.yaml +322 -0
- package/components/table/cell-types.js +296 -0
- package/components/table/table.a2ui.json +458 -0
- package/components/table/table.css +531 -0
- package/components/table/table.js +1392 -0
- package/components/table/table.yaml +528 -0
- package/components/tabs/tab.js +34 -0
- package/components/tabs/tabs.a2ui.json +174 -0
- package/components/tabs/tabs.css +162 -0
- package/components/tabs/tabs.js +226 -0
- package/components/tabs/tabs.yaml +255 -0
- package/components/tag/tag.a2ui.json +148 -0
- package/components/tag/tag.css +118 -0
- package/components/tag/tag.js +88 -0
- package/components/tag/tag.yaml +125 -0
- package/components/text/text.a2ui.json +99 -0
- package/components/text/text.css +65 -0
- package/components/text/text.js +35 -0
- package/components/text/text.yaml +360 -0
- package/components/textarea/textarea.a2ui.json +91 -0
- package/components/textarea/textarea.css +93 -0
- package/components/textarea/textarea.js +114 -0
- package/components/textarea/textarea.yaml +79 -0
- package/components/timeline/timeline.a2ui.json +82 -0
- package/components/timeline/timeline.css +389 -0
- package/components/timeline/timeline.js +171 -0
- package/components/timeline/timeline.yaml +185 -0
- package/components/toast/toast.a2ui.json +199 -0
- package/components/toast/toast.css +211 -0
- package/components/toast/toast.js +146 -0
- package/components/toast/toast.yaml +184 -0
- package/components/toggle-group/toggle-group.a2ui.json +126 -0
- package/components/toggle-group/toggle-group.css +102 -0
- package/components/toggle-group/toggle-group.js +147 -0
- package/components/toggle-group/toggle-group.yaml +98 -0
- package/components/toolbar/toolbar.a2ui.json +131 -0
- package/components/toolbar/toolbar.css +132 -0
- package/components/toolbar/toolbar.js +366 -0
- package/components/toolbar/toolbar.yaml +238 -0
- package/components/tooltip/tooltip.a2ui.json +148 -0
- package/components/tooltip/tooltip.css +39 -0
- package/components/tooltip/tooltip.js +96 -0
- package/components/tooltip/tooltip.yaml +201 -0
- package/components/tree/tree.a2ui.json +119 -0
- package/components/tree/tree.css +133 -0
- package/components/tree/tree.js +253 -0
- package/components/tree/tree.yaml +92 -0
- package/components/upload/upload.a2ui.json +185 -0
- package/components/upload/upload.css +115 -0
- package/components/upload/upload.js +189 -0
- package/components/upload/upload.yaml +302 -0
- package/core/anchor.js +187 -0
- package/core/controller.js +182 -0
- package/core/element.js +257 -0
- package/core/form.js +217 -0
- package/core/icons.js +180 -0
- package/core/markdown.js +95 -0
- package/core/polyfills.js +23 -0
- package/core/provider.js +262 -0
- package/core/signals.js +113 -0
- package/core/template.js +226 -0
- package/core/transport.js +77 -0
- package/package.json +38 -0
- package/patterns/adia-chat/adia-chat.a2ui.json +149 -0
- package/patterns/adia-chat/adia-chat.css +10 -0
- package/patterns/adia-chat/adia-chat.js +297 -0
- package/patterns/adia-chat/adia-chat.yaml +118 -0
- package/patterns/adia-chat/css/adia-chat.empty.css +12 -0
- package/patterns/adia-chat/css/adia-chat.layout.css +60 -0
- package/patterns/adia-chat/css/adia-chat.markdown.css +74 -0
- package/patterns/adia-chat/css/adia-chat.messages.css +87 -0
- package/patterns/adia-chat/css/adia-chat.streaming.css +30 -0
- package/patterns/adia-chat/css/adia-chat.tokens.css +95 -0
- package/patterns/adia-chat/index.html +93 -0
- package/patterns/adia-editor/adia-editor.a2ui.json +58 -0
- package/patterns/adia-editor/adia-editor.css +6 -0
- package/patterns/adia-editor/adia-editor.js +56 -0
- package/patterns/adia-editor/adia-editor.yaml +36 -0
- package/patterns/adia-editor/css/adia-editor.layout.css +86 -0
- package/patterns/adia-editor/css/adia-editor.tokens.css +28 -0
- package/patterns/adia-editor/index.html +179 -0
- package/patterns/app-nav/app-nav.a2ui.json +89 -0
- package/patterns/app-nav/app-nav.css +92 -0
- package/patterns/app-nav/app-nav.js +99 -0
- package/patterns/app-nav/app-nav.yaml +54 -0
- package/patterns/app-nav-group/app-nav-group.a2ui.json +82 -0
- package/patterns/app-nav-group/app-nav-group.css +261 -0
- package/patterns/app-nav-group/app-nav-group.js +116 -0
- package/patterns/app-nav-group/app-nav-group.yaml +59 -0
- package/patterns/app-nav-item/app-nav-item.a2ui.json +83 -0
- package/patterns/app-nav-item/app-nav-item.css +156 -0
- package/patterns/app-nav-item/app-nav-item.js +42 -0
- package/patterns/app-nav-item/app-nav-item.yaml +62 -0
- package/patterns/app-shell/app-shell.a2ui.json +114 -0
- package/patterns/app-shell/app-shell.css +14 -0
- package/patterns/app-shell/app-shell.js +251 -0
- package/patterns/app-shell/app-shell.yaml +66 -0
- package/patterns/app-shell/css/app-shell.collapsed.css +86 -0
- package/patterns/app-shell/css/app-shell.helpers.css +42 -0
- package/patterns/app-shell/css/app-shell.main.css +58 -0
- package/patterns/app-shell/css/app-shell.shell.css +44 -0
- package/patterns/app-shell/css/app-shell.sidebar.css +116 -0
- package/patterns/app-shell/css/app-shell.templates.css +214 -0
- package/patterns/app-shell/css/app-shell.tokens.css +116 -0
- package/patterns/app-shell/index.html +112 -0
- package/patterns/gen-ui/gen-ui.a2ui.json +72 -0
- package/patterns/gen-ui/gen-ui.css +83 -0
- package/patterns/gen-ui/gen-ui.js +136 -0
- package/patterns/gen-ui/gen-ui.yaml +43 -0
- package/patterns/index.js +10 -0
- package/patterns/section-nav/section-nav.a2ui.json +91 -0
- package/patterns/section-nav/section-nav.css +59 -0
- package/patterns/section-nav/section-nav.js +42 -0
- package/patterns/section-nav/section-nav.yaml +58 -0
- package/patterns/section-nav-group/section-nav-group.a2ui.json +95 -0
- package/patterns/section-nav-group/section-nav-group.css +74 -0
- package/patterns/section-nav-group/section-nav-group.js +84 -0
- package/patterns/section-nav-group/section-nav-group.yaml +66 -0
- package/patterns/section-nav-item/section-nav-item.a2ui.json +97 -0
- package/patterns/section-nav-item/section-nav-item.css +96 -0
- package/patterns/section-nav-item/section-nav-item.js +66 -0
- package/patterns/section-nav-item/section-nav-item.yaml +70 -0
- package/styles/colors/index.css +6 -0
- package/styles/colors/parameters.css +52 -0
- package/styles/colors/primitives-accent.css +89 -0
- package/styles/colors/primitives-brand.css +89 -0
- package/styles/colors/primitives-danger.css +89 -0
- package/styles/colors/primitives-info.css +89 -0
- package/styles/colors/primitives-neutral.css +91 -0
- package/styles/colors/primitives-shared.css +57 -0
- package/styles/colors/primitives-success.css +89 -0
- package/styles/colors/primitives-warning.css +89 -0
- package/styles/colors/primitives.css +17 -0
- package/styles/colors/scrims.css +182 -0
- package/styles/colors/semantics.css +595 -0
- package/styles/colors/surfaces.css +43 -0
- package/styles/fonts.css +99 -0
- package/styles/layouts/admin.css +7 -0
- package/styles/prose.css +186 -0
- package/styles/styles.css +193 -0
- package/styles/themes.css +155 -0
- package/styles/tokens.css +304 -0
- package/styles/typography.css +853 -0
- package/traits/active-state.js +24 -0
- package/traits/anchor-positioning.js +66 -0
- package/traits/attention-pulse.js +30 -0
- package/traits/confetti-burst.js +65 -0
- package/traits/confetti.js +57 -0
- package/traits/count-up.js +42 -0
- package/traits/define.js +76 -0
- package/traits/dirty-state.js +38 -0
- package/traits/drag-ghost.js +38 -0
- package/traits/draggable.js +73 -0
- package/traits/fade-presence.js +52 -0
- package/traits/focus-trap.js +63 -0
- package/traits/focusable.js +38 -0
- package/traits/glow-focus.js +33 -0
- package/traits/gradient-shift.js +32 -0
- package/traits/haptic-feedback.js +28 -0
- package/traits/hotkey.js +62 -0
- package/traits/hoverable.js +26 -0
- package/traits/index.js +55 -0
- package/traits/inertia-drag.js +133 -0
- package/traits/intersection-observer.js +33 -0
- package/traits/keyboard-nav.js +36 -0
- package/traits/magnetic-hover.js +37 -0
- package/traits/noise-texture.js +30 -0
- package/traits/parallax.js +42 -0
- package/traits/portal.js +27 -0
- package/traits/pressable.js +75 -0
- package/traits/resizable.js +100 -0
- package/traits/resize-observer.js +31 -0
- package/traits/ripple.js +53 -0
- package/traits/roving-tabindex.js +67 -0
- package/traits/scale-press.js +43 -0
- package/traits/scroll-lock.js +27 -0
- package/traits/shimmer-loading.js +44 -0
- package/traits/snap-to-grid.js +28 -0
- package/traits/sound-feedback.js +30 -0
- package/traits/spring-animate.js +56 -0
- package/traits/tilt-hover.js +37 -0
- package/traits/tossable.js +178 -0
- package/traits/typeahead.js +63 -0
- package/traits/typewriter.js +35 -0
- package/traits/validation.js +118 -0
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <agent-reasoning-ui> — Agent inner monologue + pipeline viewer.
|
|
3
|
+
*
|
|
4
|
+
* Unified chain-of-thought surface. Composes <timeline-ui size="sm"> for step
|
|
5
|
+
* rendering and adds plan / thought / iteration interstitials. Auto-collapses
|
|
6
|
+
* after finish.
|
|
7
|
+
*
|
|
8
|
+
* - STEPS → timeline-ui size="sm" rows (completed / active+spinner / error)
|
|
9
|
+
* - THOUGHTS → free-form monologue paragraphs
|
|
10
|
+
* - PLAN → ordered up-front list in a subtle panel
|
|
11
|
+
* - ITERATION → attempt N blocks, each with its own sub-timeline
|
|
12
|
+
*
|
|
13
|
+
* JS API:
|
|
14
|
+
* const r = document.createElement('agent-reasoning-ui');
|
|
15
|
+
*
|
|
16
|
+
* r.setPlan(['Read intent', 'Search patterns', 'Synthesize output']);
|
|
17
|
+
* r.addThought('The request matches the "product card" pattern.');
|
|
18
|
+
*
|
|
19
|
+
* r.addStep({ id: 'search', label: 'search: Finding patterns…' });
|
|
20
|
+
* r.updateStep('search', { outcomes: ['3 candidates ranked'] });
|
|
21
|
+
* r.completeStep('search', 1200);
|
|
22
|
+
*
|
|
23
|
+
* r.startIteration(1, 'First attempt');
|
|
24
|
+
* r.addStep({ id: 'gen', label: 'generate' });
|
|
25
|
+
* r.completeStep('gen', 3000);
|
|
26
|
+
* r.endIteration(1, { status: 'error', summary: 'validation 62/100' });
|
|
27
|
+
*
|
|
28
|
+
* r.startIteration(2, 'Retry with hint');
|
|
29
|
+
* r.addStep({ id: 'gen2', label: 'generate (retry)' });
|
|
30
|
+
* r.completeStep('gen2', 2500);
|
|
31
|
+
* r.endIteration(2, { status: 'done', summary: 'validation 94/100' });
|
|
32
|
+
*
|
|
33
|
+
* r.finish('2 iterations · 94/100 · 7s');
|
|
34
|
+
*
|
|
35
|
+
* Attributes:
|
|
36
|
+
* collapsed — start collapsed
|
|
37
|
+
* autocollapse — collapse 1.2s after finish (default: true)
|
|
38
|
+
* heading — fallback summary label while active
|
|
39
|
+
* status — 'idle' | 'active' | 'done' | 'error' (default: 'active')
|
|
40
|
+
* Drives the status icon: spinner / check-circle / warning-circle
|
|
41
|
+
*
|
|
42
|
+
* Events:
|
|
43
|
+
* reasoning-toggle — summary expanded/collapsed (detail: { collapsed })
|
|
44
|
+
* reasoning-step-toggle — a step's outcomes were toggled (detail: { stepId })
|
|
45
|
+
* reasoning-finish — .finish() was called (detail: { summary, status })
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
import { AdiaElement } from '@core/element.js';
|
|
49
|
+
|
|
50
|
+
// Status lifecycle for the reasoning surface as a whole.
|
|
51
|
+
// active — still thinking (default; renders the spinner)
|
|
52
|
+
// done — finished successfully (renders check-circle)
|
|
53
|
+
// error — finished with failure (renders warning)
|
|
54
|
+
// idle — not started (renders muted dot)
|
|
55
|
+
const REASONING_STATUSES = new Set(['idle', 'active', 'done', 'error']);
|
|
56
|
+
|
|
57
|
+
class AdiaAgentReasoning extends AdiaElement {
|
|
58
|
+
static properties = {
|
|
59
|
+
collapsed: { type: Boolean, default: false, reflect: true },
|
|
60
|
+
autocollapse: { type: Boolean, default: true, reflect: true },
|
|
61
|
+
heading: { type: String, default: '', reflect: true },
|
|
62
|
+
status: { type: String, default: 'active', reflect: true },
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
static template = () => null;
|
|
66
|
+
|
|
67
|
+
// Flat entries list; each is one of:
|
|
68
|
+
// { kind: 'step', id, label, status, duration, outcomes, children }
|
|
69
|
+
// { kind: 'thought', id, text }
|
|
70
|
+
// { kind: 'plan', id, items: string[] }
|
|
71
|
+
// { kind: 'iteration', id, n, label, status, summary, steps: step[] }
|
|
72
|
+
#entries = [];
|
|
73
|
+
#iterationStack = [];
|
|
74
|
+
#startTime = Date.now();
|
|
75
|
+
#timerInterval = null;
|
|
76
|
+
#finishTimer = null;
|
|
77
|
+
#summaryEl = null;
|
|
78
|
+
#bodyEl = null;
|
|
79
|
+
|
|
80
|
+
get entries() { return this.#entries; }
|
|
81
|
+
|
|
82
|
+
connected() {
|
|
83
|
+
this.#startTime = Date.now();
|
|
84
|
+
this.#timerInterval = setInterval(() => this.#tickTimers(), 1000);
|
|
85
|
+
this.#buildShell();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
disconnected() {
|
|
89
|
+
if (this.#timerInterval != null) {
|
|
90
|
+
clearInterval(this.#timerInterval);
|
|
91
|
+
this.#timerInterval = null;
|
|
92
|
+
}
|
|
93
|
+
if (this.#finishTimer != null) {
|
|
94
|
+
clearTimeout(this.#finishTimer);
|
|
95
|
+
this.#finishTimer = null;
|
|
96
|
+
}
|
|
97
|
+
this.#summaryEl?.removeEventListener('click', this.#onSummaryClick);
|
|
98
|
+
this.#summaryEl = null;
|
|
99
|
+
this.#bodyEl = null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ── Public API ──
|
|
103
|
+
|
|
104
|
+
addStep(step) {
|
|
105
|
+
const entry = {
|
|
106
|
+
kind: 'step',
|
|
107
|
+
status: 'active',
|
|
108
|
+
duration: null,
|
|
109
|
+
outcomes: [],
|
|
110
|
+
children: [],
|
|
111
|
+
...step,
|
|
112
|
+
};
|
|
113
|
+
this.#appendToCurrentScope(entry);
|
|
114
|
+
this.#render();
|
|
115
|
+
return entry;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
updateStep(id, updates) {
|
|
119
|
+
const step = this.#findStep(id);
|
|
120
|
+
if (!step) return;
|
|
121
|
+
Object.assign(step, updates);
|
|
122
|
+
this.#render();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
completeStep(id, duration) {
|
|
126
|
+
const step = this.#findStep(id);
|
|
127
|
+
if (!step) return;
|
|
128
|
+
step.status = 'done';
|
|
129
|
+
if (duration != null) step.duration = duration;
|
|
130
|
+
this.#render();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
failStep(id, error) {
|
|
134
|
+
const step = this.#findStep(id);
|
|
135
|
+
if (!step) return;
|
|
136
|
+
step.status = 'error';
|
|
137
|
+
if (error) step.outcomes = [...(step.outcomes || []), String(error)];
|
|
138
|
+
this.#render();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
addThought(text, id = `thought-${this.#entries.length}`) {
|
|
142
|
+
this.#appendToCurrentScope({ kind: 'thought', id, text });
|
|
143
|
+
this.#render();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
setPlan(items, id = 'plan') {
|
|
147
|
+
const existing = this.#entries.find(e => e.kind === 'plan' && e.id === id);
|
|
148
|
+
if (existing) existing.items = items.slice();
|
|
149
|
+
else this.#entries.push({ kind: 'plan', id, items: items.slice() });
|
|
150
|
+
this.#render();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
startIteration(n, label = `Attempt ${n}`, id = `iter-${n}`) {
|
|
154
|
+
const iter = {
|
|
155
|
+
kind: 'iteration',
|
|
156
|
+
id, n, label,
|
|
157
|
+
status: 'active',
|
|
158
|
+
summary: '',
|
|
159
|
+
steps: [],
|
|
160
|
+
};
|
|
161
|
+
this.#entries.push(iter);
|
|
162
|
+
this.#iterationStack.push(id);
|
|
163
|
+
this.#render();
|
|
164
|
+
return iter;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
endIteration(n, { status = 'done', summary = '' } = {}) {
|
|
168
|
+
const id = `iter-${n}`;
|
|
169
|
+
const iter = this.#entries.find(e => e.kind === 'iteration' && e.id === id);
|
|
170
|
+
if (!iter) return;
|
|
171
|
+
iter.status = status;
|
|
172
|
+
iter.summary = summary;
|
|
173
|
+
const idx = this.#iterationStack.lastIndexOf(id);
|
|
174
|
+
if (idx >= 0) this.#iterationStack.splice(idx, 1);
|
|
175
|
+
this.#render();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
finish(summaryLabel, { status = 'done' } = {}) {
|
|
179
|
+
const resolved = REASONING_STATUSES.has(status) ? status : 'done';
|
|
180
|
+
const isError = resolved === 'error';
|
|
181
|
+
for (const entry of this.#entries) {
|
|
182
|
+
if (entry.kind === 'step' && entry.status === 'active') {
|
|
183
|
+
entry.status = isError ? 'error' : 'done';
|
|
184
|
+
}
|
|
185
|
+
if (entry.kind === 'iteration') {
|
|
186
|
+
if (entry.status === 'active') entry.status = isError ? 'error' : 'done';
|
|
187
|
+
for (const s of entry.steps || []) {
|
|
188
|
+
if (s.status === 'active') s.status = isError ? 'error' : 'done';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (this.#timerInterval != null) {
|
|
193
|
+
clearInterval(this.#timerInterval);
|
|
194
|
+
this.#timerInterval = null;
|
|
195
|
+
}
|
|
196
|
+
this.status = resolved;
|
|
197
|
+
if (summaryLabel) this.dataset.summary = summaryLabel;
|
|
198
|
+
this.#render();
|
|
199
|
+
this.dispatchEvent(new CustomEvent('reasoning-finish', {
|
|
200
|
+
bubbles: true,
|
|
201
|
+
detail: { summary: summaryLabel || '', status: resolved },
|
|
202
|
+
}));
|
|
203
|
+
|
|
204
|
+
if (this.#finishTimer != null) clearTimeout(this.#finishTimer);
|
|
205
|
+
if (this.autocollapse && !isError) {
|
|
206
|
+
this.#finishTimer = setTimeout(() => {
|
|
207
|
+
this.#finishTimer = null;
|
|
208
|
+
this.collapsed = true;
|
|
209
|
+
this.#render();
|
|
210
|
+
}, 1200);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
fail(summaryLabel) {
|
|
215
|
+
this.finish(summaryLabel, { status: 'error' });
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// ── Private ──
|
|
219
|
+
|
|
220
|
+
#appendToCurrentScope(entry) {
|
|
221
|
+
if (this.#iterationStack.length > 0) {
|
|
222
|
+
const topId = this.#iterationStack[this.#iterationStack.length - 1];
|
|
223
|
+
const iter = this.#entries.find(e => e.kind === 'iteration' && e.id === topId);
|
|
224
|
+
if (iter) {
|
|
225
|
+
if (entry.kind === 'step') iter.steps.push(entry);
|
|
226
|
+
else this.#entries.push(entry);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
this.#entries.push(entry);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
#findStep(id) {
|
|
234
|
+
for (const e of this.#entries) {
|
|
235
|
+
if (e.kind === 'step' && e.id === id) return e;
|
|
236
|
+
if (e.kind === 'iteration') {
|
|
237
|
+
for (const s of e.steps || []) if (s.id === id) return s;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
#onSummaryClick = () => {
|
|
244
|
+
this.collapsed = !this.collapsed;
|
|
245
|
+
this.dispatchEvent(new CustomEvent('reasoning-toggle', {
|
|
246
|
+
bubbles: true,
|
|
247
|
+
detail: { collapsed: this.collapsed },
|
|
248
|
+
}));
|
|
249
|
+
this.#render();
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
#buildShell() {
|
|
253
|
+
this.innerHTML = '';
|
|
254
|
+
|
|
255
|
+
this.#summaryEl = document.createElement('div');
|
|
256
|
+
this.#summaryEl.setAttribute('data-reasoning-summary', '');
|
|
257
|
+
this.#summaryEl.addEventListener('click', this.#onSummaryClick);
|
|
258
|
+
this.appendChild(this.#summaryEl);
|
|
259
|
+
|
|
260
|
+
this.#bodyEl = document.createElement('div');
|
|
261
|
+
this.#bodyEl.setAttribute('data-reasoning-body', '');
|
|
262
|
+
this.appendChild(this.#bodyEl);
|
|
263
|
+
|
|
264
|
+
this.#render();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
#activeLabel() {
|
|
268
|
+
for (let i = this.#entries.length - 1; i >= 0; i--) {
|
|
269
|
+
const e = this.#entries[i];
|
|
270
|
+
if (e.kind === 'step' && e.status === 'active') return e.label;
|
|
271
|
+
if (e.kind === 'iteration') {
|
|
272
|
+
for (let j = (e.steps || []).length - 1; j >= 0; j--) {
|
|
273
|
+
const s = e.steps[j];
|
|
274
|
+
if (s.status === 'active') return s.label;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (e.kind === 'thought') return e.text;
|
|
278
|
+
}
|
|
279
|
+
const lastStep = this.#entries.findLast?.(e => e.kind === 'step');
|
|
280
|
+
return lastStep?.label || this.heading || 'Thinking…';
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
#renderStatusIcon(status) {
|
|
284
|
+
switch (status) {
|
|
285
|
+
case 'done':
|
|
286
|
+
return '<icon-ui name="check-circle" color="success" data-reasoning-check></icon-ui>';
|
|
287
|
+
case 'error':
|
|
288
|
+
return '<icon-ui name="warning-circle" color="danger" data-reasoning-check data-error></icon-ui>';
|
|
289
|
+
case 'idle':
|
|
290
|
+
return '<icon-ui name="circle" color="muted" data-reasoning-check data-idle></icon-ui>';
|
|
291
|
+
case 'active':
|
|
292
|
+
default:
|
|
293
|
+
return '<span data-reasoning-spinner></span>';
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
#countSteps() {
|
|
298
|
+
let total = 0, done = 0;
|
|
299
|
+
const tally = (s) => { total++; if (s.status === 'done') done++; };
|
|
300
|
+
for (const e of this.#entries) {
|
|
301
|
+
if (e.kind === 'step') tally(e);
|
|
302
|
+
if (e.kind === 'iteration') for (const s of e.steps || []) tally(s);
|
|
303
|
+
}
|
|
304
|
+
return { total, done };
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
#render() {
|
|
308
|
+
if (!this.#summaryEl) return;
|
|
309
|
+
|
|
310
|
+
const status = REASONING_STATUSES.has(this.status) ? this.status : 'active';
|
|
311
|
+
const isFinal = status === 'done' || status === 'error';
|
|
312
|
+
const { total, done } = this.#countSteps();
|
|
313
|
+
const elapsed = Math.round((Date.now() - this.#startTime) / 1000);
|
|
314
|
+
const label = isFinal && this.dataset.summary ? this.dataset.summary : this.#activeLabel();
|
|
315
|
+
|
|
316
|
+
this.#summaryEl.innerHTML = `
|
|
317
|
+
${this.#renderStatusIcon(status)}
|
|
318
|
+
<span data-reasoning-label>${escapeText(label)}</span>
|
|
319
|
+
<span data-reasoning-meta>
|
|
320
|
+
${total ? `<span data-reasoning-counter>${done}/${total}</span>` : ''}
|
|
321
|
+
<span data-reasoning-time>${elapsed}s</span>
|
|
322
|
+
<icon-ui name="${this.collapsed ? 'caret-right' : 'caret-up'}" color="muted" data-reasoning-chevron></icon-ui>
|
|
323
|
+
</span>
|
|
324
|
+
`;
|
|
325
|
+
|
|
326
|
+
this.#bodyEl.hidden = this.collapsed;
|
|
327
|
+
if (this.collapsed) return;
|
|
328
|
+
|
|
329
|
+
// Body rendering: we group contiguous steps into timeline-ui blocks and
|
|
330
|
+
// render plan/thought/iteration as sibling nodes between them. Keeping
|
|
331
|
+
// steps contiguous preserves timeline-ui's connector line.
|
|
332
|
+
this.#bodyEl.innerHTML = '';
|
|
333
|
+
let currentTimeline = null;
|
|
334
|
+
for (const entry of this.#entries) {
|
|
335
|
+
if (entry.kind === 'step') {
|
|
336
|
+
if (!currentTimeline) {
|
|
337
|
+
currentTimeline = this.#makeTimeline();
|
|
338
|
+
this.#bodyEl.appendChild(currentTimeline);
|
|
339
|
+
}
|
|
340
|
+
currentTimeline.appendChild(this.#makeStepItem(entry));
|
|
341
|
+
} else {
|
|
342
|
+
currentTimeline = null;
|
|
343
|
+
this.#bodyEl.appendChild(this.#renderNonStep(entry));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
#makeTimeline() {
|
|
349
|
+
const tl = document.createElement('timeline-ui');
|
|
350
|
+
tl.setAttribute('size', 'sm');
|
|
351
|
+
return tl;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
#makeStepItem(step) {
|
|
355
|
+
const item = document.createElement('timeline-item-ui');
|
|
356
|
+
item.setAttribute('text', step.label || '');
|
|
357
|
+
if (step.status === 'done') item.setAttribute('completed', '');
|
|
358
|
+
if (step.status === 'error') item.setAttribute('error', '');
|
|
359
|
+
if (step.status === 'active') { item.setAttribute('active', ''); item.setAttribute('spinner', ''); }
|
|
360
|
+
|
|
361
|
+
const duration = step.durationLabel
|
|
362
|
+
|| (step.duration != null ? formatDuration(step.duration) : '');
|
|
363
|
+
if (duration) item.setAttribute('duration', duration);
|
|
364
|
+
|
|
365
|
+
if (step.outcomes?.length) item.outcomes = step.outcomes;
|
|
366
|
+
|
|
367
|
+
item.addEventListener('timeline-toggle', () => {
|
|
368
|
+
this.dispatchEvent(new CustomEvent('reasoning-step-toggle', {
|
|
369
|
+
bubbles: true, detail: { stepId: step.id },
|
|
370
|
+
}));
|
|
371
|
+
});
|
|
372
|
+
return item;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
#renderNonStep(entry) {
|
|
376
|
+
switch (entry.kind) {
|
|
377
|
+
case 'thought': return this.#renderThought(entry);
|
|
378
|
+
case 'plan': return this.#renderPlan(entry);
|
|
379
|
+
case 'iteration': return this.#renderIteration(entry);
|
|
380
|
+
default: return document.createTextNode('');
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
#renderThought(entry) {
|
|
385
|
+
const el = document.createElement('div');
|
|
386
|
+
el.setAttribute('data-reasoning-thought', '');
|
|
387
|
+
const text = document.createElement('span');
|
|
388
|
+
text.setAttribute('data-reasoning-thought-text', '');
|
|
389
|
+
text.textContent = entry.text || '';
|
|
390
|
+
el.appendChild(text);
|
|
391
|
+
return el;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
#renderPlan(entry) {
|
|
395
|
+
const el = document.createElement('div');
|
|
396
|
+
el.setAttribute('data-reasoning-plan', '');
|
|
397
|
+
const label = document.createElement('div');
|
|
398
|
+
label.setAttribute('data-reasoning-plan-label', '');
|
|
399
|
+
label.textContent = 'Plan';
|
|
400
|
+
el.appendChild(label);
|
|
401
|
+
const list = document.createElement('ol');
|
|
402
|
+
list.setAttribute('data-reasoning-plan-list', '');
|
|
403
|
+
for (const item of (entry.items || [])) {
|
|
404
|
+
const li = document.createElement('li');
|
|
405
|
+
li.textContent = item;
|
|
406
|
+
list.appendChild(li);
|
|
407
|
+
}
|
|
408
|
+
el.appendChild(list);
|
|
409
|
+
return el;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
#renderIteration(entry) {
|
|
413
|
+
const el = document.createElement('div');
|
|
414
|
+
el.setAttribute('data-reasoning-iteration', '');
|
|
415
|
+
if (entry.status === 'active') el.setAttribute('data-active', '');
|
|
416
|
+
if (entry.status === 'done') el.setAttribute('data-done', '');
|
|
417
|
+
if (entry.status === 'error') el.setAttribute('data-error', '');
|
|
418
|
+
|
|
419
|
+
const header = document.createElement('div');
|
|
420
|
+
header.setAttribute('data-reasoning-iter-header', '');
|
|
421
|
+
const statusIcon = entry.status === 'done'
|
|
422
|
+
? '<icon-ui name="check-circle" color="success" size="sm"></icon-ui>'
|
|
423
|
+
: entry.status === 'error'
|
|
424
|
+
? '<icon-ui name="warning" color="danger" size="sm"></icon-ui>'
|
|
425
|
+
: '<span data-reasoning-spinner data-small></span>';
|
|
426
|
+
header.innerHTML = `
|
|
427
|
+
${statusIcon}
|
|
428
|
+
<span data-reasoning-iter-n>#${entry.n}</span>
|
|
429
|
+
<span data-reasoning-iter-label>${escapeText(entry.label || '')}</span>
|
|
430
|
+
${entry.summary ? `<span data-reasoning-iter-summary>${escapeText(entry.summary)}</span>` : ''}
|
|
431
|
+
`;
|
|
432
|
+
el.appendChild(header);
|
|
433
|
+
|
|
434
|
+
if (entry.steps?.length) {
|
|
435
|
+
const tl = this.#makeTimeline();
|
|
436
|
+
for (const s of entry.steps) tl.appendChild(this.#makeStepItem(s));
|
|
437
|
+
el.appendChild(tl);
|
|
438
|
+
}
|
|
439
|
+
return el;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
#tickTimers() {
|
|
443
|
+
if (this.status === 'done' || this.status === 'error') return;
|
|
444
|
+
const elapsed = Math.round((Date.now() - this.#startTime) / 1000);
|
|
445
|
+
const timeEl = this.#summaryEl?.querySelector('[data-reasoning-time]');
|
|
446
|
+
if (timeEl) timeEl.textContent = elapsed + 's';
|
|
447
|
+
|
|
448
|
+
// Live-update active step durations inside nested timeline-item-ui
|
|
449
|
+
const elapsedLabel = elapsed + 's';
|
|
450
|
+
for (const item of this.querySelectorAll('timeline-item-ui[active]:not([completed])')) {
|
|
451
|
+
// Only mirror the ticking label; do not stomp a durationLabel author set
|
|
452
|
+
if (!item.dataset._frozenDuration) {
|
|
453
|
+
item.setAttribute('duration', elapsedLabel);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function escapeText(s) {
|
|
460
|
+
return String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function formatDuration(ms) {
|
|
464
|
+
if (ms < 1000) return ms + 'ms';
|
|
465
|
+
return Math.round(ms / 1000) + 's';
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
customElements.define('agent-reasoning-ui', AdiaAgentReasoning);
|
|
469
|
+
export { AdiaAgentReasoning };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
|
+
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
+
name: AdiaAgentReasoning
|
|
5
|
+
tag: agent-reasoning-ui
|
|
6
|
+
component: AgentReasoning
|
|
7
|
+
category: agent
|
|
8
|
+
version: 1
|
|
9
|
+
description: Agent inner monologue + pipeline viewer with steps, thoughts, plans, and iterations.
|
|
10
|
+
props:
|
|
11
|
+
autocollapse:
|
|
12
|
+
description: Auto-collapse after finish().
|
|
13
|
+
type: boolean
|
|
14
|
+
default: true
|
|
15
|
+
collapsed:
|
|
16
|
+
description: Start collapsed.
|
|
17
|
+
type: boolean
|
|
18
|
+
default: false
|
|
19
|
+
heading:
|
|
20
|
+
description: Fallback summary label.
|
|
21
|
+
type: string
|
|
22
|
+
default: ""
|
|
23
|
+
mode:
|
|
24
|
+
description: compact | expanded
|
|
25
|
+
type: string
|
|
26
|
+
default: compact
|
|
27
|
+
events:
|
|
28
|
+
reasoning-finish:
|
|
29
|
+
description: "Fired on reasoning-finish."
|
|
30
|
+
reasoning-step-toggle:
|
|
31
|
+
description: "Fired on reasoning-step-toggle."
|
|
32
|
+
reasoning-toggle:
|
|
33
|
+
description: "Fired on reasoning-toggle."
|
|
34
|
+
slots:
|
|
35
|
+
default:
|
|
36
|
+
description: "Default slot — primary child content."
|
|
37
|
+
states:
|
|
38
|
+
- name: idle
|
|
39
|
+
description: Default, ready for interaction.
|
|
40
|
+
traits: []
|
|
41
|
+
tokens: {}
|
|
42
|
+
a2ui:
|
|
43
|
+
rules: []
|
|
44
|
+
anti_patterns: []
|
|
45
|
+
examples:
|
|
46
|
+
- name: basic
|
|
47
|
+
description: Agent reasoning with a plan and three steps.
|
|
48
|
+
a2ui: >-
|
|
49
|
+
[
|
|
50
|
+
{
|
|
51
|
+
"id": "root",
|
|
52
|
+
"component": "AgentReasoning",
|
|
53
|
+
"heading": "Analyzing request"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
keywords:
|
|
57
|
+
- reasoning
|
|
58
|
+
- thinking
|
|
59
|
+
- agent
|
|
60
|
+
- chain of thought
|
|
61
|
+
- cot
|
|
62
|
+
- monologue
|
|
63
|
+
- plan
|
|
64
|
+
- iteration
|
|
65
|
+
synonyms:
|
|
66
|
+
chain-of-thought-n: agent-reasoning-ui
|
|
67
|
+
cot-n: agent-reasoning-ui
|
|
68
|
+
related:
|
|
69
|
+
- agent-trace-ui
|
|
70
|
+
- pipeline-status-ui
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/AgentSuggestions.json",
|
|
4
|
+
"title": "AgentSuggestions",
|
|
5
|
+
"description": "Row of follow-up suggestion chips.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"component": {
|
|
17
|
+
"const": "AgentSuggestions"
|
|
18
|
+
},
|
|
19
|
+
"disabled": {
|
|
20
|
+
"description": "Disable all chips.",
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": false
|
|
23
|
+
},
|
|
24
|
+
"size": {
|
|
25
|
+
"description": "sm | md",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": "sm"
|
|
28
|
+
},
|
|
29
|
+
"variant": {
|
|
30
|
+
"description": "outline | ghost | subtle",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"default": "outline"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": [
|
|
36
|
+
"component"
|
|
37
|
+
],
|
|
38
|
+
"unevaluatedProperties": false,
|
|
39
|
+
"x-adiaui": {
|
|
40
|
+
"anti_patterns": [],
|
|
41
|
+
"category": "agent",
|
|
42
|
+
"events": {
|
|
43
|
+
"suggestion-select": {
|
|
44
|
+
"description": "Fired on suggestion-select."
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"examples": [
|
|
48
|
+
{
|
|
49
|
+
"description": "Three follow-up chips",
|
|
50
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"AgentSuggestions\"\n }\n]",
|
|
51
|
+
"name": "basic"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"keywords": [
|
|
55
|
+
"suggestions",
|
|
56
|
+
"chips",
|
|
57
|
+
"follow-up",
|
|
58
|
+
"quick replies"
|
|
59
|
+
],
|
|
60
|
+
"name": "AdiaAgentSuggestions",
|
|
61
|
+
"related": [
|
|
62
|
+
"agent-questions-ui",
|
|
63
|
+
"agent-feedback-bar-ui"
|
|
64
|
+
],
|
|
65
|
+
"slots": {
|
|
66
|
+
"default": {
|
|
67
|
+
"description": "Default slot — primary child content."
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"states": [
|
|
71
|
+
{
|
|
72
|
+
"description": "Default, ready for interaction.",
|
|
73
|
+
"name": "idle"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"description": "Non-interactive; dimmed.",
|
|
77
|
+
"attribute": "disabled",
|
|
78
|
+
"name": "disabled"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"synonyms": {},
|
|
82
|
+
"tag": "agent-suggestions-ui",
|
|
83
|
+
"tokens": {},
|
|
84
|
+
"traits": [],
|
|
85
|
+
"version": 1
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@scope (agent-suggestions-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
--agent-suggestions-gap: var(--a-space-2);
|
|
4
|
+
--agent-suggestions-padding: var(--a-space-2);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:scope {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
gap: var(--agent-suggestions-gap);
|
|
11
|
+
padding-block: var(--agent-suggestions-padding);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:scope[disabled] {
|
|
15
|
+
opacity: 0.6;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
}
|