@automattic/agenttic-ui 0.1.9 → 0.1.11
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 +281 -350
- package/dist/_basePickBy-Co6w2C-t.js +151 -0
- package/dist/_baseUniq-BbhifY2s.js +614 -0
- package/dist/abap-Y8Dl9g_6.js +6 -0
- package/dist/actionscript-3-DZzbMeqX.js +6 -0
- package/dist/ada-vP6ak0IW.js +6 -0
- package/dist/andromeeda-uXNdzNpk.js +4 -0
- package/dist/angular-html-BmadGEgW.js +32 -0
- package/dist/angular-ts-D-QQnnGT.js +21 -0
- package/dist/apache-BUjz-sD2.js +6 -0
- package/dist/apex-D_wPycVx.js +6 -0
- package/dist/apl-sitt7C8I.js +16 -0
- package/dist/applescript-BPx7YFFu.js +6 -0
- package/dist/ara-Z2fSOxSw.js +6 -0
- package/dist/arc-DMQNivgh.js +83 -0
- package/dist/architecture-O4VJ6CD3-CrsUkgBe.js +5 -0
- package/dist/architectureDiagram-KFL7JDKH-BCeU_Tkj.js +4665 -0
- package/dist/asciidoc-B-pCoB3G.js +6 -0
- package/dist/asm-BTWLY5ym.js +6 -0
- package/dist/astro-DHnp0xIo.js +18 -0
- package/dist/aurora-x-BwoVEUWZ.js +4 -0
- package/dist/awk-Fb0P9dkn.js +6 -0
- package/dist/ayu-dark-CxPZkpb2.js +4 -0
- package/dist/ballerina-oZK-YekG.js +6 -0
- package/dist/bat-0FvbqU9S.js +6 -0
- package/dist/beancount-DEfTbbFX.js +6 -0
- package/dist/berry-PwsHPR_K.js +6 -0
- package/dist/bibtex-EULQRLY5.js +6 -0
- package/dist/bicep-DFU2oTl7.js +6 -0
- package/dist/blade-OPzGcV14.js +20 -0
- package/dist/blockDiagram-ZYB65J3Q-eNfG2owp.js +2265 -0
- package/dist/bsl-NkNNwerW.js +8 -0
- package/dist/c-eeMepfLm.js +6 -0
- package/dist/c4Diagram-AAMF2YG6-CEVcZg_d.js +1581 -0
- package/dist/cadence-DMRWHJp4.js +6 -0
- package/dist/cairo-DM6WF2e3.js +8 -0
- package/dist/catppuccin-frappe-DlGpEc12.js +4 -0
- package/dist/catppuccin-latte-DDI4I_Rd.js +4 -0
- package/dist/catppuccin-macchiato-BBzuZG5U.js +4 -0
- package/dist/catppuccin-mocha-CwrFPXRy.js +4 -0
- package/dist/channel-DwkBtswx.js +5 -0
- package/dist/chunk-ANTBXLJU-DjsG4Faa.js +9 -0
- package/dist/chunk-FHKO5MBM-DvgpKHah.js +15 -0
- package/dist/chunk-GLLZNHP4-BS9MWsNn.js +19 -0
- package/dist/chunk-JBRWN2VN-BB1oFn95.js +1376 -0
- package/dist/chunk-LXBSTHXV-DoWWvL-R.js +1382 -0
- package/dist/chunk-NRVI72HA-CN8BG5Yn.js +20 -0
- package/dist/chunk-OMD6QJNC-D7UKmZm8.js +64 -0
- package/dist/chunk-WVR4S24B-D3bw0yi4.js +8 -0
- package/dist/clarity-BseSxcHx.js +6 -0
- package/dist/classDiagram-3BZAVTQC-DhpbenB7.js +16 -0
- package/dist/classDiagram-v2-QTMF73CY-DhpbenB7.js +16 -0
- package/dist/clojure-CXJfHrL3.js +6 -0
- package/dist/clone-DmrWxu_i.js +8 -0
- package/dist/cmake-BJz8BOTU.js +6 -0
- package/dist/cobol-4A8XjHhj.js +10 -0
- package/dist/codeowners-Bt9yU6NX.js +6 -0
- package/dist/codeql-DHkodjjI.js +6 -0
- package/dist/coffee-Dl27lzbd.js +8 -0
- package/dist/common-lisp-EVqT9Zhp.js +6 -0
- package/dist/components/AgentUI.d.ts +20 -1
- package/dist/components/AgentUI.d.ts.map +1 -1
- package/dist/components/AgentUIContainer.d.ts +8 -0
- package/dist/components/AgentUIContainer.d.ts.map +1 -0
- package/dist/components/animations/index.d.ts +0 -1
- package/dist/components/animations/index.d.ts.map +1 -1
- package/dist/components/chat/AnimatedPlaceholder.d.ts +8 -0
- package/dist/components/chat/AnimatedPlaceholder.d.ts.map +1 -0
- package/dist/components/chat/Chat.d.ts +1 -1
- package/dist/components/chat/Chat.d.ts.map +1 -1
- package/dist/components/chat/ChatFooter.d.ts +4 -2
- package/dist/components/chat/ChatFooter.d.ts.map +1 -1
- package/dist/components/chat/ChatFooter.stories.d.ts +73 -0
- package/dist/components/chat/ChatFooter.stories.d.ts.map +1 -0
- package/dist/components/chat/ChatHeader.d.ts +2 -1
- package/dist/components/chat/ChatHeader.d.ts.map +1 -1
- package/dist/components/chat/ChatInput.d.ts +5 -2
- package/dist/components/chat/ChatInput.d.ts.map +1 -1
- package/dist/components/chat/ChatInput.stories.d.ts +41 -1
- package/dist/components/chat/ChatInput.stories.d.ts.map +1 -1
- package/dist/components/chat/MessageActions.d.ts.map +1 -1
- package/dist/components/chat/Messages.d.ts +2 -2
- package/dist/components/chat/Messages.d.ts.map +1 -1
- package/dist/components/chat/Messages.stories.d.ts +2 -2
- package/dist/components/chat/Notice.d.ts +3 -1
- package/dist/components/chat/Notice.d.ts.map +1 -1
- package/dist/components/chat/Notice.stories.d.ts +3 -0
- package/dist/components/chat/Notice.stories.d.ts.map +1 -1
- package/dist/components/chat/Suggestions.d.ts +2 -0
- package/dist/components/chat/Suggestions.d.ts.map +1 -1
- package/dist/components/composable/AgentUIConversationView.d.ts +8 -0
- package/dist/components/composable/AgentUIConversationView.d.ts.map +1 -0
- package/dist/components/composable/AgentUIFooter.d.ts +7 -0
- package/dist/components/composable/AgentUIFooter.d.ts.map +1 -0
- package/dist/components/composable/AgentUIHeader.d.ts +5 -0
- package/dist/components/composable/AgentUIHeader.d.ts.map +1 -0
- package/dist/components/composable/AgentUIInput.d.ts +9 -0
- package/dist/components/composable/AgentUIInput.d.ts.map +1 -0
- package/dist/components/composable/AgentUIMessages.d.ts +5 -0
- package/dist/components/composable/AgentUIMessages.d.ts.map +1 -0
- package/dist/components/composable/AgentUINotice.d.ts +5 -0
- package/dist/components/composable/AgentUINotice.d.ts.map +1 -0
- package/dist/components/composable/AgentUISuggestions.d.ts +6 -0
- package/dist/components/composable/AgentUISuggestions.d.ts.map +1 -0
- package/dist/components/icons/ZoomIcon.d.ts +3 -0
- package/dist/components/icons/ZoomIcon.d.ts.map +1 -0
- package/dist/components/icons/ZoomIconFilled.d.ts +3 -0
- package/dist/components/icons/ZoomIconFilled.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +3 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.stories.d.ts +15 -4
- package/dist/components/ui/button.stories.d.ts.map +1 -1
- package/dist/components/views/CompactView.d.ts +6 -2
- package/dist/components/views/CompactView.d.ts.map +1 -1
- package/dist/components/views/ConversationView.d.ts +3 -2
- package/dist/components/views/ConversationView.d.ts.map +1 -1
- package/dist/context/AgentUIContext.d.ts +41 -0
- package/dist/context/AgentUIContext.d.ts.map +1 -0
- package/dist/coq-B0L9upzn.js +6 -0
- package/dist/cpp-Cj177cuW.js +18 -0
- package/dist/crystal-ymVvJzbZ.js +18 -0
- package/dist/csharp-DmxfTLWR.js +6 -0
- package/dist/css-CECN5uSL.js +6 -0
- package/dist/csv-CmYOceLb.js +6 -0
- package/dist/cue-ZzumE7IT.js +6 -0
- package/dist/cypher-jpdmjtA6.js +6 -0
- package/dist/cytoscape.esm-ZmItrg9y.js +18731 -0
- package/dist/d-CBagWSwH.js +6 -0
- package/dist/dagre-2BBEFEWP-DWbEdWsD.js +447 -0
- package/dist/dark-plus-pUHDTVV0.js +4 -0
- package/dist/dart-6ObCrKr9.js +6 -0
- package/dist/dax-CcDT-8dH.js +6 -0
- package/dist/defaultLocale-D7EN2tov.js +171 -0
- package/dist/desktop-B93p9R9O.js +6 -0
- package/dist/diagram-4IRLE6MV-Q8q6qm5n.js +534 -0
- package/dist/diagram-GUPCWM2R-B8VhFieT.js +143 -0
- package/dist/diagram-RP2FKANI-CYWUKKLB.js +221 -0
- package/dist/diff-BxzP2J8R.js +6 -0
- package/dist/docker-CsHqm9tx.js +6 -0
- package/dist/dotenv-BMjVjUL1.js +6 -0
- package/dist/dracula-BtZx2Kac.js +4 -0
- package/dist/dracula-soft-BKa-aqBv.js +4 -0
- package/dist/dream-maker-PAx17jaB.js +6 -0
- package/dist/edge-_LvgTcmu.js +12 -0
- package/dist/elixir-BTCUAmQk.js +8 -0
- package/dist/elm-BtNbw_Cd.js +8 -0
- package/dist/emacs-lisp-Cfxdx5D-.js +6 -0
- package/dist/erDiagram-HZWUO2LU-CC0RhTpv.js +842 -0
- package/dist/erb-D0PIpZCP.js +10 -0
- package/dist/erlang-xM7DPKQj.js +8 -0
- package/dist/everforest-dark-DMCBqXCK.js +4 -0
- package/dist/everforest-light-BbXl82Em.js +4 -0
- package/dist/fennel-N4WcXuKx.js +6 -0
- package/dist/fish-B6QqlqeT.js +6 -0
- package/dist/flowDiagram-THRYKUMA-B00E_hY6.js +1627 -0
- package/dist/fluent-BMXUxfv1.js +6 -0
- package/dist/fortran-fixed-form-DUsA-VGo.js +8 -0
- package/dist/fortran-free-form-DPIT_jbP.js +6 -0
- package/dist/fsharp-BTdsmEUN.js +8 -0
- package/dist/ganttDiagram-WV7ZQ7D5-Cv2vsghm.js +2499 -0
- package/dist/gdresource-DLfsylRW.js +10 -0
- package/dist/gdscript-9lm8qppb.js +6 -0
- package/dist/gdshader-Bk8fF6yr.js +6 -0
- package/dist/genie-DzUvd7U9.js +6 -0
- package/dist/gherkin-DHRaV0YP.js +6 -0
- package/dist/git-commit-Bd32YZ0K.js +8 -0
- package/dist/git-rebase-ZWUFO_T4.js +8 -0
- package/dist/gitGraph-ZV4HHKMB-Bj31zYat.js +5 -0
- package/dist/gitGraphDiagram-OJR772UL-BGrYC5q0.js +712 -0
- package/dist/github-dark-DenFmJkN.js +4 -0
- package/dist/github-dark-default-BJPUVz4H.js +4 -0
- package/dist/github-dark-dimmed-DUshB20C.js +4 -0
- package/dist/github-dark-high-contrast-D3aGCnF8.js +4 -0
- package/dist/github-light-JYsPkUQd.js +4 -0
- package/dist/github-light-default-D99KPAby.js +4 -0
- package/dist/github-light-high-contrast-BbmZE-Mp.js +4 -0
- package/dist/gleam-Bv284lvN.js +6 -0
- package/dist/glimmer-js-CkxRszZZ.js +14 -0
- package/dist/glimmer-ts-Bi6BYQCn.js +14 -0
- package/dist/glsl-CkUcVZNK.js +8 -0
- package/dist/gnuplot-yPG9-sE_.js +6 -0
- package/dist/go-ChxJuLYK.js +6 -0
- package/dist/graph-DaSuptw6.js +247 -0
- package/dist/graphql-BLaPX4fU.js +14 -0
- package/dist/groovy-CJQTphOW.js +6 -0
- package/dist/gruvbox-dark-hard-C2ND4cMr.js +4 -0
- package/dist/gruvbox-dark-medium-C8k4c8au.js +4 -0
- package/dist/gruvbox-dark-soft-xx9Q6FaG.js +4 -0
- package/dist/gruvbox-light-hard-BpUXv5in.js +4 -0
- package/dist/gruvbox-light-medium-D3XFCoU1.js +4 -0
- package/dist/gruvbox-light-soft-u7hpfz6Z.js +4 -0
- package/dist/hack-Bx1jMtBC.js +10 -0
- package/dist/haml-6FagfhCM.js +10 -0
- package/dist/handlebars-Bd5Y4M6I.js +14 -0
- package/dist/haskell-WeIwNIP6.js +6 -0
- package/dist/haxe-TztHsm5T.js +6 -0
- package/dist/hcl-D438OF-I.js +6 -0
- package/dist/hjson-DYBUbqOl.js +6 -0
- package/dist/hlsl-Bk8TCZNL.js +6 -0
- package/dist/hooks/useMultiTimeout.d.ts +11 -0
- package/dist/hooks/useMultiTimeout.d.ts.map +1 -0
- package/dist/houston-BDYrDoDW.js +4 -0
- package/dist/html-7XVNRwN7.js +10 -0
- package/dist/html-derivative-BNxZ5Yf6.js +8 -0
- package/dist/http-WC357zBG.js +14 -0
- package/dist/hxml-GbqSQCLa.js +8 -0
- package/dist/hy-Brt5EZ7-.js +6 -0
- package/dist/imba-CimUv-Uh.js +6 -0
- package/dist/index-DR9mkSeU.js +29474 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -2371
- package/dist/info-63CPKGFF-DnZM8nKQ.js +5 -0
- package/dist/infoDiagram-DDUCL6P7-ClQolrbt.js +24 -0
- package/dist/ini-BZIuRIvJ.js +6 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/java-DY6VlHhP.js +6 -0
- package/dist/javascript-Dp1Jmi5H.js +6 -0
- package/dist/jinja-WEhOU5ES.js +11 -0
- package/dist/jison-c2JI40PB.js +8 -0
- package/dist/journeyDiagram-FFXJYRFH-P_IVMTj2.js +836 -0
- package/dist/json-DxJze_jm.js +6 -0
- package/dist/json5-BT4Fjg39.js +6 -0
- package/dist/jsonc-CHjZD8gR.js +6 -0
- package/dist/jsonl-BGuvDmy9.js +6 -0
- package/dist/jsonnet-Bx2cfsXg.js +6 -0
- package/dist/jssm-BcADi6EI.js +6 -0
- package/dist/jsx-BtKADgXT.js +6 -0
- package/dist/julia-DcoDQokW.js +16 -0
- package/dist/kanagawa-dragon-CiKur4Hl.js +4 -0
- package/dist/kanagawa-lotus-BKu-smKu.js +4 -0
- package/dist/kanagawa-wave-CQwozSzG.js +4 -0
- package/dist/kanban-definition-KOZQBZVT-Uk8JKe_b.js +720 -0
- package/dist/kotlin-ByBMgTeR.js +6 -0
- package/dist/kusto-VWFLl2T0.js +6 -0
- package/dist/laserwave-6a00oqik.js +4 -0
- package/dist/latex-MZCpjnva.js +8 -0
- package/dist/layout-BHKAMNdk.js +1324 -0
- package/dist/lean-DXqEE_d1.js +6 -0
- package/dist/less-B1GLI2Di.js +6 -0
- package/dist/light-plus-CZuVqSLX.js +4 -0
- package/dist/linear-UAzexi4b.js +255 -0
- package/dist/liquid-3HHuHOZ2.js +14 -0
- package/dist/llvm-6RQLId6G.js +6 -0
- package/dist/log-Al8wyEFV.js +6 -0
- package/dist/logo-DBa4JDzV.js +6 -0
- package/dist/lua-kX5WP_P5.js +8 -0
- package/dist/luau-BeoZWRh5.js +6 -0
- package/dist/make-CsMclxtr.js +6 -0
- package/dist/markdown-CiI2E98D.js +6 -0
- package/dist/marko-L-KhXzqZ.js +14 -0
- package/dist/material-theme-D6KBX41T.js +4 -0
- package/dist/material-theme-darker-CkRroheE.js +4 -0
- package/dist/material-theme-lighter-BUBw43Yz.js +4 -0
- package/dist/material-theme-ocean-ClGX14Ja.js +4 -0
- package/dist/material-theme-palenight-C1RVm8K1.js +4 -0
- package/dist/matlab-BOAaUVP0.js +6 -0
- package/dist/mdc-DPBWa7dN.js +12 -0
- package/dist/mdx-BOhZZUJ8.js +6 -0
- package/dist/mermaid-B0ixDHKN.js +6 -0
- package/dist/mermaid-parser.core-FuzJzmL7.js +12921 -0
- package/dist/mermaid.core-D7qBd055.js +14002 -0
- package/dist/min-dark-C7ak0t6c.js +4 -0
- package/dist/min-light-CKFxVcPp.js +4 -0
- package/dist/mindmap-definition-LNHGMQRG-D1C2-kkn.js +3229 -0
- package/dist/mipsasm-CTx18fBl.js +6 -0
- package/dist/mojo-BD611d7o.js +6 -0
- package/dist/monokai-C1KBYcO0.js +4 -0
- package/dist/move-653S600C.js +6 -0
- package/dist/narrat-DmhDCBs-.js +6 -0
- package/dist/nextflow-D1Zd9cNl.js +6 -0
- package/dist/nginx-5vhPAEw3.js +8 -0
- package/dist/night-owl-Bm2rzalh.js +4 -0
- package/dist/nim-Fi8wNe6i.js +20 -0
- package/dist/nix-ceY58Dty.js +6 -0
- package/dist/nord-CC5OiUXg.js +4 -0
- package/dist/nushell-Be2rueDv.js +6 -0
- package/dist/objective-c-Itk8tzmv.js +6 -0
- package/dist/objective-cpp-DGt5UKRO.js +6 -0
- package/dist/ocaml-eSVK32Eg.js +6 -0
- package/dist/one-dark-pro-DTA3VF0_.js +4 -0
- package/dist/one-light-D9sNaUtq.js +4 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/packet-HUATNLJX-B5EJOyma.js +5 -0
- package/dist/pascal-xy8pJNns.js +6 -0
- package/dist/perl-BoEn6HmT.js +16 -0
- package/dist/php-BRU9zhoN.js +18 -0
- package/dist/pie-WTHONI2E-Bl1BKqE7.js +5 -0
- package/dist/pieDiagram-DBDJKBY4-BkVTsR1n.js +161 -0
- package/dist/plastic-CSTz3KZp.js +4 -0
- package/dist/plsql-pVbGZfOv.js +6 -0
- package/dist/po-BNfHvqmm.js +6 -0
- package/dist/poimandres-C-VADXHD.js +4 -0
- package/dist/polar-CAZahv3u.js +6 -0
- package/dist/postcss-05aHdL-n.js +6 -0
- package/dist/powerquery-DI9HkTvs.js +6 -0
- package/dist/powershell-Clc4ydu-.js +6 -0
- package/dist/prisma-FZjmVtSl.js +6 -0
- package/dist/prolog-C5-yg4TO.js +6 -0
- package/dist/proto-MmCPeFAD.js +6 -0
- package/dist/pug-CJWI-qSo.js +12 -0
- package/dist/puppet-CUJHmnxV.js +6 -0
- package/dist/purescript-rUfGld-4.js +6 -0
- package/dist/python-BFNSHbwJ.js +6 -0
- package/dist/qml-D3ATcgGh.js +8 -0
- package/dist/qmldir-BInDYbpo.js +6 -0
- package/dist/qss-AeJTysr_.js +6 -0
- package/dist/quadrantDiagram-YPSRARAO-D1el8UE7.js +1024 -0
- package/dist/r-Bm0uF0U2.js +6 -0
- package/dist/racket-B83wSAja.js +6 -0
- package/dist/radar-NJJJXTRR-Ba8Estdw.js +5 -0
- package/dist/raku-nEQ4ZJJ7.js +6 -0
- package/dist/razor-BPFYEoc9.js +10 -0
- package/dist/red-7y8PH7HH.js +4 -0
- package/dist/reg-m_s_Kiip.js +6 -0
- package/dist/regexp-BazyLpPg.js +6 -0
- package/dist/rel-BcRfyd6Q.js +6 -0
- package/dist/requirementDiagram-EGVEC5DT-DL1bEAjs.js +852 -0
- package/dist/riscv-Ce8MAQLP.js +6 -0
- package/dist/rose-pine-Cr4kwgAY.js +4 -0
- package/dist/rose-pine-dawn-ClRRUdXX.js +4 -0
- package/dist/rose-pine-moon-ucNn3Gm8.js +4 -0
- package/dist/rst-B6mPMsKo.js +22 -0
- package/dist/ruby-DInklMmU.js +30 -0
- package/dist/rust-CLzF9zIN.js +6 -0
- package/dist/sankeyDiagram-HRAUVNP4-Dyr3TqRu.js +810 -0
- package/dist/sas-fpEvgATw.js +8 -0
- package/dist/sass-DxHp5rTx.js +6 -0
- package/dist/scala-D4grkFkl.js +6 -0
- package/dist/scheme-BCRWuEm4.js +6 -0
- package/dist/scss-B1FaCqwR.js +8 -0
- package/dist/sdbl-B7T8abf4.js +6 -0
- package/dist/sequenceDiagram-4MX5Z3NR-CaMVkEvG.js +2283 -0
- package/dist/shaderlab-Cr62-Wb4.js +8 -0
- package/dist/shellscript-InADTalH.js +6 -0
- package/dist/shellsession-DiDJNQdy.js +8 -0
- package/dist/slack-dark-i7wN4OET.js +4 -0
- package/dist/slack-ochin-ndHf0LoP.js +4 -0
- package/dist/smalltalk-BlI1_OkM.js +6 -0
- package/dist/snazzy-light-BlSJXAu4.js +4 -0
- package/dist/solarized-dark-UTmkh7lw.js +4 -0
- package/dist/solarized-light-BheCkDPT.js +4 -0
- package/dist/solidity-CneOhxmR.js +6 -0
- package/dist/soy-LybuU3Y_.js +8 -0
- package/dist/sparql-B0KWFEri.js +8 -0
- package/dist/splunk-CRXR8A9s.js +6 -0
- package/dist/sql-Cn_v3PB0.js +6 -0
- package/dist/ssh-config-DP-hNVbF.js +6 -0
- package/dist/stata-B8c5fTjX.js +8 -0
- package/dist/stateDiagram-UUKSUZ4H-D-xTiq6H.js +263 -0
- package/dist/stateDiagram-v2-EYPG3UTE-BK5bFTpp.js +16 -0
- package/dist/stylus-CyKEU1Ej.js +6 -0
- package/dist/svelte-BjDUPxZ1.js +14 -0
- package/dist/swift-_uF_96_m.js +6 -0
- package/dist/synthwave-84-NU3C_KFZ.js +4 -0
- package/dist/system-verilog-BCm7smPJ.js +6 -0
- package/dist/systemd-C-4qm6XH.js +6 -0
- package/dist/talonscript-CFF3LF_O.js +6 -0
- package/dist/tasl-Cg_WBUAe.js +6 -0
- package/dist/tcl-DN7buRTF.js +6 -0
- package/dist/templ-Brj2RH7A.js +12 -0
- package/dist/terraform-DGvcn9zM.js +6 -0
- package/dist/tex-CmrLTxbG.js +8 -0
- package/dist/timeline-definition-3HZDQTIS-DbCuAY-N.js +801 -0
- package/dist/tokyo-night-DP4TmcQl.js +4 -0
- package/dist/toml-DY62mUL_.js +6 -0
- package/dist/treemap-75Q7IDZK-RcudvwLc.js +5 -0
- package/dist/ts-tags-CZMzuZh-.js +41 -0
- package/dist/tsv-BtvSkaG0.js +6 -0
- package/dist/tsx-B8rCNbgL.js +6 -0
- package/dist/turtle-_H59FV7D.js +6 -0
- package/dist/twig-GjIxYqCX.js +18 -0
- package/dist/types/index.d.ts +7 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/typescript-mg6ATTE8.js +6 -0
- package/dist/typespec-Djmco60m.js +6 -0
- package/dist/typst-D_1QKWns.js +6 -0
- package/dist/v-BW14IZv7.js +6 -0
- package/dist/vala-uxaPR7d1.js +6 -0
- package/dist/vb-D8_c5-KN.js +6 -0
- package/dist/verilog-B-bybjPF.js +6 -0
- package/dist/vesper-BckBta1U.js +4 -0
- package/dist/vhdl-CUlNa8ac.js +6 -0
- package/dist/viml-DsfA-sWm.js +6 -0
- package/dist/vitesse-black-BoGvW84i.js +4 -0
- package/dist/vitesse-dark-Cym-eLtO.js +4 -0
- package/dist/vitesse-light-CcmG315c.js +4 -0
- package/dist/vue-D-ba2-Rx.js +31 -0
- package/dist/vue-html-Dn2ZoOSz.js +10 -0
- package/dist/vue-vine-Jmfkm6lF.js +20 -0
- package/dist/vyper-CPQuu50u.js +6 -0
- package/dist/wasm-BBXxrAl7.js +6 -0
- package/dist/wasm-DQxwEHae.js +7 -0
- package/dist/wenyan-pbVjoM9_.js +6 -0
- package/dist/wgsl-DY4iK1q1.js +6 -0
- package/dist/wikitext-Z-MoUasO.js +6 -0
- package/dist/wit-CQMQOlTg.js +6 -0
- package/dist/wolfram-Dz4KXISs.js +6 -0
- package/dist/xml-C2J0sS9M.js +8 -0
- package/dist/xsl-BmSZphgC.js +8 -0
- package/dist/xychartDiagram-FDP5SA34-NGeBTA9Y.js +1340 -0
- package/dist/yaml-DaO7k5B1.js +6 -0
- package/dist/zenscript-CxBjpf9c.js +6 -0
- package/dist/zig-Vm0PO9wB.js +6 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -10,316 +10,345 @@ npm install @automattic/agenttic-ui
|
|
|
10
10
|
|
|
11
11
|
## Key Features
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
13
|
+
- Pure UI components with no agent communication logic
|
|
14
|
+
- Composable architecture for complete layout flexibility
|
|
15
|
+
- Floating and embedded chat variants
|
|
16
|
+
- Controlled input support for external value management
|
|
17
|
+
- Smooth animations and drag-and-drop positioning
|
|
18
|
+
- Message actions and markdown rendering
|
|
19
|
+
- Request cancellation UI with stop button functionality
|
|
20
|
+
- TypeScript support with comprehensive types
|
|
21
|
+
- Storybook component documentation
|
|
20
22
|
|
|
21
23
|
## Quick Start
|
|
22
24
|
|
|
23
|
-
### Complete Chat Interface
|
|
25
|
+
### Complete Chat Interface (Convenience API)
|
|
24
26
|
|
|
25
27
|
```tsx
|
|
26
28
|
import { useAgentChat } from '@automattic/agenttic-client';
|
|
27
29
|
import { AgentUI } from '@automattic/agenttic-ui';
|
|
28
30
|
|
|
29
31
|
function ChatApplication() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
const {
|
|
33
|
+
messages,
|
|
34
|
+
isProcessing,
|
|
35
|
+
error,
|
|
36
|
+
onSubmit,
|
|
37
|
+
abortCurrentRequest,
|
|
38
|
+
suggestions,
|
|
39
|
+
clearSuggestions,
|
|
40
|
+
messageRenderer,
|
|
41
|
+
} = useAgentChat( {
|
|
42
|
+
agentId: 'big-sky',
|
|
43
|
+
sessionId: 'my-session',
|
|
44
|
+
} );
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<AgentUI
|
|
48
|
+
messages={ messages }
|
|
49
|
+
isProcessing={ isProcessing }
|
|
50
|
+
error={ error }
|
|
51
|
+
onSubmit={ onSubmit }
|
|
52
|
+
onStop={ abortCurrentRequest }
|
|
53
|
+
suggestions={ suggestions }
|
|
54
|
+
clearSuggestions={ clearSuggestions }
|
|
55
|
+
messageRenderer={ messageRenderer }
|
|
56
|
+
variant="floating"
|
|
57
|
+
placeholder="Ask me anything..."
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
56
60
|
}
|
|
57
61
|
```
|
|
58
62
|
|
|
59
|
-
###
|
|
63
|
+
### Composable Architecture
|
|
64
|
+
|
|
65
|
+
For complete control over layout and component ordering:
|
|
60
66
|
|
|
61
67
|
```tsx
|
|
62
|
-
|
|
63
|
-
messages={messages}
|
|
64
|
-
isProcessing={isProcessing}
|
|
65
|
-
error={error}
|
|
66
|
-
onSubmit={onSubmit}
|
|
67
|
-
variant="embedded"
|
|
68
|
-
placeholder="How can I help you?"
|
|
69
|
-
/>
|
|
70
|
-
```
|
|
68
|
+
import { AgentUI } from '@automattic/agenttic-ui';
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
function CustomChatLayout() {
|
|
71
|
+
return (
|
|
72
|
+
<AgentUI.Container
|
|
73
|
+
messages={ messages }
|
|
74
|
+
isProcessing={ isProcessing }
|
|
75
|
+
error={ error }
|
|
76
|
+
onSubmit={ onSubmit }
|
|
77
|
+
onStop={ abortCurrentRequest }
|
|
78
|
+
variant="embedded"
|
|
79
|
+
>
|
|
80
|
+
<AgentUI.ConversationView>
|
|
81
|
+
<AgentUI.Header />
|
|
82
|
+
<AgentUI.Messages />
|
|
83
|
+
<AgentUI.Footer>
|
|
84
|
+
<AgentUI.Notice />
|
|
85
|
+
<AgentUI.Input />
|
|
86
|
+
</AgentUI.Footer>
|
|
87
|
+
<AgentUI.Suggestions />
|
|
88
|
+
</AgentUI.ConversationView>
|
|
89
|
+
</AgentUI.Container>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
73
93
|
|
|
74
|
-
###
|
|
94
|
+
### Controlled Input
|
|
75
95
|
|
|
76
|
-
|
|
96
|
+
External control of input value and changes:
|
|
77
97
|
|
|
78
98
|
```tsx
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// Chat state management (floating variant)
|
|
94
|
-
floatingChatState?: ChatState;
|
|
95
|
-
onOpen?: () => void;
|
|
96
|
-
onExpand?: () => void;
|
|
97
|
-
onClose?: () => void;
|
|
98
|
-
|
|
99
|
-
// Suggestions
|
|
100
|
-
suggestions?: Suggestion[];
|
|
101
|
-
clearSuggestions?: () => void;
|
|
102
|
-
|
|
103
|
-
// Message rendering
|
|
104
|
-
messageRenderer?: ComponentType<{ children: string }>;
|
|
105
|
-
|
|
106
|
-
// Styling
|
|
107
|
-
className?: string;
|
|
108
|
-
style?: React.CSSProperties;
|
|
99
|
+
function ExternallyControlledChat() {
|
|
100
|
+
const [ inputValue, setInputValue ] = useState( '' );
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<AgentUI
|
|
104
|
+
messages={ messages }
|
|
105
|
+
isProcessing={ isProcessing }
|
|
106
|
+
onSubmit={ onSubmit }
|
|
107
|
+
inputValue={ inputValue }
|
|
108
|
+
onInputChange={ setInputValue }
|
|
109
|
+
variant="embedded"
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
109
112
|
}
|
|
110
113
|
```
|
|
111
114
|
|
|
112
|
-
|
|
113
|
-
- `floating` - Draggable chat widget with collapsed/compact/expanded states
|
|
114
|
-
- `embedded` - Fixed chat interface for integration in existing layouts
|
|
115
|
+
## Architecture
|
|
115
116
|
|
|
116
|
-
###
|
|
117
|
+
### AgentUI Components
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
**AgentUI** - Convenience wrapper with default layout
|
|
120
|
+
**AgentUI.Container** - Root container with state management and context
|
|
121
|
+
**AgentUI.ConversationView** - Conversation layout wrapper
|
|
122
|
+
**AgentUI.Header** - Chat header with close/expand buttons
|
|
123
|
+
**AgentUI.Messages** - Message history display
|
|
124
|
+
**AgentUI.Footer** - Footer wrapper for input and notice
|
|
125
|
+
**AgentUI.Input** - Text input with auto-resize
|
|
126
|
+
**AgentUI.Notice** - Error and notification display
|
|
127
|
+
**AgentUI.Suggestions** - Quick action suggestions
|
|
119
128
|
|
|
120
|
-
|
|
121
|
-
import {
|
|
122
|
-
Chat,
|
|
123
|
-
Messages,
|
|
124
|
-
Message,
|
|
125
|
-
ChatInput,
|
|
126
|
-
Suggestions
|
|
127
|
-
} from '@automattic/agenttic-ui';
|
|
129
|
+
### AgentUIProps Interface
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
131
|
+
```tsx
|
|
132
|
+
interface AgentUIProps {
|
|
133
|
+
// Core chat data
|
|
134
|
+
messages: Message[];
|
|
135
|
+
isProcessing: boolean;
|
|
136
|
+
error?: string | null;
|
|
137
|
+
onSubmit: ( message: string ) => void;
|
|
138
|
+
onStop?: () => void;
|
|
139
|
+
|
|
140
|
+
// UI configuration
|
|
141
|
+
variant?: 'floating' | 'embedded';
|
|
142
|
+
placeholder?: string | string[];
|
|
143
|
+
triggerIcon?: React.ReactNode;
|
|
144
|
+
notice?: NoticeConfig;
|
|
145
|
+
emptyView?: React.ReactNode;
|
|
146
|
+
|
|
147
|
+
// Chat state management (floating variant)
|
|
148
|
+
floatingChatState?: ChatState;
|
|
149
|
+
onOpen?: () => void;
|
|
150
|
+
onExpand?: () => void;
|
|
151
|
+
onClose?: () => void;
|
|
152
|
+
|
|
153
|
+
// Suggestions
|
|
154
|
+
suggestions?: Suggestion[];
|
|
155
|
+
clearSuggestions?: () => void;
|
|
156
|
+
|
|
157
|
+
// Message rendering
|
|
158
|
+
messageRenderer?: ComponentType< { children: string } >;
|
|
159
|
+
|
|
160
|
+
// Controlled input (optional)
|
|
161
|
+
inputValue?: string;
|
|
162
|
+
onInputChange?: ( value: string ) => void;
|
|
163
|
+
|
|
164
|
+
// Styling
|
|
165
|
+
className?: string;
|
|
166
|
+
style?: React.CSSProperties;
|
|
147
167
|
}
|
|
148
168
|
```
|
|
149
169
|
|
|
150
|
-
##
|
|
170
|
+
## Usage Patterns
|
|
151
171
|
|
|
152
|
-
###
|
|
172
|
+
### Flexible Component Ordering
|
|
153
173
|
|
|
154
|
-
|
|
174
|
+
Place suggestions anywhere in your layout:
|
|
155
175
|
|
|
156
176
|
```tsx
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
177
|
+
<AgentUI.Container {...props}>
|
|
178
|
+
<AgentUI.ConversationView>
|
|
179
|
+
<AgentUI.Messages />
|
|
180
|
+
<AgentUI.Suggestions /> {/* Above input */}
|
|
181
|
+
<AgentUI.Footer>
|
|
182
|
+
<AgentUI.Input />
|
|
183
|
+
</AgentUI.Footer>
|
|
184
|
+
</AgentUI.ConversationView>
|
|
185
|
+
</AgentUI.Container>
|
|
186
|
+
|
|
187
|
+
// Or below input:
|
|
188
|
+
<AgentUI.Container {...props}>
|
|
189
|
+
<AgentUI.ConversationView>
|
|
190
|
+
<AgentUI.Messages />
|
|
191
|
+
<AgentUI.Footer>
|
|
192
|
+
<AgentUI.Input />
|
|
193
|
+
</AgentUI.Footer>
|
|
194
|
+
<AgentUI.Suggestions /> {/* Below input */}
|
|
195
|
+
</AgentUI.ConversationView>
|
|
196
|
+
</AgentUI.Container>
|
|
168
197
|
```
|
|
169
198
|
|
|
170
|
-
###
|
|
199
|
+
### Individual Components
|
|
171
200
|
|
|
172
|
-
|
|
201
|
+
Use individual components for complete customization:
|
|
173
202
|
|
|
174
203
|
```tsx
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
204
|
+
import {
|
|
205
|
+
Messages,
|
|
206
|
+
Message,
|
|
207
|
+
ChatInput,
|
|
208
|
+
Suggestions,
|
|
209
|
+
} from '@automattic/agenttic-ui';
|
|
210
|
+
|
|
211
|
+
function FullyCustomChat() {
|
|
212
|
+
return (
|
|
213
|
+
<div className="my-chat-container">
|
|
214
|
+
<Messages
|
|
215
|
+
messages={ messages }
|
|
216
|
+
messageRenderer={ messageRenderer }
|
|
217
|
+
/>
|
|
218
|
+
<ChatInput
|
|
219
|
+
value={ inputValue }
|
|
220
|
+
onChange={ setInputValue }
|
|
221
|
+
onSubmit={ onSubmit }
|
|
222
|
+
placeholder="Type a message..."
|
|
223
|
+
isProcessing={ isProcessing }
|
|
224
|
+
/>
|
|
225
|
+
<Suggestions
|
|
226
|
+
suggestions={ suggestions }
|
|
227
|
+
onSuggestionClick={ onSubmit }
|
|
228
|
+
onClear={ clearSuggestions }
|
|
229
|
+
/>
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
}
|
|
180
233
|
```
|
|
181
234
|
|
|
182
|
-
###
|
|
235
|
+
### Request Cancellation
|
|
183
236
|
|
|
184
|
-
|
|
237
|
+
Stop button appears automatically during processing:
|
|
185
238
|
|
|
186
239
|
```tsx
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
240
|
+
<AgentUI
|
|
241
|
+
isProcessing={ isProcessing }
|
|
242
|
+
onStop={ abortCurrentRequest }
|
|
243
|
+
// Submit button becomes stop button when processing
|
|
191
244
|
/>
|
|
192
245
|
```
|
|
193
246
|
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
-
Text input with auto-resize and submit handling.
|
|
247
|
+
### Custom Message Renderer
|
|
197
248
|
|
|
198
249
|
```tsx
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
textareaRef={textareaRef}
|
|
207
|
-
/>
|
|
250
|
+
import { ReactMarkdown } from 'react-markdown';
|
|
251
|
+
|
|
252
|
+
const customRenderer = ( { children }: { children: string } ) => (
|
|
253
|
+
<ReactMarkdown remarkPlugins={ [ remarkGfm ] }>{ children }</ReactMarkdown>
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
<AgentUI messageRenderer={ customRenderer } />;
|
|
208
257
|
```
|
|
209
258
|
|
|
210
|
-
###
|
|
259
|
+
### Chat State Control
|
|
211
260
|
|
|
212
|
-
|
|
261
|
+
For floating variant, control state externally:
|
|
213
262
|
|
|
214
263
|
```tsx
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
264
|
+
const [ chatState, setChatState ] = useState< ChatState >( 'collapsed' );
|
|
265
|
+
|
|
266
|
+
<AgentUI
|
|
267
|
+
variant="floating"
|
|
268
|
+
floatingChatState={ chatState }
|
|
269
|
+
onOpen={ () => setChatState( 'compact' ) }
|
|
270
|
+
onExpand={ () => setChatState( 'expanded' ) }
|
|
271
|
+
onClose={ () => setChatState( 'collapsed' ) }
|
|
272
|
+
/>;
|
|
223
273
|
```
|
|
224
274
|
|
|
225
275
|
## Hooks
|
|
226
276
|
|
|
227
277
|
### useChat
|
|
228
278
|
|
|
229
|
-
Manages chat state
|
|
279
|
+
Manages floating chat state:
|
|
230
280
|
|
|
231
281
|
```tsx
|
|
232
282
|
const {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
} = useChat(initialState);
|
|
283
|
+
state, // 'collapsed' | 'compact' | 'expanded'
|
|
284
|
+
setState,
|
|
285
|
+
isOpen, // boolean
|
|
286
|
+
open, // () => void
|
|
287
|
+
close, // () => void
|
|
288
|
+
toggle, // () => void
|
|
289
|
+
} = useChat( initialState );
|
|
240
290
|
```
|
|
241
291
|
|
|
242
292
|
### useInput
|
|
243
293
|
|
|
244
|
-
Manages
|
|
294
|
+
Manages input state with auto-resize:
|
|
245
295
|
|
|
246
296
|
```tsx
|
|
247
|
-
const {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
} = useInput({
|
|
255
|
-
value: inputValue,
|
|
256
|
-
setValue: setInputValue,
|
|
257
|
-
onSubmit: handleSubmit,
|
|
258
|
-
isProcessing: false
|
|
259
|
-
});
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
## Icons
|
|
263
|
-
|
|
264
|
-
Pre-built icon components for consistent UI:
|
|
265
|
-
|
|
266
|
-
```tsx
|
|
267
|
-
import {
|
|
268
|
-
ThumbsUpIcon,
|
|
269
|
-
ThumbsDownIcon,
|
|
270
|
-
CopyIcon,
|
|
271
|
-
StopIcon,
|
|
272
|
-
ArrowUpIcon,
|
|
273
|
-
XIcon,
|
|
274
|
-
BigSkyIcon,
|
|
275
|
-
StylesIcon
|
|
276
|
-
} from '@automattic/agenttic-ui';
|
|
297
|
+
const { value, setValue, clear, textareaRef, handleKeyDown, adjustHeight } =
|
|
298
|
+
useInput( {
|
|
299
|
+
value: inputValue,
|
|
300
|
+
setValue: setInputValue,
|
|
301
|
+
onSubmit: handleSubmit,
|
|
302
|
+
isProcessing: false,
|
|
303
|
+
} );
|
|
277
304
|
```
|
|
278
305
|
|
|
279
306
|
## Type Definitions
|
|
280
307
|
|
|
281
308
|
```tsx
|
|
282
309
|
interface Message {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
310
|
+
id: string;
|
|
311
|
+
role: 'user' | 'agent';
|
|
312
|
+
content: Array< {
|
|
313
|
+
type: 'text' | 'image_url' | 'component';
|
|
314
|
+
text?: string;
|
|
315
|
+
image_url?: string;
|
|
316
|
+
component?: React.ComponentType;
|
|
317
|
+
componentProps?: any;
|
|
318
|
+
} >;
|
|
319
|
+
timestamp: number;
|
|
320
|
+
archived: boolean;
|
|
321
|
+
showIcon: boolean;
|
|
322
|
+
icon?: string;
|
|
323
|
+
actions?: MessageAction[];
|
|
297
324
|
}
|
|
298
325
|
|
|
299
326
|
interface MessageAction {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
327
|
+
id: string;
|
|
328
|
+
icon?: React.ReactNode;
|
|
329
|
+
label: string;
|
|
330
|
+
onClick: ( message: Message ) => void | Promise< void >;
|
|
331
|
+
tooltip?: string;
|
|
332
|
+
disabled?: boolean;
|
|
333
|
+
pressed?: boolean;
|
|
334
|
+
showLabel?: boolean;
|
|
306
335
|
}
|
|
307
336
|
|
|
308
337
|
interface Suggestion {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
338
|
+
id: string;
|
|
339
|
+
label: string;
|
|
340
|
+
prompt: string;
|
|
312
341
|
}
|
|
313
342
|
|
|
314
343
|
interface NoticeConfig {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
344
|
+
icon?: React.ReactNode;
|
|
345
|
+
message: string;
|
|
346
|
+
action?: {
|
|
347
|
+
label: string;
|
|
348
|
+
onClick: () => void;
|
|
349
|
+
};
|
|
350
|
+
dismissible?: boolean;
|
|
351
|
+
onDismiss?: () => void;
|
|
323
352
|
}
|
|
324
353
|
|
|
325
354
|
type ChatState = 'collapsed' | 'compact' | 'expanded';
|
|
@@ -329,131 +358,46 @@ type ChatState = 'collapsed' | 'compact' | 'expanded';
|
|
|
329
358
|
|
|
330
359
|
### CSS Import
|
|
331
360
|
|
|
332
|
-
Components automatically import their styles. For manual control:
|
|
333
|
-
|
|
334
|
-
```css
|
|
335
|
-
/* In your CSS */
|
|
336
|
-
@import '@automattic/agenttic-ui/index.css';
|
|
337
|
-
```
|
|
338
|
-
|
|
339
361
|
```tsx
|
|
340
|
-
// In JavaScript/TypeScript
|
|
341
362
|
import '@automattic/agenttic-ui/index.css';
|
|
342
363
|
```
|
|
343
364
|
|
|
344
365
|
### CSS Scoping
|
|
345
366
|
|
|
346
|
-
All
|
|
367
|
+
All styles are scoped to `.agenttic` class to prevent conflicts.
|
|
347
368
|
|
|
348
369
|
### Customization
|
|
349
370
|
|
|
350
|
-
Override CSS custom properties
|
|
371
|
+
Override CSS custom properties:
|
|
351
372
|
|
|
352
373
|
```css
|
|
353
|
-
/* Global theming */
|
|
354
374
|
.agenttic {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
/* ...other custom properties as needed. */
|
|
375
|
+
--color-primary: #your-brand-color;
|
|
376
|
+
--color-background: #ffffff;
|
|
377
|
+
--color-foreground: #000000;
|
|
359
378
|
}
|
|
360
379
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
--color-foreground: oklch(0.241 0 0);
|
|
365
|
-
--color-primary: #your-brand-color;
|
|
366
|
-
--color-primary-foreground: oklch(1 0 0);
|
|
367
|
-
--color-muted: oklch(0.925 0 0);
|
|
368
|
-
--color-muted-foreground: oklch(0.6 0 0);
|
|
380
|
+
.agenttic [data-slot='chat-footer'] {
|
|
381
|
+
--color-background: oklch( 1 0 0 );
|
|
382
|
+
--color-primary: #your-brand-color;
|
|
369
383
|
}
|
|
370
384
|
```
|
|
371
385
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
## Advanced Usage
|
|
375
|
-
|
|
376
|
-
### Custom Message Renderer
|
|
377
|
-
|
|
378
|
-
Provide a custom markdown renderer:
|
|
379
|
-
|
|
380
|
-
```tsx
|
|
381
|
-
import { ReactMarkdown } from 'react-markdown';
|
|
382
|
-
|
|
383
|
-
const customRenderer = ({ children }: { children: string }) => (
|
|
384
|
-
<ReactMarkdown
|
|
385
|
-
remarkPlugins={[remarkGfm]}
|
|
386
|
-
components={{
|
|
387
|
-
code: ({ children }) => <code className="custom-code">{children}</code>
|
|
388
|
-
}}
|
|
389
|
-
>
|
|
390
|
-
{children}
|
|
391
|
-
</ReactMarkdown>
|
|
392
|
-
);
|
|
393
|
-
|
|
394
|
-
<AgentUI
|
|
395
|
-
messages={messages}
|
|
396
|
-
messageRenderer={customRenderer}
|
|
397
|
-
// ... other props
|
|
398
|
-
/>
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
### Message Actions
|
|
402
|
-
|
|
403
|
-
Messages can include interactive actions:
|
|
404
|
-
|
|
405
|
-
```tsx
|
|
406
|
-
const messagesWithActions = messages.map(message => ({
|
|
407
|
-
...message,
|
|
408
|
-
actions: message.role === 'agent' ? [
|
|
409
|
-
{
|
|
410
|
-
id: 'copy',
|
|
411
|
-
icon: <CopyIcon />,
|
|
412
|
-
label: 'Copy',
|
|
413
|
-
onClick: () => navigator.clipboard.writeText(message.content[0].text)
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
id: 'feedback',
|
|
417
|
-
icon: <ThumbsUpIcon />,
|
|
418
|
-
label: 'Good response',
|
|
419
|
-
onClick: () => console.log('Positive feedback')
|
|
420
|
-
}
|
|
421
|
-
] : []
|
|
422
|
-
}));
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
### Controlled Chat State
|
|
426
|
-
|
|
427
|
-
For floating variant, control the chat state externally:
|
|
428
|
-
|
|
429
|
-
```tsx
|
|
430
|
-
const [chatState, setChatState] = useState<ChatState>('collapsed');
|
|
431
|
-
|
|
432
|
-
<AgentUI
|
|
433
|
-
variant="floating"
|
|
434
|
-
floatingChatState={chatState}
|
|
435
|
-
onOpen={() => setChatState('compact')}
|
|
436
|
-
onExpand={() => setChatState('expanded')}
|
|
437
|
-
onClose={() => setChatState('collapsed')}
|
|
438
|
-
// ... other props
|
|
439
|
-
/>
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
### Custom Empty View
|
|
386
|
+
## Icons
|
|
443
387
|
|
|
444
|
-
|
|
388
|
+
Pre-built icon components:
|
|
445
389
|
|
|
446
390
|
```tsx
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
391
|
+
import {
|
|
392
|
+
ThumbsUpIcon,
|
|
393
|
+
ThumbsDownIcon,
|
|
394
|
+
CopyIcon,
|
|
395
|
+
StopIcon,
|
|
396
|
+
ArrowUpIcon,
|
|
397
|
+
XIcon,
|
|
398
|
+
BigSkyIcon,
|
|
399
|
+
StylesIcon,
|
|
400
|
+
} from '@automattic/agenttic-ui';
|
|
457
401
|
```
|
|
458
402
|
|
|
459
403
|
## Development
|
|
@@ -475,32 +419,19 @@ pnpm type-check
|
|
|
475
419
|
pnpm storybook
|
|
476
420
|
```
|
|
477
421
|
|
|
478
|
-
## Storybook Documentation
|
|
479
|
-
|
|
480
|
-
Interactive component documentation is available via Storybook:
|
|
481
|
-
|
|
482
|
-
```bash
|
|
483
|
-
pnpm storybook
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
Visit `http://localhost:6006` to explore component examples and documentation.
|
|
487
|
-
|
|
488
422
|
## Integration with agenttic-client
|
|
489
423
|
|
|
490
|
-
This UI package is designed to work seamlessly with `@automattic/agenttic-client`:
|
|
491
|
-
|
|
492
424
|
```tsx
|
|
493
425
|
import { useAgentChat } from '@automattic/agenttic-client';
|
|
494
426
|
import { AgentUI } from '@automattic/agenttic-ui';
|
|
495
427
|
|
|
496
428
|
function App() {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
});
|
|
429
|
+
const agentProps = useAgentChat( {
|
|
430
|
+
agentId: 'big-sky',
|
|
431
|
+
} );
|
|
501
432
|
|
|
502
|
-
|
|
433
|
+
return <AgentUI { ...agentProps } variant="floating" />;
|
|
503
434
|
}
|
|
504
435
|
```
|
|
505
436
|
|
|
506
|
-
The `useAgentChat` hook returns props that match the `AgentUI` interface
|
|
437
|
+
The `useAgentChat` hook returns props that match the `AgentUI` interface.
|