@automattic/agenttic-ui 0.1.10 → 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 -387
- 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 +19 -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/chat/Chat.d.ts.map +1 -1
- package/dist/components/chat/ChatFooter.stories.d.ts.map +1 -1
- 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 +2 -1
- package/dist/components/chat/ChatInput.d.ts.map +1 -1
- package/dist/components/chat/ChatInput.stories.d.ts +39 -1
- package/dist/components/chat/ChatInput.stories.d.ts.map +1 -1
- package/dist/components/chat/Messages.d.ts +2 -1
- package/dist/components/chat/Messages.d.ts.map +1 -1
- 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/ui/button.d.ts +2 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/views/CompactView.d.ts +4 -1
- package/dist/components/views/CompactView.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 +18 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -2501
- 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 +2 -0
- 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 +3 -3
package/README.md
CHANGED
|
@@ -10,321 +10,345 @@ npm install @automattic/agenttic-ui
|
|
|
10
10
|
|
|
11
11
|
## Key Features
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
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
|
|
21
22
|
|
|
22
23
|
## Quick Start
|
|
23
24
|
|
|
24
|
-
### Complete Chat Interface
|
|
25
|
+
### Complete Chat Interface (Convenience API)
|
|
25
26
|
|
|
26
27
|
```tsx
|
|
27
28
|
import { useAgentChat } from '@automattic/agenttic-client';
|
|
28
29
|
import { AgentUI } from '@automattic/agenttic-ui';
|
|
29
30
|
|
|
30
31
|
function ChatApplication() {
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
);
|
|
59
60
|
}
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
###
|
|
63
|
+
### Composable Architecture
|
|
64
|
+
|
|
65
|
+
For complete control over layout and component ordering:
|
|
63
66
|
|
|
64
67
|
```tsx
|
|
65
|
-
|
|
66
|
-
messages={messages}
|
|
67
|
-
isProcessing={isProcessing}
|
|
68
|
-
error={error}
|
|
69
|
-
onSubmit={onSubmit}
|
|
70
|
-
variant="embedded"
|
|
71
|
-
placeholder="How can I help you?"
|
|
72
|
-
/>
|
|
73
|
-
```
|
|
68
|
+
import { AgentUI } from '@automattic/agenttic-ui';
|
|
74
69
|
|
|
75
|
-
|
|
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
|
+
```
|
|
76
93
|
|
|
77
|
-
###
|
|
94
|
+
### Controlled Input
|
|
78
95
|
|
|
79
|
-
|
|
96
|
+
External control of input value and changes:
|
|
80
97
|
|
|
81
98
|
```tsx
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
emptyView?: React.ReactNode;
|
|
96
|
-
|
|
97
|
-
// Chat state management (floating variant)
|
|
98
|
-
floatingChatState?: ChatState;
|
|
99
|
-
onOpen?: () => void;
|
|
100
|
-
onExpand?: () => void;
|
|
101
|
-
onClose?: () => void;
|
|
102
|
-
|
|
103
|
-
// Suggestions
|
|
104
|
-
suggestions?: Suggestion[];
|
|
105
|
-
clearSuggestions?: () => void;
|
|
106
|
-
|
|
107
|
-
// Message rendering
|
|
108
|
-
messageRenderer?: ComponentType<{ children: string }>;
|
|
109
|
-
|
|
110
|
-
// Styling
|
|
111
|
-
className?: string;
|
|
112
|
-
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
|
+
);
|
|
113
112
|
}
|
|
114
113
|
```
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
- `floating` - Draggable chat widget with collapsed/compact/expanded states
|
|
118
|
-
- `embedded` - Fixed chat interface for integration in existing layouts
|
|
115
|
+
## Architecture
|
|
119
116
|
|
|
120
|
-
###
|
|
117
|
+
### AgentUI Components
|
|
121
118
|
|
|
122
|
-
|
|
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
|
|
123
128
|
|
|
124
|
-
|
|
125
|
-
import {
|
|
126
|
-
Chat,
|
|
127
|
-
Messages,
|
|
128
|
-
Message,
|
|
129
|
-
ChatInput,
|
|
130
|
-
Suggestions
|
|
131
|
-
} from '@automattic/agenttic-ui';
|
|
129
|
+
### AgentUIProps Interface
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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;
|
|
151
167
|
}
|
|
152
168
|
```
|
|
153
169
|
|
|
154
|
-
##
|
|
170
|
+
## Usage Patterns
|
|
155
171
|
|
|
156
|
-
###
|
|
172
|
+
### Flexible Component Ordering
|
|
157
173
|
|
|
158
|
-
|
|
174
|
+
Place suggestions anywhere in your layout:
|
|
159
175
|
|
|
160
176
|
```tsx
|
|
161
|
-
<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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>
|
|
172
197
|
```
|
|
173
198
|
|
|
174
|
-
###
|
|
199
|
+
### Individual Components
|
|
175
200
|
|
|
176
|
-
|
|
201
|
+
Use individual components for complete customization:
|
|
177
202
|
|
|
178
203
|
```tsx
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
+
}
|
|
184
233
|
```
|
|
185
234
|
|
|
186
|
-
###
|
|
235
|
+
### Request Cancellation
|
|
187
236
|
|
|
188
|
-
|
|
237
|
+
Stop button appears automatically during processing:
|
|
189
238
|
|
|
190
239
|
```tsx
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
240
|
+
<AgentUI
|
|
241
|
+
isProcessing={ isProcessing }
|
|
242
|
+
onStop={ abortCurrentRequest }
|
|
243
|
+
// Submit button becomes stop button when processing
|
|
195
244
|
/>
|
|
196
245
|
```
|
|
197
246
|
|
|
198
|
-
###
|
|
199
|
-
|
|
200
|
-
Text input with auto-resize and submit handling.
|
|
247
|
+
### Custom Message Renderer
|
|
201
248
|
|
|
202
249
|
```tsx
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
isProcessing={false}
|
|
211
|
-
textareaRef={textareaRef}
|
|
212
|
-
/>
|
|
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 } />;
|
|
213
257
|
```
|
|
214
258
|
|
|
215
|
-
###
|
|
259
|
+
### Chat State Control
|
|
216
260
|
|
|
217
|
-
|
|
261
|
+
For floating variant, control state externally:
|
|
218
262
|
|
|
219
263
|
```tsx
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
+
/>;
|
|
228
273
|
```
|
|
229
274
|
|
|
230
275
|
## Hooks
|
|
231
276
|
|
|
232
277
|
### useChat
|
|
233
278
|
|
|
234
|
-
Manages chat state
|
|
279
|
+
Manages floating chat state:
|
|
235
280
|
|
|
236
281
|
```tsx
|
|
237
282
|
const {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
} = useChat(initialState);
|
|
283
|
+
state, // 'collapsed' | 'compact' | 'expanded'
|
|
284
|
+
setState,
|
|
285
|
+
isOpen, // boolean
|
|
286
|
+
open, // () => void
|
|
287
|
+
close, // () => void
|
|
288
|
+
toggle, // () => void
|
|
289
|
+
} = useChat( initialState );
|
|
245
290
|
```
|
|
246
291
|
|
|
247
292
|
### useInput
|
|
248
293
|
|
|
249
|
-
Manages
|
|
294
|
+
Manages input state with auto-resize:
|
|
250
295
|
|
|
251
296
|
```tsx
|
|
252
|
-
const {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
} = useInput({
|
|
260
|
-
value: inputValue,
|
|
261
|
-
setValue: setInputValue,
|
|
262
|
-
onSubmit: handleSubmit,
|
|
263
|
-
isProcessing: false
|
|
264
|
-
});
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
## Icons
|
|
268
|
-
|
|
269
|
-
Pre-built icon components for consistent UI:
|
|
270
|
-
|
|
271
|
-
```tsx
|
|
272
|
-
import {
|
|
273
|
-
ThumbsUpIcon,
|
|
274
|
-
ThumbsDownIcon,
|
|
275
|
-
CopyIcon,
|
|
276
|
-
StopIcon,
|
|
277
|
-
ArrowUpIcon,
|
|
278
|
-
XIcon,
|
|
279
|
-
BigSkyIcon,
|
|
280
|
-
StylesIcon
|
|
281
|
-
} 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
|
+
} );
|
|
282
304
|
```
|
|
283
305
|
|
|
284
306
|
## Type Definitions
|
|
285
307
|
|
|
286
308
|
```tsx
|
|
287
309
|
interface Message {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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[];
|
|
302
324
|
}
|
|
303
325
|
|
|
304
326
|
interface MessageAction {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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;
|
|
311
335
|
}
|
|
312
336
|
|
|
313
337
|
interface Suggestion {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
338
|
+
id: string;
|
|
339
|
+
label: string;
|
|
340
|
+
prompt: string;
|
|
317
341
|
}
|
|
318
342
|
|
|
319
343
|
interface NoticeConfig {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
344
|
+
icon?: React.ReactNode;
|
|
345
|
+
message: string;
|
|
346
|
+
action?: {
|
|
347
|
+
label: string;
|
|
348
|
+
onClick: () => void;
|
|
349
|
+
};
|
|
350
|
+
dismissible?: boolean;
|
|
351
|
+
onDismiss?: () => void;
|
|
328
352
|
}
|
|
329
353
|
|
|
330
354
|
type ChatState = 'collapsed' | 'compact' | 'expanded';
|
|
@@ -334,163 +358,46 @@ type ChatState = 'collapsed' | 'compact' | 'expanded';
|
|
|
334
358
|
|
|
335
359
|
### CSS Import
|
|
336
360
|
|
|
337
|
-
Components automatically import their styles. For manual control:
|
|
338
|
-
|
|
339
|
-
```css
|
|
340
|
-
/* In your CSS */
|
|
341
|
-
@import '@automattic/agenttic-ui/index.css';
|
|
342
|
-
```
|
|
343
|
-
|
|
344
361
|
```tsx
|
|
345
|
-
// In JavaScript/TypeScript
|
|
346
362
|
import '@automattic/agenttic-ui/index.css';
|
|
347
363
|
```
|
|
348
364
|
|
|
349
365
|
### CSS Scoping
|
|
350
366
|
|
|
351
|
-
All
|
|
367
|
+
All styles are scoped to `.agenttic` class to prevent conflicts.
|
|
352
368
|
|
|
353
369
|
### Customization
|
|
354
370
|
|
|
355
|
-
Override CSS custom properties
|
|
371
|
+
Override CSS custom properties:
|
|
356
372
|
|
|
357
373
|
```css
|
|
358
|
-
/* Global theming */
|
|
359
374
|
.agenttic {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
/* ...other custom properties as needed. */
|
|
375
|
+
--color-primary: #your-brand-color;
|
|
376
|
+
--color-background: #ffffff;
|
|
377
|
+
--color-foreground: #000000;
|
|
364
378
|
}
|
|
365
379
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
--color-foreground: oklch(0.241 0 0);
|
|
370
|
-
--color-primary: #your-brand-color;
|
|
371
|
-
--color-primary-foreground: oklch(1 0 0);
|
|
372
|
-
--color-muted: oklch(0.925 0 0);
|
|
373
|
-
--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;
|
|
374
383
|
}
|
|
375
384
|
```
|
|
376
385
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
## Advanced Usage
|
|
380
|
-
|
|
381
|
-
### Request Cancellation UI
|
|
382
|
-
|
|
383
|
-
The UI automatically displays a stop button when `isProcessing` is true and an `onStop` callback is provided. The submit button transforms into a stop button during processing:
|
|
384
|
-
|
|
385
|
-
```tsx
|
|
386
|
-
const {
|
|
387
|
-
abortCurrentRequest,
|
|
388
|
-
isProcessing
|
|
389
|
-
} = useAgentChat(config);
|
|
390
|
-
|
|
391
|
-
<AgentUI
|
|
392
|
-
isProcessing={isProcessing}
|
|
393
|
-
onStop={abortCurrentRequest}
|
|
394
|
-
// When processing, the submit button becomes a stop button
|
|
395
|
-
// ... other props
|
|
396
|
-
/>
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
For custom implementations:
|
|
400
|
-
|
|
401
|
-
```tsx
|
|
402
|
-
<ChatInput
|
|
403
|
-
isProcessing={isProcessing}
|
|
404
|
-
onStop={() => {
|
|
405
|
-
console.log('User requested to stop');
|
|
406
|
-
abortCurrentRequest();
|
|
407
|
-
}}
|
|
408
|
-
// The button automatically shows stop icon during processing
|
|
409
|
-
// ... other props
|
|
410
|
-
/>
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
### Custom Message Renderer
|
|
414
|
-
|
|
415
|
-
Provide a custom markdown renderer:
|
|
416
|
-
|
|
417
|
-
```tsx
|
|
418
|
-
import { ReactMarkdown } from 'react-markdown';
|
|
419
|
-
|
|
420
|
-
const customRenderer = ({ children }: { children: string }) => (
|
|
421
|
-
<ReactMarkdown
|
|
422
|
-
remarkPlugins={[remarkGfm]}
|
|
423
|
-
components={{
|
|
424
|
-
code: ({ children }) => <code className="custom-code">{children}</code>
|
|
425
|
-
}}
|
|
426
|
-
>
|
|
427
|
-
{children}
|
|
428
|
-
</ReactMarkdown>
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
<AgentUI
|
|
432
|
-
messages={messages}
|
|
433
|
-
messageRenderer={customRenderer}
|
|
434
|
-
// ... other props
|
|
435
|
-
/>
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
### Message Actions
|
|
439
|
-
|
|
440
|
-
Messages can include interactive actions:
|
|
441
|
-
|
|
442
|
-
```tsx
|
|
443
|
-
const messagesWithActions = messages.map(message => ({
|
|
444
|
-
...message,
|
|
445
|
-
actions: message.role === 'agent' ? [
|
|
446
|
-
{
|
|
447
|
-
id: 'copy',
|
|
448
|
-
icon: <CopyIcon />,
|
|
449
|
-
label: 'Copy',
|
|
450
|
-
onClick: () => navigator.clipboard.writeText(message.content[0].text)
|
|
451
|
-
},
|
|
452
|
-
{
|
|
453
|
-
id: 'feedback',
|
|
454
|
-
icon: <ThumbsUpIcon />,
|
|
455
|
-
label: 'Good response',
|
|
456
|
-
onClick: () => console.log('Positive feedback')
|
|
457
|
-
}
|
|
458
|
-
] : []
|
|
459
|
-
}));
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
### Controlled Chat State
|
|
463
|
-
|
|
464
|
-
For floating variant, control the chat state externally:
|
|
465
|
-
|
|
466
|
-
```tsx
|
|
467
|
-
const [chatState, setChatState] = useState<ChatState>('collapsed');
|
|
468
|
-
|
|
469
|
-
<AgentUI
|
|
470
|
-
variant="floating"
|
|
471
|
-
floatingChatState={chatState}
|
|
472
|
-
onOpen={() => setChatState('compact')}
|
|
473
|
-
onExpand={() => setChatState('expanded')}
|
|
474
|
-
onClose={() => setChatState('collapsed')}
|
|
475
|
-
// ... other props
|
|
476
|
-
/>
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
### Custom Empty View
|
|
386
|
+
## Icons
|
|
480
387
|
|
|
481
|
-
|
|
388
|
+
Pre-built icon components:
|
|
482
389
|
|
|
483
390
|
```tsx
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
391
|
+
import {
|
|
392
|
+
ThumbsUpIcon,
|
|
393
|
+
ThumbsDownIcon,
|
|
394
|
+
CopyIcon,
|
|
395
|
+
StopIcon,
|
|
396
|
+
ArrowUpIcon,
|
|
397
|
+
XIcon,
|
|
398
|
+
BigSkyIcon,
|
|
399
|
+
StylesIcon,
|
|
400
|
+
} from '@automattic/agenttic-ui';
|
|
494
401
|
```
|
|
495
402
|
|
|
496
403
|
## Development
|
|
@@ -512,32 +419,19 @@ pnpm type-check
|
|
|
512
419
|
pnpm storybook
|
|
513
420
|
```
|
|
514
421
|
|
|
515
|
-
## Storybook Documentation
|
|
516
|
-
|
|
517
|
-
Interactive component documentation is available via Storybook:
|
|
518
|
-
|
|
519
|
-
```bash
|
|
520
|
-
pnpm storybook
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
Visit `http://localhost:6006` to explore component examples and documentation.
|
|
524
|
-
|
|
525
422
|
## Integration with agenttic-client
|
|
526
423
|
|
|
527
|
-
This UI package is designed to work seamlessly with `@automattic/agenttic-client`:
|
|
528
|
-
|
|
529
424
|
```tsx
|
|
530
425
|
import { useAgentChat } from '@automattic/agenttic-client';
|
|
531
426
|
import { AgentUI } from '@automattic/agenttic-ui';
|
|
532
427
|
|
|
533
428
|
function App() {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
});
|
|
429
|
+
const agentProps = useAgentChat( {
|
|
430
|
+
agentId: 'big-sky',
|
|
431
|
+
} );
|
|
538
432
|
|
|
539
|
-
|
|
433
|
+
return <AgentUI { ...agentProps } variant="floating" />;
|
|
540
434
|
}
|
|
541
435
|
```
|
|
542
436
|
|
|
543
|
-
The `useAgentChat` hook returns props that match the `AgentUI` interface
|
|
437
|
+
The `useAgentChat` hook returns props that match the `AgentUI` interface.
|