@backmatter/studio 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/UiKitPage-CgNMOqfE.js +172 -0
- package/dist/chunks/WorkspaceRoutes-DgRtdie8.js +87297 -0
- package/dist/chunks/abap-Y8Dl9g_6.js +6 -0
- package/dist/chunks/actionscript-3-DQVEcJUW.js +6 -0
- package/dist/chunks/ada-vP6ak0IW.js +6 -0
- package/dist/chunks/andromeeda-BbmzSJq1.js +4 -0
- package/dist/chunks/angular-html-DPB4Rf0C.js +32 -0
- package/dist/chunks/angular-ts-CTOR2ofC.js +21 -0
- package/dist/chunks/apache-BUjz-sD2.js +6 -0
- package/dist/chunks/apex-OyTfjCYK.js +6 -0
- package/dist/chunks/apl-CjNiDgad.js +16 -0
- package/dist/chunks/applescript-BPx7YFFu.js +6 -0
- package/dist/chunks/ara-Z2fSOxSw.js +6 -0
- package/dist/chunks/asciidoc-C1T9ziH6.js +6 -0
- package/dist/chunks/asm-BTWLY5ym.js +6 -0
- package/dist/chunks/astro-CFFExE8Q.js +18 -0
- package/dist/chunks/aurora-x-BwoVEUWZ.js +4 -0
- package/dist/chunks/awk-Fb0P9dkn.js +6 -0
- package/dist/chunks/ayu-dark-DJoqd4M9.js +4 -0
- package/dist/chunks/ayu-light-BzXEJRJ-.js +4 -0
- package/dist/chunks/ayu-mirage-BJ2oZGzi.js +4 -0
- package/dist/chunks/ballerina-oZK-YekG.js +6 -0
- package/dist/chunks/bat-0FvbqU9S.js +6 -0
- package/dist/chunks/beancount-DqJEb89h.js +6 -0
- package/dist/chunks/berry-DODBq_Ff.js +6 -0
- package/dist/chunks/bibtex-EULQRLY5.js +6 -0
- package/dist/chunks/bicep-BorU73w0.js +6 -0
- package/dist/chunks/bird2-CIjBSNj3.js +6 -0
- package/dist/chunks/blade-D0HyNvCw.js +20 -0
- package/dist/chunks/bsl-NkNNwerW.js +8 -0
- package/dist/chunks/c-eeMepfLm.js +6 -0
- package/dist/chunks/c3-BY5XW5ym.js +6 -0
- package/dist/chunks/cadence-02UX7mW8.js +6 -0
- package/dist/chunks/cairo-DM6WF2e3.js +8 -0
- package/dist/chunks/catppuccin-frappe-D3cH2rXe.js +4 -0
- package/dist/chunks/catppuccin-latte-C0LRGUW4.js +4 -0
- package/dist/chunks/catppuccin-macchiato-c5wQ11TT.js +4 -0
- package/dist/chunks/catppuccin-mocha-WMD6Qvya.js +4 -0
- package/dist/chunks/clarity-PKm5CwqM.js +6 -0
- package/dist/chunks/clojure-CXJfHrL3.js +6 -0
- package/dist/chunks/cmake-BJz8BOTU.js +6 -0
- package/dist/chunks/cobol-HihOMwht.js +10 -0
- package/dist/chunks/codeowners-Bt9yU6NX.js +6 -0
- package/dist/chunks/codeql-DHkodjjI.js +6 -0
- package/dist/chunks/coffee-DGBR_nr_.js +8 -0
- package/dist/chunks/common-lisp-EVqT9Zhp.js +6 -0
- package/dist/chunks/coq-B0L9upzn.js +6 -0
- package/dist/chunks/cpp-Cj177cuW.js +18 -0
- package/dist/chunks/crystal-CRJyc4G-.js +18 -0
- package/dist/chunks/csharp-CCgA4A09.js +6 -0
- package/dist/chunks/css-CECN5uSL.js +6 -0
- package/dist/chunks/csv-CmYOceLb.js +6 -0
- package/dist/chunks/cue-ZzumE7IT.js +6 -0
- package/dist/chunks/cypher-jpdmjtA6.js +6 -0
- package/dist/chunks/d-CBagWSwH.js +6 -0
- package/dist/chunks/dark-plus-pUHDTVV0.js +4 -0
- package/dist/chunks/dart-6ObCrKr9.js +6 -0
- package/dist/chunks/dashboard-XKKZuJGm.js +1736 -0
- package/dist/chunks/dax-CcDT-8dH.js +6 -0
- package/dist/chunks/define-studio-BYtYDGLX.js +33 -0
- package/dist/chunks/desktop-B93p9R9O.js +6 -0
- package/dist/chunks/diff-BxzP2J8R.js +6 -0
- package/dist/chunks/docker-CsHqm9tx.js +6 -0
- package/dist/chunks/dotenv-BMjVjUL1.js +6 -0
- package/dist/chunks/dracula-BtZx2Kac.js +4 -0
- package/dist/chunks/dracula-soft-BKa-aqBv.js +4 -0
- package/dist/chunks/dream-maker-PAx17jaB.js +6 -0
- package/dist/chunks/edge-BYQkOzbF.js +12 -0
- package/dist/chunks/elixir-Dh036GMp.js +8 -0
- package/dist/chunks/elm-BtNbw_Cd.js +8 -0
- package/dist/chunks/emacs-lisp-Cfxdx5D-.js +6 -0
- package/dist/chunks/erb-ScVOXVpH.js +10 -0
- package/dist/chunks/erlang-DNcDT8Hi.js +8 -0
- package/dist/chunks/everforest-dark-DMCBqXCK.js +4 -0
- package/dist/chunks/everforest-light-BbXl82Em.js +4 -0
- package/dist/chunks/fennel-N4WcXuKx.js +6 -0
- package/dist/chunks/fish-BTDEUgqH.js +6 -0
- package/dist/chunks/fluent-BMXUxfv1.js +6 -0
- package/dist/chunks/fortran-fixed-form-B67KFkXH.js +8 -0
- package/dist/chunks/fortran-free-form-CwqYvCLJ.js +6 -0
- package/dist/chunks/fsharp-CYOiIVNx.js +8 -0
- package/dist/chunks/gdresource-CvCIUjhi.js +10 -0
- package/dist/chunks/gdscript-DSAxJ_aS.js +6 -0
- package/dist/chunks/gdshader-Bk8fF6yr.js +6 -0
- package/dist/chunks/genie-DzUvd7U9.js +6 -0
- package/dist/chunks/gherkin-DHRaV0YP.js +6 -0
- package/dist/chunks/git-commit-Bd32YZ0K.js +8 -0
- package/dist/chunks/git-rebase-ZWUFO_T4.js +8 -0
- package/dist/chunks/github-dark-DenFmJkN.js +4 -0
- package/dist/chunks/github-dark-default-BJPUVz4H.js +4 -0
- package/dist/chunks/github-dark-dimmed-DUshB20C.js +4 -0
- package/dist/chunks/github-dark-high-contrast-D3aGCnF8.js +4 -0
- package/dist/chunks/github-light-JYsPkUQd.js +4 -0
- package/dist/chunks/github-light-default-D99KPAby.js +4 -0
- package/dist/chunks/github-light-high-contrast-BbmZE-Mp.js +4 -0
- package/dist/chunks/gleam-Bv284lvN.js +6 -0
- package/dist/chunks/glimmer-js-DkxNrfPT.js +14 -0
- package/dist/chunks/glimmer-ts-D6YZEmK_.js +14 -0
- package/dist/chunks/glsl-CkUcVZNK.js +8 -0
- package/dist/chunks/gn-XtJxiLa4.js +6 -0
- package/dist/chunks/gnuplot-yPG9-sE_.js +6 -0
- package/dist/chunks/go-CvFNMTvu.js +6 -0
- package/dist/chunks/graphql-CBu2ehBn.js +14 -0
- package/dist/chunks/groovy-CJQTphOW.js +6 -0
- package/dist/chunks/gruvbox-dark-hard-C5HOtKIh.js +4 -0
- package/dist/chunks/gruvbox-dark-medium-FVgwJHuz.js +4 -0
- package/dist/chunks/gruvbox-dark-soft-B46F314v.js +4 -0
- package/dist/chunks/gruvbox-light-hard-CJD38wDZ.js +4 -0
- package/dist/chunks/gruvbox-light-medium-BlIhMYTA.js +4 -0
- package/dist/chunks/gruvbox-light-soft-DoPHyLVZ.js +4 -0
- package/dist/chunks/hack-ItRNKiEb.js +10 -0
- package/dist/chunks/haml-NZLVzu_R.js +10 -0
- package/dist/chunks/handlebars-mxStpSE7.js +14 -0
- package/dist/chunks/haskell-WeIwNIP6.js +6 -0
- package/dist/chunks/haxe-TztHsm5T.js +6 -0
- package/dist/chunks/hcl-D438OF-I.js +6 -0
- package/dist/chunks/hjson-DYBUbqOl.js +6 -0
- package/dist/chunks/hlsl-Bk8TCZNL.js +6 -0
- package/dist/chunks/horizon-CJQ10nlf.js +4 -0
- package/dist/chunks/horizon-bright-CdkBZOMB.js +4 -0
- package/dist/chunks/houston-BDYrDoDW.js +4 -0
- package/dist/chunks/html-B50bmoVb.js +10 -0
- package/dist/chunks/html-derivative-C6bxFbFW.js +8 -0
- package/dist/chunks/http-DLvAkeD-.js +14 -0
- package/dist/chunks/hurl-CgkFN90t.js +12 -0
- package/dist/chunks/hxml-GbqSQCLa.js +8 -0
- package/dist/chunks/hy-Brt5EZ7-.js +6 -0
- package/dist/chunks/imba-CimUv-Uh.js +6 -0
- package/dist/chunks/index-CFAIR8GH.js +18924 -0
- package/dist/chunks/ini-BZIuRIvJ.js +6 -0
- package/dist/chunks/java-DY6VlHhP.js +6 -0
- package/dist/chunks/javascript-C25yR2R2.js +6 -0
- package/dist/chunks/jinja-CFW5uAwY.js +11 -0
- package/dist/chunks/jison-DdreslRX.js +8 -0
- package/dist/chunks/json-DxJze_jm.js +6 -0
- package/dist/chunks/json5-BT4Fjg39.js +6 -0
- package/dist/chunks/jsonc-CHjZD8gR.js +6 -0
- package/dist/chunks/jsonl-BGuvDmy9.js +6 -0
- package/dist/chunks/jsonnet-Bx2cfsXg.js +6 -0
- package/dist/chunks/jssm-BcADi6EI.js +6 -0
- package/dist/chunks/jsx-BtKADgXT.js +6 -0
- package/dist/chunks/julia-CZiKXNNP.js +16 -0
- package/dist/chunks/just-CEK2SJ_k.js +18 -0
- package/dist/chunks/kanagawa-dragon-CiKur4Hl.js +4 -0
- package/dist/chunks/kanagawa-lotus-BKu-smKu.js +4 -0
- package/dist/chunks/kanagawa-wave-CQwozSzG.js +4 -0
- package/dist/chunks/kdl-BNOv9TC3.js +6 -0
- package/dist/chunks/kotlin-ByBMgTeR.js +6 -0
- package/dist/chunks/kusto-DH_XitHS.js +6 -0
- package/dist/chunks/laserwave-6a00oqik.js +4 -0
- package/dist/chunks/latex-B8Egmqc5.js +8 -0
- package/dist/chunks/lean-BnVxaZxY.js +6 -0
- package/dist/chunks/less-B1GLI2Di.js +6 -0
- package/dist/chunks/light-plus-CZuVqSLX.js +4 -0
- package/dist/chunks/liquid-CHzkx3jT.js +14 -0
- package/dist/chunks/llvm-Bk2XctFf.js +6 -0
- package/dist/chunks/log-Al8wyEFV.js +6 -0
- package/dist/chunks/logo-DBa4JDzV.js +6 -0
- package/dist/chunks/lua-Bp3IRv7I.js +8 -0
- package/dist/chunks/luau-UQyhudEE.js +6 -0
- package/dist/chunks/make-CsMclxtr.js +6 -0
- package/dist/chunks/markdown-CrScaQ96.js +6 -0
- package/dist/chunks/marko-CJBA24Ri.js +14 -0
- package/dist/chunks/material-theme-D6KBX41T.js +4 -0
- package/dist/chunks/material-theme-darker-CkRroheE.js +4 -0
- package/dist/chunks/material-theme-lighter-BUBw43Yz.js +4 -0
- package/dist/chunks/material-theme-ocean-ClGX14Ja.js +4 -0
- package/dist/chunks/material-theme-palenight-C1RVm8K1.js +4 -0
- package/dist/chunks/matlab-BOAaUVP0.js +6 -0
- package/dist/chunks/mdc-C9YSUwVC.js +12 -0
- package/dist/chunks/mdx-BOhZZUJ8.js +6 -0
- package/dist/chunks/mermaid-C3rz4dYh.js +6 -0
- package/dist/chunks/min-dark-C7ak0t6c.js +4 -0
- package/dist/chunks/min-light-CKFxVcPp.js +4 -0
- package/dist/chunks/mipsasm-CTx18fBl.js +6 -0
- package/dist/chunks/mojo-EIZIZRTQ.js +6 -0
- package/dist/chunks/monokai-C1KBYcO0.js +4 -0
- package/dist/chunks/moonbit-B1TV0fG3.js +6 -0
- package/dist/chunks/move-Db4ltDq1.js +6 -0
- package/dist/chunks/narrat-DmhDCBs-.js +6 -0
- package/dist/chunks/nextflow-47kAzSl1.js +8 -0
- package/dist/chunks/nextflow-groovy-Drz_2V0j.js +6 -0
- package/dist/chunks/nginx-D7O4WoB1.js +8 -0
- package/dist/chunks/night-owl-Bm2rzalh.js +4 -0
- package/dist/chunks/night-owl-light-CBI5u5kw.js +4 -0
- package/dist/chunks/nim-QAjRdh9w.js +20 -0
- package/dist/chunks/nix-fTRXMGic.js +9 -0
- package/dist/chunks/nord-CC5OiUXg.js +4 -0
- package/dist/chunks/nushell-BGCPRlV5.js +6 -0
- package/dist/chunks/objective-c-Itk8tzmv.js +6 -0
- package/dist/chunks/objective-cpp-DGt5UKRO.js +6 -0
- package/dist/chunks/ocaml-eSVK32Eg.js +6 -0
- package/dist/chunks/odin-BItnF517.js +6 -0
- package/dist/chunks/one-dark-pro-DTA3VF0_.js +4 -0
- package/dist/chunks/one-light-LkMrt1Cf.js +4 -0
- package/dist/chunks/openscad-Sp5uZ6f2.js +6 -0
- package/dist/chunks/pascal-xy8pJNns.js +6 -0
- package/dist/chunks/perl-DkVrgJBg.js +16 -0
- package/dist/chunks/php-BIzsF_5x.js +18 -0
- package/dist/chunks/pkl-C-zSNmaA.js +6 -0
- package/dist/chunks/plastic-CSTz3KZp.js +4 -0
- package/dist/chunks/plsql-pVbGZfOv.js +6 -0
- package/dist/chunks/po-BNfHvqmm.js +6 -0
- package/dist/chunks/poimandres-C-VADXHD.js +4 -0
- package/dist/chunks/polar-CAZahv3u.js +6 -0
- package/dist/chunks/postcss-05aHdL-n.js +6 -0
- package/dist/chunks/powerquery-DI9HkTvs.js +6 -0
- package/dist/chunks/powershell-Clc4ydu-.js +6 -0
- package/dist/chunks/prisma-FZjmVtSl.js +6 -0
- package/dist/chunks/prolog-C5-yg4TO.js +6 -0
- package/dist/chunks/proto-C7QgialS.js +6 -0
- package/dist/chunks/pug-XOw9Q1Ho.js +12 -0
- package/dist/chunks/puppet-CUJHmnxV.js +6 -0
- package/dist/chunks/purescript-rUfGld-4.js +6 -0
- package/dist/chunks/python-BFNSHbwJ.js +6 -0
- package/dist/chunks/qml-rTNXsquU.js +8 -0
- package/dist/chunks/qmldir-BInDYbpo.js +6 -0
- package/dist/chunks/qss-AeJTysr_.js +6 -0
- package/dist/chunks/r-CSmzDPi7.js +6 -0
- package/dist/chunks/racket-B83wSAja.js +6 -0
- package/dist/chunks/raku-nEQ4ZJJ7.js +6 -0
- package/dist/chunks/razor-Ci8D0dQK.js +10 -0
- package/dist/chunks/red-7y8PH7HH.js +4 -0
- package/dist/chunks/reg-m_s_Kiip.js +6 -0
- package/dist/chunks/regexp-BazyLpPg.js +6 -0
- package/dist/chunks/rel-BcRfyd6Q.js +6 -0
- package/dist/chunks/riscv-Ce8MAQLP.js +6 -0
- package/dist/chunks/ron-DCEEQypA.js +6 -0
- package/dist/chunks/rose-pine-BKc3yVeu.js +4 -0
- package/dist/chunks/rose-pine-dawn-BulJcPZT.js +4 -0
- package/dist/chunks/rose-pine-moon-j6jiXKV8.js +4 -0
- package/dist/chunks/rosmsg-Cz0w1km8.js +6 -0
- package/dist/chunks/rst-DM32Wy3O.js +22 -0
- package/dist/chunks/ruby-BeqCs27h.js +30 -0
- package/dist/chunks/rust-CLzF9zIN.js +6 -0
- package/dist/chunks/sas-fpEvgATw.js +8 -0
- package/dist/chunks/sass-DxHp5rTx.js +6 -0
- package/dist/chunks/scala-D4grkFkl.js +6 -0
- package/dist/chunks/scheme-BCRWuEm4.js +6 -0
- package/dist/chunks/scss-B1FaCqwR.js +8 -0
- package/dist/chunks/sdbl-B7T8abf4.js +6 -0
- package/dist/chunks/shaderlab-Cr62-Wb4.js +8 -0
- package/dist/chunks/shellscript-InADTalH.js +6 -0
- package/dist/chunks/shellsession-DiDJNQdy.js +8 -0
- package/dist/chunks/slack-dark-i7wN4OET.js +4 -0
- package/dist/chunks/slack-ochin-ndHf0LoP.js +4 -0
- package/dist/chunks/smalltalk-BlI1_OkM.js +6 -0
- package/dist/chunks/snazzy-light-BlSJXAu4.js +4 -0
- package/dist/chunks/solarized-dark-UTmkh7lw.js +4 -0
- package/dist/chunks/solarized-light-BheCkDPT.js +4 -0
- package/dist/chunks/solidity-DUWnFhS6.js +6 -0
- package/dist/chunks/soy-C1-6njHa.js +8 -0
- package/dist/chunks/sparql-B0KWFEri.js +8 -0
- package/dist/chunks/splunk-CRXR8A9s.js +6 -0
- package/dist/chunks/sql-Cn_v3PB0.js +6 -0
- package/dist/chunks/ssh-config-DP-hNVbF.js +6 -0
- package/dist/chunks/stata-B8c5fTjX.js +8 -0
- package/dist/chunks/stylus-CyKEU1Ej.js +6 -0
- package/dist/chunks/surrealql-CQi7GQN7.js +8 -0
- package/dist/chunks/svelte-rYri41WT.js +14 -0
- package/dist/chunks/swift-DJpUqPLg.js +6 -0
- package/dist/chunks/synthwave-84-NU3C_KFZ.js +4 -0
- package/dist/chunks/system-verilog-BCm7smPJ.js +6 -0
- package/dist/chunks/systemd-C-4qm6XH.js +6 -0
- package/dist/chunks/talonscript-CFF3LF_O.js +6 -0
- package/dist/chunks/tasl-Cg_WBUAe.js +6 -0
- package/dist/chunks/tcl-DN7buRTF.js +6 -0
- package/dist/chunks/templ-Crs9Ui8q.js +12 -0
- package/dist/chunks/terraform-DGvcn9zM.js +6 -0
- package/dist/chunks/tex-AHxmLTL0.js +8 -0
- package/dist/chunks/tokyo-night-DP4TmcQl.js +4 -0
- package/dist/chunks/toml-DY62mUL_.js +6 -0
- package/dist/chunks/ts-tags-ioVe2PKw.js +41 -0
- package/dist/chunks/tsv-BtvSkaG0.js +6 -0
- package/dist/chunks/tsx-B8rCNbgL.js +6 -0
- package/dist/chunks/turtle-_H59FV7D.js +6 -0
- package/dist/chunks/twig-DwV2Fi4L.js +18 -0
- package/dist/chunks/typescript-RycA9KXf.js +6 -0
- package/dist/chunks/typespec-DWqp-kUU.js +6 -0
- package/dist/chunks/typst-D_1QKWns.js +6 -0
- package/dist/chunks/v-BPCNiyYe.js +6 -0
- package/dist/chunks/vala-uxaPR7d1.js +6 -0
- package/dist/chunks/vb-D8_c5-KN.js +6 -0
- package/dist/chunks/verilog-B-bybjPF.js +6 -0
- package/dist/chunks/vesper-BckBta1U.js +4 -0
- package/dist/chunks/vhdl-CUlNa8ac.js +6 -0
- package/dist/chunks/viml-DsfA-sWm.js +6 -0
- package/dist/chunks/vitesse-black-BoGvW84i.js +4 -0
- package/dist/chunks/vitesse-dark-Cym-eLtO.js +4 -0
- package/dist/chunks/vitesse-light-CcmG315c.js +4 -0
- package/dist/chunks/vue-DXEmyXn9.js +31 -0
- package/dist/chunks/vue-html-j9xNEdu3.js +8 -0
- package/dist/chunks/vue-vine-D41-N99t.js +18 -0
- package/dist/chunks/vyper-CPQuu50u.js +6 -0
- package/dist/chunks/wasm-BBXxrAl7.js +6 -0
- package/dist/chunks/wasm-DQxwEHae.js +7 -0
- package/dist/chunks/wenyan-pbVjoM9_.js +6 -0
- package/dist/chunks/wgsl-DY4iK1q1.js +6 -0
- package/dist/chunks/wikitext-Z-MoUasO.js +6 -0
- package/dist/chunks/wit-CQMQOlTg.js +6 -0
- package/dist/chunks/wolfram-Dz4KXISs.js +6 -0
- package/dist/chunks/xml-C2J0sS9M.js +8 -0
- package/dist/chunks/xsl-BmSZphgC.js +8 -0
- package/dist/chunks/yaml-DaO7k5B1.js +6 -0
- package/dist/chunks/zenscript-CxBjpf9c.js +6 -0
- package/dist/chunks/zig-Vm0PO9wB.js +6 -0
- package/dist/dashboard.js +8 -0
- package/dist/define.js +4 -0
- package/dist/index.js +317 -0
- package/dist/studio.css +2272 -0
- package/dist/styles.js +1 -0
- package/package.json +88 -0
- package/prose-node-shims/fs.ts +6 -0
- package/prose-node-shims/path.ts +16 -0
- package/prose-node-shims/sharp.ts +4 -0
- package/prose-ui-node-shim.ts +26 -0
- package/src/App.tsx +173 -0
- package/src/WorkspaceRoutes.tsx +38 -0
- package/src/api.ts +833 -0
- package/src/auth-client.ts +15 -0
- package/src/chat/ChangeCard.tsx +330 -0
- package/src/chat/ChatBar.tsx +238 -0
- package/src/chat/ChatMessage.tsx +478 -0
- package/src/chat/ChatPanel.tsx +406 -0
- package/src/chat/ChatProvider.tsx +661 -0
- package/src/chat/Composer.tsx +461 -0
- package/src/chat/DocListCard.tsx +322 -0
- package/src/chat/LiveStatus.tsx +83 -0
- package/src/chat/MentionPopover.tsx +164 -0
- package/src/chat/ModelPicker.tsx +113 -0
- package/src/chat/Shimmer.tsx +39 -0
- package/src/chat/ThreadHistory.tsx +268 -0
- package/src/chat/chat-context.ts +41 -0
- package/src/chat/chat-helpers.ts +402 -0
- package/src/chat/chat-state.ts +59 -0
- package/src/chat/icons.tsx +171 -0
- package/src/chat/useStickToBottom.ts +110 -0
- package/src/chrome/AppShell.tsx +100 -0
- package/src/chrome/AppSidebar.tsx +305 -0
- package/src/chrome/CommandPalette.tsx +559 -0
- package/src/chrome/ContentApiPopover.tsx +215 -0
- package/src/chrome/EditorActionsContext.tsx +63 -0
- package/src/chrome/EditorFocusContext.tsx +80 -0
- package/src/chrome/EditorStatusContext.tsx +84 -0
- package/src/chrome/NavItem.tsx +75 -0
- package/src/chrome/OpenSiteButton.tsx +148 -0
- package/src/chrome/StatusBar.tsx +73 -0
- package/src/chrome/UserMenu.tsx +130 -0
- package/src/chrome/WorkspaceNavContext.tsx +60 -0
- package/src/chrome/WorkspaceStatusBar.tsx +940 -0
- package/src/chrome/content-api-url.ts +111 -0
- package/src/chrome/content-type-groups.ts +32 -0
- package/src/chrome/hotkeys.ts +79 -0
- package/src/chrome/icons.tsx +191 -0
- package/src/chrome/open-site.ts +30 -0
- package/src/chrome/status-bar-action.ts +24 -0
- package/src/components/AppChromeContext.tsx +32 -0
- package/src/components/Shell.tsx +18 -0
- package/src/components/WorkspaceSwitcher.tsx +345 -0
- package/src/content-blocks/index.tsx +262 -0
- package/src/css.d.ts +2 -0
- package/src/dashboard.ts +5 -0
- package/src/define-studio.tsx +98 -0
- package/src/define.ts +12 -0
- package/src/index.css +123 -0
- package/src/index.ts +19 -0
- package/src/last-user.ts +40 -0
- package/src/last-workspace.ts +57 -0
- package/src/mcp/McpConnectorsPanel.tsx +872 -0
- package/src/mcp/parse-json.ts +52 -0
- package/src/pages/AcceptInvitePage.tsx +99 -0
- package/src/pages/BlockSettingsDialog.tsx +303 -0
- package/src/pages/BlocksList.tsx +402 -0
- package/src/pages/BodyProse.tsx +236 -0
- package/src/pages/DocEditorPage.tsx +1394 -0
- package/src/pages/EmbedChatPage.tsx +110 -0
- package/src/pages/EmbedPublishPage.tsx +259 -0
- package/src/pages/EnterPage.tsx +96 -0
- package/src/pages/GithubConnectPage.tsx +142 -0
- package/src/pages/LegacyWorkspaceRedirect.tsx +57 -0
- package/src/pages/LoginPage.tsx +335 -0
- package/src/pages/NewWorkspacePage.tsx +74 -0
- package/src/pages/RenderedBody.tsx +598 -0
- package/src/pages/ResumeHome.tsx +18 -0
- package/src/pages/SelectionBar.tsx +277 -0
- package/src/pages/SettingsGeneralPage.tsx +403 -0
- package/src/pages/SettingsGithubPage.tsx +277 -0
- package/src/pages/SettingsLayout.tsx +127 -0
- package/src/pages/SettingsMcpPage.tsx +30 -0
- package/src/pages/SettingsSchemaPage.tsx +93 -0
- package/src/pages/SettingsUsersPage.tsx +363 -0
- package/src/pages/TypeDocsPage.tsx +225 -0
- package/src/pages/UiKitPage.tsx +331 -0
- package/src/pages/UserSettingsPage.tsx +94 -0
- package/src/pages/WorkspaceHomeRedirect.tsx +17 -0
- package/src/pages/WorkspaceLayout.tsx +103 -0
- package/src/pages/WorkspacesPage.tsx +35 -0
- package/src/pages/blocks-list.ts +73 -0
- package/src/pages/body-blocks.ts +233 -0
- package/src/pages/body-mdx.tsx +82 -0
- package/src/pages/compile-body.ts +37 -0
- package/src/pages/host-env.ts +22 -0
- package/src/pages/html-to-markdown.ts +99 -0
- package/src/pages/preview-bridge.ts +46 -0
- package/src/pages/preview-split.ts +30 -0
- package/src/pages/preview-url.ts +92 -0
- package/src/pages/selection-format.ts +179 -0
- package/src/pages/type-docs.ts +9 -0
- package/src/replica/BootstrapSplash.tsx +80 -0
- package/src/replica/ReplicaProvider.tsx +267 -0
- package/src/replica/cache.ts +30 -0
- package/src/replica/idb.ts +89 -0
- package/src/replica/instance.ts +39 -0
- package/src/replica/pull.ts +23 -0
- package/src/replica/store.ts +497 -0
- package/src/replica/sync-cache.ts +51 -0
- package/src/replica/types.ts +119 -0
- package/src/replica/useReplica.ts +13 -0
- package/src/site.tsx +230 -0
- package/src/studio-config.ts +81 -0
- package/src/styles/themes.ts +49 -0
- package/src/styles/tokens.stylex.ts +58 -0
- package/src/styles.ts +11 -0
- package/src/theme/AccentOverride.tsx +29 -0
- package/src/theme/ThemeProvider.tsx +130 -0
- package/src/theme/apply-theme-class.ts +12 -0
- package/src/ui/BackLink.tsx +28 -0
- package/src/ui/Button.tsx +167 -0
- package/src/ui/ConfirmDialog.tsx +141 -0
- package/src/ui/Field.tsx +45 -0
- package/src/ui/Input.tsx +183 -0
- package/src/ui/ListRow.tsx +88 -0
- package/src/ui/Page.tsx +151 -0
- package/src/ui/Text.tsx +77 -0
- package/src/ui/Tooltip.tsx +85 -0
- package/src/ui/popup.ts +216 -0
- package/src/workspace/permissions.ts +17 -0
- package/src/workspace/types.ts +12 -0
- package/src/workspace-path.ts +98 -0
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
// packages/studio/src/mcp/McpConnectorsPanel.tsx
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import * as stylex from "@stylexjs/stylex";
|
|
4
|
+
import { Menu } from "@base-ui/react/menu";
|
|
5
|
+
import {
|
|
6
|
+
createUserMcp,
|
|
7
|
+
createWorkspaceMcp,
|
|
8
|
+
deleteUserMcp,
|
|
9
|
+
deleteWorkspaceMcp,
|
|
10
|
+
fetchUserMcp,
|
|
11
|
+
fetchWorkspaceMcp,
|
|
12
|
+
testUserMcp,
|
|
13
|
+
testWorkspaceMcp,
|
|
14
|
+
updateUserMcp,
|
|
15
|
+
updateWorkspaceMcp,
|
|
16
|
+
type McpConnector,
|
|
17
|
+
type McpWriteBody,
|
|
18
|
+
} from "../api";
|
|
19
|
+
import { MoreIcon } from "../chrome/icons";
|
|
20
|
+
import { Button } from "../ui/Button";
|
|
21
|
+
import { ConfirmDialog } from "../ui/ConfirmDialog";
|
|
22
|
+
import { Field } from "../ui/Field";
|
|
23
|
+
import { Textarea } from "../ui/Input";
|
|
24
|
+
import { Panel, Stack } from "../ui/Page";
|
|
25
|
+
import { Text } from "../ui/Text";
|
|
26
|
+
import { cx, popup, popupClassName } from "../ui/popup";
|
|
27
|
+
import { colors, radius, space, type } from "../styles/tokens.stylex";
|
|
28
|
+
import { mcpConnectorDraftJson, parseMcpJsonPaste } from "./parse-json";
|
|
29
|
+
|
|
30
|
+
function statusLabel(connector: McpConnector): string {
|
|
31
|
+
if (!connector.enabled) return "Off";
|
|
32
|
+
if (connector.status === "connected") return "Connected";
|
|
33
|
+
if (connector.status === "needs_auth") return "Needs attention";
|
|
34
|
+
if (connector.status === "error") return "Needs attention";
|
|
35
|
+
return "Unknown";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function needsAttention(connector: McpConnector): boolean {
|
|
39
|
+
return (
|
|
40
|
+
connector.enabled &&
|
|
41
|
+
(connector.status === "error" || connector.status === "needs_auth")
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function McpConnectorsPanel({
|
|
46
|
+
scope,
|
|
47
|
+
workspaceId,
|
|
48
|
+
canEdit,
|
|
49
|
+
}: {
|
|
50
|
+
scope: "user" | "workspace";
|
|
51
|
+
workspaceId?: string;
|
|
52
|
+
canEdit: boolean;
|
|
53
|
+
}) {
|
|
54
|
+
const [connectors, setConnectors] = useState<McpConnector[]>([]);
|
|
55
|
+
const [error, setError] = useState<string | null>(null);
|
|
56
|
+
const [loading, setLoading] = useState(true);
|
|
57
|
+
const [editing, setEditing] = useState<"new" | McpConnector | null>(null);
|
|
58
|
+
const [pendingDelete, setPendingDelete] = useState<McpConnector | null>(null);
|
|
59
|
+
const [busy, setBusy] = useState(false);
|
|
60
|
+
const [togglingId, setTogglingId] = useState<string | null>(null);
|
|
61
|
+
|
|
62
|
+
async function load() {
|
|
63
|
+
setError(null);
|
|
64
|
+
const res =
|
|
65
|
+
scope === "user"
|
|
66
|
+
? await fetchUserMcp()
|
|
67
|
+
: await fetchWorkspaceMcp(workspaceId!);
|
|
68
|
+
setConnectors(res.connectors);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
let cancelled = false;
|
|
73
|
+
setLoading(true);
|
|
74
|
+
setError(null);
|
|
75
|
+
const req =
|
|
76
|
+
scope === "user" ? fetchUserMcp() : fetchWorkspaceMcp(workspaceId!);
|
|
77
|
+
void req
|
|
78
|
+
.then((res) => {
|
|
79
|
+
if (!cancelled) setConnectors(res.connectors);
|
|
80
|
+
})
|
|
81
|
+
.catch((err: Error) => {
|
|
82
|
+
if (!cancelled) setError(err.message);
|
|
83
|
+
})
|
|
84
|
+
.finally(() => {
|
|
85
|
+
if (!cancelled) setLoading(false);
|
|
86
|
+
});
|
|
87
|
+
return () => {
|
|
88
|
+
cancelled = true;
|
|
89
|
+
};
|
|
90
|
+
}, [scope, workspaceId]);
|
|
91
|
+
|
|
92
|
+
const attention = useMemo(
|
|
93
|
+
() => connectors.filter(needsAttention),
|
|
94
|
+
[connectors],
|
|
95
|
+
);
|
|
96
|
+
const connected = useMemo(
|
|
97
|
+
() => connectors.filter((c) => !needsAttention(c)),
|
|
98
|
+
[connectors],
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
async function onSave(body: McpWriteBody, id?: string) {
|
|
102
|
+
setBusy(true);
|
|
103
|
+
setError(null);
|
|
104
|
+
try {
|
|
105
|
+
if (scope === "user") {
|
|
106
|
+
if (id) await updateUserMcp(id, body);
|
|
107
|
+
else await createUserMcp(body);
|
|
108
|
+
} else {
|
|
109
|
+
if (id) await updateWorkspaceMcp(workspaceId!, id, body);
|
|
110
|
+
else await createWorkspaceMcp(workspaceId!, body);
|
|
111
|
+
}
|
|
112
|
+
await load();
|
|
113
|
+
setEditing(null);
|
|
114
|
+
} catch (err) {
|
|
115
|
+
setError(err instanceof Error ? err.message : "Save failed");
|
|
116
|
+
} finally {
|
|
117
|
+
setBusy(false);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function onToggleEnabled(connector: McpConnector, enabled: boolean) {
|
|
122
|
+
const previous = connectors;
|
|
123
|
+
setConnectors((rows) =>
|
|
124
|
+
rows.map((row) => (row.id === connector.id ? { ...row, enabled } : row)),
|
|
125
|
+
);
|
|
126
|
+
if (editing && editing !== "new" && editing.id === connector.id) {
|
|
127
|
+
setEditing({ ...editing, enabled });
|
|
128
|
+
}
|
|
129
|
+
setTogglingId(connector.id);
|
|
130
|
+
setError(null);
|
|
131
|
+
try {
|
|
132
|
+
if (scope === "user") await updateUserMcp(connector.id, { enabled });
|
|
133
|
+
else await updateWorkspaceMcp(workspaceId!, connector.id, { enabled });
|
|
134
|
+
} catch (err) {
|
|
135
|
+
setConnectors(previous);
|
|
136
|
+
setError(err instanceof Error ? err.message : "Update failed");
|
|
137
|
+
} finally {
|
|
138
|
+
setTogglingId(null);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async function onTest(id: string) {
|
|
143
|
+
setBusy(true);
|
|
144
|
+
setError(null);
|
|
145
|
+
try {
|
|
146
|
+
if (scope === "user") await testUserMcp(id);
|
|
147
|
+
else await testWorkspaceMcp(workspaceId!, id);
|
|
148
|
+
await load();
|
|
149
|
+
} catch (err) {
|
|
150
|
+
setError(err instanceof Error ? err.message : "Test failed");
|
|
151
|
+
} finally {
|
|
152
|
+
setBusy(false);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
async function onDelete() {
|
|
157
|
+
if (!pendingDelete) return;
|
|
158
|
+
setBusy(true);
|
|
159
|
+
setError(null);
|
|
160
|
+
try {
|
|
161
|
+
if (scope === "user") await deleteUserMcp(pendingDelete.id);
|
|
162
|
+
else await deleteWorkspaceMcp(workspaceId!, pendingDelete.id);
|
|
163
|
+
await load();
|
|
164
|
+
if (editing && editing !== "new" && editing.id === pendingDelete.id) {
|
|
165
|
+
setEditing(null);
|
|
166
|
+
}
|
|
167
|
+
setPendingDelete(null);
|
|
168
|
+
} catch (err) {
|
|
169
|
+
setError(err instanceof Error ? err.message : "Delete failed");
|
|
170
|
+
setPendingDelete(null);
|
|
171
|
+
} finally {
|
|
172
|
+
setBusy(false);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<Stack gap="lg">
|
|
178
|
+
{error ? <Text tone="danger">{error}</Text> : null}
|
|
179
|
+
{canEdit ? (
|
|
180
|
+
<div {...stylex.props(styles.toolbar)}>
|
|
181
|
+
<Button
|
|
182
|
+
variant="secondary"
|
|
183
|
+
disabled={busy}
|
|
184
|
+
onClick={() => setEditing("new")}
|
|
185
|
+
>
|
|
186
|
+
Add connector
|
|
187
|
+
</Button>
|
|
188
|
+
</div>
|
|
189
|
+
) : null}
|
|
190
|
+
{editing ? (
|
|
191
|
+
<McpConnectorForm
|
|
192
|
+
initial={editing === "new" ? null : editing}
|
|
193
|
+
canEdit={canEdit}
|
|
194
|
+
busy={busy}
|
|
195
|
+
togglingEnabled={
|
|
196
|
+
editing !== "new" && togglingId === editing.id
|
|
197
|
+
}
|
|
198
|
+
onToggleEnabled={
|
|
199
|
+
editing === "new"
|
|
200
|
+
? undefined
|
|
201
|
+
: (enabled) => onToggleEnabled(editing, enabled)
|
|
202
|
+
}
|
|
203
|
+
onCancel={() => setEditing(null)}
|
|
204
|
+
onSave={onSave}
|
|
205
|
+
onTest={editing === "new" ? undefined : () => onTest(editing.id)}
|
|
206
|
+
onDelete={
|
|
207
|
+
editing === "new" ? undefined : () => setPendingDelete(editing)
|
|
208
|
+
}
|
|
209
|
+
/>
|
|
210
|
+
) : null}
|
|
211
|
+
{loading ? <Text tone="muted">Loading connectors…</Text> : null}
|
|
212
|
+
{!loading && connectors.length === 0 && !editing ? (
|
|
213
|
+
<Panel>
|
|
214
|
+
<Text tone="muted">
|
|
215
|
+
{canEdit
|
|
216
|
+
? "No connectors yet. Paste a remote MCP server as JSON."
|
|
217
|
+
: "No connectors on this workspace."}
|
|
218
|
+
</Text>
|
|
219
|
+
</Panel>
|
|
220
|
+
) : null}
|
|
221
|
+
{attention.length > 0 ? (
|
|
222
|
+
<ConnectorGroup
|
|
223
|
+
title="Needs attention"
|
|
224
|
+
connectors={attention}
|
|
225
|
+
canEdit={canEdit}
|
|
226
|
+
togglingId={togglingId}
|
|
227
|
+
onSelect={setEditing}
|
|
228
|
+
onToggleEnabled={onToggleEnabled}
|
|
229
|
+
/>
|
|
230
|
+
) : null}
|
|
231
|
+
{connected.length > 0 ? (
|
|
232
|
+
<ConnectorGroup
|
|
233
|
+
title="Connected"
|
|
234
|
+
connectors={connected}
|
|
235
|
+
canEdit={canEdit}
|
|
236
|
+
togglingId={togglingId}
|
|
237
|
+
onSelect={setEditing}
|
|
238
|
+
onToggleEnabled={onToggleEnabled}
|
|
239
|
+
/>
|
|
240
|
+
) : null}
|
|
241
|
+
<ConfirmDialog
|
|
242
|
+
open={pendingDelete !== null}
|
|
243
|
+
onOpenChange={(open) => !open && setPendingDelete(null)}
|
|
244
|
+
title="Remove connector?"
|
|
245
|
+
description={
|
|
246
|
+
pendingDelete
|
|
247
|
+
? `${pendingDelete.name} will no longer be available in chat.`
|
|
248
|
+
: undefined
|
|
249
|
+
}
|
|
250
|
+
confirmLabel="Remove"
|
|
251
|
+
destructive
|
|
252
|
+
busy={busy}
|
|
253
|
+
onConfirm={onDelete}
|
|
254
|
+
/>
|
|
255
|
+
</Stack>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function ConnectorGroup({
|
|
260
|
+
title,
|
|
261
|
+
connectors,
|
|
262
|
+
canEdit,
|
|
263
|
+
togglingId,
|
|
264
|
+
onSelect,
|
|
265
|
+
onToggleEnabled,
|
|
266
|
+
}: {
|
|
267
|
+
title: string;
|
|
268
|
+
connectors: McpConnector[];
|
|
269
|
+
canEdit: boolean;
|
|
270
|
+
togglingId: string | null;
|
|
271
|
+
onSelect: (connector: McpConnector) => void;
|
|
272
|
+
onToggleEnabled: (connector: McpConnector, enabled: boolean) => void;
|
|
273
|
+
}) {
|
|
274
|
+
return (
|
|
275
|
+
<div>
|
|
276
|
+
<Text as="h2" size="sm" weight="medium" tone="muted">
|
|
277
|
+
{title}
|
|
278
|
+
</Text>
|
|
279
|
+
<div {...stylex.props(styles.list)}>
|
|
280
|
+
{connectors.map((connector) => (
|
|
281
|
+
<div key={connector.id} {...stylex.props(styles.row)}>
|
|
282
|
+
<button
|
|
283
|
+
type="button"
|
|
284
|
+
{...stylex.props(styles.rowMain)}
|
|
285
|
+
onClick={() => onSelect(connector)}
|
|
286
|
+
>
|
|
287
|
+
<span {...stylex.props(styles.rowBody)}>
|
|
288
|
+
<span {...stylex.props(styles.rowTitle)}>{connector.name}</span>
|
|
289
|
+
<span {...stylex.props(styles.rowMeta)}>
|
|
290
|
+
{statusLabel(connector)}
|
|
291
|
+
{connector.toolCount > 0
|
|
292
|
+
? ` · ${connector.toolCount} tools`
|
|
293
|
+
: ""}
|
|
294
|
+
</span>
|
|
295
|
+
</span>
|
|
296
|
+
</button>
|
|
297
|
+
<Switch
|
|
298
|
+
checked={connector.enabled}
|
|
299
|
+
disabled={!canEdit || togglingId === connector.id}
|
|
300
|
+
label={
|
|
301
|
+
connector.enabled
|
|
302
|
+
? `Disable ${connector.name}`
|
|
303
|
+
: `Enable ${connector.name}`
|
|
304
|
+
}
|
|
305
|
+
onChange={(enabled) => onToggleEnabled(connector, enabled)}
|
|
306
|
+
/>
|
|
307
|
+
</div>
|
|
308
|
+
))}
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function ChevronIcon() {
|
|
315
|
+
return (
|
|
316
|
+
<svg
|
|
317
|
+
width="12"
|
|
318
|
+
height="12"
|
|
319
|
+
viewBox="0 0 16 16"
|
|
320
|
+
fill="none"
|
|
321
|
+
aria-hidden
|
|
322
|
+
stroke="currentColor"
|
|
323
|
+
strokeWidth="1.5"
|
|
324
|
+
strokeLinecap="round"
|
|
325
|
+
strokeLinejoin="round"
|
|
326
|
+
>
|
|
327
|
+
<path d="M4 6.5 8 10.5l4-4" />
|
|
328
|
+
</svg>
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function Switch({
|
|
333
|
+
checked,
|
|
334
|
+
disabled,
|
|
335
|
+
label,
|
|
336
|
+
onChange,
|
|
337
|
+
}: {
|
|
338
|
+
checked: boolean;
|
|
339
|
+
disabled?: boolean;
|
|
340
|
+
label: string;
|
|
341
|
+
onChange: (next: boolean) => void;
|
|
342
|
+
}) {
|
|
343
|
+
return (
|
|
344
|
+
<button
|
|
345
|
+
type="button"
|
|
346
|
+
role="switch"
|
|
347
|
+
aria-checked={checked}
|
|
348
|
+
aria-label={label}
|
|
349
|
+
disabled={disabled}
|
|
350
|
+
{...stylex.props(styles.switchHit, disabled && styles.switchDisabled)}
|
|
351
|
+
onClick={() => onChange(!checked)}
|
|
352
|
+
>
|
|
353
|
+
<span {...stylex.props(styles.switchTrack, checked && styles.switchTrackOn)}>
|
|
354
|
+
<span {...stylex.props(styles.switchKnob, checked && styles.switchKnobOn)} />
|
|
355
|
+
</span>
|
|
356
|
+
</button>
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function McpConnectorForm({
|
|
361
|
+
initial,
|
|
362
|
+
canEdit,
|
|
363
|
+
busy,
|
|
364
|
+
togglingEnabled,
|
|
365
|
+
onToggleEnabled,
|
|
366
|
+
onCancel,
|
|
367
|
+
onSave,
|
|
368
|
+
onTest,
|
|
369
|
+
onDelete,
|
|
370
|
+
}: {
|
|
371
|
+
initial: McpConnector | null;
|
|
372
|
+
canEdit: boolean;
|
|
373
|
+
busy: boolean;
|
|
374
|
+
togglingEnabled?: boolean;
|
|
375
|
+
onToggleEnabled?: (enabled: boolean) => void;
|
|
376
|
+
onCancel: () => void;
|
|
377
|
+
onSave: (body: McpWriteBody, id?: string) => Promise<void>;
|
|
378
|
+
onTest?: () => void;
|
|
379
|
+
onDelete?: () => void;
|
|
380
|
+
}) {
|
|
381
|
+
const title = initial?.name ?? "New connector";
|
|
382
|
+
const [paste, setPaste] = useState(
|
|
383
|
+
initial ? mcpConnectorDraftJson(initial) : "",
|
|
384
|
+
);
|
|
385
|
+
const [enabled, setEnabled] = useState(initial?.enabled ?? true);
|
|
386
|
+
const [tools, setTools] = useState(initial?.tools ?? []);
|
|
387
|
+
const [openTools, setOpenTools] = useState<Set<string>>(() => new Set());
|
|
388
|
+
const [formError, setFormError] = useState<string | null>(null);
|
|
389
|
+
|
|
390
|
+
useEffect(() => {
|
|
391
|
+
setEnabled(initial?.enabled ?? true);
|
|
392
|
+
}, [initial?.enabled]);
|
|
393
|
+
|
|
394
|
+
function setServerEnabled(next: boolean) {
|
|
395
|
+
setEnabled(next);
|
|
396
|
+
onToggleEnabled?.(next);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function toggleToolOpen(name: string) {
|
|
400
|
+
setOpenTools((current) => {
|
|
401
|
+
const next = new Set(current);
|
|
402
|
+
if (next.has(name)) next.delete(name);
|
|
403
|
+
else next.add(name);
|
|
404
|
+
return next;
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
async function submit(e: React.FormEvent) {
|
|
409
|
+
e.preventDefault();
|
|
410
|
+
const parsed = parseMcpJsonPaste(paste);
|
|
411
|
+
if (!parsed?.url) {
|
|
412
|
+
setFormError(
|
|
413
|
+
'Paste JSON with a url, e.g. { "name": "Stripe", "url": "https://…", "headers": { "Authorization": "Bearer …" } }.',
|
|
414
|
+
);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
const name = parsed.name ?? initial?.name ?? "";
|
|
418
|
+
if (!name) {
|
|
419
|
+
setFormError("Add a name, or use { \"stripe\": { \"url\": \"…\" } }.");
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const body: McpWriteBody = {
|
|
423
|
+
name,
|
|
424
|
+
url: parsed.url,
|
|
425
|
+
enabled,
|
|
426
|
+
tools: tools.map((t) => ({ name: t.name, enabled: t.enabled })),
|
|
427
|
+
};
|
|
428
|
+
if (parsed.headers) body.headers = parsed.headers;
|
|
429
|
+
await onSave(body, initial?.id);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return (
|
|
433
|
+
<Panel>
|
|
434
|
+
<form onSubmit={(e) => void submit(e)}>
|
|
435
|
+
<Stack>
|
|
436
|
+
<div {...stylex.props(styles.formHeader)}>
|
|
437
|
+
<div {...stylex.props(styles.formTitle)}>
|
|
438
|
+
<Text as="h2" size="lg" weight="medium" truncate>
|
|
439
|
+
{title}
|
|
440
|
+
</Text>
|
|
441
|
+
</div>
|
|
442
|
+
<div {...stylex.props(styles.headerControls)}>
|
|
443
|
+
{onTest || onDelete ? (
|
|
444
|
+
<Menu.Root>
|
|
445
|
+
<Menu.Trigger
|
|
446
|
+
disabled={busy}
|
|
447
|
+
aria-label={`Actions for ${title}`}
|
|
448
|
+
className={cx(styles.moreHit, busy && styles.switchDisabled)}
|
|
449
|
+
>
|
|
450
|
+
<MoreIcon />
|
|
451
|
+
</Menu.Trigger>
|
|
452
|
+
<Menu.Portal>
|
|
453
|
+
<Menu.Positioner
|
|
454
|
+
side="bottom"
|
|
455
|
+
align="end"
|
|
456
|
+
sideOffset={6}
|
|
457
|
+
className={cx(popup.positioner)}
|
|
458
|
+
>
|
|
459
|
+
<Menu.Popup
|
|
460
|
+
aria-label={`${title} actions`}
|
|
461
|
+
className={(state) =>
|
|
462
|
+
popupClassName(state, styles.moreMenu)
|
|
463
|
+
}
|
|
464
|
+
>
|
|
465
|
+
{onTest ? (
|
|
466
|
+
<Menu.Item
|
|
467
|
+
label="Test connection"
|
|
468
|
+
disabled={busy}
|
|
469
|
+
onClick={onTest}
|
|
470
|
+
className={(state) =>
|
|
471
|
+
cx(
|
|
472
|
+
popup.item,
|
|
473
|
+
styles.menuItem,
|
|
474
|
+
state.highlighted && popup.itemHighlighted,
|
|
475
|
+
)
|
|
476
|
+
}
|
|
477
|
+
>
|
|
478
|
+
Test connection
|
|
479
|
+
</Menu.Item>
|
|
480
|
+
) : null}
|
|
481
|
+
{canEdit && onDelete ? (
|
|
482
|
+
<Menu.Item
|
|
483
|
+
label="Remove"
|
|
484
|
+
disabled={busy}
|
|
485
|
+
onClick={onDelete}
|
|
486
|
+
className={(state) =>
|
|
487
|
+
cx(
|
|
488
|
+
popup.item,
|
|
489
|
+
styles.menuItem,
|
|
490
|
+
styles.menuDanger,
|
|
491
|
+
state.highlighted && popup.itemHighlighted,
|
|
492
|
+
)
|
|
493
|
+
}
|
|
494
|
+
>
|
|
495
|
+
Remove
|
|
496
|
+
</Menu.Item>
|
|
497
|
+
) : null}
|
|
498
|
+
</Menu.Popup>
|
|
499
|
+
</Menu.Positioner>
|
|
500
|
+
</Menu.Portal>
|
|
501
|
+
</Menu.Root>
|
|
502
|
+
) : null}
|
|
503
|
+
<Switch
|
|
504
|
+
checked={enabled}
|
|
505
|
+
disabled={!canEdit || busy || togglingEnabled}
|
|
506
|
+
label={enabled ? `Disable ${title}` : `Enable ${title}`}
|
|
507
|
+
onChange={setServerEnabled}
|
|
508
|
+
/>
|
|
509
|
+
</div>
|
|
510
|
+
</div>
|
|
511
|
+
{initial?.statusError ? (
|
|
512
|
+
<Text tone="danger">{initial.statusError}</Text>
|
|
513
|
+
) : null}
|
|
514
|
+
{formError ? <Text tone="danger">{formError}</Text> : null}
|
|
515
|
+
<Field label="JSON">
|
|
516
|
+
<Textarea
|
|
517
|
+
mono
|
|
518
|
+
value={paste}
|
|
519
|
+
onChange={(e) => setPaste(e.target.value)}
|
|
520
|
+
placeholder={`{\n "name": "Stripe",\n "url": "https://mcp.example.com",\n "headers": { "Authorization": "Bearer …" }\n}`}
|
|
521
|
+
disabled={!canEdit || busy}
|
|
522
|
+
spellCheck={false}
|
|
523
|
+
/>
|
|
524
|
+
</Field>
|
|
525
|
+
{initial && canEdit ? (
|
|
526
|
+
<Text tone="muted" size="sm">
|
|
527
|
+
Omit headers to keep the stored secret. Include headers to rotate them.
|
|
528
|
+
</Text>
|
|
529
|
+
) : null}
|
|
530
|
+
{tools.length > 0 ? (
|
|
531
|
+
<Stack gap="sm">
|
|
532
|
+
<Text as="h3" size="sm" weight="medium" tone="muted">
|
|
533
|
+
Tools
|
|
534
|
+
</Text>
|
|
535
|
+
<div {...stylex.props(styles.list)}>
|
|
536
|
+
{tools.map((tool) => {
|
|
537
|
+
const open = openTools.has(tool.name);
|
|
538
|
+
return (
|
|
539
|
+
<div key={tool.name} {...stylex.props(styles.toolItem)}>
|
|
540
|
+
<div {...stylex.props(styles.toolRow)}>
|
|
541
|
+
<button
|
|
542
|
+
type="button"
|
|
543
|
+
{...stylex.props(styles.toolMain)}
|
|
544
|
+
aria-expanded={open}
|
|
545
|
+
aria-label={
|
|
546
|
+
open
|
|
547
|
+
? `Hide description for ${tool.name}`
|
|
548
|
+
: `Show description for ${tool.name}`
|
|
549
|
+
}
|
|
550
|
+
onClick={() => toggleToolOpen(tool.name)}
|
|
551
|
+
>
|
|
552
|
+
<span
|
|
553
|
+
{...stylex.props(
|
|
554
|
+
styles.chevron,
|
|
555
|
+
open && styles.chevronOpen,
|
|
556
|
+
)}
|
|
557
|
+
aria-hidden
|
|
558
|
+
>
|
|
559
|
+
<ChevronIcon />
|
|
560
|
+
</span>
|
|
561
|
+
<span {...stylex.props(styles.toolName)}>{tool.name}</span>
|
|
562
|
+
</button>
|
|
563
|
+
<Switch
|
|
564
|
+
checked={tool.enabled}
|
|
565
|
+
disabled={!canEdit || busy}
|
|
566
|
+
label={
|
|
567
|
+
tool.enabled
|
|
568
|
+
? `Disable ${tool.name}`
|
|
569
|
+
: `Enable ${tool.name}`
|
|
570
|
+
}
|
|
571
|
+
onChange={(next) =>
|
|
572
|
+
setTools((current) =>
|
|
573
|
+
current.map((t) =>
|
|
574
|
+
t.name === tool.name
|
|
575
|
+
? { ...t, enabled: next }
|
|
576
|
+
: t,
|
|
577
|
+
),
|
|
578
|
+
)
|
|
579
|
+
}
|
|
580
|
+
/>
|
|
581
|
+
</div>
|
|
582
|
+
{open ? (
|
|
583
|
+
<p {...stylex.props(styles.toolDesc)}>
|
|
584
|
+
{tool.description || "No description."}
|
|
585
|
+
</p>
|
|
586
|
+
) : null}
|
|
587
|
+
</div>
|
|
588
|
+
);
|
|
589
|
+
})}
|
|
590
|
+
</div>
|
|
591
|
+
</Stack>
|
|
592
|
+
) : null}
|
|
593
|
+
<div {...stylex.props(styles.actions)}>
|
|
594
|
+
<Button type="button" variant="ghost" onClick={onCancel}>
|
|
595
|
+
Cancel
|
|
596
|
+
</Button>
|
|
597
|
+
{canEdit ? (
|
|
598
|
+
<Button type="submit" variant="secondary" disabled={busy}>
|
|
599
|
+
{initial ? "Save" : "Add"}
|
|
600
|
+
</Button>
|
|
601
|
+
) : null}
|
|
602
|
+
</div>
|
|
603
|
+
</Stack>
|
|
604
|
+
</form>
|
|
605
|
+
</Panel>
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const hover = "@media (hover: hover)";
|
|
610
|
+
|
|
611
|
+
const styles = stylex.create({
|
|
612
|
+
toolbar: {
|
|
613
|
+
display: "flex",
|
|
614
|
+
justifyContent: "flex-end",
|
|
615
|
+
},
|
|
616
|
+
list: {
|
|
617
|
+
marginTop: space.sm,
|
|
618
|
+
display: "flex",
|
|
619
|
+
flexDirection: "column",
|
|
620
|
+
borderWidth: 1,
|
|
621
|
+
borderStyle: "solid",
|
|
622
|
+
borderColor: colors.border,
|
|
623
|
+
borderRadius: radius.md,
|
|
624
|
+
backgroundColor: colors.bgSurface,
|
|
625
|
+
overflow: "hidden",
|
|
626
|
+
},
|
|
627
|
+
row: {
|
|
628
|
+
display: "flex",
|
|
629
|
+
alignItems: "center",
|
|
630
|
+
gap: space.md,
|
|
631
|
+
minHeight: "44px",
|
|
632
|
+
width: "100%",
|
|
633
|
+
paddingInline: space.lg,
|
|
634
|
+
borderBottomWidth: 1,
|
|
635
|
+
borderBottomStyle: "solid",
|
|
636
|
+
borderBottomColor: colors.border,
|
|
637
|
+
backgroundColor: colors.bgSurface,
|
|
638
|
+
":last-child": {
|
|
639
|
+
borderBottomWidth: 0,
|
|
640
|
+
},
|
|
641
|
+
[hover]: {
|
|
642
|
+
":hover": {
|
|
643
|
+
backgroundColor: colors.bgHover,
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
},
|
|
647
|
+
rowMain: {
|
|
648
|
+
display: "flex",
|
|
649
|
+
alignItems: "center",
|
|
650
|
+
flex: 1,
|
|
651
|
+
minWidth: 0,
|
|
652
|
+
minHeight: "44px",
|
|
653
|
+
paddingBlock: space.md,
|
|
654
|
+
paddingInline: 0,
|
|
655
|
+
borderWidth: 0,
|
|
656
|
+
backgroundColor: "transparent",
|
|
657
|
+
color: colors.text,
|
|
658
|
+
textAlign: "left",
|
|
659
|
+
cursor: "pointer",
|
|
660
|
+
},
|
|
661
|
+
rowBody: {
|
|
662
|
+
display: "flex",
|
|
663
|
+
minWidth: 0,
|
|
664
|
+
flexDirection: "column",
|
|
665
|
+
gap: 2,
|
|
666
|
+
},
|
|
667
|
+
rowTitle: {
|
|
668
|
+
fontSize: type.md,
|
|
669
|
+
fontWeight: 500,
|
|
670
|
+
},
|
|
671
|
+
rowMeta: {
|
|
672
|
+
fontSize: type.sm,
|
|
673
|
+
color: colors.textMuted,
|
|
674
|
+
},
|
|
675
|
+
switchHit: {
|
|
676
|
+
display: "inline-flex",
|
|
677
|
+
alignItems: "center",
|
|
678
|
+
justifyContent: "center",
|
|
679
|
+
flexShrink: 0,
|
|
680
|
+
width: "44px",
|
|
681
|
+
height: "44px",
|
|
682
|
+
margin: 0,
|
|
683
|
+
padding: 0,
|
|
684
|
+
borderWidth: 0,
|
|
685
|
+
backgroundColor: "transparent",
|
|
686
|
+
cursor: "pointer",
|
|
687
|
+
touchAction: "manipulation",
|
|
688
|
+
":focus-visible": {
|
|
689
|
+
outlineWidth: 2,
|
|
690
|
+
outlineStyle: "solid",
|
|
691
|
+
outlineColor: colors.focus,
|
|
692
|
+
outlineOffset: 2,
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
switchTrack: {
|
|
696
|
+
position: "relative",
|
|
697
|
+
display: "block",
|
|
698
|
+
width: "36px",
|
|
699
|
+
height: "20px",
|
|
700
|
+
borderRadius: 999,
|
|
701
|
+
backgroundColor: colors.border,
|
|
702
|
+
transitionProperty: "background-color",
|
|
703
|
+
transitionDuration: "150ms",
|
|
704
|
+
transitionTimingFunction: "ease-out",
|
|
705
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
706
|
+
transitionDuration: "0ms",
|
|
707
|
+
},
|
|
708
|
+
},
|
|
709
|
+
switchTrackOn: {
|
|
710
|
+
backgroundColor: colors.accent,
|
|
711
|
+
},
|
|
712
|
+
switchKnob: {
|
|
713
|
+
position: "absolute",
|
|
714
|
+
top: "2px",
|
|
715
|
+
left: "2px",
|
|
716
|
+
width: "16px",
|
|
717
|
+
height: "16px",
|
|
718
|
+
borderRadius: 999,
|
|
719
|
+
backgroundColor: colors.bgSurface,
|
|
720
|
+
boxShadow: "0 1px 2px rgba(24, 24, 27, 0.2)",
|
|
721
|
+
transform: "translateX(0)",
|
|
722
|
+
transitionProperty: "transform",
|
|
723
|
+
transitionDuration: "150ms",
|
|
724
|
+
transitionTimingFunction: "ease-out",
|
|
725
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
726
|
+
transitionDuration: "0ms",
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
switchKnobOn: {
|
|
730
|
+
transform: "translateX(16px)",
|
|
731
|
+
},
|
|
732
|
+
switchDisabled: {
|
|
733
|
+
opacity: 0.55,
|
|
734
|
+
cursor: "default",
|
|
735
|
+
},
|
|
736
|
+
formHeader: {
|
|
737
|
+
display: "flex",
|
|
738
|
+
alignItems: "center",
|
|
739
|
+
justifyContent: "space-between",
|
|
740
|
+
gap: space.md,
|
|
741
|
+
minHeight: "44px",
|
|
742
|
+
},
|
|
743
|
+
formTitle: {
|
|
744
|
+
minWidth: 0,
|
|
745
|
+
flex: 1,
|
|
746
|
+
},
|
|
747
|
+
headerControls: {
|
|
748
|
+
display: "flex",
|
|
749
|
+
alignItems: "center",
|
|
750
|
+
flexShrink: 0,
|
|
751
|
+
},
|
|
752
|
+
moreHit: {
|
|
753
|
+
display: "inline-flex",
|
|
754
|
+
alignItems: "center",
|
|
755
|
+
justifyContent: "center",
|
|
756
|
+
flexShrink: 0,
|
|
757
|
+
width: "44px",
|
|
758
|
+
height: "44px",
|
|
759
|
+
margin: 0,
|
|
760
|
+
padding: 0,
|
|
761
|
+
borderWidth: 0,
|
|
762
|
+
borderRadius: radius.md,
|
|
763
|
+
backgroundColor: "transparent",
|
|
764
|
+
color: colors.textMuted,
|
|
765
|
+
cursor: "pointer",
|
|
766
|
+
touchAction: "manipulation",
|
|
767
|
+
":focus-visible": {
|
|
768
|
+
outlineWidth: 2,
|
|
769
|
+
outlineStyle: "solid",
|
|
770
|
+
outlineColor: colors.focus,
|
|
771
|
+
outlineOffset: 2,
|
|
772
|
+
},
|
|
773
|
+
[hover]: {
|
|
774
|
+
":hover": {
|
|
775
|
+
color: colors.text,
|
|
776
|
+
backgroundColor: colors.bgHover,
|
|
777
|
+
},
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
moreMenu: {
|
|
781
|
+
minWidth: "180px",
|
|
782
|
+
},
|
|
783
|
+
menuItem: {
|
|
784
|
+
cursor: "pointer",
|
|
785
|
+
fontWeight: 500,
|
|
786
|
+
},
|
|
787
|
+
menuDanger: {
|
|
788
|
+
color: colors.danger,
|
|
789
|
+
},
|
|
790
|
+
toolItem: {
|
|
791
|
+
borderBottomWidth: 1,
|
|
792
|
+
borderBottomStyle: "solid",
|
|
793
|
+
borderBottomColor: colors.border,
|
|
794
|
+
":last-child": {
|
|
795
|
+
borderBottomWidth: 0,
|
|
796
|
+
},
|
|
797
|
+
[hover]: {
|
|
798
|
+
":hover": {
|
|
799
|
+
backgroundColor: colors.bgHover,
|
|
800
|
+
},
|
|
801
|
+
},
|
|
802
|
+
},
|
|
803
|
+
toolRow: {
|
|
804
|
+
display: "flex",
|
|
805
|
+
alignItems: "center",
|
|
806
|
+
gap: space.sm,
|
|
807
|
+
minHeight: "44px",
|
|
808
|
+
paddingInline: space.md,
|
|
809
|
+
},
|
|
810
|
+
toolMain: {
|
|
811
|
+
display: "flex",
|
|
812
|
+
alignItems: "center",
|
|
813
|
+
gap: space.sm,
|
|
814
|
+
flex: 1,
|
|
815
|
+
minWidth: 0,
|
|
816
|
+
minHeight: "44px",
|
|
817
|
+
margin: 0,
|
|
818
|
+
padding: 0,
|
|
819
|
+
borderWidth: 0,
|
|
820
|
+
backgroundColor: "transparent",
|
|
821
|
+
color: colors.text,
|
|
822
|
+
textAlign: "left",
|
|
823
|
+
cursor: "pointer",
|
|
824
|
+
touchAction: "manipulation",
|
|
825
|
+
":focus-visible": {
|
|
826
|
+
outlineWidth: 2,
|
|
827
|
+
outlineStyle: "solid",
|
|
828
|
+
outlineColor: colors.focus,
|
|
829
|
+
outlineOffset: 2,
|
|
830
|
+
},
|
|
831
|
+
},
|
|
832
|
+
toolName: {
|
|
833
|
+
minWidth: 0,
|
|
834
|
+
overflow: "hidden",
|
|
835
|
+
textOverflow: "ellipsis",
|
|
836
|
+
whiteSpace: "nowrap",
|
|
837
|
+
fontSize: type.sm,
|
|
838
|
+
fontWeight: 500,
|
|
839
|
+
},
|
|
840
|
+
chevron: {
|
|
841
|
+
display: "inline-flex",
|
|
842
|
+
flexShrink: 0,
|
|
843
|
+
color: colors.textMuted,
|
|
844
|
+
transform: "rotate(-90deg)",
|
|
845
|
+
transitionProperty: "transform",
|
|
846
|
+
transitionDuration: "150ms",
|
|
847
|
+
transitionTimingFunction: "ease-out",
|
|
848
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
849
|
+
transitionDuration: "0ms",
|
|
850
|
+
},
|
|
851
|
+
},
|
|
852
|
+
chevronOpen: {
|
|
853
|
+
transform: "rotate(0deg)",
|
|
854
|
+
},
|
|
855
|
+
toolDesc: {
|
|
856
|
+
margin: 0,
|
|
857
|
+
paddingTop: 0,
|
|
858
|
+
paddingRight: space.md,
|
|
859
|
+
paddingBottom: space.md,
|
|
860
|
+
paddingLeft: "26px",
|
|
861
|
+
color: colors.textMuted,
|
|
862
|
+
fontSize: type.sm,
|
|
863
|
+
lineHeight: 1.45,
|
|
864
|
+
},
|
|
865
|
+
actions: {
|
|
866
|
+
display: "flex",
|
|
867
|
+
flexWrap: "wrap",
|
|
868
|
+
alignItems: "center",
|
|
869
|
+
justifyContent: "space-between",
|
|
870
|
+
gap: space.sm,
|
|
871
|
+
},
|
|
872
|
+
});
|