@carbon/ai-chat-components 0.5.0 → 0.6.0-rc.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/custom-elements.json +9201 -295
- package/dist/16-B6dpbhwk.js +91 -0
- package/dist/apl-Bkd9Mf6P.js +91 -0
- package/dist/asciiarmor-DL4R2aFc.js +91 -0
- package/dist/asn1-BNuq0wMN.js +91 -0
- package/dist/asterisk-CKsJI4Xo.js +91 -0
- package/dist/button-Cl3aa-QH.js +157 -0
- package/dist/button-skeleton-DpmYT5sr.js +116 -0
- package/dist/carbon-element-DtQeYrv7.js +91 -0
- package/dist/carbon-element-wyoWZuGw.js +91 -0
- package/dist/chain-of-thought.min.js +276 -0
- package/dist/chat-button.min.js +71 -81
- package/dist/checkbox-skeleton-77m2gyNb.js +166 -0
- package/dist/class-map-BgQK6m9u.js +106 -0
- package/dist/clike-7TJ9zfKW.js +91 -0
- package/dist/clojure-9jpZ60Lu.js +91 -0
- package/dist/cmake-UY0DwvRL.js +91 -0
- package/dist/cobol-DhfZi79a.js +91 -0
- package/dist/code-snippet.min.js +91 -0
- package/dist/codemirror-runtime-ClX6d06H.js +173 -0
- package/dist/coffeescript-mDf6LSpC.js +91 -0
- package/dist/collection-helpers-DTO_rBxT.js +91 -0
- package/dist/commonlisp-Qa7gZPAc.js +91 -0
- package/dist/crystal-C1gbEnje.js +91 -0
- package/dist/css-BLorXS28.js +91 -0
- package/dist/custom-element-C-oe1CPQ.js +96 -0
- package/dist/cypher-BY0J-JQD.js +91 -0
- package/dist/d-zkooxxUz.js +91 -0
- package/dist/diff-CrCOHpAq.js +91 -0
- package/dist/dockerfile-D7x4UVxN.js +91 -0
- package/dist/dtd-Cp_rfrvO.js +91 -0
- package/dist/dylan-BWjG5gpG.js +91 -0
- package/dist/ebnf-JN5Vq0lF.js +91 -0
- package/dist/ecl-De3xBvSp.js +91 -0
- package/dist/eiffel-BUg3McKi.js +91 -0
- package/dist/elm-BzEpaycL.js +91 -0
- package/dist/erlang-CRda3Szm.js +91 -0
- package/dist/factor-HH6tZH2o.js +91 -0
- package/dist/fcl-DethtZZ9.js +91 -0
- package/dist/feedback.min.js +300 -0
- package/dist/forth-CvRI4Fp8.js +91 -0
- package/dist/fortran-BlOOIWks.js +91 -0
- package/dist/gas-D13dt2I8.js +91 -0
- package/dist/gherkin-DeOVdg90.js +91 -0
- package/dist/groovy-HwkbYX11.js +91 -0
- package/dist/haskell-BrtcJMpO.js +91 -0
- package/dist/haxe-DLraHdYm.js +91 -0
- package/dist/http-DZFwp0rs.js +91 -0
- package/dist/icon-button-DLTQYCDh.js +143 -0
- package/dist/icon-loader-DNSGSUXr.js +101 -0
- package/dist/idl-9eLgsa_L.js +91 -0
- package/dist/if-defined-D_Efffcr.js +96 -0
- package/dist/index-07U-x-DZ.js +91 -0
- package/dist/index-B-leT4Qo.js +91 -0
- package/dist/index-BCIOZ3Iv.js +91 -0
- package/dist/index-BJcdJS87.js +91 -0
- package/dist/index-BlpbVMq_.js +91 -0
- package/dist/index-CB8fQWmx.js +91 -0
- package/dist/index-CDmjsjkj.js +91 -0
- package/dist/index-CHI0qSLN.js +91 -0
- package/dist/index-CHor-HRv.js +91 -0
- package/dist/index-C_x1WGc6.js +91 -0
- package/dist/index-Cg3MLvVN.js +91 -0
- package/dist/index-Cp5sEHjB.js +367 -0
- package/dist/index-CtUoNlIM.js +91 -0
- package/dist/index-CusUYvgE.js +91 -0
- package/dist/index-CvvPafwM.js +168 -0
- package/dist/index-DDjGfF24.js +91 -0
- package/dist/index-DxS06aLY.js +91 -0
- package/dist/index-FwP_JV-c.js +91 -0
- package/dist/index-Hcd_VCMd.js +91 -0
- package/dist/index-LlI0lXKE.js +91 -0
- package/dist/index-Q34JRmNZ.js +91 -0
- package/dist/index-f7UAoB15.js +91 -0
- package/dist/index-mQZVoo3c.js +91 -0
- package/dist/index-yd1vgygF.js +91 -0
- package/dist/javascript-hgM39w7C.js +91 -0
- package/dist/julia-DtM_gc7j.js +91 -0
- package/dist/{settings-XW6XylsZ.js → lit-element-BnGYooZk.js} +70 -12
- package/dist/livescript-BySrhTUe.js +91 -0
- package/dist/lua-ChD7R8km.js +91 -0
- package/dist/markdown.min.js +296 -0
- package/dist/mathematica-kcP6Cajy.js +91 -0
- package/dist/mbox-Bw_KHaUe.js +91 -0
- package/dist/mirc-jvko25mJ.js +91 -0
- package/dist/mllike-CNKOuVeX.js +91 -0
- package/dist/modelica-YfrFDmxR.js +91 -0
- package/dist/mscgen-Bok75bzR.js +91 -0
- package/dist/mumps-BTuSBaU1.js +91 -0
- package/dist/nginx-DwZuHJnC.js +91 -0
- package/dist/nsis-CIx93lk7.js +91 -0
- package/dist/ntriples-Djj269Be.js +91 -0
- package/dist/octave-CrdvfVOv.js +91 -0
- package/dist/oz-C4bYf6je.js +91 -0
- package/dist/pascal-D2KPt6vl.js +91 -0
- package/dist/perl-5YDHx0ay.js +91 -0
- package/dist/pig-DzmRINVg.js +91 -0
- package/dist/powershell-BT_ybnoW.js +91 -0
- package/dist/processing.min.js +71 -4
- package/dist/properties-4YytEGly.js +91 -0
- package/dist/protobuf-CI-p1B8j.js +91 -0
- package/dist/pug-DLHGbkXU.js +91 -0
- package/dist/puppet-BbNNtXxr.js +91 -0
- package/dist/python-D3PSFk0-.js +91 -0
- package/dist/q-ObXF982D.js +91 -0
- package/dist/query-DLqIY4Wn.js +101 -0
- package/dist/r-DiZLK5qY.js +91 -0
- package/dist/radio-group-manager-GuAarpdg.js +91 -0
- package/dist/reasoning-steps.min.js +171 -0
- package/dist/repeat-DQkjGru3.js +96 -0
- package/dist/rpm-BA1XlISV.js +91 -0
- package/dist/ruby-o3bYJp8s.js +91 -0
- package/dist/sas-YW-OKZPX.js +91 -0
- package/dist/scheme-D5iPrCDC.js +91 -0
- package/dist/settings-BfbbHBjJ.js +99 -0
- package/dist/shell-BMwJ8_g7.js +91 -0
- package/dist/sieve-BE4sKTG2.js +91 -0
- package/dist/simple-mode-2GmZ0AR1.js +91 -0
- package/dist/smalltalk-CI3t8V3g.js +91 -0
- package/dist/solr-xhjjvvCE.js +91 -0
- package/dist/sparql-D64FGxiD.js +91 -0
- package/dist/spreadsheet-CnwQq-zp.js +91 -0
- package/dist/sql-CWCB15es.js +91 -0
- package/dist/state-BF51fRID.js +96 -0
- package/dist/stex-DqIfOYF1.js +91 -0
- package/dist/stylus-xz-vruRQ.js +91 -0
- package/dist/swift-BPHP66va.js +91 -0
- package/dist/sync-HIZypRbs.js +91 -0
- package/dist/table-runtime-C7apcdgu.js +510 -0
- package/dist/table.min.js +91 -0
- package/dist/tcl-BSDESp20.js +91 -0
- package/dist/text-input-Ca8K1Ydg.js +158 -0
- package/dist/textile-COeIYMRW.js +91 -0
- package/dist/throttle-CN5lMS8t.js +91 -0
- package/dist/tiddlywiki-Bs5PoKQf.js +91 -0
- package/dist/tiki-DqKGtwP5.js +91 -0
- package/dist/tile-container.min.js +70 -14
- package/dist/toml-DA5Yl8WK.js +91 -0
- package/dist/toolbar.min.js +180 -0
- package/dist/troff-BRNQrjuW.js +91 -0
- package/dist/ttcn-Bn8eKWOh.js +91 -0
- package/dist/ttcn-cfg-BO-9W9JU.js +91 -0
- package/dist/turtle-CxuhUAyA.js +91 -0
- package/dist/vb-C40-VEDj.js +91 -0
- package/dist/vbscript-BogOMGMf.js +91 -0
- package/dist/velocity-CQs7G9b4.js +91 -0
- package/dist/verilog-CelFoyTQ.js +91 -0
- package/dist/vhdl-BlCs0iAG.js +91 -0
- package/dist/webidl-VWB4mjSa.js +91 -0
- package/dist/workspace-shell.min.js +162 -0
- package/dist/xquery-B8qd1YwF.js +91 -0
- package/dist/yacas-OhfCFLfI.js +91 -0
- package/dist/z80-oZfTgdDp.js +91 -0
- package/es/components/chain-of-thought/index.d.ts +4 -0
- package/es/components/chain-of-thought/index.js +11 -0
- package/es/components/chain-of-thought/index.js.map +1 -0
- package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.d.ts +15 -0
- package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.js +36 -0
- package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.js.map +1 -0
- package/es/components/chain-of-thought/src/chain-of-thought.d.ts +87 -0
- package/es/components/chain-of-thought/src/chain-of-thought.js +189 -0
- package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -0
- package/es/components/chain-of-thought/src/chain-of-thought.scss.js +13 -0
- package/es/components/chain-of-thought/src/chain-of-thought.scss.js.map +1 -0
- package/es/components/chain-of-thought/src/chain-of-thought.template.d.ts +5 -0
- package/es/components/chain-of-thought/src/chain-of-thought.template.js +206 -0
- package/es/components/chain-of-thought/src/chain-of-thought.template.js.map +1 -0
- package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.d.ts +10 -0
- package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.js +50 -0
- package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.js.map +1 -0
- package/es/components/chain-of-thought/src/types.d.ts +73 -0
- package/es/components/chain-of-thought/src/types.js +29 -0
- package/es/components/chain-of-thought/src/types.js.map +1 -0
- package/es/components/chat-button/defs.d.ts +25 -0
- package/es/components/chat-button/defs.js +36 -0
- package/es/components/chat-button/defs.js.map +1 -0
- package/es/components/chat-button/index.d.ts +1 -1
- package/es/components/chat-button/index.js +1 -1
- package/es/components/chat-button/src/chat-button.d.ts +32 -0
- package/es/components/chat-button/{chat-button.js → src/chat-button.js} +16 -10
- package/es/components/chat-button/src/chat-button.js.map +1 -0
- package/es/components/chat-button/src/chat-button.scss.js +1 -1
- package/es/components/code-snippet/index.d.ts +3 -0
- package/es/components/code-snippet/index.js +10 -0
- package/es/components/code-snippet/index.js.map +1 -0
- package/es/components/code-snippet/src/code-snippet-tile-container.d.ts +32 -0
- package/es/components/code-snippet/src/code-snippet-tile-container.js +143 -0
- package/es/components/code-snippet/src/code-snippet-tile-container.js.map +1 -0
- package/es/components/code-snippet/src/code-snippet.d.ts +482 -0
- package/es/components/code-snippet/src/code-snippet.js +592 -0
- package/es/components/code-snippet/src/code-snippet.js.map +1 -0
- package/es/components/code-snippet/src/code-snippet.scss.js +13 -0
- package/es/components/code-snippet/src/code-snippet.scss.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/base-setup.d.ts +12 -0
- package/es/components/code-snippet/src/codemirror/base-setup.js +65 -0
- package/es/components/code-snippet/src/codemirror/base-setup.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/codemirror-loader.d.ts +12 -0
- package/es/components/code-snippet/src/codemirror/codemirror-loader.js +36 -0
- package/es/components/code-snippet/src/codemirror/codemirror-loader.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +7 -0
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +13 -0
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/content-sync.d.ts +12 -0
- package/es/components/code-snippet/src/codemirror/content-sync.js +72 -0
- package/es/components/code-snippet/src/codemirror/content-sync.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +28 -0
- package/es/components/code-snippet/src/codemirror/editor-manager.js +75 -0
- package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/language-controller.d.ts +38 -0
- package/es/components/code-snippet/src/codemirror/language-controller.js +220 -0
- package/es/components/code-snippet/src/codemirror/language-controller.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/language-data.d.ts +6 -0
- package/es/components/code-snippet/src/codemirror/language-data.js +1043 -0
- package/es/components/code-snippet/src/codemirror/language-data.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/language-utils.d.ts +79 -0
- package/es/components/code-snippet/src/codemirror/language-utils.js +219 -0
- package/es/components/code-snippet/src/codemirror/language-utils.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/marker-utils.d.ts +123 -0
- package/es/components/code-snippet/src/codemirror/marker-utils.js +183 -0
- package/es/components/code-snippet/src/codemirror/marker-utils.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/theme.d.ts +54 -0
- package/es/components/code-snippet/src/codemirror/theme.js +320 -0
- package/es/components/code-snippet/src/codemirror/theme.js.map +1 -0
- package/es/components/code-snippet/src/dom-utils.d.ts +24 -0
- package/es/components/code-snippet/src/dom-utils.js +63 -0
- package/es/components/code-snippet/src/dom-utils.js.map +1 -0
- package/es/components/code-snippet/src/formatters.d.ts +4 -0
- package/es/components/code-snippet/src/formatters.js +19 -0
- package/es/components/code-snippet/src/formatters.js.map +1 -0
- package/es/components/code-snippet/src/layout-utils.d.ts +22 -0
- package/es/components/code-snippet/src/layout-utils.js +63 -0
- package/es/components/code-snippet/src/layout-utils.js.map +1 -0
- package/es/components/code-snippet/src/streaming-manager.d.ts +24 -0
- package/es/components/code-snippet/src/streaming-manager.js +120 -0
- package/es/components/code-snippet/src/streaming-manager.js.map +1 -0
- package/es/components/feedback/index.d.ts +7 -0
- package/es/components/feedback/index.js +12 -0
- package/es/components/feedback/index.js.map +1 -0
- package/es/components/feedback/src/cds-aichat-feedback-buttons.d.ts +15 -0
- package/es/components/feedback/src/cds-aichat-feedback-buttons.js +36 -0
- package/es/components/feedback/src/cds-aichat-feedback-buttons.js.map +1 -0
- package/es/components/feedback/src/cds-aichat-feedback.d.ts +15 -0
- package/es/components/feedback/src/cds-aichat-feedback.js +36 -0
- package/es/components/feedback/src/cds-aichat-feedback.js.map +1 -0
- package/es/components/feedback/src/feedback-buttons.d.ts +56 -0
- package/es/components/feedback/src/feedback-buttons.js +104 -0
- package/es/components/feedback/src/feedback-buttons.js.map +1 -0
- package/es/components/feedback/src/feedback-buttons.scss.js +13 -0
- package/es/components/feedback/src/feedback-buttons.scss.js.map +1 -0
- package/es/components/feedback/src/feedback-buttons.template.d.ts +4 -0
- package/es/components/feedback/src/feedback-buttons.template.js +79 -0
- package/es/components/feedback/src/feedback-buttons.template.js.map +1 -0
- package/es/components/feedback/src/feedback.d.ts +114 -0
- package/es/components/feedback/src/feedback.js +182 -0
- package/es/components/feedback/src/feedback.js.map +1 -0
- package/es/components/feedback/src/feedback.scss.js +13 -0
- package/es/components/feedback/src/feedback.scss.js.map +1 -0
- package/es/components/feedback/src/feedback.template.d.ts +12 -0
- package/es/components/feedback/src/feedback.template.js +115 -0
- package/es/components/feedback/src/feedback.template.js.map +1 -0
- package/es/components/markdown/index.d.ts +2 -0
- package/es/components/markdown/index.js +9 -0
- package/es/components/markdown/index.js.map +1 -0
- package/es/components/markdown/src/cds-aichat-markdown.d.ts +13 -0
- package/es/components/markdown/src/cds-aichat-markdown.js +35 -0
- package/es/components/markdown/src/cds-aichat-markdown.js.map +1 -0
- package/es/components/markdown/src/markdown-renderer.d.ts +62 -0
- package/es/components/markdown/src/markdown-renderer.js +354 -0
- package/es/components/markdown/src/markdown-renderer.js.map +1 -0
- package/es/components/markdown/src/markdown-token-tree.d.ts +32 -0
- package/es/components/markdown/src/markdown-token-tree.js +178 -0
- package/es/components/markdown/src/markdown-token-tree.js.map +1 -0
- package/es/components/markdown/src/markdown.d.ts +44 -0
- package/es/components/markdown/src/markdown.js +238 -0
- package/es/components/markdown/src/markdown.js.map +1 -0
- package/es/components/markdown/src/markdown.scss.js +13 -0
- package/es/components/markdown/src/markdown.scss.js.map +1 -0
- package/es/components/markdown/src/markdown.template.d.ts +3 -0
- package/es/components/markdown/src/markdown.template.js +24 -0
- package/es/components/markdown/src/markdown.template.js.map +1 -0
- package/es/components/markdown/src/plugins/markdown-it-attrs.d.ts +7 -0
- package/es/components/markdown/src/plugins/markdown-it-attrs.js +84 -0
- package/es/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -0
- package/es/components/markdown/src/plugins/markdown-it-highlight.d.ts +7 -0
- package/es/components/markdown/src/plugins/markdown-it-highlight.js +59 -0
- package/es/components/markdown/src/plugins/markdown-it-highlight.js.map +1 -0
- package/es/components/markdown/src/plugins/markdown-it-task-lists.d.ts +12 -0
- package/es/components/markdown/src/plugins/markdown-it-task-lists.js +73 -0
- package/es/components/markdown/src/plugins/markdown-it-task-lists.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/core.d.ts +26 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/core.js +330 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/core.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +6 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +63 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +6 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +43 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +5 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +55 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +19 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +210 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +13 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +156 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +13 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +216 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/types.d.ts +34 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/types.js +8 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/types.js.map +1 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +25 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/utils.js +62 -0
- package/es/components/markdown/src/plugins/markdownItAttrs/utils.js.map +1 -0
- package/es/components/markdown/src/utils/html-helpers.d.ts +2 -0
- package/es/components/markdown/src/utils/html-helpers.js +204 -0
- package/es/components/markdown/src/utils/html-helpers.js.map +1 -0
- package/es/components/markdown/src/utils/table-helpers.d.ts +31 -0
- package/es/components/markdown/src/utils/table-helpers.js +106 -0
- package/es/components/markdown/src/utils/table-helpers.js.map +1 -0
- package/es/components/markdown/src/utils.d.ts +8 -0
- package/es/components/markdown/src/utils.js +31 -0
- package/es/components/markdown/src/utils.js.map +1 -0
- package/es/components/reasoning-steps/index.d.ts +2 -0
- package/es/components/reasoning-steps/index.js +10 -0
- package/es/components/reasoning-steps/index.js.map +1 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.d.ts +29 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.js +231 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.js.map +1 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.scss.js +13 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.scss.js.map +1 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.d.ts +13 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.js +96 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.js.map +1 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.scss.js +13 -0
- package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.scss.js.map +1 -0
- package/es/components/table/index.d.ts +3 -0
- package/es/components/table/index.js +9 -0
- package/es/components/table/index.js.map +1 -0
- package/es/components/table/src/cds-aichat-table.d.ts +262 -0
- package/es/components/table/src/cds-aichat-table.js +511 -0
- package/es/components/table/src/cds-aichat-table.js.map +1 -0
- package/es/components/table/src/table-loader.d.ts +4 -0
- package/es/components/table/src/table-loader.js +28 -0
- package/es/components/table/src/table-loader.js.map +1 -0
- package/es/components/table/src/table-pagination.template.d.ts +27 -0
- package/es/components/table/src/table-pagination.template.js +55 -0
- package/es/components/table/src/table-pagination.template.js.map +1 -0
- package/es/components/table/src/table-runtime.d.ts +2 -0
- package/es/components/table/src/table-runtime.js +10 -0
- package/es/components/table/src/table-runtime.js.map +1 -0
- package/es/components/table/src/table-skeleton.template.d.ts +6 -0
- package/es/components/table/src/table-skeleton.template.js +34 -0
- package/es/components/table/src/table-skeleton.template.js.map +1 -0
- package/es/components/table/src/table.scss.js +13 -0
- package/es/components/table/src/table.scss.js.map +1 -0
- package/es/components/table/src/table.template.d.ts +10 -0
- package/es/components/table/src/table.template.js +89 -0
- package/es/components/table/src/table.template.js.map +1 -0
- package/es/components/table/src/types.d.ts +13 -0
- package/es/components/table/src/types.js +8 -0
- package/es/components/table/src/types.js.map +1 -0
- package/es/components/tile-container/src/styles.scss.js +1 -1
- package/es/components/toolbar/index.d.ts +1 -0
- package/es/components/toolbar/index.js +9 -0
- package/es/components/toolbar/index.js.map +1 -0
- package/es/components/toolbar/src/toolbar.d.ts +39 -0
- package/es/components/toolbar/src/toolbar.js +179 -0
- package/es/components/toolbar/src/toolbar.js.map +1 -0
- package/es/components/toolbar/src/toolbar.scss.js +13 -0
- package/es/components/toolbar/src/toolbar.scss.js.map +1 -0
- package/es/components/workspace-shell/index.d.ts +5 -0
- package/es/components/workspace-shell/index.js +13 -0
- package/es/components/workspace-shell/index.js.map +1 -0
- package/es/components/workspace-shell/src/styles.scss.js +13 -0
- package/es/components/workspace-shell/src/styles.scss.js.map +1 -0
- package/es/components/workspace-shell/src/workspace-shell-body.d.ts +16 -0
- package/es/components/workspace-shell/src/workspace-shell-body.js +50 -0
- package/es/components/workspace-shell/src/workspace-shell-body.js.map +1 -0
- package/es/components/workspace-shell/src/workspace-shell-footer.d.ts +19 -0
- package/es/components/workspace-shell/src/workspace-shell-footer.js +53 -0
- package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -0
- package/es/components/workspace-shell/src/workspace-shell-header.d.ts +27 -0
- package/es/components/workspace-shell/src/workspace-shell-header.js +77 -0
- package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -0
- package/es/components/workspace-shell/src/workspace-shell-toolbar.d.ts +22 -0
- package/es/components/workspace-shell/src/workspace-shell-toolbar.js +61 -0
- package/es/components/workspace-shell/src/workspace-shell-toolbar.js.map +1 -0
- package/es/components/workspace-shell/src/workspace-shell.d.ts +20 -0
- package/es/components/workspace-shell/src/workspace-shell.js +83 -0
- package/es/components/workspace-shell/src/workspace-shell.js.map +1 -0
- package/es/components/workspace-shell/src/workspace-shell.scss.js +13 -0
- package/es/components/workspace-shell/src/workspace-shell.scss.js.map +1 -0
- package/es/globals/utils/uuid.d.ts +5 -0
- package/es/globals/utils/uuid.js +32 -0
- package/es/globals/utils/uuid.js.map +1 -0
- package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js +9 -0
- package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +1 -0
- package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +11 -0
- package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +1 -0
- package/es/node_modules/@codemirror/autocomplete/dist/index.js +258 -0
- package/es/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
- package/es/node_modules/@codemirror/commands/dist/index.js +1140 -0
- package/es/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/es/node_modules/@codemirror/lint/dist/index.js +636 -0
- package/es/node_modules/@codemirror/lint/dist/index.js.map +1 -0
- package/es/node_modules/@lezer/common/dist/index.js +253 -0
- package/es/node_modules/@lezer/common/dist/index.js.map +1 -0
- package/es/node_modules/crelt/index.js +37 -0
- package/es/node_modules/crelt/index.js.map +1 -0
- package/es/react/ai-label.d.ts +2 -1
- package/es/react/ai-label.js +3 -2
- package/es/react/ai-label.js.map +1 -1
- package/es/react/button.d.ts +2 -1
- package/es/react/button.js +3 -2
- package/es/react/button.js.map +1 -1
- package/es/react/chain-of-thought.d.ts +7 -0
- package/es/react/chain-of-thought.js +29 -0
- package/es/react/chain-of-thought.js.map +1 -0
- package/es/react/chat-button.d.ts +4 -4
- package/es/react/chat-button.js +6 -4
- package/es/react/chat-button.js.map +1 -1
- package/es/react/code-snippet-tile-container.d.ts +5 -0
- package/es/react/code-snippet-tile-container.js +30 -0
- package/es/react/code-snippet-tile-container.js.map +1 -0
- package/es/react/code-snippet.d.ts +4 -0
- package/es/react/code-snippet.js +31 -0
- package/es/react/code-snippet.js.map +1 -0
- package/es/react/content-switcher.d.ts +7 -0
- package/es/react/content-switcher.js +37 -0
- package/es/react/content-switcher.js.map +1 -0
- package/es/react/feedback-buttons.d.ts +4 -0
- package/es/react/feedback-buttons.js +28 -0
- package/es/react/feedback-buttons.js.map +1 -0
- package/es/react/feedback.d.ts +6 -0
- package/es/react/feedback.js +32 -0
- package/es/react/feedback.js.map +1 -0
- package/es/react/icon-button.d.ts +2 -1
- package/es/react/icon-button.js +3 -2
- package/es/react/icon-button.js.map +1 -1
- package/es/react/icon.d.ts +4 -0
- package/es/react/icon.js +28 -0
- package/es/react/icon.js.map +1 -0
- package/es/react/markdown.d.ts +4 -0
- package/es/react/markdown.js +28 -0
- package/es/react/markdown.js.map +1 -0
- package/es/react/overflow-menu.d.ts +9 -0
- package/es/react/overflow-menu.js +40 -0
- package/es/react/overflow-menu.js.map +1 -0
- package/es/react/processing.d.ts +2 -1
- package/es/react/processing.js +3 -2
- package/es/react/processing.js.map +1 -1
- package/es/react/reasoning-step.d.ts +6 -0
- package/es/react/reasoning-step.js +31 -0
- package/es/react/reasoning-step.js.map +1 -0
- package/es/react/reasoning-steps.d.ts +3 -0
- package/es/react/reasoning-steps.js +27 -0
- package/es/react/reasoning-steps.js.map +1 -0
- package/es/react/tile-container.d.ts +2 -1
- package/es/react/tile-container.js +3 -2
- package/es/react/tile-container.js.map +1 -1
- package/es/react/tile.d.ts +3 -2
- package/es/react/tile.js +5 -4
- package/es/react/tile.js.map +1 -1
- package/es/react/toolbar.d.ts +4 -0
- package/es/react/toolbar.js +28 -0
- package/es/react/toolbar.js.map +1 -0
- package/es/react/utils/withWebComponentBridge.d.ts +15 -0
- package/es/react/utils/withWebComponentBridge.js +95 -0
- package/es/react/utils/withWebComponentBridge.js.map +1 -0
- package/es/testing/load-all-lazy-deps.d.ts +10 -0
- package/es/testing/load-all-lazy-deps.js +30 -0
- package/es/testing/load-all-lazy-deps.js.map +1 -0
- package/package.json +39 -5
- package/dist/carbon-element-CMR7BOhG.js +0 -24
- package/dist/class-map-h7IEvsL_.js +0 -39
- package/es/components/chat-button/chat-button.d.ts +0 -23
- package/es/components/chat-button/chat-button.js.map +0 -1
- package/es/components/chat-button/src/chat-button.template.d.ts +0 -16
- package/es/components/chat-button/src/chat-button.template.js +0 -27
- package/es/components/chat-button/src/chat-button.template.js.map +0 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import '../../markdown/src/cds-aichat-markdown.js';
|
|
9
|
+
import '@carbon/web-components/es/components/inline-loading/index.js';
|
|
10
|
+
import { iconLoader } from '@carbon/web-components/es/globals/internal/icon-loader.js';
|
|
11
|
+
import CheckmarkFilled16 from '@carbon/icons/es/checkmark--filled/16.js';
|
|
12
|
+
import ChevronRight16 from '@carbon/icons/es/chevron--right/16.js';
|
|
13
|
+
import ErrorFilled16 from '@carbon/icons/es/error--filled/16.js';
|
|
14
|
+
import { html } from 'lit';
|
|
15
|
+
import prefix from '../../../globals/settings.js';
|
|
16
|
+
import { ChainOfThoughtStepStatus } from './types.js';
|
|
17
|
+
import { parseUnknownDataToMarkdown } from './parse-unknown-data-to-markdown.js';
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* Copyright IBM Corp. 2025
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*
|
|
25
|
+
* @license
|
|
26
|
+
*/
|
|
27
|
+
const CSS_CLASS_ITEM_PREFIX = `${prefix}--chain-of-thought-item`;
|
|
28
|
+
const CSS_CLASS_STATUS_PREFIX = `${prefix}--chain-of-thought-accordion-item-header-status`;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the correct icon given the status of the step. If there is no status, we assume it is successful.
|
|
31
|
+
*/
|
|
32
|
+
function stepStatus(status, statusSucceededLabelText, statusFailedLabelText, statusProcessingLabelText) {
|
|
33
|
+
switch (status) {
|
|
34
|
+
case ChainOfThoughtStepStatus.PROCESSING:
|
|
35
|
+
return html `<cds-inline-loading
|
|
36
|
+
status="active"
|
|
37
|
+
aria-label="${statusProcessingLabelText}"
|
|
38
|
+
></cds-inline-loading>`;
|
|
39
|
+
case ChainOfThoughtStepStatus.FAILURE:
|
|
40
|
+
return html `<span
|
|
41
|
+
class="${CSS_CLASS_STATUS_PREFIX}--${ChainOfThoughtStepStatus.FAILURE}"
|
|
42
|
+
aria-label="${statusFailedLabelText}"
|
|
43
|
+
>${iconLoader(ErrorFilled16)}</span
|
|
44
|
+
>`;
|
|
45
|
+
default:
|
|
46
|
+
return html `<span
|
|
47
|
+
class="${CSS_CLASS_STATUS_PREFIX}--${ChainOfThoughtStepStatus.SUCCESS}"
|
|
48
|
+
aria-label="${statusSucceededLabelText}"
|
|
49
|
+
>${iconLoader(CheckmarkFilled16)}</span
|
|
50
|
+
>`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function renderToolDataAsMarkdown(content, label, classPostfix, customElementClass) {
|
|
54
|
+
const { filterPlaceholderText, previousPageText, nextPageText, itemsPerPageText, locale, getPaginationSupplementalText, getPaginationStatusText, feedback, showLessText, showMoreText, tooltipContent, getLineCountText, } = customElementClass;
|
|
55
|
+
return html `<div
|
|
56
|
+
class="${CSS_CLASS_ITEM_PREFIX} ${CSS_CLASS_ITEM_PREFIX}-${classPostfix}"
|
|
57
|
+
>
|
|
58
|
+
<div class="${CSS_CLASS_ITEM_PREFIX}-label">${label}</div>
|
|
59
|
+
<cds-aichat-markdown
|
|
60
|
+
sanitize-html
|
|
61
|
+
markdown=${content}
|
|
62
|
+
filter-placeholder-text=${filterPlaceholderText}
|
|
63
|
+
previous-page-text=${previousPageText}
|
|
64
|
+
next-page-text=${nextPageText}
|
|
65
|
+
items-per-page-text=${itemsPerPageText}
|
|
66
|
+
locale=${locale}
|
|
67
|
+
.getPaginationSupplementalText=${getPaginationSupplementalText}
|
|
68
|
+
.getPaginationStatusText=${getPaginationStatusText}
|
|
69
|
+
feedback=${feedback}
|
|
70
|
+
show-less-text=${showLessText}
|
|
71
|
+
show-more-text=${showMoreText}
|
|
72
|
+
tooltip-content=${tooltipContent}
|
|
73
|
+
.getLineCountText=${getLineCountText}
|
|
74
|
+
></cds-aichat-markdown>
|
|
75
|
+
</div>`;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Takes the input/output data that is unknown and then renders it in the correct format or returns nothing.
|
|
79
|
+
*/
|
|
80
|
+
function renderToolData(data, label, classPostfix, customElementClass) {
|
|
81
|
+
const content = parseUnknownDataToMarkdown(data);
|
|
82
|
+
if (content) {
|
|
83
|
+
return renderToolDataAsMarkdown(content, label, classPostfix, customElementClass);
|
|
84
|
+
}
|
|
85
|
+
return html ``;
|
|
86
|
+
}
|
|
87
|
+
function accordionItemContent(customElementClass, item) {
|
|
88
|
+
const { inputLabelText, outputLabelText, toolLabelText, filterPlaceholderText, previousPageText, nextPageText, itemsPerPageText, locale, getPaginationSupplementalText, getPaginationStatusText, feedback, showLessText, showMoreText, tooltipContent, getLineCountText, } = customElementClass;
|
|
89
|
+
if (item.open) {
|
|
90
|
+
return html ` ${item.description
|
|
91
|
+
? html `<div
|
|
92
|
+
class="${CSS_CLASS_ITEM_PREFIX} ${CSS_CLASS_ITEM_PREFIX}-description"
|
|
93
|
+
>
|
|
94
|
+
<cds-aichat-markdown
|
|
95
|
+
sanitize-html
|
|
96
|
+
markdown=${item.description}
|
|
97
|
+
filter-placeholder-text=${filterPlaceholderText}
|
|
98
|
+
previous-page-text=${previousPageText}
|
|
99
|
+
next-page-text=${nextPageText}
|
|
100
|
+
items-per-page-text=${itemsPerPageText}
|
|
101
|
+
locale=${locale}
|
|
102
|
+
.getPaginationSupplementalText=${getPaginationSupplementalText}
|
|
103
|
+
.getPaginationStatusText=${getPaginationStatusText}
|
|
104
|
+
feedback=${feedback}
|
|
105
|
+
show-less-text=${showLessText}
|
|
106
|
+
show-more-text=${showMoreText}
|
|
107
|
+
tooltip-content=${tooltipContent}
|
|
108
|
+
.getLineCountText=${getLineCountText}
|
|
109
|
+
></cds-aichat-markdown>
|
|
110
|
+
</div>`
|
|
111
|
+
: null}
|
|
112
|
+
${item.tool_name
|
|
113
|
+
? html `<div
|
|
114
|
+
class="${CSS_CLASS_ITEM_PREFIX} ${CSS_CLASS_ITEM_PREFIX}-toolName"
|
|
115
|
+
>
|
|
116
|
+
<div class="${CSS_CLASS_ITEM_PREFIX}-label">${toolLabelText}</div>
|
|
117
|
+
${item.tool_name}
|
|
118
|
+
</div>`
|
|
119
|
+
: null}
|
|
120
|
+
${renderToolData(item.request?.args, inputLabelText, "input", customElementClass)}
|
|
121
|
+
${renderToolData(item.response?.content, outputLabelText, "output", customElementClass)}`;
|
|
122
|
+
}
|
|
123
|
+
return html ``;
|
|
124
|
+
}
|
|
125
|
+
function accordionContent(customElementClass) {
|
|
126
|
+
const { _steps, open, _chainOfThoughtPanelID, onStepToggle, formatStepLabelText, statusSucceededLabelText, statusFailedLabelText, statusProcessingLabelText, } = customElementClass;
|
|
127
|
+
if (open) {
|
|
128
|
+
return html `${_steps.map((item, index) => {
|
|
129
|
+
const stepNumber = index + 1;
|
|
130
|
+
const content_id = `${_chainOfThoughtPanelID}-step-${stepNumber}-content`;
|
|
131
|
+
const disabled = !item.description && !item.request && !item.response;
|
|
132
|
+
return html `<div class="${prefix}--chain-of-thought-accordion-item">
|
|
133
|
+
<button
|
|
134
|
+
class="${prefix}--chain-of-thought-accordion-item-header"
|
|
135
|
+
@click=${() => {
|
|
136
|
+
item.open = !item.open;
|
|
137
|
+
customElementClass.requestUpdate();
|
|
138
|
+
const element = customElementClass.shadowRoot?.querySelector(`#${content_id}`);
|
|
139
|
+
if (element) {
|
|
140
|
+
onStepToggle?.(item.open, element);
|
|
141
|
+
}
|
|
142
|
+
}}
|
|
143
|
+
aria-expanded=${item.open}
|
|
144
|
+
aria-controls=${content_id}
|
|
145
|
+
?disabled=${disabled}
|
|
146
|
+
>
|
|
147
|
+
<span
|
|
148
|
+
class="${prefix}--chain-of-thought-accordion-item-header-chevron"
|
|
149
|
+
?data-disabled=${disabled}
|
|
150
|
+
?data-open=${item.open}
|
|
151
|
+
>${iconLoader(ChevronRight16)}</span
|
|
152
|
+
>
|
|
153
|
+
<span class="${prefix}--chain-of-thought-accordion-item-header-title"
|
|
154
|
+
>${formatStepLabelText({
|
|
155
|
+
stepNumber,
|
|
156
|
+
stepTitle: item.title || item.tool_name || "",
|
|
157
|
+
})}</span
|
|
158
|
+
>
|
|
159
|
+
<span class="${CSS_CLASS_STATUS_PREFIX}"
|
|
160
|
+
>${stepStatus(item.status || ChainOfThoughtStepStatus.SUCCESS, statusSucceededLabelText, statusFailedLabelText, statusProcessingLabelText)}</span
|
|
161
|
+
>
|
|
162
|
+
</button>
|
|
163
|
+
<div
|
|
164
|
+
class="${prefix}--chain-of-thought-accordion-item-content"
|
|
165
|
+
id=${content_id}
|
|
166
|
+
?hidden=${!item.open}
|
|
167
|
+
>
|
|
168
|
+
${accordionItemContent(customElementClass, item)}
|
|
169
|
+
</div>
|
|
170
|
+
</div>`;
|
|
171
|
+
})}`;
|
|
172
|
+
}
|
|
173
|
+
return html ``;
|
|
174
|
+
}
|
|
175
|
+
function chainOfThoughtElementTemplate(customElementClass) {
|
|
176
|
+
const { _chainOfThoughtPanelID, explainabilityText, open, onToggle } = customElementClass;
|
|
177
|
+
function toggle() {
|
|
178
|
+
customElementClass.open = !customElementClass.open;
|
|
179
|
+
onToggle?.(customElementClass.open, customElementClass);
|
|
180
|
+
}
|
|
181
|
+
return html `<div class="${prefix}--chain-of-thought">
|
|
182
|
+
<button
|
|
183
|
+
class="${prefix}--chain-of-thought-button"
|
|
184
|
+
@click=${toggle}
|
|
185
|
+
aria-expanded=${open}
|
|
186
|
+
aria-controls=${_chainOfThoughtPanelID}
|
|
187
|
+
>
|
|
188
|
+
<span class="${prefix}--chain-of-thought-button-chevron"
|
|
189
|
+
>${iconLoader(ChevronRight16)}</span
|
|
190
|
+
>
|
|
191
|
+
${explainabilityText}
|
|
192
|
+
</button>
|
|
193
|
+
<div
|
|
194
|
+
id=${_chainOfThoughtPanelID}
|
|
195
|
+
class="${prefix}--chain-of-thought-content"
|
|
196
|
+
?hidden=${!open}
|
|
197
|
+
>
|
|
198
|
+
<div class="${prefix}--chain-of-thought-inner-content">
|
|
199
|
+
${accordionContent(customElementClass)}
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>`;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export { chainOfThoughtElementTemplate };
|
|
206
|
+
//# sourceMappingURL=chain-of-thought.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-of-thought.template.js","sources":["../../../../src/components/chain-of-thought/src/chain-of-thought.template.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAmBH,MAAM,qBAAqB,GAAG,CAAA,EAAG,MAAM,yBAAyB;AAChE,MAAM,uBAAuB,GAAG,CAAA,EAAG,MAAM,iDAAiD;AAE1F;;AAEG;AACH,SAAS,UAAU,CACjB,MAAgC,EAChC,wBAAgC,EAChC,qBAA6B,EAC7B,yBAAiC,EAAA;IAEjC,QA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MAAM,CAAA;AAChB,aAAA,EAAA,mBAAmB,CAAC;gBACrB,UAAU;gBACV,SAAS,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,IAAI,EAAE;aAC9C,CAAC,CAAA;;yBAEW,uBAAuB,CAAA;AACjC,aAAA,EAAA,UAAU,CACX,IAAI,CAAC,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAC/C,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,CAC1B,CAAA;;;;mBAIM,MAAM,CAAA;eACV,UAAU;oBACL,CAAC,IAAI,CAAC,IAAI;;AAElB,UAAA,EAAA,oBAAoB,CAAC,kBAAkB,EAAE,IAAI,CAAC;;aAE7C;QACT,CAAC,CAAC,EAAE;IACN;IAEA,OAAO,IAAI,CAAA,CAAA,CAAE;AACf;AAEA,SAAS,6BAA6B,CACpC,kBAAyC,EAAA;IAEzC,MAAM,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,GAClE,kBAAkB;AAEpB,IAAA,SAAS,MAAM,GAAA;AACb,QAAA,kBAAkB,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,IAAI;QAClD,QAAQ,GAAG,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,CAAC;IACzD;IAEA,OAAO,IAAI,CAAA,CAAA,YAAA,EAAe,MAAM,CAAA;;eAEnB,MAAM,CAAA;eACN,MAAM;sBACC,IAAI;sBACJ,sBAAsB;;qBAEvB,MAAM,CAAA;WAChB,UAAU,CAAC,cAAc,CAAC,CAAA;;QAE7B,kBAAkB;;;WAGf,sBAAsB;eAClB,MAAM,CAAA;AACL,cAAA,EAAA,CAAC,IAAI;;oBAED,MAAM,CAAA;UAChB,gBAAgB,CAAC,kBAAkB,CAAC;;;SAGrC;AACT;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attempts to parse the given value into a markdown string. If the value is an object or a JSON string,
|
|
3
|
+
* it is pretty printed as a code block. Otherwise, string content is returned as-is and other primitives are
|
|
4
|
+
* converted to strings.
|
|
5
|
+
*
|
|
6
|
+
* @param data The value to normalize.
|
|
7
|
+
* @returns Markdown formatted string or `undefined` if the value cannot be represented.
|
|
8
|
+
*/
|
|
9
|
+
declare function parseUnknownDataToMarkdown(data: unknown): string | undefined;
|
|
10
|
+
export { parseUnknownDataToMarkdown };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Copyright IBM Corp. 2025
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*
|
|
14
|
+
* @license
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Attempts to parse the given value into a markdown string. If the value is an object or a JSON string,
|
|
18
|
+
* it is pretty printed as a code block. Otherwise, string content is returned as-is and other primitives are
|
|
19
|
+
* converted to strings.
|
|
20
|
+
*
|
|
21
|
+
* @param data The value to normalize.
|
|
22
|
+
* @returns Markdown formatted string or `undefined` if the value cannot be represented.
|
|
23
|
+
*/
|
|
24
|
+
function parseUnknownDataToMarkdown(data) {
|
|
25
|
+
if (!data) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
if (typeof data === "object") {
|
|
30
|
+
return `\`\`\`\n${JSON.stringify(data, null, 2)}\n\`\`\`\n`;
|
|
31
|
+
}
|
|
32
|
+
if (typeof data === "string") {
|
|
33
|
+
try {
|
|
34
|
+
const parsed = JSON.parse(data);
|
|
35
|
+
return `\`\`\`\n${JSON.stringify(parsed, null, 2)}\n\`\`\`\n`;
|
|
36
|
+
}
|
|
37
|
+
catch (_error) {
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return String(data);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error("Cannot parse step content", error);
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { parseUnknownDataToMarkdown };
|
|
50
|
+
//# sourceMappingURL=parse-unknown-data-to-markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-unknown-data-to-markdown.js","sources":["../../../../src/components/chain-of-thought/src/parse-unknown-data-to-markdown.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAEH;;;;;;;AAOG;AACH,SAAS,0BAA0B,CAAC,IAAa,EAAA;IAC/C,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,IAAI;AACF,QAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC5B,YAAA,OAAO,CAAA,QAAA,EAAW,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA,UAAA,CAAY;QAC7D;AAEA,QAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC5B,YAAA,IAAI;gBACF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAC/B,gBAAA,OAAO,CAAA,QAAA,EAAW,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA,UAAA,CAAY;YAC/D;YAAE,OAAO,MAAM,EAAE;AACf,gBAAA,OAAO,IAAI;YACb;QACF;AAEA,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB;IAAE,OAAO,KAAK,EAAE;AACd,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC;AACjD,QAAA,OAAO,SAAS;IAClB;AACF;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status of the chain of thought step.
|
|
3
|
+
*
|
|
4
|
+
* @category Messaging
|
|
5
|
+
*/
|
|
6
|
+
declare enum ChainOfThoughtStepStatus {
|
|
7
|
+
PROCESSING = "processing",
|
|
8
|
+
FAILURE = "failure",
|
|
9
|
+
SUCCESS = "success"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A chain of thought step is meant to show tool calls and other steps made by your agent
|
|
13
|
+
* to reach its final answer.
|
|
14
|
+
*
|
|
15
|
+
* @category Messaging
|
|
16
|
+
*/
|
|
17
|
+
interface ChainOfThoughtStep {
|
|
18
|
+
/**
|
|
19
|
+
* The plain text name of the step.
|
|
20
|
+
*/
|
|
21
|
+
title?: string;
|
|
22
|
+
/**
|
|
23
|
+
* An optional human readable description of what the tool does.
|
|
24
|
+
*
|
|
25
|
+
* Accepts markdown formatted text.
|
|
26
|
+
*/
|
|
27
|
+
description?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The plain text name of the tool called.
|
|
30
|
+
*/
|
|
31
|
+
tool_name?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional request metadata sent to a tool.
|
|
34
|
+
*/
|
|
35
|
+
request?: {
|
|
36
|
+
/**
|
|
37
|
+
* Arguments sent to the tool. If this is properly formed JSON, it will be shown as a code block.
|
|
38
|
+
*/
|
|
39
|
+
args?: unknown;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Optional response from a tool.
|
|
43
|
+
*/
|
|
44
|
+
response?: {
|
|
45
|
+
/**
|
|
46
|
+
* Content returned by the tool. If this is properly formed JSON, it will be shown as a code block.
|
|
47
|
+
*
|
|
48
|
+
* You can also return markdown compatible text here.
|
|
49
|
+
*/
|
|
50
|
+
content: unknown;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Optionally, share the status of this step. An icon will appear in the view showing the status. If no status is
|
|
54
|
+
* shared, the UI will assume success.
|
|
55
|
+
*/
|
|
56
|
+
status?: ChainOfThoughtStepStatus;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A function to allow the chat component to properly scroll to the element on toggle.
|
|
60
|
+
*
|
|
61
|
+
* @category Messaging
|
|
62
|
+
*/
|
|
63
|
+
type ChainOfThoughtOnToggle = (isOpen: boolean, scrollToElement: HTMLElement) => void;
|
|
64
|
+
/**
|
|
65
|
+
* @category Messaging
|
|
66
|
+
*/
|
|
67
|
+
interface ChainOfThoughtStepWithToggle extends ChainOfThoughtStep {
|
|
68
|
+
/**
|
|
69
|
+
* If the step is opened.
|
|
70
|
+
*/
|
|
71
|
+
open: boolean;
|
|
72
|
+
}
|
|
73
|
+
export { type ChainOfThoughtOnToggle, type ChainOfThoughtStep, ChainOfThoughtStepStatus, type ChainOfThoughtStepWithToggle, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Copyright IBM Corp. 2025
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*
|
|
14
|
+
* @license
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Status of the chain of thought step.
|
|
18
|
+
*
|
|
19
|
+
* @category Messaging
|
|
20
|
+
*/
|
|
21
|
+
var ChainOfThoughtStepStatus;
|
|
22
|
+
(function (ChainOfThoughtStepStatus) {
|
|
23
|
+
ChainOfThoughtStepStatus["PROCESSING"] = "processing";
|
|
24
|
+
ChainOfThoughtStepStatus["FAILURE"] = "failure";
|
|
25
|
+
ChainOfThoughtStepStatus["SUCCESS"] = "success";
|
|
26
|
+
})(ChainOfThoughtStepStatus || (ChainOfThoughtStepStatus = {}));
|
|
27
|
+
|
|
28
|
+
export { ChainOfThoughtStepStatus };
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/components/chain-of-thought/src/types.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAEH;;;;AAIG;AACH,IAAK;AAAL,CAAA,UAAK,wBAAwB,EAAA;AAC3B,IAAA,wBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,wBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,wBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAJI,wBAAwB,KAAxB,wBAAwB,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Chat Button size.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum CHAT_BUTTON_SIZE {
|
|
13
|
+
/**
|
|
14
|
+
* Small size.
|
|
15
|
+
*/
|
|
16
|
+
SMALL = "sm",
|
|
17
|
+
/**
|
|
18
|
+
* Medium size.
|
|
19
|
+
*/
|
|
20
|
+
MEDIUM = "md",
|
|
21
|
+
/**
|
|
22
|
+
* Large size.
|
|
23
|
+
*/
|
|
24
|
+
LARGE = "lg"
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
*
|
|
11
|
+
* Copyright IBM Corp. 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Chat Button size.
|
|
18
|
+
*/
|
|
19
|
+
var CHAT_BUTTON_SIZE;
|
|
20
|
+
(function (CHAT_BUTTON_SIZE) {
|
|
21
|
+
/**
|
|
22
|
+
* Small size.
|
|
23
|
+
*/
|
|
24
|
+
CHAT_BUTTON_SIZE["SMALL"] = "sm";
|
|
25
|
+
/**
|
|
26
|
+
* Medium size.
|
|
27
|
+
*/
|
|
28
|
+
CHAT_BUTTON_SIZE["MEDIUM"] = "md";
|
|
29
|
+
/**
|
|
30
|
+
* Large size.
|
|
31
|
+
*/
|
|
32
|
+
CHAT_BUTTON_SIZE["LARGE"] = "lg";
|
|
33
|
+
})(CHAT_BUTTON_SIZE || (CHAT_BUTTON_SIZE = {}));
|
|
34
|
+
|
|
35
|
+
export { CHAT_BUTTON_SIZE };
|
|
36
|
+
//# sourceMappingURL=defs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defs.js","sources":["../../../src/components/chat-button/defs.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAEH;;AAEG;IACS;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AAC1B;;AAEG;AACH,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,IAAY;AAEZ;;AAEG;AACH,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,IAAa;AAEb;;AAEG;AACH,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,IAAY;AACd,CAAC,EAfW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import { PropertyValues } from "lit";
|
|
10
|
+
import { CHAT_BUTTON_SIZE } from "../defs";
|
|
11
|
+
import { BUTTON_KIND as CHAT_BUTTON_KIND, BUTTON_TYPE as CHAT_BUTTON_TYPE, BUTTON_TYPE as CHAT_BUTTON_TOOLTIP_ALIGNMENT, BUTTON_TYPE as CHAT_BUTTON_TOOLTIP_POSITION } from "@carbon/web-components/es/components/button/button.js";
|
|
12
|
+
import CDSButton from "@carbon/web-components/es/components/button/button.js";
|
|
13
|
+
export { CHAT_BUTTON_KIND, CHAT_BUTTON_TYPE, CHAT_BUTTON_SIZE, CHAT_BUTTON_TOOLTIP_ALIGNMENT, CHAT_BUTTON_TOOLTIP_POSITION, };
|
|
14
|
+
type ChatButtonSize = CHAT_BUTTON_SIZE.SMALL | CHAT_BUTTON_SIZE.MEDIUM | CHAT_BUTTON_SIZE.LARGE;
|
|
15
|
+
/**
|
|
16
|
+
* Component extending the @carbon/web-components' button
|
|
17
|
+
*/
|
|
18
|
+
declare class ChatButton extends CDSButton {
|
|
19
|
+
static styles: any;
|
|
20
|
+
/**
|
|
21
|
+
* Specify whether the `ChatButton` should be rendered as a quick action button
|
|
22
|
+
*/
|
|
23
|
+
isQuickAction: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Button size.
|
|
26
|
+
*/
|
|
27
|
+
size: ChatButtonSize;
|
|
28
|
+
private readonly allowedSizes;
|
|
29
|
+
protected willUpdate(changedProps: PropertyValues<this>): void;
|
|
30
|
+
private _normalizeButtonState;
|
|
31
|
+
}
|
|
32
|
+
export default ChatButton;
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import { __decorate } from 'tslib';
|
|
9
9
|
import { property, customElement } from 'lit/decorators.js';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
10
|
+
import { CHAT_BUTTON_SIZE } from '../defs.js';
|
|
11
|
+
import CarbonButtonElement, { BUTTON_KIND } from '@carbon/web-components/es/components/button/button.js';
|
|
12
|
+
export { BUTTON_KIND as CHAT_BUTTON_KIND, BUTTON_TYPE as CHAT_BUTTON_TOOLTIP_ALIGNMENT, BUTTON_TYPE as CHAT_BUTTON_TOOLTIP_POSITION, BUTTON_TYPE as CHAT_BUTTON_TYPE } from '@carbon/web-components/es/components/button/button.js';
|
|
13
|
+
import prefix from '../../../globals/settings.js';
|
|
14
|
+
import styles from './chat-button.scss.js';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* @license
|
|
@@ -22,7 +24,7 @@ import prefix from '../../globals/settings.js';
|
|
|
22
24
|
/**
|
|
23
25
|
* Component extending the @carbon/web-components' button
|
|
24
26
|
*/
|
|
25
|
-
let ChatButton = class ChatButton extends
|
|
27
|
+
let ChatButton = class ChatButton extends CarbonButtonElement {
|
|
26
28
|
constructor() {
|
|
27
29
|
super(...arguments);
|
|
28
30
|
/**
|
|
@@ -30,9 +32,9 @@ let ChatButton = class ChatButton extends chatButton {
|
|
|
30
32
|
*/
|
|
31
33
|
this.isQuickAction = false;
|
|
32
34
|
this.allowedSizes = [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
CHAT_BUTTON_SIZE.SMALL,
|
|
36
|
+
CHAT_BUTTON_SIZE.MEDIUM,
|
|
37
|
+
CHAT_BUTTON_SIZE.LARGE,
|
|
36
38
|
];
|
|
37
39
|
}
|
|
38
40
|
willUpdate(changedProps) {
|
|
@@ -43,25 +45,29 @@ let ChatButton = class ChatButton extends chatButton {
|
|
|
43
45
|
_normalizeButtonState() {
|
|
44
46
|
if (this.isQuickAction) {
|
|
45
47
|
this.kind = BUTTON_KIND.GHOST;
|
|
46
|
-
this.size =
|
|
48
|
+
this.size = CHAT_BUTTON_SIZE.SMALL;
|
|
47
49
|
return;
|
|
48
50
|
}
|
|
49
51
|
// Do not allow size larger than `lg`
|
|
50
52
|
if (!this.allowedSizes.includes(this.size)) {
|
|
51
|
-
this.size =
|
|
53
|
+
this.size = CHAT_BUTTON_SIZE.LARGE;
|
|
52
54
|
}
|
|
53
55
|
if (!Object.values(BUTTON_KIND).includes(this.kind)) {
|
|
54
56
|
this.kind = BUTTON_KIND.PRIMARY;
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
};
|
|
60
|
+
ChatButton.styles = styles;
|
|
58
61
|
__decorate([
|
|
59
62
|
property({ type: Boolean, attribute: "is-quick-action" })
|
|
60
63
|
], ChatButton.prototype, "isQuickAction", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
property({ reflect: true })
|
|
66
|
+
], ChatButton.prototype, "size", void 0);
|
|
61
67
|
ChatButton = __decorate([
|
|
62
68
|
customElement(`${prefix}-button`)
|
|
63
69
|
], ChatButton);
|
|
64
70
|
var AIChatButton = ChatButton;
|
|
65
71
|
|
|
66
|
-
export { AIChatButton as default };
|
|
72
|
+
export { CHAT_BUTTON_SIZE, AIChatButton as default };
|
|
67
73
|
//# sourceMappingURL=chat-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-button.js","sources":["../../../../src/components/chat-button/src/chat-button.ts"],"sourcesContent":[null],"names":["CDSButton","CHAT_BUTTON_KIND"],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AA6BH;;AAEG;AAEH,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQA,mBAAS,CAAA;AAAlC,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAA,CAAA,aAAa,GAAG,KAAK;AAQJ,QAAA,IAAA,CAAA,YAAY,GAAuB;AAClD,YAAA,gBAAgB,CAAC,KAAK;AACtB,YAAA,gBAAgB,CAAC,MAAM;AACvB,YAAA,gBAAg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