@kubed.io/cdn 0.0.4 → 0.0.6
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 +11 -0
- package/dist/chunks/1c-Cg7z75RR.js +94 -0
- package/dist/chunks/1c-Cg7z75RR.js.map +1 -0
- package/dist/chunks/abnf-DjOFdYyB.js +59 -0
- package/dist/chunks/abnf-DjOFdYyB.js.map +1 -0
- package/dist/chunks/accesslog-CT59MCIO.js +72 -0
- package/dist/chunks/accesslog-CT59MCIO.js.map +1 -0
- package/dist/chunks/actionscript-BF7IWfId.js +85 -0
- package/dist/chunks/actionscript-BF7IWfId.js.map +1 -0
- package/dist/chunks/ada-BW8u8CRX.js +107 -0
- package/dist/chunks/ada-BW8u8CRX.js.map +1 -0
- package/dist/chunks/angelscript-2l-XM2Vw.js +91 -0
- package/dist/chunks/angelscript-2l-XM2Vw.js.map +1 -0
- package/dist/chunks/apache-ClDRwhlj.js +87 -0
- package/dist/chunks/apache-ClDRwhlj.js.map +1 -0
- package/dist/chunks/applescript-BnCdU8ml.js +57 -0
- package/dist/chunks/applescript-BnCdU8ml.js.map +1 -0
- package/dist/chunks/arcade-BtIJZuSq.js +157 -0
- package/dist/chunks/arcade-BtIJZuSq.js.map +1 -0
- package/dist/chunks/arduino-xB3NbW4M.js +272 -0
- package/dist/chunks/arduino-xB3NbW4M.js.map +1 -0
- package/dist/chunks/armasm-Dg5wPE4N.js +66 -0
- package/dist/chunks/armasm-Dg5wPE4N.js.map +1 -0
- package/dist/chunks/asciidoc-ZAddoC6x.js +178 -0
- package/dist/chunks/asciidoc-ZAddoC6x.js.map +1 -0
- package/dist/chunks/aspectj-Dfd0IA-3.js +126 -0
- package/dist/chunks/aspectj-Dfd0IA-3.js.map +1 -0
- package/dist/chunks/autohotkey-tKEhIrY9.js +55 -0
- package/dist/chunks/autohotkey-tKEhIrY9.js.map +1 -0
- package/dist/chunks/autoit-BPoYFiDT.js +123 -0
- package/dist/chunks/autoit-BPoYFiDT.js.map +1 -0
- package/dist/chunks/avrasm-DcwC__J5.js +47 -0
- package/dist/chunks/avrasm-DcwC__J5.js.map +1 -0
- package/dist/chunks/awk-B0eiS31p.js +56 -0
- package/dist/chunks/awk-B0eiS31p.js.map +1 -0
- package/dist/chunks/axapta-BZnaEvVa.js +65 -0
- package/dist/chunks/axapta-BZnaEvVa.js.map +1 -0
- package/dist/chunks/bash-SfqkqXwO.js +171 -0
- package/dist/chunks/bash-SfqkqXwO.js.map +1 -0
- package/dist/chunks/basic-hK9i76TR.js +44 -0
- package/dist/chunks/basic-hK9i76TR.js.map +1 -0
- package/dist/chunks/bnf-CT5PE87o.js +28 -0
- package/dist/chunks/bnf-CT5PE87o.js.map +1 -0
- package/dist/chunks/brainfuck-Cix81oQc.js +41 -0
- package/dist/chunks/brainfuck-Cix81oQc.js.map +1 -0
- package/dist/chunks/c-DqpMY-rp.js +189 -0
- package/dist/chunks/c-DqpMY-rp.js.map +1 -0
- package/dist/chunks/cal-C-xic9Tn.js +91 -0
- package/dist/chunks/cal-C-xic9Tn.js.map +1 -0
- package/dist/chunks/capnproto-Bte6wB8g.js +84 -0
- package/dist/chunks/capnproto-Bte6wB8g.js.map +1 -0
- package/dist/chunks/ceylon-B5xM3rkd.js +77 -0
- package/dist/chunks/ceylon-B5xM3rkd.js.map +1 -0
- package/dist/chunks/clean-58wPfVlT.js +24 -0
- package/dist/chunks/clean-58wPfVlT.js.map +1 -0
- package/dist/chunks/clojure-DnooNAlk.js +114 -0
- package/dist/chunks/clojure-DnooNAlk.js.map +1 -0
- package/dist/chunks/clojure-repl-BOwc5f8V.js +18 -0
- package/dist/chunks/clojure-repl-BOwc5f8V.js.map +1 -0
- package/dist/chunks/cmake-CmXecy9B.js +28 -0
- package/dist/chunks/cmake-CmXecy9B.js.map +1 -0
- package/dist/chunks/coffeescript-BxFWPVxK.js +199 -0
- package/dist/chunks/coffeescript-BxFWPVxK.js.map +1 -0
- package/dist/chunks/coq-q80xvjL8.js +26 -0
- package/dist/chunks/coq-q80xvjL8.js.map +1 -0
- package/dist/chunks/core-BSQzrNYA.js +853 -0
- package/dist/chunks/core-BSQzrNYA.js.map +1 -0
- package/dist/chunks/cos-DiRYB57M.js +78 -0
- package/dist/chunks/cos-DiRYB57M.js.map +1 -0
- package/dist/chunks/cpp-BvOt3G_R.js +238 -0
- package/dist/chunks/cpp-BvOt3G_R.js.map +1 -0
- package/dist/chunks/crmsh-h8TY8H79.js +80 -0
- package/dist/chunks/crmsh-h8TY8H79.js.map +1 -0
- package/dist/chunks/crystal-Cn8iNhTZ.js +247 -0
- package/dist/chunks/crystal-Cn8iNhTZ.js.map +1 -0
- package/dist/chunks/csharp-BUAiXZio.js +262 -0
- package/dist/chunks/csharp-BUAiXZio.js.map +1 -0
- package/dist/chunks/csp-BP06y0Ba.js +25 -0
- package/dist/chunks/csp-BP06y0Ba.js.map +1 -0
- package/dist/chunks/css-CuP2L3Vg.js +147 -0
- package/dist/chunks/css-CuP2L3Vg.js.map +1 -0
- package/dist/chunks/d-C0cOEHlZ.js +87 -0
- package/dist/chunks/d-C0cOEHlZ.js.map +1 -0
- package/dist/chunks/dart-DOyn4FWh.js +136 -0
- package/dist/chunks/dart-DOyn4FWh.js.map +1 -0
- package/dist/chunks/{define-XzEniRJH.js → define-DqUpowD9.js} +3 -3
- package/dist/chunks/{define-XzEniRJH.js.map → define-DqUpowD9.js.map} +1 -1
- package/dist/chunks/delphi-BL8QbVUL.js +95 -0
- package/dist/chunks/delphi-BL8QbVUL.js.map +1 -0
- package/dist/chunks/diff-DMbO7OaS.js +41 -0
- package/dist/chunks/diff-DMbO7OaS.js.map +1 -0
- package/dist/chunks/django-CnvXUSpm.js +44 -0
- package/dist/chunks/django-CnvXUSpm.js.map +1 -0
- package/dist/chunks/dns-DpaEqlb1.js +73 -0
- package/dist/chunks/dns-DpaEqlb1.js.map +1 -0
- package/dist/chunks/dockerfile-D9WngOli.js +36 -0
- package/dist/chunks/dockerfile-D9WngOli.js.map +1 -0
- package/dist/chunks/dos-w6Vxr4_L.js +59 -0
- package/dist/chunks/dos-w6Vxr4_L.js.map +1 -0
- package/dist/chunks/dsconfig-Dq_NzMQE.js +56 -0
- package/dist/chunks/dsconfig-Dq_NzMQE.js.map +1 -0
- package/dist/chunks/dts-CpWaLhGr.js +117 -0
- package/dist/chunks/dts-CpWaLhGr.js.map +1 -0
- package/dist/chunks/dust-C4uDg2L0.js +34 -0
- package/dist/chunks/dust-C4uDg2L0.js.map +1 -0
- package/dist/chunks/ebnf-ByjV7C32.js +41 -0
- package/dist/chunks/ebnf-ByjV7C32.js.map +1 -0
- package/dist/chunks/{element-ChNBLJ5X.js → element-CaN9ZVoe.js} +60 -60
- package/dist/chunks/element-CaN9ZVoe.js.map +1 -0
- package/dist/chunks/elixir-DkdYO0Vr.js +191 -0
- package/dist/chunks/elixir-DkdYO0Vr.js.map +1 -0
- package/dist/chunks/elm-Clms-iZw.js +101 -0
- package/dist/chunks/elm-Clms-iZw.js.map +1 -0
- package/dist/chunks/erb-BC3HNNgp.js +18 -0
- package/dist/chunks/erb-BC3HNNgp.js.map +1 -0
- package/dist/chunks/erlang-Cu0IlQov.js +220 -0
- package/dist/chunks/erlang-Cu0IlQov.js.map +1 -0
- package/dist/chunks/erlang-repl-5hCt0uhz.js +42 -0
- package/dist/chunks/erlang-repl-5hCt0uhz.js.map +1 -0
- package/dist/chunks/excel-BIDJpxSu.js +49 -0
- package/dist/chunks/excel-BIDJpxSu.js.map +1 -0
- package/dist/chunks/fix-C0h50qaq.js +31 -0
- package/dist/chunks/fix-C0h50qaq.js.map +1 -0
- package/dist/chunks/flix-BCyKzKuw.js +61 -0
- package/dist/chunks/flix-BCyKzKuw.js.map +1 -0
- package/dist/chunks/fortran-DJ9If3VL.js +55 -0
- package/dist/chunks/fortran-DJ9If3VL.js.map +1 -0
- package/dist/chunks/freedesktop-DY5X71dr.js +88 -0
- package/dist/chunks/freedesktop-DY5X71dr.js.map +1 -0
- package/dist/chunks/fsharp-B-zxwYyG.js +243 -0
- package/dist/chunks/fsharp-B-zxwYyG.js.map +1 -0
- package/dist/chunks/gams-Bk-CWpk3.js +128 -0
- package/dist/chunks/gams-Bk-CWpk3.js.map +1 -0
- package/dist/chunks/gauss-DoDOans8.js +154 -0
- package/dist/chunks/gauss-DoDOans8.js.map +1 -0
- package/dist/chunks/gcode-BUHWwtTe.js +123 -0
- package/dist/chunks/gcode-BUHWwtTe.js.map +1 -0
- package/dist/chunks/gherkin-Wzf9M781.js +70 -0
- package/dist/chunks/gherkin-Wzf9M781.js.map +1 -0
- package/dist/chunks/glsl-CUb3B_sB.js +27 -0
- package/dist/chunks/glsl-CUb3B_sB.js.map +1 -0
- package/dist/chunks/gml-BS5lKjIV.js +24 -0
- package/dist/chunks/gml-BS5lKjIV.js.map +1 -0
- package/dist/chunks/go-BUD6D8kx.js +146 -0
- package/dist/chunks/go-BUD6D8kx.js.map +1 -0
- package/dist/chunks/golo-CeWwUkIr.js +27 -0
- package/dist/chunks/golo-CeWwUkIr.js.map +1 -0
- package/dist/chunks/gradle-BoqM74sD.js +20 -0
- package/dist/chunks/gradle-BoqM74sD.js.map +1 -0
- package/dist/chunks/graphql-j3kf95P9.js +69 -0
- package/dist/chunks/graphql-j3kf95P9.js.map +1 -0
- package/dist/chunks/groovy-B3DHxrmD.js +129 -0
- package/dist/chunks/groovy-B3DHxrmD.js.map +1 -0
- package/dist/chunks/haml-CgF67t0s.js +98 -0
- package/dist/chunks/haml-CgF67t0s.js.map +1 -0
- package/dist/chunks/handlebars-Bp8_IuhA.js +146 -0
- package/dist/chunks/handlebars-Bp8_IuhA.js.map +1 -0
- package/dist/chunks/haskell-2oFXwht3.js +140 -0
- package/dist/chunks/haskell-2oFXwht3.js.map +1 -0
- package/dist/chunks/haxe-BWUFK1R1.js +144 -0
- package/dist/chunks/haxe-BWUFK1R1.js.map +1 -0
- package/dist/chunks/highlight-D54M45bZ.js +328 -0
- package/dist/chunks/highlight-D54M45bZ.js.map +1 -0
- package/dist/chunks/hsp-YaLnMBmw.js +47 -0
- package/dist/chunks/hsp-YaLnMBmw.js.map +1 -0
- package/dist/chunks/http-D1Jx4NCy.js +76 -0
- package/dist/chunks/http-D1Jx4NCy.js.map +1 -0
- package/dist/chunks/hy-W6RLRSst.js +75 -0
- package/dist/chunks/hy-W6RLRSst.js.map +1 -0
- package/dist/chunks/inform7-Cqmf6Xxi.js +45 -0
- package/dist/chunks/inform7-Cqmf6Xxi.js.map +1 -0
- package/dist/chunks/ini-C_A9yUHA.js +90 -0
- package/dist/chunks/ini-C_A9yUHA.js.map +1 -0
- package/dist/chunks/irpf90-CFKe0d2G.js +49 -0
- package/dist/chunks/irpf90-CFKe0d2G.js.map +1 -0
- package/dist/chunks/isbl-DRZZfDZN.js +98 -0
- package/dist/chunks/isbl-DRZZfDZN.js.map +1 -0
- package/dist/chunks/java-DH7DXQTB.js +176 -0
- package/dist/chunks/java-DH7DXQTB.js.map +1 -0
- package/dist/chunks/javascript-D-ispHLP.js +433 -0
- package/dist/chunks/javascript-D-ispHLP.js.map +1 -0
- package/dist/chunks/jboss-cli-DwoEMfEn.js +48 -0
- package/dist/chunks/jboss-cli-DwoEMfEn.js.map +1 -0
- package/dist/chunks/json-BrJhaXJI.js +44 -0
- package/dist/chunks/json-BrJhaXJI.js.map +1 -0
- package/dist/chunks/julia-DUM4uO0n.js +82 -0
- package/dist/chunks/julia-DUM4uO0n.js.map +1 -0
- package/dist/chunks/julia-repl-DkEOqH-L.js +20 -0
- package/dist/chunks/julia-repl-DkEOqH-L.js.map +1 -0
- package/dist/chunks/kd-B0BcpOG_.js +2662 -0
- package/dist/chunks/kd-B0BcpOG_.js.map +1 -0
- package/dist/chunks/kotlin-BvSvL3hH.js +208 -0
- package/dist/chunks/kotlin-BvSvL3hH.js.map +1 -0
- package/dist/chunks/lasso-BixBtX3R.js +122 -0
- package/dist/chunks/lasso-BixBtX3R.js.map +1 -0
- package/dist/chunks/latex-BNm-5qSt.js +188 -0
- package/dist/chunks/latex-BNm-5qSt.js.map +1 -0
- package/dist/chunks/ldif-D2VChYy1.js +26 -0
- package/dist/chunks/ldif-D2VChYy1.js.map +1 -0
- package/dist/chunks/leaf-DZ17MVc2.js +67 -0
- package/dist/chunks/leaf-DZ17MVc2.js.map +1 -0
- package/dist/chunks/less-Cj7NvTiz.js +198 -0
- package/dist/chunks/less-Cj7NvTiz.js.map +1 -0
- package/dist/chunks/lisp-0CHBhNkP.js +105 -0
- package/dist/chunks/lisp-0CHBhNkP.js.map +1 -0
- package/dist/chunks/livecodeserver-f04_o5o0.js +85 -0
- package/dist/chunks/livecodeserver-f04_o5o0.js.map +1 -0
- package/dist/chunks/livescript-DnaWcjJC.js +192 -0
- package/dist/chunks/livescript-DnaWcjJC.js.map +1 -0
- package/dist/chunks/llvm-CD_EQmwW.js +71 -0
- package/dist/chunks/llvm-CD_EQmwW.js.map +1 -0
- package/dist/chunks/lsl-BjbA45DV.js +56 -0
- package/dist/chunks/lsl-BjbA45DV.js.map +1 -0
- package/dist/chunks/lua-C8cmPpDf.js +48 -0
- package/dist/chunks/lua-C8cmPpDf.js.map +1 -0
- package/dist/chunks/makefile-vKf6Crs_.js +59 -0
- package/dist/chunks/makefile-vKf6Crs_.js.map +1 -0
- package/dist/chunks/markdown-D1MbcAo6.js +180 -0
- package/dist/chunks/markdown-D1MbcAo6.js.map +1 -0
- package/dist/chunks/marked.esm-BrPimSW6.js +1494 -0
- package/dist/chunks/marked.esm-BrPimSW6.js.map +1 -0
- package/dist/chunks/mathematica-BAI0dr8P.js +71 -0
- package/dist/chunks/mathematica-BAI0dr8P.js.map +1 -0
- package/dist/chunks/matlab-tHkexNRr.js +72 -0
- package/dist/chunks/matlab-tHkexNRr.js.map +1 -0
- package/dist/chunks/maxima-DBb1On73.js +40 -0
- package/dist/chunks/maxima-DBb1On73.js.map +1 -0
- package/dist/chunks/mel-DQ2XEeJZ.js +26 -0
- package/dist/chunks/mel-DQ2XEeJZ.js.map +1 -0
- package/dist/chunks/mercury-DB7FwEBk.js +57 -0
- package/dist/chunks/mercury-DB7FwEBk.js.map +1 -0
- package/dist/chunks/mipsasm-Bnw9lQ6-.js +55 -0
- package/dist/chunks/mipsasm-Bnw9lQ6-.js.map +1 -0
- package/dist/chunks/mizar-CKEtvqV9.js +12 -0
- package/dist/chunks/mizar-CKEtvqV9.js.map +1 -0
- package/dist/chunks/mojolicious-FvfVuUnD.js +29 -0
- package/dist/chunks/mojolicious-FvfVuUnD.js.map +1 -0
- package/dist/chunks/monkey-DaGzblyK.js +73 -0
- package/dist/chunks/monkey-DaGzblyK.js.map +1 -0
- package/dist/chunks/moonscript-B9xmaKDF.js +99 -0
- package/dist/chunks/moonscript-B9xmaKDF.js.map +1 -0
- package/dist/chunks/n1ql-h7HuiOG_.js +47 -0
- package/dist/chunks/n1ql-h7HuiOG_.js.map +1 -0
- package/dist/chunks/nestedtext-z3hOUdBb.js +67 -0
- package/dist/chunks/nestedtext-z3hOUdBb.js.map +1 -0
- package/dist/chunks/nginx-Cscn9g8k.js +126 -0
- package/dist/chunks/nginx-Cscn9g8k.js.map +1 -0
- package/dist/chunks/nim-DuEHXsfI.js +57 -0
- package/dist/chunks/nim-DuEHXsfI.js.map +1 -0
- package/dist/chunks/nix-CK-JoV_w.js +176 -0
- package/dist/chunks/nix-CK-JoV_w.js.map +1 -0
- package/dist/chunks/node-repl-YPgIlFR4.js +21 -0
- package/dist/chunks/node-repl-YPgIlFR4.js.map +1 -0
- package/dist/chunks/nsis-C2knGE1f.js +103 -0
- package/dist/chunks/nsis-C2knGE1f.js.map +1 -0
- package/dist/chunks/objectivec-CUvPbZB7.js +119 -0
- package/dist/chunks/objectivec-CUvPbZB7.js.map +1 -0
- package/dist/chunks/ocaml-CJnlG7MK.js +54 -0
- package/dist/chunks/ocaml-CJnlG7MK.js.map +1 -0
- package/dist/chunks/openscad-B7xqzB_t.js +61 -0
- package/dist/chunks/openscad-B7xqzB_t.js.map +1 -0
- package/dist/chunks/oxygene-y7G7cOvu.js +55 -0
- package/dist/chunks/oxygene-y7G7cOvu.js.map +1 -0
- package/dist/chunks/parser3-BO1P2QTe.js +42 -0
- package/dist/chunks/parser3-BO1P2QTe.js.map +1 -0
- package/dist/chunks/perl-CIZiAqA2.js +194 -0
- package/dist/chunks/perl-CIZiAqA2.js.map +1 -0
- package/dist/chunks/pf-DtIBAeXH.js +32 -0
- package/dist/chunks/pf-DtIBAeXH.js.map +1 -0
- package/dist/chunks/pgsql-DhvwSgY7.js +193 -0
- package/dist/chunks/pgsql-DhvwSgY7.js.map +1 -0
- package/dist/chunks/php-Df419x2P.js +302 -0
- package/dist/chunks/php-Df419x2P.js.map +1 -0
- package/dist/chunks/php-template-NGWDJ4ZL.js +45 -0
- package/dist/chunks/php-template-NGWDJ4ZL.js.map +1 -0
- package/dist/chunks/plaintext-DI9-6uUK.js +12 -0
- package/dist/chunks/plaintext-DI9-6uUK.js.map +1 -0
- package/dist/chunks/pony-DWRlzIm6.js +52 -0
- package/dist/chunks/pony-DWRlzIm6.js.map +1 -0
- package/dist/chunks/powershell-Bi81KJvX.js +190 -0
- package/dist/chunks/powershell-Bi81KJvX.js.map +1 -0
- package/dist/chunks/processing-NRILzl6W.js +100 -0
- package/dist/chunks/processing-NRILzl6W.js.map +1 -0
- package/dist/chunks/profile-C5HdUz2O.js +40 -0
- package/dist/chunks/profile-C5HdUz2O.js.map +1 -0
- package/dist/chunks/prolog-CSxvOOUl.js +56 -0
- package/dist/chunks/prolog-CSxvOOUl.js.map +1 -0
- package/dist/chunks/properties-DVff9GiD.js +40 -0
- package/dist/chunks/properties-DVff9GiD.js.map +1 -0
- package/dist/chunks/protobuf-CwPeazJT.js +63 -0
- package/dist/chunks/protobuf-CwPeazJT.js.map +1 -0
- package/dist/chunks/puppet-wWT6-WaD.js +84 -0
- package/dist/chunks/puppet-wWT6-WaD.js.map +1 -0
- package/dist/chunks/purebasic-HWZkxa8e.js +44 -0
- package/dist/chunks/purebasic-HWZkxa8e.js.map +1 -0
- package/dist/chunks/purify.es-C_X9UTsz.js +846 -0
- package/dist/chunks/purify.es-C_X9UTsz.js.map +1 -0
- package/dist/chunks/python-B3xOtrtl.js +240 -0
- package/dist/chunks/python-B3xOtrtl.js.map +1 -0
- package/dist/chunks/python-repl-DFMVj5e5.js +21 -0
- package/dist/chunks/python-repl-DFMVj5e5.js.map +1 -0
- package/dist/chunks/q-DOHmm85f.js +23 -0
- package/dist/chunks/q-DOHmm85f.js.map +1 -0
- package/dist/chunks/qml-LsukXoE-.js +129 -0
- package/dist/chunks/qml-LsukXoE-.js.map +1 -0
- package/dist/chunks/r-qBqOPbmv.js +142 -0
- package/dist/chunks/r-qBqOPbmv.js.map +1 -0
- package/dist/chunks/reasonml-D25FoGuQ.js +80 -0
- package/dist/chunks/reasonml-D25FoGuQ.js.map +1 -0
- package/dist/chunks/rib-C3T5JisO.js +18 -0
- package/dist/chunks/rib-C3T5JisO.js.map +1 -0
- package/dist/chunks/roboconf-Ckycnnun.js +55 -0
- package/dist/chunks/roboconf-Ckycnnun.js.map +1 -0
- package/dist/chunks/routeros-DIBiqeDi.js +104 -0
- package/dist/chunks/routeros-DIBiqeDi.js.map +1 -0
- package/dist/chunks/rsl-C2V3vKIN.js +61 -0
- package/dist/chunks/rsl-C2V3vKIN.js.map +1 -0
- package/dist/chunks/ruby-C7c-uCk8.js +264 -0
- package/dist/chunks/ruby-C7c-uCk8.js.map +1 -0
- package/dist/chunks/ruleslanguage-IlptjHhp.js +28 -0
- package/dist/chunks/ruleslanguage-IlptjHhp.js.map +1 -0
- package/dist/chunks/rust-D-q21Dm6.js +184 -0
- package/dist/chunks/rust-D-q21Dm6.js.map +1 -0
- package/dist/chunks/sas-ObguUuPf.js +80 -0
- package/dist/chunks/sas-ObguUuPf.js.map +1 -0
- package/dist/chunks/scala-DVAYHay6.js +164 -0
- package/dist/chunks/scala-DVAYHay6.js.map +1 -0
- package/dist/chunks/scheme-DIcGbflN.js +106 -0
- package/dist/chunks/scheme-DIcGbflN.js.map +1 -0
- package/dist/chunks/scilab-ilneDJJS.js +47 -0
- package/dist/chunks/scilab-ilneDJJS.js.map +1 -0
- package/dist/chunks/scss-BP8UD0nN.js +157 -0
- package/dist/chunks/scss-BP8UD0nN.js.map +1 -0
- package/dist/chunks/shell-DBkgOY0Y.js +19 -0
- package/dist/chunks/shell-DBkgOY0Y.js.map +1 -0
- package/dist/chunks/smali-De20QX07.js +85 -0
- package/dist/chunks/smali-De20QX07.js.map +1 -0
- package/dist/chunks/smalltalk-DWMPo-qT.js +59 -0
- package/dist/chunks/smalltalk-DWMPo-qT.js.map +1 -0
- package/dist/chunks/sml-yOrArwoc.js +51 -0
- package/dist/chunks/sml-yOrArwoc.js.map +1 -0
- package/dist/chunks/sqf-BCN5uwk_.js +78 -0
- package/dist/chunks/sqf-BCN5uwk_.js.map +1 -0
- package/dist/chunks/sql-CmVzGP4w.js +120 -0
- package/dist/chunks/sql-CmVzGP4w.js.map +1 -0
- package/dist/chunks/stan-BSt7sG8M.js +142 -0
- package/dist/chunks/stan-BSt7sG8M.js.map +1 -0
- package/dist/chunks/stata-sbG438-7.js +35 -0
- package/dist/chunks/stata-sbG438-7.js.map +1 -0
- package/dist/chunks/step21-Cfi2MQDZ.js +55 -0
- package/dist/chunks/step21-Cfi2MQDZ.js.map +1 -0
- package/dist/chunks/stylus-CiBDFhBN.js +185 -0
- package/dist/chunks/stylus-CiBDFhBN.js.map +1 -0
- package/dist/chunks/subunit-DWjzVCiA.js +36 -0
- package/dist/chunks/subunit-DWjzVCiA.js.map +1 -0
- package/dist/chunks/swift-Qo_eIir5.js +577 -0
- package/dist/chunks/swift-Qo_eIir5.js.map +1 -0
- package/dist/chunks/taggerscript-BvuLYKHz.js +39 -0
- package/dist/chunks/taggerscript-BvuLYKHz.js.map +1 -0
- package/dist/chunks/tap-uMi8uF_X.js +32 -0
- package/dist/chunks/tap-uMi8uF_X.js.map +1 -0
- package/dist/chunks/tcl-DMPG3T59.js +46 -0
- package/dist/chunks/tcl-DMPG3T59.js.map +1 -0
- package/dist/chunks/thrift-DAA8HOe8.js +67 -0
- package/dist/chunks/thrift-DAA8HOe8.js.map +1 -0
- package/dist/chunks/tp-46SXlDZT.js +87 -0
- package/dist/chunks/tp-46SXlDZT.js.map +1 -0
- package/dist/chunks/twig-Cf_tZ_wH.js +84 -0
- package/dist/chunks/twig-Cf_tZ_wH.js.map +1 -0
- package/dist/chunks/typescript-Dc6pBLOZ.js +518 -0
- package/dist/chunks/typescript-Dc6pBLOZ.js.map +1 -0
- package/dist/chunks/vala-C2GHqzgV.js +41 -0
- package/dist/chunks/vala-C2GHqzgV.js.map +1 -0
- package/dist/chunks/vbnet-DgQ7B7yi.js +71 -0
- package/dist/chunks/vbnet-DgQ7B7yi.js.map +1 -0
- package/dist/chunks/vbscript-Bid2w6kd.js +43 -0
- package/dist/chunks/vbscript-Bid2w6kd.js.map +1 -0
- package/dist/chunks/vbscript-html-DznzJpE3.js +16 -0
- package/dist/chunks/vbscript-html-DznzJpE3.js.map +1 -0
- package/dist/chunks/verilog-Cfn8vMNy.js +58 -0
- package/dist/chunks/verilog-Cfn8vMNy.js.map +1 -0
- package/dist/chunks/vhdl-DjBWCsn1.js +48 -0
- package/dist/chunks/vhdl-DjBWCsn1.js.map +1 -0
- package/dist/chunks/vim-DtRU07HQ.js +56 -0
- package/dist/chunks/vim-DtRU07HQ.js.map +1 -0
- package/dist/chunks/wasm-CavVFuAK.js +65 -0
- package/dist/chunks/wasm-CavVFuAK.js.map +1 -0
- package/dist/chunks/wren-BKTRrWxW.js +210 -0
- package/dist/chunks/wren-BKTRrWxW.js.map +1 -0
- package/dist/chunks/x86asm-D3FT8ZrX.js +66 -0
- package/dist/chunks/x86asm-D3FT8ZrX.js.map +1 -0
- package/dist/chunks/xl-O8DviBwg.js +85 -0
- package/dist/chunks/xl-O8DviBwg.js.map +1 -0
- package/dist/chunks/xml-UTtAqziF.js +164 -0
- package/dist/chunks/xml-UTtAqziF.js.map +1 -0
- package/dist/chunks/xquery-Ybt8-gzE.js +149 -0
- package/dist/chunks/xquery-Ybt8-gzE.js.map +1 -0
- package/dist/chunks/yaml-DT7UV549.js +146 -0
- package/dist/chunks/yaml-DT7UV549.js.map +1 -0
- package/dist/chunks/zephir-Dsfqs5td.js +72 -0
- package/dist/chunks/zephir-Dsfqs5td.js.map +1 -0
- package/dist/github/activity.d.ts +49 -0
- package/dist/github/hash.d.ts +8 -0
- package/dist/github/index.d.ts +10 -0
- package/dist/github/tree.d.ts +26 -0
- package/dist/github/urls.d.ts +34 -0
- package/dist/github.js +253 -0
- package/dist/github.js.map +1 -0
- package/dist/k8s.js +6 -6
- package/dist/k8s.js.map +1 -1
- package/dist/kd/elements/code.d.ts +53 -0
- package/dist/kd/elements/markdown.d.ts +55 -0
- package/dist/kd/feed.d.ts +31 -0
- package/dist/kd/files/explorer.d.ts +88 -0
- package/dist/kd/files/file.d.ts +84 -0
- package/dist/kd/files/index.d.ts +6 -0
- package/dist/kd/files/static.d.ts +12 -0
- package/dist/kd/files/types.d.ts +51 -0
- package/dist/kd/highlight.d.ts +26 -0
- package/dist/kd/index.d.ts +8 -0
- package/dist/kd.js +5 -5
- package/dist/n8n/config.d.ts +3 -2
- package/dist/n8n.js +4 -4
- package/dist/n8n.js.map +1 -1
- package/dist/openapi.js +4 -4
- package/dist/openapi.js.map +1 -1
- package/package.json +18 -3
- package/dist/chunks/element-ChNBLJ5X.js.map +0 -1
- package/dist/chunks/kd-Bbw0GeQ5.js +0 -1149
- package/dist/chunks/kd-Bbw0GeQ5.js.map +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import { KdElement } from '../element';
|
|
3
|
+
import { type Provider } from './types';
|
|
4
|
+
/** A link in the header: GitHub, code-server and the like. `icon` is an image URL or an emoji. */
|
|
5
|
+
export interface FileLink {
|
|
6
|
+
text?: string;
|
|
7
|
+
href: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Bases for a markdown file's relative links and images, as `kd-markdown` takes them. */
|
|
12
|
+
export interface MarkdownBase {
|
|
13
|
+
links?: string;
|
|
14
|
+
images?: string;
|
|
15
|
+
}
|
|
16
|
+
/** How a file is shown. */
|
|
17
|
+
export type FileKind = 'markdown' | 'code' | 'image' | 'binary';
|
|
18
|
+
/**
|
|
19
|
+
* The kind a type or, failing that, the path's extension names. `type` is a
|
|
20
|
+
* MIME type or a kind (`markdown`, `code`, `text`, `image`, `binary`).
|
|
21
|
+
* Undefined means "look at the content".
|
|
22
|
+
*/
|
|
23
|
+
export declare function fileKind(path: string, type?: string | null): FileKind | undefined;
|
|
24
|
+
/** Whether text decoded from a file looks binary: a NUL, or more than 10% control or undecodable characters. */
|
|
25
|
+
export declare function looksBinary(text: string): boolean;
|
|
26
|
+
/** A blob's text, or null when its bytes look binary. */
|
|
27
|
+
export declare function blobText(blob: Blob): Promise<string | null>;
|
|
28
|
+
/**
|
|
29
|
+
* One file: a header (the path as a breadcrumb, the size, `links`), then the
|
|
30
|
+
* file by its kind - markdown in `kd-markdown` (given `base`), text and code in
|
|
31
|
+
* `kd-code`, images inline, anything else as a summary. The kind comes from
|
|
32
|
+
* `type`, else the extension, else the content (a NUL byte or mostly control
|
|
33
|
+
* characters is binary). Give it `text` or `blob` (or an image `src`), or a
|
|
34
|
+
* `provider` and `path` and it reads the file itself.
|
|
35
|
+
*
|
|
36
|
+
* `<kd-file path="docs/README.md"></kd-file>` + `el.text = '# Hello'`
|
|
37
|
+
*/
|
|
38
|
+
export declare class KdFile extends KdElement {
|
|
39
|
+
#private;
|
|
40
|
+
static properties: {
|
|
41
|
+
path: {};
|
|
42
|
+
text: {};
|
|
43
|
+
blob: {
|
|
44
|
+
attribute: boolean;
|
|
45
|
+
};
|
|
46
|
+
src: {};
|
|
47
|
+
type: {};
|
|
48
|
+
size: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
};
|
|
51
|
+
links: {
|
|
52
|
+
attribute: string;
|
|
53
|
+
converter: {
|
|
54
|
+
fromAttribute(value: string | null): unknown;
|
|
55
|
+
toAttribute(value: unknown): string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
provider: {
|
|
59
|
+
attribute: boolean;
|
|
60
|
+
};
|
|
61
|
+
base: {
|
|
62
|
+
attribute: boolean;
|
|
63
|
+
};
|
|
64
|
+
truncated: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
};
|
|
67
|
+
empty: {};
|
|
68
|
+
};
|
|
69
|
+
static styles: import("lit").CSSResult[];
|
|
70
|
+
path: string | undefined;
|
|
71
|
+
text: string | undefined;
|
|
72
|
+
blob: Blob | undefined;
|
|
73
|
+
src: string | undefined;
|
|
74
|
+
type: string | undefined;
|
|
75
|
+
size: number | undefined;
|
|
76
|
+
links: FileLink[] | undefined;
|
|
77
|
+
provider: Provider | undefined;
|
|
78
|
+
base: MarkdownBase | undefined;
|
|
79
|
+
truncated: boolean | undefined;
|
|
80
|
+
empty: string | undefined;
|
|
81
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
82
|
+
disconnectedCallback(): void;
|
|
83
|
+
render(): TemplateResult<1>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './explorer';
|
|
2
|
+
import './file';
|
|
3
|
+
export { KdFiles, type FileColumn, type FilesEventDetail } from './explorer';
|
|
4
|
+
export { KdFile, blobText, fileKind, looksBinary, type FileKind, type FileLink } from './file';
|
|
5
|
+
export { staticProvider, type StaticOptions } from './static';
|
|
6
|
+
export { basename, dirname, entryName, formatSize, modifiedTime, normalizePath, type Capabilities, type Entry, type FileContent, type Provider, } from './types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Entry, type FileContent, type Provider } from './types';
|
|
2
|
+
export interface StaticOptions {
|
|
3
|
+
/** Reads a file, when the caller has a way to (a fetch, say). */
|
|
4
|
+
read?(path: string): Promise<FileContent>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A provider over a flat list. Folders that are only implied by a path are
|
|
8
|
+
* made up; each folder's `size`, every numeric stat and the newest `modified`
|
|
9
|
+
* are rolled up from everything below it (a folder with nothing listed below
|
|
10
|
+
* it keeps whatever it was given). Later entries for a path win.
|
|
11
|
+
*/
|
|
12
|
+
export declare function staticProvider(entries: readonly Entry[] | null | undefined, options?: StaticOptions): Provider;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Cell } from '../cell';
|
|
2
|
+
/** One file or folder. Paths are `/`-separated with no leading slash; the root is `''`. */
|
|
3
|
+
export interface Entry {
|
|
4
|
+
path: string;
|
|
5
|
+
/** Defaults to the last segment of `path`. */
|
|
6
|
+
name?: string;
|
|
7
|
+
type: 'file' | 'dir';
|
|
8
|
+
/** Bytes. A folder's is the sum of what is below it. */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** An ISO time or epoch milliseconds. A folder's is its newest. */
|
|
11
|
+
modified?: string | number;
|
|
12
|
+
/** Where the entry opens elsewhere (GitHub, say), shown beside its name. */
|
|
13
|
+
href?: string;
|
|
14
|
+
/** Numbers a column can show; a folder's are the sums of what is below it. */
|
|
15
|
+
stats?: Record<string, number>;
|
|
16
|
+
/** Anything else a column can show, as a kd cell. Not rolled up. */
|
|
17
|
+
cells?: Record<string, Cell>;
|
|
18
|
+
/** A folder the provider could not list (deeper than it loaded, say). */
|
|
19
|
+
partial?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** What `read` resolves to: text, or a blob with its type. */
|
|
22
|
+
export interface FileContent {
|
|
23
|
+
text?: string;
|
|
24
|
+
blob?: Blob;
|
|
25
|
+
/** A MIME type or a kind (`markdown`, `code`, `text`, `image`, `binary`). */
|
|
26
|
+
type?: string;
|
|
27
|
+
size?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface Capabilities {
|
|
30
|
+
read?: boolean;
|
|
31
|
+
write?: boolean;
|
|
32
|
+
rename?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface Provider {
|
|
35
|
+
/** The entries directly in a folder; rejects for a folder that does not exist. */
|
|
36
|
+
list(path: string): Promise<Entry[]>;
|
|
37
|
+
read?(path: string): Promise<FileContent>;
|
|
38
|
+
capabilities?: Capabilities;
|
|
39
|
+
}
|
|
40
|
+
/** A path with no leading, trailing or doubled slashes. */
|
|
41
|
+
export declare function normalizePath(path: string | null | undefined): string;
|
|
42
|
+
/** The folder a path is in; the root's parent is the root. */
|
|
43
|
+
export declare function dirname(path: string): string;
|
|
44
|
+
/** The last segment of a path. */
|
|
45
|
+
export declare function basename(path: string): string;
|
|
46
|
+
/** An entry's display name. */
|
|
47
|
+
export declare function entryName(entry: Entry): string;
|
|
48
|
+
/** `1536` -> `1.5 KiB`. */
|
|
49
|
+
export declare function formatSize(bytes: number | null | undefined): string;
|
|
50
|
+
/** A `modified` value as epoch milliseconds; NaN when unreadable. */
|
|
51
|
+
export declare function modifiedTime(value: string | number | null | undefined): number;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Every language highlight.js has a chunk for, by file name (`yaml`, `javascript`, …). */
|
|
2
|
+
export declare function languages(): string[];
|
|
3
|
+
/**
|
|
4
|
+
* The highlight.js language for a language name or alias (`js`, `yml`,
|
|
5
|
+
* `language-sh`), or undefined when there is none. `plaintext` means a text
|
|
6
|
+
* file: shown plain, nothing to load.
|
|
7
|
+
*/
|
|
8
|
+
export declare function languageOf(name: string | null | undefined): string | undefined;
|
|
9
|
+
/** The highlight.js language for a file name or path (`Dockerfile`, `src/app.ts`, `.env`), or undefined. */
|
|
10
|
+
export declare function languageOfFile(filename: string | null | undefined): string | undefined;
|
|
11
|
+
export interface Highlighted {
|
|
12
|
+
/** The highlight.js language used. */
|
|
13
|
+
language: string;
|
|
14
|
+
/** Its display name, such as `YAML`. */
|
|
15
|
+
name: string;
|
|
16
|
+
/** highlight.js's HTML for each line: its own escaped text and `<span class="hljs-…">` only. */
|
|
17
|
+
lines: string[];
|
|
18
|
+
}
|
|
19
|
+
/** Splits highlight.js HTML into lines; null when it holds any other markup. */
|
|
20
|
+
export declare function splitLines(markup: string): string[] | null;
|
|
21
|
+
/**
|
|
22
|
+
* Highlights `text` (lines split on `\n`) as `language`, a name, alias or
|
|
23
|
+
* highlight.js language. Null when the language is unknown, is plain text, or
|
|
24
|
+
* its chunk cannot load.
|
|
25
|
+
*/
|
|
26
|
+
export declare function highlight(text: string, language: string): Promise<Highlighted | null>;
|
package/dist/kd/index.d.ts
CHANGED
|
@@ -3,9 +3,11 @@ export { define, VERSION } from './define';
|
|
|
3
3
|
export { KdElement, base, json, themedAncestor } from './element';
|
|
4
4
|
export { kdjson, registerHelpers } from './helpers';
|
|
5
5
|
import './elements/bar';
|
|
6
|
+
import './elements/code';
|
|
6
7
|
import './elements/data';
|
|
7
8
|
import './elements/groups';
|
|
8
9
|
import './elements/link';
|
|
10
|
+
import './elements/markdown';
|
|
9
11
|
import './elements/mask';
|
|
10
12
|
import './elements/meter';
|
|
11
13
|
import './elements/pill';
|
|
@@ -18,9 +20,11 @@ export { renderCell, cellStyles, isEmpty, type Cell, type PillCell, type HrefCel
|
|
|
18
20
|
export { renderIcon, safeHref, tone, tones, type Tone } from './parts';
|
|
19
21
|
export { toYaml, yamlLines, quote, type YamlKind, type YamlLine, type YamlToken } from './yaml';
|
|
20
22
|
export { KdBar, type BarData } from './elements/bar';
|
|
23
|
+
export { KdCode, highlighter, lineSet } from './elements/code';
|
|
21
24
|
export { KdData } from './elements/data';
|
|
22
25
|
export { KdGroups, jsonValue, type GroupsData } from './elements/groups';
|
|
23
26
|
export { KdLink, linkUrl, type LinkData, type Vars } from './elements/link';
|
|
27
|
+
export { KdMarkdown, rebase, slug, type MarkdownBase } from './elements/markdown';
|
|
24
28
|
export { KdMask } from './elements/mask';
|
|
25
29
|
export { KdMeter, type MeterData, type MeterMark } from './elements/meter';
|
|
26
30
|
export { KdPill } from './elements/pill';
|
|
@@ -30,3 +34,7 @@ export { KdTable, type TableColumn, type TableData } from './elements/table';
|
|
|
30
34
|
export { KdTabs } from './elements/tabs';
|
|
31
35
|
export { KdTile } from './elements/tile';
|
|
32
36
|
export * from './scene';
|
|
37
|
+
export { feed, variable as contextVariable, type FeedContext, type FeedMap } from './feed';
|
|
38
|
+
export type { Highlighted } from './highlight';
|
|
39
|
+
import './files';
|
|
40
|
+
export * from './files';
|
package/dist/kd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as e,
|
|
2
|
-
import { n as o, t as s } from "./chunks/define-
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
export {
|
|
1
|
+
import { d as e, f as t, i as n, n as r, r as i, t as a } from "./chunks/element-CaN9ZVoe.js";
|
|
2
|
+
import { n as o, t as s } from "./chunks/define-DqUpowD9.js";
|
|
3
|
+
import { A as c, B as l, C as u, D as d, E as f, F as p, G as m, H as h, I as g, K as _, L as v, M as y, N as b, O as x, P as S, R as C, S as w, T, U as E, V as D, W as O, _ as k, a as A, b as j, c as M, d as N, f as P, g as F, h as I, i as L, j as R, k as z, l as B, m as V, n as H, o as U, p as W, r as G, s as K, t as q, u as J, v as Y, w as X, x as Z, y as Q, z as $ } from "./chunks/kd-B0BcpOG_.js";
|
|
4
|
+
import { _ as ee, a as te, c as ne, d as re, f as ie, g as ae, h as oe, i as se, l as ce, m as le, n as ue, o as de, p as fe, r as pe, s as me, t as he, u as ge } from "./chunks/scene-CUr0fSXC.js";
|
|
5
|
+
export { c as KdBar, d as KdCode, D as KdData, a as KdElement, q as KdFile, A as KdFiles, T as KdGroups, p as KdLink, w as KdMarkdown, Z as KdMask, j as KdMeter, S as KdPill, Q as KdSheet, Y as KdSteps, k as KdTable, F as KdTabs, I as KdTile, s as VERSION, e as applyTheme, r as base, K as basename, H as blobText, R as cellStyles, V as contextVariable, o as define, M as dirname, B as entryName, W as feed, G as fileKind, he as fitPanel, ue as focusPanel, t as followTheme, J as formatSize, pe as gridHeight, se as groups, x as highlighter, te as intervalSeconds, y as isEmpty, i as json, f as jsonValue, m as kdjson, z as lineSet, g as linkUrl, L as looksBinary, N as modifiedTime, P as normalizePath, de as pageWindow, h as quote, u as rebase, me as refresh, ne as refreshIntervals, _ as registerHelpers, b as renderCell, v as renderIcon, C as safeHref, ce as scene, ge as setRefresh, re as setTimeRange, ie as setVariable, fe as setVariables, X as slug, le as snapInterval, U as staticProvider, n as themedAncestor, oe as timeRange, E as toYaml, $ as tone, l as tones, ae as variable, ee as variableValue, O as yamlLines };
|
package/dist/n8n/config.d.ts
CHANGED
|
@@ -27,14 +27,15 @@ export interface ChatConfig {
|
|
|
27
27
|
user?: string;
|
|
28
28
|
/** The Authorization header value. Kept in Grafana and passed in, never in this package. */
|
|
29
29
|
auth?: string;
|
|
30
|
-
/** The `@n8n/chat` version loaded from jsDelivr. */
|
|
30
|
+
/** The `@n8n/chat` version loaded from jsDelivr; by default the one package.json pins. */
|
|
31
31
|
chatVersion?: string;
|
|
32
32
|
/** The tile: an element, a selector, or by default `#n8n-chat-tile`. An `<a>` or a `<kd-tile>`. */
|
|
33
33
|
tile?: Element | string | null;
|
|
34
34
|
/** The page; by default the tile's, else the global window. */
|
|
35
35
|
window?: Window;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
/** The `@n8n/chat` build loaded by default: package.json's peer dependency, injected at build time. */
|
|
38
|
+
export declare const CHAT_VERSION: string;
|
|
38
39
|
export interface Settings {
|
|
39
40
|
icon: string;
|
|
40
41
|
label: string;
|
package/dist/n8n.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./chunks/define-
|
|
1
|
+
import { t as e } from "./chunks/define-DqUpowD9.js";
|
|
2
2
|
import { _ as t, a as n, c as r, d as i, f as a, h as o, i as s, n as c, o as l, s as u, u as d } from "./chunks/scene-CUr0fSXC.js";
|
|
3
3
|
//#region src/n8n/config.ts
|
|
4
|
-
var f = "1.
|
|
4
|
+
var f = "1.41.3";
|
|
5
5
|
function p(e) {
|
|
6
6
|
return typeof e == "string" ? e.startsWith("${") ? "" : e : "";
|
|
7
7
|
}
|
|
@@ -35,7 +35,7 @@ function g(e) {
|
|
|
35
35
|
stream: e.stream === !0 || p(e.stream) === "true",
|
|
36
36
|
user: p(e.user),
|
|
37
37
|
auth: p(e.auth),
|
|
38
|
-
chatVersion: p(e.chatVersion).trim() || "1.
|
|
38
|
+
chatVersion: p(e.chatVersion).trim() || "1.41.3"
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
@@ -279,7 +279,7 @@ var P = [
|
|
|
279
279
|
].join("\n"), F = (e) => `https://cdn.jsdelivr.net/npm/@n8n/chat@${e}/dist/chat.bundle.es.js`, I = (e) => `https://cdn.jsdelivr.net/npm/@n8n/chat@${e}/dist/style.css`, L = "[data-testid=\"data-testid dashboard controls\"]", R = 900;
|
|
280
280
|
function z(t) {
|
|
281
281
|
let n = t.head.querySelector("style[data-n8n-chat-tile]");
|
|
282
|
-
n?.dataset.n8nChatTile !== "0.0.
|
|
282
|
+
n?.dataset.n8nChatTile !== "0.0.6" && (n || (n = t.createElement("style"), t.head.append(n)), n.dataset.n8nChatTile = e, n.textContent = P);
|
|
283
283
|
}
|
|
284
284
|
function B(e, t) {
|
|
285
285
|
let n = I(t), r = e.head.querySelector("link[data-n8n-chat-style]");
|
package/dist/n8n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"n8n.js","names":["VERSION","variableValue","intervalSeconds","refreshIntervals","setTimeRange","setVariable","timeRange","groups","focusPanel","pageWindow","refresh","setRefresh","CHAT_VERSION","text","value","list","x","groupNotes","notes","part","eq","settings","config","pair","key","name","wrapFetch","win","base","response","input","init","chat","url","body","vars","reply","cleaned","HIDDEN","textOf","content","p","kindOf","m","cleanHistory","data","kept","describeGroups","count","g","head","note","chatMetadata","meta","home","s","live","r","RESERVED","ALIAS","NOT_A_VALUE","readToolCalls","asked","read","call","payload","settable","applyState","applied","values","from","to","set","page","raw","stateCard","chips","k","v","focused","card","doc","chip","el","tag","b","label","i","where","go","onGo","placeCard","bots","host","applyToolCalls","state","target","CONTROL_NODE","controlFilter","decoder","encoder","carry","pass","line","chunk","node","bytes","lines","out","STYLES","chatBundle","version","chatStyle","CONTROLS","NARROW","injectStyles","style","chatStylesheet","href","link","fillTile","external","tile","icon","img","fitChat","root","wrapper","box","cs","toggle","reserve","removeChat","pageOf","given","load","mount","_auth","visible","current","names","loader","createChat"],"sources":["../src/n8n/config.ts","../src/n8n/fetch.ts","../src/n8n/history.ts","../src/n8n/metadata.ts","../src/n8n/state.ts","../src/n8n/stream.ts","../src/n8n/styles.ts","../src/n8n/mount.ts"],"sourcesContent":["/**\n * What the library panel passes to `mount`: its `chat_*` constants (decoded),\n * the viewer, and the Authorization header. A field that arrives as a literal\n * `${...}` (a dashboard without that variable) reads as empty.\n */\nexport interface ChatConfig {\n /** An emoji, or an image URL. */\n icon?: string;\n label?: string;\n /** Where the tile goes; an http(s) link opens a new tab. */\n link?: string;\n /** The n8n Chat Trigger URL. Empty means tile only, and any leftover bubble is removed. */\n webhook?: string;\n title?: string;\n subtitle?: string;\n /** Greeting lines, split on `|`. */\n greeting?: string;\n /** Extra metadata as `key=variable` pairs, read live on every send: `pod=pod,database=datname`. */\n context?: string;\n /** The names the agent may set, in applied order. `time_from`, `time_to`, `refresh` and `focus` are reserved. */\n settable?: string;\n /** Each group's purpose, `Name=purpose` pairs joined by `|` (Grafana has no description on a tab or a row). */\n groups?: string;\n /** Stream the reply. Must match the Chat Trigger's responseMode, or nothing renders. */\n stream?: boolean | string;\n /** The viewer's login, sent as metadata. */\n user?: string;\n /** The Authorization header value. Kept in Grafana and passed in, never in this package. */\n auth?: string;\n /** The `@n8n/chat` version loaded from jsDelivr. */\n chatVersion?: string;\n /** The tile: an element, a selector, or by default `#n8n-chat-tile`. An `<a>` or a `<kd-tile>`. */\n tile?: Element | string | null;\n /** The page; by default the tile's, else the global window. */\n window?: Window;\n}\n\nexport const CHAT_VERSION = '1.39.2';\n\nexport interface Settings {\n icon: string;\n label: string;\n link: string;\n webhook: string;\n title: string;\n subtitle: string;\n greeting: string[];\n context: [key: string, variable: string][];\n settable: string[];\n groups: Record<string, string>;\n stream: boolean;\n user: string;\n auth: string;\n chatVersion: string;\n}\n\nfunction text(value: unknown): string {\n if (typeof value !== 'string') return '';\n return value.startsWith('${') ? '' : value;\n}\n\nexport function list(value: string): string[] {\n return value\n .split(',')\n .map((x) => x.trim())\n .filter(Boolean);\n}\n\n/** `Name=purpose|Other=purpose` -> lower-cased name to purpose. */\nexport function groupNotes(value: string): Record<string, string> {\n const notes: Record<string, string> = {};\n for (const part of value.split('|')) {\n const eq = part.indexOf('=');\n if (eq > 0) notes[part.slice(0, eq).trim().toLowerCase()] = part.slice(eq + 1).trim();\n }\n return notes;\n}\n\nexport function settings(config: ChatConfig): Settings {\n return {\n icon: text(config.icon),\n label: text(config.label),\n link: text(config.link),\n webhook: text(config.webhook).trim(),\n title: text(config.title),\n subtitle: text(config.subtitle),\n greeting: text(config.greeting)\n .split('|')\n .map((x) => x.trim())\n .filter(Boolean),\n context: list(text(config.context)).map((pair): [string, string] => {\n if (!pair.includes('=')) return [pair, pair];\n const [key, name] = pair.split('=').map((x) => x.trim());\n return [key, name];\n }),\n settable: list(text(config.settable)),\n groups: groupNotes(text(config.groups)),\n stream: config.stream === true || text(config.stream) === 'true',\n user: text(config.user),\n auth: text(config.auth),\n chatVersion: text(config.chatVersion).trim() || CHAT_VERSION,\n };\n}\n","import type { Focused } from '../kd/scene';\n\n/**\n * What the fetch wrapper acts for: the chat on screen. Kept on the page window\n * as `n8nChat` in the shape the pre-package library panel used, so a wrapper\n * installed by either one serves the other.\n */\nexport interface ChatHandle {\n webhook: string;\n settable: string[];\n stream: boolean;\n setVariables(vars: Record<string, unknown> | null | undefined, names: string[]): Record<string, string>;\n cleanHistory<T>(reply: T): T;\n filterStream(body: ReadableStream<Uint8Array>): ReadableStream<Uint8Array>;\n}\n\n/** The page globals the chat keeps. They outlive this module across SPA navigation and package versions. */\nexport interface ChatWindow extends Window {\n n8nChat?: ChatHandle | null;\n n8nChatWatch?: number;\n n8nChatFetchWrapped?: boolean;\n n8nChatFit?: () => void;\n n8nChatResize?: boolean;\n n8nChatMount?: { key: string; done: boolean; ready: Promise<void> };\n /** The resolver the agent navigates with, for the dashboard's own buttons (Torrent's use it). */\n dashboardFocus?: (target: string | number) => Focused | null;\n}\n\n/**\n * Wraps the page's fetch, once per page. The wrapper reads `n8nChat` on every\n * call, which each mount replaces, so it acts for the dashboard on screen and\n * only for its webhook.\n */\nexport function wrapFetch(win: ChatWindow): void {\n if (win.n8nChatFetchWrapped) return;\n win.n8nChatFetchWrapped = true;\n const base = win.fetch.bind(win);\n win.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n const response = await base(input, init);\n const chat = win.n8nChat;\n const url = typeof input === 'string' ? input : input instanceof URL ? input.href : String(input?.url ?? '');\n const body = typeof init?.body === 'string' ? init.body : '';\n if (!chat || !chat.webhook || !url.includes(chat.webhook)) return response;\n if (body.includes('\"sendMessage\"')) {\n // n8n sends the NDJSON stream as application/json too, so the setting\n // decides, not the content type. Filtered even with nothing settable: the\n // control chunk must never render as a message.\n if (chat.stream && response.body) {\n return new Response(chat.filterStream(response.body), {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n }\n // responseMode lastNode: the variables ride on the JSON reply.\n if (chat.settable.length) {\n response\n .clone()\n .json()\n .then((reply: { dashboard_variables?: unknown }) => {\n let vars = reply?.dashboard_variables;\n if (typeof vars === 'string') vars = JSON.parse(vars);\n chat.setVariables(vars as Record<string, unknown>, chat.settable);\n })\n .catch(() => {});\n }\n return response;\n }\n if (body.includes('\"loadPreviousSession\"')) {\n try {\n const cleaned = chat.cleanHistory(await response.clone().json());\n return new Response(JSON.stringify(cleaned), { status: response.status, headers: response.headers });\n } catch {\n return response;\n }\n }\n return response;\n };\n}\n","interface StoredMessage {\n id?: unknown;\n kwargs?: { content?: unknown; [key: string]: unknown };\n [key: string]: unknown;\n}\n\n// LangChain tags each stored message's class in `id`, e.g.\n// ['langchain_core', 'messages', 'ToolMessage']; that is the only reliable\n// discriminator, as kwargs.type is absent on these.\nconst HIDDEN = ['ToolMessage', 'SystemMessage', 'FunctionMessage'];\n\nfunction textOf(content: unknown): string {\n if (typeof content === 'string') return content;\n if (!Array.isArray(content)) return '';\n return content.map((p) => (typeof p === 'string' ? p : (p as { text?: string } | null)?.text || '')).join('');\n}\n\nfunction kindOf(m: StoredMessage | null | undefined): string {\n return Array.isArray(m?.id) ? String(m.id[m.id.length - 1]) : '';\n}\n\n/**\n * Cleans a `loadPreviousSession` reply for the widget, whose markdown renderer\n * throws on anything but a string. Tool, system and function messages are\n * dropped (a tool message's content is the tool's raw JSON, a non-empty string\n * that would otherwise fill the reloaded chat); array content is flattened to\n * its text, and a message left with no text is dropped.\n */\nexport function cleanHistory<T>(reply: T): T {\n const data = (reply as { data?: unknown } | null)?.data;\n if (!Array.isArray(data)) return reply;\n const kept = (data as StoredMessage[]).flatMap((m) => {\n if (HIDDEN.includes(kindOf(m))) return [];\n const text = textOf(m?.kwargs?.content);\n return text.trim() ? [{ ...m, kwargs: { ...m.kwargs, content: text } }] : [];\n });\n return { ...reply, data: kept };\n}\n","import { groups, intervalSeconds, refresh, refreshIntervals, timeRange, variableValue, type Group } from '../kd/scene';\nimport type { Settings } from './config';\n\n/** The navigation map for the agent: one line per group, with its purpose from `chat_groups`. */\nexport function describeGroups(list: Group[], notes: Record<string, string>): string {\n return list\n .map((g) => {\n const count = `${g.panels.length} ${g.panels.length === 1 ? 'panel' : 'panels'}`;\n const head = `- ${g.name} (${g.kind}, ${count}${g.open ? ', OPEN' : ''}${g.focusable ? '' : ', pinned'})`;\n const note = notes[g.name.toLowerCase()];\n return note ? `${head}: ${note}` : head;\n })\n .join('\\n');\n}\n\n/**\n * The metadata sent with every message. @n8n/chat serialises this same object\n * on each send, so every live field is a getter: the agent hears about the\n * window, refresh and layout on screen at send time, not at page load.\n */\nexport function chatMetadata(win: Window, s: Settings, home: string): Record<string, unknown> {\n const meta: Record<string, unknown> = {\n dashboard: home.split('/')[2] || 'unknown',\n user: s.user,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n };\n const live = (key: string, get: () => unknown): void => {\n Object.defineProperty(meta, key, { enumerable: true, configurable: true, get });\n };\n live('dashboardUrl', () => win.location.href);\n live('timestamp', () => new Date().toISOString());\n // Raw is what to say to a person (\"now-24h\"); ISO is what a query needs.\n live('timeFrom', () => timeRange(win)?.from ?? '');\n live('timeTo', () => timeRange(win)?.to ?? '');\n live('timeFromIso', () => timeRange(win)?.fromIso ?? '');\n live('timeToIso', () => timeRange(win)?.toIso ?? '');\n live('refresh', () => {\n const r = refresh(win);\n return r === null ? '' : r || 'off';\n });\n live('refreshSeconds', () => intervalSeconds(refresh(win)));\n // The only intervals the picker accepts; anything else blanks it.\n live('refreshIntervals', () => refreshIntervals(win).join(','));\n live('groups', () => describeGroups(groups(win), s.groups));\n live('openGroups', () =>\n groups(win)\n .filter((g) => g.open && g.focusable)\n .map((g) => g.name)\n .join(', '),\n );\n for (const [key, name] of s.context) live(key, () => variableValue(win, name));\n return meta;\n}\n","import { focusPanel, pageWindow, setRefresh, setTimeRange, setVariable, type Focused, type Page } from '../kd/scene';\n\n/** Names in `chat_settable` that are not template variables. */\nexport const RESERVED = ['time_from', 'time_to', 'refresh', 'focus'];\n\n// The read tool spells the window timeFrom/timeTo; the picker's names are time_from/time_to.\nconst ALIAS: Record<string, string> = { timeFrom: 'time_from', timeTo: 'time_to' };\n\n// `.*` is the panel-data tool's \"all databases\" default; a dropdown's own\n// all-value is $__all, so `.*` would match no option. It means nothing to set.\nconst NOT_A_VALUE = ['', '.*'];\n\nexport interface ToolCalls {\n tools?: { args?: Record<string, unknown> | null }[];\n}\n\nexport interface DashboardState {\n /** Settable names to values; a later call in the turn wins. */\n vars: Record<string, string>;\n /** What to bring on screen: an explicit `focus`, else the last panel read. Null unless `focus` is settable. */\n focus: string | null;\n}\n\n/**\n * Maps a turn's tool calls onto the dashboard. An argument named like a\n * settable name IS that name, so no dashboard-specific mapping lives in n8n.\n * `panelId` is how the agent says which panel it read, so reading a panel is a\n * focus; an explicit `focus` argument beats it.\n */\nexport function readToolCalls(payload: ToolCalls | null | undefined, settable: string[]): DashboardState {\n const vars: Record<string, string> = {};\n let asked: string | null = null;\n let read: string | null = null;\n for (const call of payload?.tools ?? []) {\n for (const [key, value] of Object.entries(call?.args ?? {})) {\n if (value === null || value === undefined || NOT_A_VALUE.includes(String(value))) continue;\n if (key === 'panelId') read = String(value);\n else if (key === 'focus') asked = String(value);\n else {\n const name = ALIAS[key] ?? key;\n if (settable.includes(name)) vars[name] = String(value);\n }\n }\n }\n // Half a window would leave the picker inverted.\n if (vars.time_from && !vars.time_to) vars.time_to = 'now';\n return { vars, focus: settable.includes('focus') ? (asked ?? read) : null };\n}\n\n/**\n * Applies `values` to the page: only the `settable` names, in that order.\n * `refresh` snaps to an offered interval; `time_from`/`time_to` are applied\n * together at the end in one call, both ends reported even when one was asked\n * for. `focus` is not applied here.\n *\n * @returns what really changed, for the state card\n */\nexport function applyState(page: Page, values: Record<string, unknown> | null | undefined, settable: string[]): Record<string, string> {\n const applied: Record<string, string> = {};\n if (!values || typeof values !== 'object') return applied;\n let from: string | null = null;\n let to: string | null = null;\n for (const name of settable) {\n const value = values[name];\n if (value === undefined || value === null || value === '') continue;\n if (name === 'time_from') from = String(value);\n else if (name === 'time_to') to = String(value);\n else if (name === 'refresh') {\n const set = setRefresh(page, String(value));\n if (set !== null) applied.refresh = set;\n } else if (name !== 'focus') {\n const set = setVariable(page, name, value);\n if (set !== null) applied[name] = set;\n }\n }\n if (from || to) {\n const raw = setTimeRange(page, from, to);\n if (raw) {\n applied.time_from = raw.from;\n applied.time_to = raw.to;\n }\n }\n return applied;\n}\n\n/**\n * The card saying what the agent just did to the dashboard, or null when it\n * did nothing. Every value came from the model, so all of it is text, never\n * markup. The focused group is a button that goes back there.\n */\nexport function stateCard(\n doc: Document,\n applied: Record<string, string>,\n focused: Focused | null,\n onGo: (target: string) => void,\n): HTMLElement | null {\n const chips: [string, string][] = [];\n if (applied.time_from || applied.time_to) {\n chips.push(['time', `${applied.time_from || 'now'} → ${applied.time_to || 'now'}`]);\n }\n for (const [k, v] of Object.entries(applied)) {\n if (k !== 'time_from' && k !== 'time_to') chips.push([k, v]);\n }\n if (!chips.length && !focused) return null;\n\n const card = doc.createElement('div');\n card.className = 'n8n-chat-state';\n const head = doc.createElement('span');\n head.className = 'ncs-head';\n head.textContent = focused && !chips.length ? 'Moved your dashboard' : 'Changed your dashboard';\n card.append(head);\n\n const chip = (tag: 'span' | 'button', label: string, value: string): HTMLElement => {\n const el = doc.createElement(tag);\n el.className = tag === 'button' ? 'ncs-chip ncs-go' : 'ncs-chip';\n if (tag === 'button') (el as HTMLButtonElement).type = 'button';\n const b = doc.createElement('b');\n b.textContent = label;\n const i = doc.createElement('i');\n i.textContent = value;\n el.append(b, i);\n card.append(el);\n return el;\n };\n for (const [label, value] of chips) chip('span', label, value);\n if (focused) {\n const where = focused.panel != null ? `${focused.group} · panel ${focused.panel}` : focused.group;\n const go = chip('button', focused.kind === 'tab' ? 'tab' : 'section', where);\n go.title = 'Show me that again';\n go.addEventListener('click', () => onGo(focused.panel != null ? String(focused.panel) : focused.group));\n }\n return card;\n}\n\n/**\n * Puts the card inside the last bot message. The widget's Vue list reorders\n * foreign children of the list itself to below every later message; inside a\n * message they are that message's own subtree and scroll away with its turn.\n */\nexport function placeCard(doc: Document, card: HTMLElement): boolean {\n const bots = doc.querySelectorAll('.chat-message-from-bot');\n const host = bots.length\n ? bots[bots.length - 1]\n : doc.querySelector('.chat-messages-list') || doc.querySelector('.chat-body');\n if (!host) return false;\n card.classList.toggle('ncs-loose', !bots.length);\n host.append(card);\n card.scrollIntoView?.({ block: 'nearest' });\n return true;\n}\n\n/** Applies one turn's control chunk: the settable values, then the focus, then the card. */\nexport function applyToolCalls(page: Page, payload: ToolCalls | null | undefined, settable: string[]): void {\n if (!settable.length) return;\n const state = readToolCalls(payload, settable);\n const applied = Object.keys(state.vars).length ? applyState(page, state.vars, settable) : {};\n const focused = state.focus ? focusPanel(page, state.focus) : null;\n const win = pageWindow(page);\n if (!win) return;\n const card = stateCard(win.document, applied, focused, (target) => focusPanel(win, target));\n // The control chunk ends the stream, but the widget may still be committing\n // the reply it belongs to.\n if (card) win.setTimeout(() => placeCard(win.document, card), 150);\n}\n","/**\n * The node whose chunks drive the dashboard. Each agent workflow ends with a\n * `Dashboard State` node that writes one chunk carrying the turn's tool calls\n * as JSON, and n8n stamps every chunk with the node that wrote it.\n */\nexport const CONTROL_NODE = 'Dashboard State';\n\ninterface Chunk {\n type?: string;\n content?: string;\n metadata?: { nodeName?: string };\n}\n\n/**\n * Rewrites n8n's NDJSON stream on its way to the widget. The control node's\n * chunks are recognised by their author and swallowed whole - begin, item and\n * end alike, since a begin/end that got through would render an empty bubble -\n * and each item's content is handed to `onControl`. Every other line passes\n * untouched.\n *\n * Chunks split anywhere, so a partial line is held back until its newline\n * arrives (or the stream ends): a half-received control chunk never leaks.\n */\nexport function controlFilter(\n onControl: (payload: unknown) => void,\n node: string = CONTROL_NODE,\n): TransformStream<Uint8Array, Uint8Array> {\n const decoder = new TextDecoder();\n const encoder = new TextEncoder();\n let carry = '';\n const pass = (line: string, out: TransformStreamDefaultController<Uint8Array>): void => {\n if (!line.trim()) return;\n let chunk: Chunk;\n try {\n chunk = JSON.parse(line) as Chunk;\n } catch {\n out.enqueue(encoder.encode(line + '\\n'));\n return;\n }\n if (chunk?.metadata?.nodeName === node) {\n if (chunk.type === 'item' && chunk.content) {\n try {\n onControl(JSON.parse(chunk.content));\n } catch (e) {\n console.warn('[n8n-chat] unreadable control chunk', chunk.content, e);\n }\n }\n return;\n }\n out.enqueue(encoder.encode(line + '\\n'));\n };\n return new TransformStream<Uint8Array, Uint8Array>({\n transform(bytes, out) {\n carry += decoder.decode(bytes, { stream: true });\n const lines = carry.split('\\n');\n carry = lines.pop() ?? '';\n for (const line of lines) pass(line, out);\n },\n flush(out) {\n carry += decoder.decode();\n if (carry.trim()) pass(carry, out);\n },\n });\n}\n","// The chat tile's page-global stylesheet, injected once into <head>: the bubble\n// lives on <body>, outside any panel, so these rules cannot be scoped to one.\n// Every rule is under #n8n-chat, .n8n-chat-widget or .n8n-chat-*, except the\n// kiosk footer fix.\n//\n// The colour literals are deliberate. @n8n/chat renders light even on a dark\n// Grafana, so its insides are pinned to light values, and the state card binds to\n// the widget's own --chat--* properties rather than to the page's theme.\n\nconst parts = [\n // Kiosk embeds: the \"Powered by\" footer is sticky inside a container fixed to\n // the first viewport height, so it floats up once the page scrolls.\n `[data-testid=\"public-dashboard-footer\"]{position:fixed!important;left:0;right:0;bottom:0}`,\n `#n8n-chat .chat-window-wrapper,.n8n-chat-widget{z-index:2147483647!important}`,\n\n // Size. The widget defaults to 400x600 with no media queries. On a desktop the\n // window's top sits under Grafana's controls row, measured into --n8n-chat-top by\n // the mount (these are fallbacks); --n8n-chat-reserve is what sits below the\n // window inside the widget's fixed wrapper (toggle, gap, inset).\n `#n8n-chat{--n8n-chat-top:14px;--n8n-chat-reserve:92px;` +\n `--chat--window--width:min(760px,calc(100vw - 2rem));` +\n `--chat--window--height:max(320px,calc(100vh - var(--n8n-chat-top) - var(--n8n-chat-reserve)))}`,\n // flex-end: the wrapper is a column of window then toggle, and a closed chat\n // hides the window with display:none, so without it the toggle rides up to the\n // controls row. It also makes an overlong window grow upwards.\n `#n8n-chat .chat-window-wrapper{top:var(--n8n-chat-top);justify-content:flex-end}`,\n // Narrow: full bleed. The mount stops setting the inline properties below 900px.\n `@media (max-width:900px){#n8n-chat{--chat--window--width:calc(100vw - 1.5rem);--chat--window--height:calc(100vh - 5rem)}}`,\n\n // Overflow: pod names, image refs and URLs have no break opportunity, and\n // break-word will not break a token on a line that already has content.\n `#n8n-chat .chat-message-markdown{overflow-wrap:anywhere}`,\n `#n8n-chat .chat-message-from-bot{max-width:94%}`,\n // Code and tables scroll rather than wrap: a wrapped command copies wrong.\n `#n8n-chat .chat-message-markdown pre,#n8n-chat .chat-message-markdown table{display:block;max-width:100%;overflow-x:auto}`,\n `#n8n-chat .chat-message-markdown pre code{overflow-wrap:normal;white-space:pre}`,\n `#n8n-chat .chat-message-markdown table{border-collapse:collapse;font-size:12px;white-space:nowrap}`,\n `#n8n-chat .chat-message-markdown th,#n8n-chat .chat-message-markdown td{border:1px solid var(--chat--color-light-shade-100,#d4d8dd);padding:3px 8px;text-align:left}`,\n `#n8n-chat .chat-message-markdown img{max-width:100%;height:auto}`,\n\n // Code contrast: Grafana's dark theme styles <code>/<pre> near-white globally,\n // which wins inside the light bubble. Elements only, so highlight.js spans keep\n // their colours.\n `#n8n-chat{--chat--message--pre--background:#f6f8fa}`,\n `#n8n-chat .chat-message-markdown pre,#n8n-chat .chat-message-markdown code{color:#1f2328!important;background:#f6f8fa}`,\n `#n8n-chat .chat-message-markdown pre{border:1px solid #d0d7de}`,\n `#n8n-chat .chat-message-markdown :not(pre)>code{background:#eaeef2;border:1px solid #d0d7de;border-radius:4px;padding:1px 5px;font-size:.92em}`,\n\n // Grafana styles every <textarea> globally: dark background, dark chat text.\n // -webkit-text-fill-color overrides color on WebKit.\n `#n8n-chat textarea{background:#fff!important;color:#14161a!important;-webkit-text-fill-color:#14161a!important;caret-color:#14161a!important;border:1px solid #c7ccd1!important;opacity:1!important}`,\n `#n8n-chat textarea::placeholder{color:#6b7280!important;-webkit-text-fill-color:#6b7280!important;opacity:1!important}`,\n `#n8n-chat .chat-input-send-button{color:#14161a!important}`,\n\n `.n8n-chat-tile{display:block;text-align:center;text-decoration:none;padding-top:6px;color:inherit}`,\n `.n8n-chat-tile .icon{font-size:30px;line-height:1;height:30px}`,\n `.n8n-chat-tile img{height:30px}`,\n // Grafana's legacy `.badge, .label` rule would paint this a grey box; this selector outranks it.\n `.n8n-chat-tile .label{display:block;font-size:12px;font-weight:inherit;line-height:inherit;opacity:.75;margin-top:6px;padding:0;background:none;color:inherit;border-radius:0;text-shadow:none;white-space:normal}`,\n\n // The state card. Colours come from the widget's own properties: .chat-body\n // inherits Grafana's dark-theme text colour, which measured 1.5:1 on the bubble.\n `.n8n-chat-state{display:flex;flex-wrap:wrap;align-items:center;gap:5px 6px;margin:10px 0 0;padding:8px 0 0;` +\n `border-top:1px solid var(--chat--color-medium,#d2d4d9);color:var(--chat--color-dark,#101330);font-size:12px;line-height:1.4}`,\n // With no reply to hang under, the card carries its own edges.\n `.n8n-chat-state.ncs-loose{margin:2px 0 10px;padding:8px 10px;border:1px solid var(--chat--color-medium,#d2d4d9);` +\n `border-left:3px solid #5794f2;border-radius:4px;background:var(--chat--message--bot--background,#fff)}`,\n `.n8n-chat-state .ncs-head{width:100%;margin-bottom:2px;font-size:11px;font-weight:600;letter-spacing:.02em;opacity:.62}`,\n `.n8n-chat-state .ncs-chip{display:inline-flex;align-items:baseline;gap:6px;margin:0;padding:3px 9px;border-radius:11px;` +\n `border:1px solid var(--chat--color-medium,#d2d4d9);background:var(--chat--color-light,#f2f4f8);font:inherit;color:inherit}`,\n `.n8n-chat-state .ncs-chip b{font-weight:600;font-size:10px;text-transform:uppercase;letter-spacing:.05em;opacity:.62}`,\n `.n8n-chat-state .ncs-chip i{font-style:normal}`,\n `.n8n-chat-state button.ncs-go{cursor:pointer}`,\n `.n8n-chat-state button.ncs-go:hover{border-color:#5794f2;background:rgba(87,148,242,.12)}`,\n];\n\nexport const STYLES = parts.join('\\n');\n","import { VERSION } from '../kd/define';\nimport { focusPanel } from '../kd/scene';\nimport { settings, type ChatConfig, type Settings } from './config';\nimport { wrapFetch, type ChatHandle, type ChatWindow } from './fetch';\nimport { cleanHistory } from './history';\nimport { chatMetadata } from './metadata';\nimport { applyState, applyToolCalls, type ToolCalls } from './state';\nimport { controlFilter } from './stream';\nimport { STYLES } from './styles';\n\nexport type CreateChat = (options: Record<string, unknown>) => unknown;\nexport type ChatLoader = (url: string) => Promise<{ createChat: CreateChat }>;\n\n// dist/ on purpose, for both files: the package root's chat.bundle.es.js has no\n// stream reader, and its style.css has no .chat-inputs rules.\nexport const chatBundle = (version: string): string => `https://cdn.jsdelivr.net/npm/@n8n/chat@${version}/dist/chat.bundle.es.js`;\nexport const chatStyle = (version: string): string => `https://cdn.jsdelivr.net/npm/@n8n/chat@${version}/dist/style.css`;\n\nconst CONTROLS = '[data-testid=\"data-testid dashboard controls\"]';\nconst NARROW = 900;\n\n/** Injects the tile's page-global stylesheet once; a newer build's replaces an older one's. */\nexport function injectStyles(doc: Document): void {\n let style = doc.head.querySelector<HTMLStyleElement>('style[data-n8n-chat-tile]');\n if (style?.dataset.n8nChatTile === VERSION) return;\n if (!style) {\n style = doc.createElement('style');\n doc.head.append(style);\n }\n style.dataset.n8nChatTile = VERSION;\n style.textContent = STYLES;\n}\n\nfunction chatStylesheet(doc: Document, version: string): void {\n const href = chatStyle(version);\n let link = doc.head.querySelector<HTMLLinkElement>('link[data-n8n-chat-style]');\n if (link?.getAttribute('href') === href) return;\n if (!link) {\n link = doc.createElement('link');\n link.rel = 'stylesheet';\n link.setAttribute('data-n8n-chat-style', '');\n doc.head.append(link);\n }\n link.href = href;\n}\n\n/** Fills the tile: an `<a>` with `.icon` and `.label` children, or a `<kd-tile>` by its attributes. */\nexport function fillTile(tile: Element, s: Pick<Settings, 'icon' | 'label' | 'link'>): void {\n const external = /^https?:/.test(s.link);\n if (tile.localName === 'kd-tile') {\n for (const [name, value] of [['icon', s.icon], ['label', s.label], ['href', s.link]]) {\n if (value) tile.setAttribute(name, value);\n else tile.removeAttribute(name);\n }\n return;\n }\n const icon = tile.querySelector('.icon');\n if (icon) {\n if (/^(https?:)?\\//.test(s.icon)) {\n const img = tile.ownerDocument.createElement('img');\n img.src = s.icon;\n img.alt = '';\n icon.replaceChildren(img);\n } else {\n icon.textContent = s.icon;\n }\n }\n const label = tile.querySelector('.label');\n if (label) label.textContent = s.label;\n if (s.link) tile.setAttribute('href', s.link);\n else tile.removeAttribute('href');\n if (external) {\n tile.setAttribute('target', '_blank');\n tile.setAttribute('rel', 'noopener');\n } else {\n tile.removeAttribute('target');\n tile.removeAttribute('rel');\n }\n}\n\n/**\n * Pins the chat window's top under Grafana's controls row, which is measured\n * because it grows when the variables wrap and is absent in a kiosk embed. With\n * no row, or below 900px, the inline values go so the stylesheet's apply.\n */\nexport function fitChat(win: Window): void {\n const doc = win.document;\n const root = doc.getElementById('n8n-chat');\n if (!root) return;\n const wrapper = root.querySelector('.chat-window-wrapper');\n const box = doc.querySelector(CONTROLS)?.getBoundingClientRect();\n if (!wrapper || !box || !box.height || win.innerWidth <= NARROW) {\n root.style.removeProperty('--n8n-chat-top');\n root.style.removeProperty('--n8n-chat-reserve');\n return;\n }\n const cs = win.getComputedStyle(wrapper);\n const toggle = root.querySelector('.chat-window-toggle');\n const reserve =\n (parseFloat(cs.bottom) || 14) +\n (toggle ? toggle.getBoundingClientRect().height : 64) +\n (parseFloat(cs.rowGap || cs.gap) || 14);\n root.style.setProperty('--n8n-chat-top', `${Math.round(box.bottom + 10)}px`);\n root.style.setProperty('--n8n-chat-reserve', `${Math.round(reserve)}px`);\n}\n\nfunction removeChat(doc: Document): void {\n doc.querySelectorAll('#n8n-chat, .n8n-chat-widget').forEach((el) => el.remove());\n}\n\nfunction pageOf(config: ChatConfig): { win: ChatWindow; tile: Element | null } {\n const given = config.tile;\n if (given && typeof given === 'object') {\n return { win: (config.window ?? given.ownerDocument.defaultView ?? window) as ChatWindow, tile: given };\n }\n const win = (config.window ?? window) as ChatWindow;\n const tile =\n typeof given === 'string' ? win.document.querySelector(given) : given === null ? null : win.document.getElementById('n8n-chat-tile');\n return { win, tile };\n}\n\nconst load: ChatLoader = (url) => import(/* @vite-ignore */ url);\n\n/**\n * Mounts the chat tile and its n8n chat on the page.\n *\n * Idempotent: the core text panel re-runs its script on every mount, so a\n * repeat call for the same dashboard and settings keeps the chat that is there.\n * Grafana is a single-page app, so the chat lives on `<body>` only while the URL\n * stays on this dashboard. With no webhook it fills the tile and removes any\n * leftover chat.\n *\n * @returns once the chat is created (or at once, tile only)\n */\nexport function mount(config: ChatConfig = {}, loader: ChatLoader = load): Promise<void> {\n const { win, tile } = pageOf(config);\n const doc = win.document;\n const s = settings(config);\n\n injectStyles(doc);\n if (tile) fillTile(tile, s);\n win.dashboardFocus = (target) => focusPanel(win, target);\n\n if (!s.webhook) {\n removeChat(doc);\n win.clearInterval(win.n8nChatWatch);\n win.n8nChat = null;\n win.n8nChatMount = undefined;\n return Promise.resolve();\n }\n\n const home = win.location.pathname;\n const { auth: _auth, ...visible } = s;\n const key = JSON.stringify([home, visible]);\n const current = win.n8nChatMount;\n if (current?.key === key && (!current.done || doc.getElementById('n8n-chat'))) return current.ready;\n\n removeChat(doc);\n win.clearInterval(win.n8nChatWatch);\n win.n8nChatWatch = win.setInterval(() => {\n if (win.location.pathname !== home) {\n removeChat(doc);\n win.clearInterval(win.n8nChatWatch);\n win.n8nChat = null;\n win.n8nChatMount = undefined;\n return;\n }\n // Also re-measures the controls row, whose height changes fire no event.\n win.n8nChatFit?.();\n }, 1000);\n chatStylesheet(doc, s.chatVersion);\n if (!win.n8nChatResize) {\n win.n8nChatResize = true;\n win.addEventListener('resize', () => win.n8nChatFit?.());\n }\n\n const handle: ChatHandle = {\n webhook: s.webhook,\n settable: s.settable,\n stream: s.stream,\n setVariables: (vars, names) => applyState(win, vars, names),\n cleanHistory,\n filterStream: (body) => body.pipeThrough(controlFilter((payload) => applyToolCalls(win, payload as ToolCalls, s.settable))),\n };\n win.n8nChat = handle;\n wrapFetch(win);\n\n const state: NonNullable<ChatWindow['n8nChatMount']> = { key, done: false, ready: Promise.resolve() };\n win.n8nChatMount = state;\n state.ready = (async () => {\n try {\n // Imported after the setup above, so the page is ready before the bundle arrives.\n const { createChat } = await loader(chatBundle(s.chatVersion));\n // A later mount, or leaving the dashboard, while the bundle loaded.\n if (win.n8nChatMount !== state || win.location.pathname !== home) return;\n win.n8nChatFit = () => fitChat(win);\n createChat({\n webhookUrl: s.webhook,\n webhookConfig: { headers: s.auth ? { Authorization: s.auth } : {} },\n chatSessionKey: 'sessionId',\n loadPreviousSession: true,\n enableStreaming: s.stream,\n metadata: chatMetadata(win, s, home),\n showWelcomeScreen: true,\n initialMessages: s.greeting,\n i18n: { en: { title: s.title, subtitle: s.subtitle } },\n });\n // createChat mounts asynchronously.\n win.setTimeout(() => win.n8nChatFit?.(), 200);\n } finally {\n state.done = true;\n }\n })();\n return state.ready;\n}\n"],"mappings":";;;AAqCA,IAAaY,IAAe;AAmB5B,SAASC,EAAK,GAAwB;CAEpC,OADI,OAAOC,KAAU,WACdA,EAAM,WAAW,IAAI,IAAI,KAAKA,IADC;AAExC;AAEA,SAAgBC,EAAK,GAAyB;CAC5C,OAAOD,EACJ,MAAM,GAAG,CAAC,CACV,KAAK,MAAME,EAAE,KAAK,CAAC,CAAC,CACpB,OAAO,OAAO;AACnB;AAGA,SAAgBC,EAAW,GAAuC;CAChE,IAAMC,IAAgC,CAAC;CACvC,KAAK,IAAMC,KAAQL,EAAM,MAAM,GAAG,GAAG;EACnC,IAAMM,IAAKD,EAAK,QAAQ,GAAG;EAC3B,AAAIC,IAAK,MAAG,EAAMD,EAAK,MAAM,GAAGC,CAAE,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,KAAKD,EAAK,MAAMC,IAAK,CAAC,CAAC,CAAC,KAAK;CACtF;CACA,OAAOF;AACT;AAEA,SAAgBG,EAAS,GAA8B;CACrD,OAAO;EACL,MAAMR,EAAKS,EAAO,IAAI;EACtB,OAAOT,EAAKS,EAAO,KAAK;EACxB,MAAMT,EAAKS,EAAO,IAAI;EACtB,SAAST,EAAKS,EAAO,OAAO,CAAC,CAAC,KAAK;EACnC,OAAOT,EAAKS,EAAO,KAAK;EACxB,UAAUT,EAAKS,EAAO,QAAQ;EAC9B,UAAUT,EAAKS,EAAO,QAAQ,CAAC,CAC5B,MAAM,GAAG,CAAC,CACV,KAAK,MAAMN,EAAE,KAAK,CAAC,CAAC,CACp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B,GAAM;GAclE,AAbA,EAAI,mBAAmBuE,EAAQlG,CAAG,GAClCmH,EAAW;IACT,YAAYvF,EAAE;IACd,eAAe,EAAE,SAASA,EAAE,OAAO,EAAE,eAAeA,EAAE,KAAK,IAAI,CAAC,EAAE;IAClE,gBAAgB;IAChB,qBAAqB;IACrB,iBAAiBA,EAAE;IACnB,UAAUH,EAAazB,GAAK4B,GAAGD,CAAI;IACnC,mBAAmB;IACnB,iBAAiBC,EAAE;IACnB,MAAM,EAAE,IAAI;KAAE,OAAOA,EAAE;KAAO,UAAUA,EAAE;IAAS,EAAE;GACvD,CAAC,GAED5B,EAAI,iBAAiBA,EAAI,aAAa,GAAG,GAAG;EAC9C,UAAU;GACR,EAAM,OAAO;EACf;CACF,EAAA,CAAG,GACIoE,EAAM;AACf"}
|
|
1
|
+
{"version":3,"file":"n8n.js","names":["VERSION","variableValue","intervalSeconds","refreshIntervals","setTimeRange","setVariable","timeRange","groups","focusPanel","pageWindow","refresh","setRefresh","CHAT_VERSION","text","value","list","x","groupNotes","notes","part","eq","settings","config","pair","key","name","wrapFetch","win","base","response","input","init","chat","url","body","vars","reply","cleaned","HIDDEN","textOf","content","p","kindOf","m","cleanHistory","data","kept","describeGroups","count","g","head","note","chatMetadata","meta","home","s","live","r","RESERVED","ALIAS","NOT_A_VALUE","readToolCalls","asked","read","call","payload","settable","applyState","applied","values","from","to","set","page","raw","stateCard","chips","k","v","focused","card","doc","chip","el","tag","b","label","i","where","go","onGo","placeCard","bots","host","applyToolCalls","state","target","CONTROL_NODE","controlFilter","decoder","encoder","carry","pass","line","chunk","node","bytes","lines","out","STYLES","chatBundle","version","chatStyle","CONTROLS","NARROW","injectStyles","style","chatStylesheet","href","link","fillTile","external","tile","icon","img","fitChat","root","wrapper","box","cs","toggle","reserve","removeChat","pageOf","given","load","mount","_auth","visible","current","names","loader","createChat"],"sources":["../src/n8n/config.ts","../src/n8n/fetch.ts","../src/n8n/history.ts","../src/n8n/metadata.ts","../src/n8n/state.ts","../src/n8n/stream.ts","../src/n8n/styles.ts","../src/n8n/mount.ts"],"sourcesContent":["/**\n * What the library panel passes to `mount`: its `chat_*` constants (decoded),\n * the viewer, and the Authorization header. A field that arrives as a literal\n * `${...}` (a dashboard without that variable) reads as empty.\n */\nexport interface ChatConfig {\n /** An emoji, or an image URL. */\n icon?: string;\n label?: string;\n /** Where the tile goes; an http(s) link opens a new tab. */\n link?: string;\n /** The n8n Chat Trigger URL. Empty means tile only, and any leftover bubble is removed. */\n webhook?: string;\n title?: string;\n subtitle?: string;\n /** Greeting lines, split on `|`. */\n greeting?: string;\n /** Extra metadata as `key=variable` pairs, read live on every send: `pod=pod,database=datname`. */\n context?: string;\n /** The names the agent may set, in applied order. `time_from`, `time_to`, `refresh` and `focus` are reserved. */\n settable?: string;\n /** Each group's purpose, `Name=purpose` pairs joined by `|` (Grafana has no description on a tab or a row). */\n groups?: string;\n /** Stream the reply. Must match the Chat Trigger's responseMode, or nothing renders. */\n stream?: boolean | string;\n /** The viewer's login, sent as metadata. */\n user?: string;\n /** The Authorization header value. Kept in Grafana and passed in, never in this package. */\n auth?: string;\n /** The `@n8n/chat` version loaded from jsDelivr; by default the one package.json pins. */\n chatVersion?: string;\n /** The tile: an element, a selector, or by default `#n8n-chat-tile`. An `<a>` or a `<kd-tile>`. */\n tile?: Element | string | null;\n /** The page; by default the tile's, else the global window. */\n window?: Window;\n}\n\n/** The `@n8n/chat` build loaded by default: package.json's peer dependency, injected at build time. */\nexport const CHAT_VERSION: string = __N8N_CHAT_VERSION__;\n\nexport interface Settings {\n icon: string;\n label: string;\n link: string;\n webhook: string;\n title: string;\n subtitle: string;\n greeting: string[];\n context: [key: string, variable: string][];\n settable: string[];\n groups: Record<string, string>;\n stream: boolean;\n user: string;\n auth: string;\n chatVersion: string;\n}\n\nfunction text(value: unknown): string {\n if (typeof value !== 'string') return '';\n return value.startsWith('${') ? '' : value;\n}\n\nexport function list(value: string): string[] {\n return value\n .split(',')\n .map((x) => x.trim())\n .filter(Boolean);\n}\n\n/** `Name=purpose|Other=purpose` -> lower-cased name to purpose. */\nexport function groupNotes(value: string): Record<string, string> {\n const notes: Record<string, string> = {};\n for (const part of value.split('|')) {\n const eq = part.indexOf('=');\n if (eq > 0) notes[part.slice(0, eq).trim().toLowerCase()] = part.slice(eq + 1).trim();\n }\n return notes;\n}\n\nexport function settings(config: ChatConfig): Settings {\n return {\n icon: text(config.icon),\n label: text(config.label),\n link: text(config.link),\n webhook: text(config.webhook).trim(),\n title: text(config.title),\n subtitle: text(config.subtitle),\n greeting: text(config.greeting)\n .split('|')\n .map((x) => x.trim())\n .filter(Boolean),\n context: list(text(config.context)).map((pair): [string, string] => {\n if (!pair.includes('=')) return [pair, pair];\n const [key, name] = pair.split('=').map((x) => x.trim());\n return [key, name];\n }),\n settable: list(text(config.settable)),\n groups: groupNotes(text(config.groups)),\n stream: config.stream === true || text(config.stream) === 'true',\n user: text(config.user),\n auth: text(config.auth),\n chatVersion: text(config.chatVersion).trim() || CHAT_VERSION,\n };\n}\n","import type { Focused } from '../kd/scene';\n\n/**\n * What the fetch wrapper acts for: the chat on screen. Kept on the page window\n * as `n8nChat` in the shape the pre-package library panel used, so a wrapper\n * installed by either one serves the other.\n */\nexport interface ChatHandle {\n webhook: string;\n settable: string[];\n stream: boolean;\n setVariables(vars: Record<string, unknown> | null | undefined, names: string[]): Record<string, string>;\n cleanHistory<T>(reply: T): T;\n filterStream(body: ReadableStream<Uint8Array>): ReadableStream<Uint8Array>;\n}\n\n/** The page globals the chat keeps. They outlive this module across SPA navigation and package versions. */\nexport interface ChatWindow extends Window {\n n8nChat?: ChatHandle | null;\n n8nChatWatch?: number;\n n8nChatFetchWrapped?: boolean;\n n8nChatFit?: () => void;\n n8nChatResize?: boolean;\n n8nChatMount?: { key: string; done: boolean; ready: Promise<void> };\n /** The resolver the agent navigates with, for the dashboard's own buttons (Torrent's use it). */\n dashboardFocus?: (target: string | number) => Focused | null;\n}\n\n/**\n * Wraps the page's fetch, once per page. The wrapper reads `n8nChat` on every\n * call, which each mount replaces, so it acts for the dashboard on screen and\n * only for its webhook.\n */\nexport function wrapFetch(win: ChatWindow): void {\n if (win.n8nChatFetchWrapped) return;\n win.n8nChatFetchWrapped = true;\n const base = win.fetch.bind(win);\n win.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n const response = await base(input, init);\n const chat = win.n8nChat;\n const url = typeof input === 'string' ? input : input instanceof URL ? input.href : String(input?.url ?? '');\n const body = typeof init?.body === 'string' ? init.body : '';\n if (!chat || !chat.webhook || !url.includes(chat.webhook)) return response;\n if (body.includes('\"sendMessage\"')) {\n // n8n sends the NDJSON stream as application/json too, so the setting\n // decides, not the content type. Filtered even with nothing settable: the\n // control chunk must never render as a message.\n if (chat.stream && response.body) {\n return new Response(chat.filterStream(response.body), {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n }\n // responseMode lastNode: the variables ride on the JSON reply.\n if (chat.settable.length) {\n response\n .clone()\n .json()\n .then((reply: { dashboard_variables?: unknown }) => {\n let vars = reply?.dashboard_variables;\n if (typeof vars === 'string') vars = JSON.parse(vars);\n chat.setVariables(vars as Record<string, unknown>, chat.settable);\n })\n .catch(() => {});\n }\n return response;\n }\n if (body.includes('\"loadPreviousSession\"')) {\n try {\n const cleaned = chat.cleanHistory(await response.clone().json());\n return new Response(JSON.stringify(cleaned), { status: response.status, headers: response.headers });\n } catch {\n return response;\n }\n }\n return response;\n };\n}\n","interface StoredMessage {\n id?: unknown;\n kwargs?: { content?: unknown; [key: string]: unknown };\n [key: string]: unknown;\n}\n\n// LangChain tags each stored message's class in `id`, e.g.\n// ['langchain_core', 'messages', 'ToolMessage']; that is the only reliable\n// discriminator, as kwargs.type is absent on these.\nconst HIDDEN = ['ToolMessage', 'SystemMessage', 'FunctionMessage'];\n\nfunction textOf(content: unknown): string {\n if (typeof content === 'string') return content;\n if (!Array.isArray(content)) return '';\n return content.map((p) => (typeof p === 'string' ? p : (p as { text?: string } | null)?.text || '')).join('');\n}\n\nfunction kindOf(m: StoredMessage | null | undefined): string {\n return Array.isArray(m?.id) ? String(m.id[m.id.length - 1]) : '';\n}\n\n/**\n * Cleans a `loadPreviousSession` reply for the widget, whose markdown renderer\n * throws on anything but a string. Tool, system and function messages are\n * dropped (a tool message's content is the tool's raw JSON, a non-empty string\n * that would otherwise fill the reloaded chat); array content is flattened to\n * its text, and a message left with no text is dropped.\n */\nexport function cleanHistory<T>(reply: T): T {\n const data = (reply as { data?: unknown } | null)?.data;\n if (!Array.isArray(data)) return reply;\n const kept = (data as StoredMessage[]).flatMap((m) => {\n if (HIDDEN.includes(kindOf(m))) return [];\n const text = textOf(m?.kwargs?.content);\n return text.trim() ? [{ ...m, kwargs: { ...m.kwargs, content: text } }] : [];\n });\n return { ...reply, data: kept };\n}\n","import { groups, intervalSeconds, refresh, refreshIntervals, timeRange, variableValue, type Group } from '../kd/scene';\nimport type { Settings } from './config';\n\n/** The navigation map for the agent: one line per group, with its purpose from `chat_groups`. */\nexport function describeGroups(list: Group[], notes: Record<string, string>): string {\n return list\n .map((g) => {\n const count = `${g.panels.length} ${g.panels.length === 1 ? 'panel' : 'panels'}`;\n const head = `- ${g.name} (${g.kind}, ${count}${g.open ? ', OPEN' : ''}${g.focusable ? '' : ', pinned'})`;\n const note = notes[g.name.toLowerCase()];\n return note ? `${head}: ${note}` : head;\n })\n .join('\\n');\n}\n\n/**\n * The metadata sent with every message. @n8n/chat serialises this same object\n * on each send, so every live field is a getter: the agent hears about the\n * window, refresh and layout on screen at send time, not at page load.\n */\nexport function chatMetadata(win: Window, s: Settings, home: string): Record<string, unknown> {\n const meta: Record<string, unknown> = {\n dashboard: home.split('/')[2] || 'unknown',\n user: s.user,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n };\n const live = (key: string, get: () => unknown): void => {\n Object.defineProperty(meta, key, { enumerable: true, configurable: true, get });\n };\n live('dashboardUrl', () => win.location.href);\n live('timestamp', () => new Date().toISOString());\n // Raw is what to say to a person (\"now-24h\"); ISO is what a query needs.\n live('timeFrom', () => timeRange(win)?.from ?? '');\n live('timeTo', () => timeRange(win)?.to ?? '');\n live('timeFromIso', () => timeRange(win)?.fromIso ?? '');\n live('timeToIso', () => timeRange(win)?.toIso ?? '');\n live('refresh', () => {\n const r = refresh(win);\n return r === null ? '' : r || 'off';\n });\n live('refreshSeconds', () => intervalSeconds(refresh(win)));\n // The only intervals the picker accepts; anything else blanks it.\n live('refreshIntervals', () => refreshIntervals(win).join(','));\n live('groups', () => describeGroups(groups(win), s.groups));\n live('openGroups', () =>\n groups(win)\n .filter((g) => g.open && g.focusable)\n .map((g) => g.name)\n .join(', '),\n );\n for (const [key, name] of s.context) live(key, () => variableValue(win, name));\n return meta;\n}\n","import { focusPanel, pageWindow, setRefresh, setTimeRange, setVariable, type Focused, type Page } from '../kd/scene';\n\n/** Names in `chat_settable` that are not template variables. */\nexport const RESERVED = ['time_from', 'time_to', 'refresh', 'focus'];\n\n// The read tool spells the window timeFrom/timeTo; the picker's names are time_from/time_to.\nconst ALIAS: Record<string, string> = { timeFrom: 'time_from', timeTo: 'time_to' };\n\n// `.*` is the panel-data tool's \"all databases\" default; a dropdown's own\n// all-value is $__all, so `.*` would match no option. It means nothing to set.\nconst NOT_A_VALUE = ['', '.*'];\n\nexport interface ToolCalls {\n tools?: { args?: Record<string, unknown> | null }[];\n}\n\nexport interface DashboardState {\n /** Settable names to values; a later call in the turn wins. */\n vars: Record<string, string>;\n /** What to bring on screen: an explicit `focus`, else the last panel read. Null unless `focus` is settable. */\n focus: string | null;\n}\n\n/**\n * Maps a turn's tool calls onto the dashboard. An argument named like a\n * settable name IS that name, so no dashboard-specific mapping lives in n8n.\n * `panelId` is how the agent says which panel it read, so reading a panel is a\n * focus; an explicit `focus` argument beats it.\n */\nexport function readToolCalls(payload: ToolCalls | null | undefined, settable: string[]): DashboardState {\n const vars: Record<string, string> = {};\n let asked: string | null = null;\n let read: string | null = null;\n for (const call of payload?.tools ?? []) {\n for (const [key, value] of Object.entries(call?.args ?? {})) {\n if (value === null || value === undefined || NOT_A_VALUE.includes(String(value))) continue;\n if (key === 'panelId') read = String(value);\n else if (key === 'focus') asked = String(value);\n else {\n const name = ALIAS[key] ?? key;\n if (settable.includes(name)) vars[name] = String(value);\n }\n }\n }\n // Half a window would leave the picker inverted.\n if (vars.time_from && !vars.time_to) vars.time_to = 'now';\n return { vars, focus: settable.includes('focus') ? (asked ?? read) : null };\n}\n\n/**\n * Applies `values` to the page: only the `settable` names, in that order.\n * `refresh` snaps to an offered interval; `time_from`/`time_to` are applied\n * together at the end in one call, both ends reported even when one was asked\n * for. `focus` is not applied here.\n *\n * @returns what really changed, for the state card\n */\nexport function applyState(page: Page, values: Record<string, unknown> | null | undefined, settable: string[]): Record<string, string> {\n const applied: Record<string, string> = {};\n if (!values || typeof values !== 'object') return applied;\n let from: string | null = null;\n let to: string | null = null;\n for (const name of settable) {\n const value = values[name];\n if (value === undefined || value === null || value === '') continue;\n if (name === 'time_from') from = String(value);\n else if (name === 'time_to') to = String(value);\n else if (name === 'refresh') {\n const set = setRefresh(page, String(value));\n if (set !== null) applied.refresh = set;\n } else if (name !== 'focus') {\n const set = setVariable(page, name, value);\n if (set !== null) applied[name] = set;\n }\n }\n if (from || to) {\n const raw = setTimeRange(page, from, to);\n if (raw) {\n applied.time_from = raw.from;\n applied.time_to = raw.to;\n }\n }\n return applied;\n}\n\n/**\n * The card saying what the agent just did to the dashboard, or null when it\n * did nothing. Every value came from the model, so all of it is text, never\n * markup. The focused group is a button that goes back there.\n */\nexport function stateCard(\n doc: Document,\n applied: Record<string, string>,\n focused: Focused | null,\n onGo: (target: string) => void,\n): HTMLElement | null {\n const chips: [string, string][] = [];\n if (applied.time_from || applied.time_to) {\n chips.push(['time', `${applied.time_from || 'now'} → ${applied.time_to || 'now'}`]);\n }\n for (const [k, v] of Object.entries(applied)) {\n if (k !== 'time_from' && k !== 'time_to') chips.push([k, v]);\n }\n if (!chips.length && !focused) return null;\n\n const card = doc.createElement('div');\n card.className = 'n8n-chat-state';\n const head = doc.createElement('span');\n head.className = 'ncs-head';\n head.textContent = focused && !chips.length ? 'Moved your dashboard' : 'Changed your dashboard';\n card.append(head);\n\n const chip = (tag: 'span' | 'button', label: string, value: string): HTMLElement => {\n const el = doc.createElement(tag);\n el.className = tag === 'button' ? 'ncs-chip ncs-go' : 'ncs-chip';\n if (tag === 'button') (el as HTMLButtonElement).type = 'button';\n const b = doc.createElement('b');\n b.textContent = label;\n const i = doc.createElement('i');\n i.textContent = value;\n el.append(b, i);\n card.append(el);\n return el;\n };\n for (const [label, value] of chips) chip('span', label, value);\n if (focused) {\n const where = focused.panel != null ? `${focused.group} · panel ${focused.panel}` : focused.group;\n const go = chip('button', focused.kind === 'tab' ? 'tab' : 'section', where);\n go.title = 'Show me that again';\n go.addEventListener('click', () => onGo(focused.panel != null ? String(focused.panel) : focused.group));\n }\n return card;\n}\n\n/**\n * Puts the card inside the last bot message. The widget's Vue list reorders\n * foreign children of the list itself to below every later message; inside a\n * message they are that message's own subtree and scroll away with its turn.\n */\nexport function placeCard(doc: Document, card: HTMLElement): boolean {\n const bots = doc.querySelectorAll('.chat-message-from-bot');\n const host = bots.length\n ? bots[bots.length - 1]\n : doc.querySelector('.chat-messages-list') || doc.querySelector('.chat-body');\n if (!host) return false;\n card.classList.toggle('ncs-loose', !bots.length);\n host.append(card);\n card.scrollIntoView?.({ block: 'nearest' });\n return true;\n}\n\n/** Applies one turn's control chunk: the settable values, then the focus, then the card. */\nexport function applyToolCalls(page: Page, payload: ToolCalls | null | undefined, settable: string[]): void {\n if (!settable.length) return;\n const state = readToolCalls(payload, settable);\n const applied = Object.keys(state.vars).length ? applyState(page, state.vars, settable) : {};\n const focused = state.focus ? focusPanel(page, state.focus) : null;\n const win = pageWindow(page);\n if (!win) return;\n const card = stateCard(win.document, applied, focused, (target) => focusPanel(win, target));\n // The control chunk ends the stream, but the widget may still be committing\n // the reply it belongs to.\n if (card) win.setTimeout(() => placeCard(win.document, card), 150);\n}\n","/**\n * The node whose chunks drive the dashboard. Each agent workflow ends with a\n * `Dashboard State` node that writes one chunk carrying the turn's tool calls\n * as JSON, and n8n stamps every chunk with the node that wrote it.\n */\nexport const CONTROL_NODE = 'Dashboard State';\n\ninterface Chunk {\n type?: string;\n content?: string;\n metadata?: { nodeName?: string };\n}\n\n/**\n * Rewrites n8n's NDJSON stream on its way to the widget. The control node's\n * chunks are recognised by their author and swallowed whole - begin, item and\n * end alike, since a begin/end that got through would render an empty bubble -\n * and each item's content is handed to `onControl`. Every other line passes\n * untouched.\n *\n * Chunks split anywhere, so a partial line is held back until its newline\n * arrives (or the stream ends): a half-received control chunk never leaks.\n */\nexport function controlFilter(\n onControl: (payload: unknown) => void,\n node: string = CONTROL_NODE,\n): TransformStream<Uint8Array, Uint8Array> {\n const decoder = new TextDecoder();\n const encoder = new TextEncoder();\n let carry = '';\n const pass = (line: string, out: TransformStreamDefaultController<Uint8Array>): void => {\n if (!line.trim()) return;\n let chunk: Chunk;\n try {\n chunk = JSON.parse(line) as Chunk;\n } catch {\n out.enqueue(encoder.encode(line + '\\n'));\n return;\n }\n if (chunk?.metadata?.nodeName === node) {\n if (chunk.type === 'item' && chunk.content) {\n try {\n onControl(JSON.parse(chunk.content));\n } catch (e) {\n console.warn('[n8n-chat] unreadable control chunk', chunk.content, e);\n }\n }\n return;\n }\n out.enqueue(encoder.encode(line + '\\n'));\n };\n return new TransformStream<Uint8Array, Uint8Array>({\n transform(bytes, out) {\n carry += decoder.decode(bytes, { stream: true });\n const lines = carry.split('\\n');\n carry = lines.pop() ?? '';\n for (const line of lines) pass(line, out);\n },\n flush(out) {\n carry += decoder.decode();\n if (carry.trim()) pass(carry, out);\n },\n });\n}\n","// The chat tile's page-global stylesheet, injected once into <head>: the bubble\n// lives on <body>, outside any panel, so these rules cannot be scoped to one.\n// Every rule is under #n8n-chat, .n8n-chat-widget or .n8n-chat-*, except the\n// kiosk footer fix.\n//\n// The colour literals are deliberate. @n8n/chat renders light even on a dark\n// Grafana, so its insides are pinned to light values, and the state card binds to\n// the widget's own --chat--* properties rather than to the page's theme.\n\nconst parts = [\n // Kiosk embeds: the \"Powered by\" footer is sticky inside a container fixed to\n // the first viewport height, so it floats up once the page scrolls.\n `[data-testid=\"public-dashboard-footer\"]{position:fixed!important;left:0;right:0;bottom:0}`,\n `#n8n-chat .chat-window-wrapper,.n8n-chat-widget{z-index:2147483647!important}`,\n\n // Size. The widget defaults to 400x600 with no media queries. On a desktop the\n // window's top sits under Grafana's controls row, measured into --n8n-chat-top by\n // the mount (these are fallbacks); --n8n-chat-reserve is what sits below the\n // window inside the widget's fixed wrapper (toggle, gap, inset).\n `#n8n-chat{--n8n-chat-top:14px;--n8n-chat-reserve:92px;` +\n `--chat--window--width:min(760px,calc(100vw - 2rem));` +\n `--chat--window--height:max(320px,calc(100vh - var(--n8n-chat-top) - var(--n8n-chat-reserve)))}`,\n // flex-end: the wrapper is a column of window then toggle, and a closed chat\n // hides the window with display:none, so without it the toggle rides up to the\n // controls row. It also makes an overlong window grow upwards.\n `#n8n-chat .chat-window-wrapper{top:var(--n8n-chat-top);justify-content:flex-end}`,\n // Narrow: full bleed. The mount stops setting the inline properties below 900px.\n `@media (max-width:900px){#n8n-chat{--chat--window--width:calc(100vw - 1.5rem);--chat--window--height:calc(100vh - 5rem)}}`,\n\n // Overflow: pod names, image refs and URLs have no break opportunity, and\n // break-word will not break a token on a line that already has content.\n `#n8n-chat .chat-message-markdown{overflow-wrap:anywhere}`,\n `#n8n-chat .chat-message-from-bot{max-width:94%}`,\n // Code and tables scroll rather than wrap: a wrapped command copies wrong.\n `#n8n-chat .chat-message-markdown pre,#n8n-chat .chat-message-markdown table{display:block;max-width:100%;overflow-x:auto}`,\n `#n8n-chat .chat-message-markdown pre code{overflow-wrap:normal;white-space:pre}`,\n `#n8n-chat .chat-message-markdown table{border-collapse:collapse;font-size:12px;white-space:nowrap}`,\n `#n8n-chat .chat-message-markdown th,#n8n-chat .chat-message-markdown td{border:1px solid var(--chat--color-light-shade-100,#d4d8dd);padding:3px 8px;text-align:left}`,\n `#n8n-chat .chat-message-markdown img{max-width:100%;height:auto}`,\n\n // Code contrast: Grafana's dark theme styles <code>/<pre> near-white globally,\n // which wins inside the light bubble. Elements only, so highlight.js spans keep\n // their colours.\n `#n8n-chat{--chat--message--pre--background:#f6f8fa}`,\n `#n8n-chat .chat-message-markdown pre,#n8n-chat .chat-message-markdown code{color:#1f2328!important;background:#f6f8fa}`,\n `#n8n-chat .chat-message-markdown pre{border:1px solid #d0d7de}`,\n `#n8n-chat .chat-message-markdown :not(pre)>code{background:#eaeef2;border:1px solid #d0d7de;border-radius:4px;padding:1px 5px;font-size:.92em}`,\n\n // Grafana styles every <textarea> globally: dark background, dark chat text.\n // -webkit-text-fill-color overrides color on WebKit.\n `#n8n-chat textarea{background:#fff!important;color:#14161a!important;-webkit-text-fill-color:#14161a!important;caret-color:#14161a!important;border:1px solid #c7ccd1!important;opacity:1!important}`,\n `#n8n-chat textarea::placeholder{color:#6b7280!important;-webkit-text-fill-color:#6b7280!important;opacity:1!important}`,\n `#n8n-chat .chat-input-send-button{color:#14161a!important}`,\n\n `.n8n-chat-tile{display:block;text-align:center;text-decoration:none;padding-top:6px;color:inherit}`,\n `.n8n-chat-tile .icon{font-size:30px;line-height:1;height:30px}`,\n `.n8n-chat-tile img{height:30px}`,\n // Grafana's legacy `.badge, .label` rule would paint this a grey box; this selector outranks it.\n `.n8n-chat-tile .label{display:block;font-size:12px;font-weight:inherit;line-height:inherit;opacity:.75;margin-top:6px;padding:0;background:none;color:inherit;border-radius:0;text-shadow:none;white-space:normal}`,\n\n // The state card. Colours come from the widget's own properties: .chat-body\n // inherits Grafana's dark-theme text colour, which measured 1.5:1 on the bubble.\n `.n8n-chat-state{display:flex;flex-wrap:wrap;align-items:center;gap:5px 6px;margin:10px 0 0;padding:8px 0 0;` +\n `border-top:1px solid var(--chat--color-medium,#d2d4d9);color:var(--chat--color-dark,#101330);font-size:12px;line-height:1.4}`,\n // With no reply to hang under, the card carries its own edges.\n `.n8n-chat-state.ncs-loose{margin:2px 0 10px;padding:8px 10px;border:1px solid var(--chat--color-medium,#d2d4d9);` +\n `border-left:3px solid #5794f2;border-radius:4px;background:var(--chat--message--bot--background,#fff)}`,\n `.n8n-chat-state .ncs-head{width:100%;margin-bottom:2px;font-size:11px;font-weight:600;letter-spacing:.02em;opacity:.62}`,\n `.n8n-chat-state .ncs-chip{display:inline-flex;align-items:baseline;gap:6px;margin:0;padding:3px 9px;border-radius:11px;` +\n `border:1px solid var(--chat--color-medium,#d2d4d9);background:var(--chat--color-light,#f2f4f8);font:inherit;color:inherit}`,\n `.n8n-chat-state .ncs-chip b{font-weight:600;font-size:10px;text-transform:uppercase;letter-spacing:.05em;opacity:.62}`,\n `.n8n-chat-state .ncs-chip i{font-style:normal}`,\n `.n8n-chat-state button.ncs-go{cursor:pointer}`,\n `.n8n-chat-state button.ncs-go:hover{border-color:#5794f2;background:rgba(87,148,242,.12)}`,\n];\n\nexport const STYLES = parts.join('\\n');\n","import { VERSION } from '../kd/define';\nimport { focusPanel } from '../kd/scene';\nimport { settings, type ChatConfig, type Settings } from './config';\nimport { wrapFetch, type ChatHandle, type ChatWindow } from './fetch';\nimport { cleanHistory } from './history';\nimport { chatMetadata } from './metadata';\nimport { applyState, applyToolCalls, type ToolCalls } from './state';\nimport { controlFilter } from './stream';\nimport { STYLES } from './styles';\n\nexport type CreateChat = (options: Record<string, unknown>) => unknown;\nexport type ChatLoader = (url: string) => Promise<{ createChat: CreateChat }>;\n\n// dist/ on purpose, for both files: the package root's chat.bundle.es.js has no\n// stream reader, and its style.css has no .chat-inputs rules.\nexport const chatBundle = (version: string): string => `https://cdn.jsdelivr.net/npm/@n8n/chat@${version}/dist/chat.bundle.es.js`;\nexport const chatStyle = (version: string): string => `https://cdn.jsdelivr.net/npm/@n8n/chat@${version}/dist/style.css`;\n\nconst CONTROLS = '[data-testid=\"data-testid dashboard controls\"]';\nconst NARROW = 900;\n\n/** Injects the tile's page-global stylesheet once; a newer build's replaces an older one's. */\nexport function injectStyles(doc: Document): void {\n let style = doc.head.querySelector<HTMLStyleElement>('style[data-n8n-chat-tile]');\n if (style?.dataset.n8nChatTile === VERSION) return;\n if (!style) {\n style = doc.createElement('style');\n doc.head.append(style);\n }\n style.dataset.n8nChatTile = VERSION;\n style.textContent = STYLES;\n}\n\nfunction chatStylesheet(doc: Document, version: string): void {\n const href = chatStyle(version);\n let link = doc.head.querySelector<HTMLLinkElement>('link[data-n8n-chat-style]');\n if (link?.getAttribute('href') === href) return;\n if (!link) {\n link = doc.createElement('link');\n link.rel = 'stylesheet';\n link.setAttribute('data-n8n-chat-style', '');\n doc.head.append(link);\n }\n link.href = href;\n}\n\n/** Fills the tile: an `<a>` with `.icon` and `.label` children, or a `<kd-tile>` by its attributes. */\nexport function fillTile(tile: Element, s: Pick<Settings, 'icon' | 'label' | 'link'>): void {\n const external = /^https?:/.test(s.link);\n if (tile.localName === 'kd-tile') {\n for (const [name, value] of [['icon', s.icon], ['label', s.label], ['href', s.link]]) {\n if (value) tile.setAttribute(name, value);\n else tile.removeAttribute(name);\n }\n return;\n }\n const icon = tile.querySelector('.icon');\n if (icon) {\n if (/^(https?:)?\\//.test(s.icon)) {\n const img = tile.ownerDocument.createElement('img');\n img.src = s.icon;\n img.alt = '';\n icon.replaceChildren(img);\n } else {\n icon.textContent = s.icon;\n }\n }\n const label = tile.querySelector('.label');\n if (label) label.textContent = s.label;\n if (s.link) tile.setAttribute('href', s.link);\n else tile.removeAttribute('href');\n if (external) {\n tile.setAttribute('target', '_blank');\n tile.setAttribute('rel', 'noopener');\n } else {\n tile.removeAttribute('target');\n tile.removeAttribute('rel');\n }\n}\n\n/**\n * Pins the chat window's top under Grafana's controls row, which is measured\n * because it grows when the variables wrap and is absent in a kiosk embed. With\n * no row, or below 900px, the inline values go so the stylesheet's apply.\n */\nexport function fitChat(win: Window): void {\n const doc = win.document;\n const root = doc.getElementById('n8n-chat');\n if (!root) return;\n const wrapper = root.querySelector('.chat-window-wrapper');\n const box = doc.querySelector(CONTROLS)?.getBoundingClientRect();\n if (!wrapper || !box || !box.height || win.innerWidth <= NARROW) {\n root.style.removeProperty('--n8n-chat-top');\n root.style.removeProperty('--n8n-chat-reserve');\n return;\n }\n const cs = win.getComputedStyle(wrapper);\n const toggle = root.querySelector('.chat-window-toggle');\n const reserve =\n (parseFloat(cs.bottom) || 14) +\n (toggle ? toggle.getBoundingClientRect().height : 64) +\n (parseFloat(cs.rowGap || cs.gap) || 14);\n root.style.setProperty('--n8n-chat-top', `${Math.round(box.bottom + 10)}px`);\n root.style.setProperty('--n8n-chat-reserve', `${Math.round(reserve)}px`);\n}\n\nfunction removeChat(doc: Document): void {\n doc.querySelectorAll('#n8n-chat, .n8n-chat-widget').forEach((el) => el.remove());\n}\n\nfunction pageOf(config: ChatConfig): { win: ChatWindow; tile: Element | null } {\n const given = config.tile;\n if (given && typeof given === 'object') {\n return { win: (config.window ?? given.ownerDocument.defaultView ?? window) as ChatWindow, tile: given };\n }\n const win = (config.window ?? window) as ChatWindow;\n const tile =\n typeof given === 'string' ? win.document.querySelector(given) : given === null ? null : win.document.getElementById('n8n-chat-tile');\n return { win, tile };\n}\n\nconst load: ChatLoader = (url) => import(/* @vite-ignore */ url);\n\n/**\n * Mounts the chat tile and its n8n chat on the page.\n *\n * Idempotent: the core text panel re-runs its script on every mount, so a\n * repeat call for the same dashboard and settings keeps the chat that is there.\n * Grafana is a single-page app, so the chat lives on `<body>` only while the URL\n * stays on this dashboard. With no webhook it fills the tile and removes any\n * leftover chat.\n *\n * @returns once the chat is created (or at once, tile only)\n */\nexport function mount(config: ChatConfig = {}, loader: ChatLoader = load): Promise<void> {\n const { win, tile } = pageOf(config);\n const doc = win.document;\n const s = settings(config);\n\n injectStyles(doc);\n if (tile) fillTile(tile, s);\n win.dashboardFocus = (target) => focusPanel(win, target);\n\n if (!s.webhook) {\n removeChat(doc);\n win.clearInterval(win.n8nChatWatch);\n win.n8nChat = null;\n win.n8nChatMount = undefined;\n return Promise.resolve();\n }\n\n const home = win.location.pathname;\n const { auth: _auth, ...visible } = s;\n const key = JSON.stringify([home, visible]);\n const current = win.n8nChatMount;\n if (current?.key === key && (!current.done || doc.getElementById('n8n-chat'))) return current.ready;\n\n removeChat(doc);\n win.clearInterval(win.n8nChatWatch);\n win.n8nChatWatch = win.setInterval(() => {\n if (win.location.pathname !== home) {\n removeChat(doc);\n win.clearInterval(win.n8nChatWatch);\n win.n8nChat = null;\n win.n8nChatMount = undefined;\n return;\n }\n // Also re-measures the controls row, whose height changes fire no event.\n win.n8nChatFit?.();\n }, 1000);\n chatStylesheet(doc, s.chatVersion);\n if (!win.n8nChatResize) {\n win.n8nChatResize = true;\n win.addEventListener('resize', () => win.n8nChatFit?.());\n }\n\n const handle: ChatHandle = {\n webhook: s.webhook,\n settable: s.settable,\n stream: s.stream,\n setVariables: (vars, names) => applyState(win, vars, names),\n cleanHistory,\n filterStream: (body) => body.pipeThrough(controlFilter((payload) => applyToolCalls(win, payload as ToolCalls, s.settable))),\n };\n win.n8nChat = handle;\n wrapFetch(win);\n\n const state: NonNullable<ChatWindow['n8nChatMount']> = { key, done: false, ready: Promise.resolve() };\n win.n8nChatMount = state;\n state.ready = (async () => {\n try {\n // Imported after the setup above, so the page is ready before the bundle arrives.\n const { createChat } = await loader(chatBundle(s.chatVersion));\n // A later mount, or leaving the dashboard, while the bundle loaded.\n if (win.n8nChatMount !== state || win.location.pathname !== home) return;\n win.n8nChatFit = () => fitChat(win);\n createChat({\n webhookUrl: s.webhook,\n webhookConfig: { headers: s.auth ? { Authorization: s.auth } : {} },\n chatSessionKey: 'sessionId',\n loadPreviousSession: true,\n enableStreaming: s.stream,\n metadata: chatMetadata(win, s, home),\n showWelcomeScreen: true,\n initialMessages: s.greeting,\n i18n: { en: { title: s.title, subtitle: s.subtitle } },\n });\n // createChat mounts asynchronously.\n win.setTimeout(() => win.n8nChatFit?.(), 200);\n } finally {\n state.done = true;\n }\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nB,iBAAiBC,EAAE;IACnB,MAAM,EAAE,IAAI;KAAE,OAAOA,EAAE;KAAO,UAAUA,EAAE;IAAS,EAAE;GACvD,CAAC,GAED5B,EAAI,iBAAiBA,EAAI,aAAa,GAAG,GAAG;EAC9C,UAAU;GACR,EAAM,OAAO;EACf;CACF,EAAA,CAAG,GACIoE,EAAM;AACf"}
|
package/dist/openapi.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as e,
|
|
2
|
-
import { n as o, t as s } from "./chunks/define-
|
|
1
|
+
import { c as e, d as t, n, o as r, t as i, u as a } from "./chunks/element-CaN9ZVoe.js";
|
|
2
|
+
import { n as o, t as s } from "./chunks/define-DqUpowD9.js";
|
|
3
3
|
//#region src/openapi/model.ts
|
|
4
4
|
var c = /* @__PURE__ */ "$ref.type.title.description.format.pattern.default.enum.const.example.examples.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.minLength.maxLength.minItems.maxItems.uniqueItems.minProperties.maxProperties.nullable.readOnly.writeOnly.deprecated.externalDocs.required.properties.items.additionalProperties.allOf.anyOf.oneOf.not.x-kubernetes-int-or-string.x-kubernetes-preserve-unknown-fields.x-kubernetes-embedded-resource.x-kubernetes-list-type.x-kubernetes-list-map-keys.x-kubernetes-map-type.x-kubernetes-validations.x-kubernetes-patch-strategy.x-kubernetes-patch-merge-key.x-kubernetes-unions.x-kubernetes-group-version-kind".split("."), l = new Set(c), u = (e) => typeof e == "object" && !!e && !Array.isArray(e), d = "#/components/schemas/";
|
|
5
5
|
function f(e) {
|
|
@@ -268,7 +268,7 @@ var O = [
|
|
|
268
268
|
#e;
|
|
269
269
|
#t = /* @__PURE__ */ new Map();
|
|
270
270
|
#n = 0;
|
|
271
|
-
static styles = [n,
|
|
271
|
+
static styles = [n, a`
|
|
272
272
|
:host {
|
|
273
273
|
font-size: 13px;
|
|
274
274
|
}
|
|
@@ -499,6 +499,6 @@ var O = [
|
|
|
499
499
|
};
|
|
500
500
|
o("kd-schema", M);
|
|
501
501
|
//#endregion
|
|
502
|
-
export { c as KEYWORDS, M as KdSchema, s as VERSION,
|
|
502
|
+
export { c as KEYWORDS, M as KdSchema, s as VERSION, t as applyTheme, E as behaviours, D as brief, T as constraints, S as find, x as normalize, f as shortName };
|
|
503
503
|
|
|
504
504
|
//# sourceMappingURL=openapi.js.map
|